-
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.
SI-5892 allow implicit views in annotation args
the problem was that lazy annotations got completed in phase pickler. the `inferView` method in Typers bails out if `isPastTyper`. now the lazy annotations completes `atPhase(typerPhase)`. test case in `pos`. the second test case in `neg` is for another bug that is discussed in a comment of SI-5892. when type checking arguments of type parameter annotations, the class members should not be in scope. this was alreay fixed in 9129cfe.
- Loading branch information
Showing
5 changed files
with
55 additions
and
2 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,17 @@ | ||
t5892.scala:5: error: type mismatch; | ||
found : Boolean(false) | ||
required: String | ||
class C[@annot(false) X] { | ||
^ | ||
t5892.scala:9: error: not found: value b2s | ||
class D[@annot(b2s(false)) X] { | ||
^ | ||
t5892.scala:13: error: type mismatch; | ||
found : Boolean(false) | ||
required: String | ||
@annot(false) class E { | ||
^ | ||
t5892.scala:17: error: not found: value b2s | ||
@annot(b2s(false)) class F { | ||
^ | ||
four errors found |
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,25 @@ | ||
import language.implicitConversions | ||
|
||
class annot(a: String) extends annotation.StaticAnnotation | ||
|
||
class C[@annot(false) X] { | ||
implicit def b2s(b: Boolean): String = "" | ||
} | ||
|
||
class D[@annot(b2s(false)) X] { | ||
implicit def b2s(b: Boolean): String = "" | ||
} | ||
|
||
@annot(false) class E { | ||
implicit def b2s(b: Boolean): String = "" | ||
} | ||
|
||
@annot(b2s(false)) class F { | ||
implicit def b2s(b: Boolean): String = "" | ||
} | ||
|
||
object T { | ||
implicit def b2s(b: Boolean): String = "" | ||
@annot(false) val x = 0 | ||
@annot(b2s(false)) val y = 0 | ||
} |
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,5 @@ | ||
class foo(a: String) extends annotation.StaticAnnotation | ||
object o { | ||
implicit def i2s(i: Int) = "" | ||
@foo(1: String) def blerg { } | ||
} |