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

Annotations on declarations aren't allowed #8056

Open
scabug opened this issue Dec 9, 2013 · 3 comments
Open

Annotations on declarations aren't allowed #8056

scabug opened this issue Dec 9, 2013 · 3 comments
Milestone

Comments

@scabug
Copy link

scabug commented Dec 9, 2013

scala> class ann extends scala.annotation.StaticAnnotation
defined class ann

scala> trait T { @ann type X }
defined trait T

scala> type T = { @ann type X }
<console>:1: error: illegal start of declaration
       type T = { @ann type X }
                  ^

scala> class T { @ann def x: Int = ??? }
defined class T

scala> type T = { @ann def x: Int }
<console>:1: error: illegal start of declaration
       type T = { @ann def x: Int }
                  ^
@scabug
Copy link
Author

scabug commented Dec 9, 2013

Imported From: https://issues.scala-lang.org/browse/SI-8056?orig=1
Reporter: @xeno-by
Affected Versions: 2.10.3, 2.11.0-M7

@scabug
Copy link
Author

scabug commented Dec 9, 2013

@SethTisue
Copy link
Member

Scala 3 accepts trait T { @ann type X } but does not accept type T = { @ann def x: Int }

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