Skip to content

Extension method can be extension_foo #9766

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
bishabosha opened this issue Sep 10, 2020 · 1 comment
Closed

Extension method can be extension_foo #9766

bishabosha opened this issue Sep 10, 2020 · 1 comment
Assignees

Comments

@bishabosha
Copy link
Member

bishabosha commented Sep 10, 2020

Minimized code

extension (x: Any) def extension_foo: String = "foo"

Output

compiles ok

Expectation

any other definition can not start with extension_, so I would expect this not to work.

the desugared method is extension_extension_foo, should there be an extra check in Desugar for the unexpanded extension method name beginning like that?

@odersky
Copy link
Contributor

odersky commented Sep 20, 2020

the desugared method is extension_extension_foo, should there be an extra check in Desugar for the unexpanded extension method name beginning like that?

I think so, yes.

bishabosha added a commit that referenced this issue Sep 23, 2020
fix #9766: extensions cannot be extension_foo
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

2 participants