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

compileTimeOnly does not work on a trait/class #10122

Closed
bishabosha opened this issue Oct 30, 2020 · 1 comment
Closed

compileTimeOnly does not work on a trait/class #10122

bishabosha opened this issue Oct 30, 2020 · 1 comment

Comments

@bishabosha
Copy link
Member

Minimized code

@annotation.compileTimeOnly("Foo should be erased") trait Foo
@annotation.compileTimeOnly("Bar should be erased") class Bar
val foo = new Foo {}
val bar = new Bar {}

Output

compiles ok

Expectation

error Foo should be erased, Bar should be erased, as in Scala 2.13

bishabosha added a commit to dotty-staging/dotty that referenced this issue Oct 30, 2020
bishabosha added a commit to dotty-staging/dotty that referenced this issue Oct 30, 2020
bishabosha added a commit to dotty-staging/dotty that referenced this issue Oct 30, 2020
@odersky
Copy link
Contributor

odersky commented Dec 27, 2020

Not sure we need to have the same behavior here. compileTimeOnly is not specced anywhere as far as I know. And it will be replaced by erased, or so we hope.

@odersky odersky closed this as completed Dec 27, 2020
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