Skip to content

Support optional parameter default expressions that reference instance members of the declaring method's class #697

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
rsmckinney opened this issue Apr 26, 2025 · 1 comment

Comments

@rsmckinney
Copy link
Member

rsmckinney commented Apr 26, 2025

Support optional parameter default expressions that reference instance members of the declaring method's class.

class MyClass {
    MyClass(String str = bar()) {. . .} 
    void foo(String str = bar()) {. . .}
    String bar() {. . .}
}

This change will support a couple of efforts planned for the near future.

  1. Record copy() feature: Use manifold's optional parameters to make records nicely copyable #698
  2. Struct class feature: Provide a "record" class equivalent using properties (manifold-props) #257

Note, the changes required to support this will likely break compiled references to existing optional parameter methods, but being that manifold-params is an experimental project, hopefully this should not come as a surprise.

rsmckinney added a commit that referenced this issue Apr 26, 2025
- support instance member access from optional parameter default expressions
@rsmckinney
Copy link
Member Author

Support available with release 2025.1.12

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant