summaryrefslogtreecommitdiff
path: root/test/files/run/t2577.scala
diff options
context:
space:
mode:
Diffstat (limited to 'test/files/run/t2577.scala')
-rw-r--r--test/files/run/t2577.scala17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/files/run/t2577.scala b/test/files/run/t2577.scala
new file mode 100644
index 0000000000..6d836a3996
--- /dev/null
+++ b/test/files/run/t2577.scala
@@ -0,0 +1,17 @@
+case class annot[T]() extends scala.annotation.StaticAnnotation
+
+// type inference should infer @annot[Nothing] instead of @annot[T]
+// note the T is not in scope here!
+class Foo[@annot U]
+
+object Test {
+ import scala.reflect.runtime.universe._
+ val x = new Foo
+
+ def main(args: Array[String]): Unit = {
+ val targ = typeOf[x.type].widen match {
+ case TypeRef(_, _, arg :: _) => arg
+ }
+ println(targ)
+ }
+}