Skip to content
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

Add DottyEnumKeyword rewrite, fixes #247. #263

Merged
merged 3 commits into from
Jul 18, 2017

Conversation

olafurpg
Copy link
Contributor

Could someone from the Dotty team maybe review, @smarter?

@smarter
Copy link

smarter commented Jul 18, 2017

Looks fine to me, should this be generalized to other keywords, like inline ?

@gabro
Copy link
Collaborator

gabro commented Jul 18, 2017

We could also have a compound "DottyKeyword" composing this and other ones like inline

DottyKeywords backticks identifiers which are upcoming keywords in
Dotty. Note that DottyKeywords will rename `@inline` to

```scala
@`inline` def foo
```

This compiles with both scalac and dotc, but looks weird. In the future,
we may want the rewrite to be semantic and insert `inline` for
codebases targeting only Dotty and keep `@scala.inline`
(unbackticked) for codebases that want to target both compilers.
With -language:Scala2, Dotty permits inline as part of annotations.
This works for both scala.inline as well as custom annotations that are
incidentallly named inline. We can later provide a separate rewrite for
writing `@scala.inline def` as `inline def` for those who only wish to
target Dotty.
@olafurpg
Copy link
Contributor Author

Thanks for the feedback! I like the idea of a DottyKeywords rewrite that also handles inline. Inline is a bit trickier since Dotty allows it in annotation position under -language:Scala2.

@olafurpg olafurpg merged commit 45dad9f into scalacenter:master Jul 18, 2017
@olafurpg olafurpg deleted the dotty-enum branch July 18, 2017 18:07
bjaglin pushed a commit to liancheng/scalafix that referenced this pull request May 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants