-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9302 from retronym/topic/extra-lazy-annotation-info
- Loading branch information
Showing
5 changed files
with
102 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import scala.annotation.StaticAnnotation | ||
|
||
class anno(attr: Boolean) extends StaticAnnotation | ||
|
||
object Test { | ||
@anno(attr = true) def attr: Int = 1 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
class Annot(arg: Any) extends scala.annotation.StaticAnnotation | ||
|
||
abstract class Demo1 { | ||
@Annot(x) | ||
def x: String = "foo" | ||
} | ||
|
||
abstract class Demo2 { | ||
@Annot(y) | ||
def x: String = "foo" | ||
|
||
@Annot(x) | ||
def y: String = "bar" | ||
} | ||
|
||
class Annot1(arg: Any) extends scala.annotation.StaticAnnotation | ||
class Annot2(arg: Any) extends scala.annotation.StaticAnnotation | ||
|
||
abstract class Demo3 { | ||
@Annot1(y) | ||
def x: String = "foo" | ||
|
||
@Annot2(x) | ||
def y: String = "bar" | ||
} | ||
|
||
// test annotations without argument | ||
import scala.annotation.unchecked | ||
|
||
class C { | ||
class D | ||
} | ||
|
||
class Test { | ||
locally { | ||
val c = new C | ||
import c._ | ||
new D | ||
} | ||
|
||
locally { | ||
import unchecked.uncheckedStable | ||
@uncheckedStable def c = new C | ||
import c._ | ||
new D | ||
} | ||
|
||
locally { | ||
@unchecked.uncheckedStable def c = new C | ||
import c._ | ||
new D | ||
} | ||
|
||
locally { | ||
import unchecked.{uncheckedStable => uc} | ||
@uc def c = new C | ||
import c._ | ||
new D | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import scala.annotation.StaticAnnotation | ||
|
||
class anno(a: Any) extends StaticAnnotation | ||
|
||
object Test { | ||
def foo = attr | ||
@anno(foo) def attr: Int = foo | ||
} |