summaryrefslogtreecommitdiff
path: root/test/files/neg/compile-time-only-a.scala
diff options
context:
space:
mode:
authorEugene Burmako <xeno.by@gmail.com>2013-12-09 16:27:59 +0100
committerEugene Burmako <xeno.by@gmail.com>2013-12-09 17:04:30 +0100
commiteb78e90ca70979fc014bc15481a38615f718abf4 (patch)
treeb7355571e22ebb998ff5ea0d5084734e16973ab6 /test/files/neg/compile-time-only-a.scala
parent75cc6cf256df9e152eaec771121ce0db9f7039f8 (diff)
downloadscala-eb78e90ca70979fc014bc15481a38615f718abf4.tar.gz
scala-eb78e90ca70979fc014bc15481a38615f718abf4.tar.bz2
scala-eb78e90ca70979fc014bc15481a38615f718abf4.zip
streamlines refchecking undesired symbol properties
Unifies `checkDeprecated`, `checkMigration` and `checkCompileTimeOnly` into a single centralized point of reference that is now consistently called from `checkTypeRef`, `transformIdent` and `transformSelect`.
Diffstat (limited to 'test/files/neg/compile-time-only-a.scala')
-rw-r--r--test/files/neg/compile-time-only-a.scala19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/files/neg/compile-time-only-a.scala b/test/files/neg/compile-time-only-a.scala
index 43d36dfab1..533175a699 100644
--- a/test/files/neg/compile-time-only-a.scala
+++ b/test/files/neg/compile-time-only-a.scala
@@ -1,4 +1,5 @@
import scala.annotation.compileTimeOnly
+import scala.language.existentials
@compileTimeOnly("C1") class C1
object C1
@@ -24,6 +25,9 @@ class C6(@compileTimeOnly("C6.x") val x: Int) {
@compileTimeOnly("C6.y") var y = 3
}
+@compileTimeOnly("C7") class C7
+@compileTimeOnly("C8") class C8[T]
+
object Test extends App {
new C1()
C1
@@ -46,6 +50,21 @@ object Test extends App {
c6.foo
type Foo = c6.Foo
c6.y = c6.y
+
+ val c701: (C7, C7) = ???
+ val c702: (C7 => C7) = ???
+ val c703: { val x: C7 } = ???
+ val c704: AnyRef with C7 = ???
+ // https://groups.google.com/forum/#!topic/scala-internals/5n07TiCnBZU
+ // val c705: ({ @compileTimeOnly("C7") type C7[T] = List[T] })#C7[_] = ???
+ val c706: C7 Either C7 = ???
+ val c707a: List[C7] = ???
+ val c707b = List[C7]()
+ val c708a: T forSome { type T <: C7 } = ???
+ // https://groups.google.com/forum/#!topic/scala-internals/5n07TiCnBZU
+ // val c708b: T forSome { @compileTimeOnly("C7") type T } = ???
+ val c709: (C8[Int], C8[C7]) = ???
+ val c710: (C8[_] => C8[_]) = ???
}
@compileTimeOnly("placebo")