-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
forbid default values for extension parameters #12460
Comments
note that default arguments are still acceptable in locally {
extension (x: String)(using s: String = "default value")
def f1: String = x.reverse
"my string".f1
} |
|
Discussing this with @mbovel, we believe we should put these checks in Refchecks |
You can find our work over there: I left some |
I thought extension methods were just methods. I find the departure from regularity surprising, but since the issue has been discussed, there must be an obvious case of misleading that I don't see. I mean obvious but not to me. The by-name case is the same as right-associative operators. Edit: I meant to say, it sounds like a lint. |
Compiler version
Minimized code
Currently this compiles fine:
Expectation
Seems that there are no use cases for it and only misleads
Probably a compiler error should be shown here.
The text was updated successfully, but these errors were encountered: