Skip to content

class parameter wrongly treated as soft keyword 'inline' #9046

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
kpbochenek opened this issue May 25, 2020 · 2 comments
Closed

class parameter wrongly treated as soft keyword 'inline' #9046

kpbochenek opened this issue May 25, 2020 · 2 comments

Comments

@kpbochenek
Copy link
Contributor

Example from dotr built from master:

scala> class C(x: String)
// defined class C

scala> class C(inline: String)
1 |class C(inline: String)
  |              ^
  |              an identifier expected, but ':' found

inline as I understand is soft keyword only allowed in inlined methods, here it should be treated as normal identifier?

@nicolasstucki
Copy link
Contributor

inline is also allowed for parameters of inline methods

inline def pow(x: Double, inline n: Int) = ....

Not sure if parameters named inline this should be allowed.

@kpbochenek
Copy link
Contributor Author

Yes, especially this works:
inline def pow(x: Double, inline: Int) = ???
which is totally inconsistent with class C(inline: String) not working.

bishabosha added a commit that referenced this issue Jun 8, 2020
Fix #9046: Allow inline as parameter name
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

3 participants