diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/files/neg/macro-invalidret.check | 3 | ||||
-rw-r--r-- | test/files/neg/macro-invalidret/Impls_1.scala | 2 | ||||
-rw-r--r-- | test/files/pos/five-dot-f.flags | 1 | ||||
-rw-r--r-- | test/files/pos/t8868a/Sub_2.scala | 1 | ||||
-rw-r--r-- | test/files/pos/t8868a/T_1.scala | 6 | ||||
-rw-r--r-- | test/files/pos/t8868b/Sub_2.scala | 2 | ||||
-rw-r--r-- | test/files/pos/t8868b/T_1.scala | 4 | ||||
-rw-r--r-- | test/files/pos/t8868c/Sub_2.scala | 2 | ||||
-rw-r--r-- | test/files/pos/t8868c/T_1.scala | 9 | ||||
-rw-r--r-- | test/files/run/t5530.flags | 1 | ||||
-rw-r--r-- | test/files/run/t5532.flags | 1 | ||||
-rw-r--r-- | test/files/run/t5614.flags | 1 | ||||
-rw-r--r-- | test/files/run/t6622.check | 10 | ||||
-rw-r--r-- | test/files/run/t6622.scala | 50 | ||||
-rw-r--r-- | test/files/run/t8087.scala | 12 | ||||
-rw-r--r-- | test/files/run/t8445.check | 1 | ||||
-rw-r--r-- | test/files/run/t8445.scala | 11 |
17 files changed, 110 insertions, 7 deletions
diff --git a/test/files/neg/macro-invalidret.check b/test/files/neg/macro-invalidret.check index 568cc7c570..ebdc8ec7da 100644 --- a/test/files/neg/macro-invalidret.check +++ b/test/files/neg/macro-invalidret.check @@ -19,8 +19,7 @@ Macros_Test_2.scala:7: warning: macro defs must have explicitly specified return def foo6 = macro Impls.foo6 ^ Macros_Test_2.scala:14: error: exception during macro expansion: -scala.NotImplementedError: an implementation is missing - at scala.Predef$.$qmark$qmark$qmark(Predef.scala:225) +java.lang.NullPointerException at Impls$.foo3(Impls_1.scala:7) foo3 diff --git a/test/files/neg/macro-invalidret/Impls_1.scala b/test/files/neg/macro-invalidret/Impls_1.scala index 434aeef10f..a52e8d8f39 100644 --- a/test/files/neg/macro-invalidret/Impls_1.scala +++ b/test/files/neg/macro-invalidret/Impls_1.scala @@ -4,7 +4,7 @@ import scala.reflect.runtime.{universe => ru} object Impls { def foo1(c: Context) = 2 def foo2(c: Context) = ru.Literal(ru.Constant(42)) - def foo3(c: Context) = ??? + def foo3(c: Context) = throw null def foo5(c: Context) = c.universe.Literal(c.universe.Constant(42)) def foo6(c: Context) = c.Expr[Int](c.universe.Literal(c.universe.Constant(42))) } diff --git a/test/files/pos/five-dot-f.flags b/test/files/pos/five-dot-f.flags deleted file mode 100644 index 112fc720a0..0000000000 --- a/test/files/pos/five-dot-f.flags +++ /dev/null @@ -1 +0,0 @@ --Xfuture
\ No newline at end of file diff --git a/test/files/pos/t8868a/Sub_2.scala b/test/files/pos/t8868a/Sub_2.scala new file mode 100644 index 0000000000..a19b529c88 --- /dev/null +++ b/test/files/pos/t8868a/Sub_2.scala @@ -0,0 +1 @@ +class Sub extends T diff --git a/test/files/pos/t8868a/T_1.scala b/test/files/pos/t8868a/T_1.scala new file mode 100644 index 0000000000..9fb97b1413 --- /dev/null +++ b/test/files/pos/t8868a/T_1.scala @@ -0,0 +1,6 @@ +class C + +trait T { + @deprecated(since = "", message = "") + class X +} diff --git a/test/files/pos/t8868b/Sub_2.scala b/test/files/pos/t8868b/Sub_2.scala new file mode 100644 index 0000000000..58b44db2b3 --- /dev/null +++ b/test/files/pos/t8868b/Sub_2.scala @@ -0,0 +1,2 @@ +class Sub extends T + diff --git a/test/files/pos/t8868b/T_1.scala b/test/files/pos/t8868b/T_1.scala new file mode 100644 index 0000000000..0b71cfdaa3 --- /dev/null +++ b/test/files/pos/t8868b/T_1.scala @@ -0,0 +1,4 @@ +@deprecated(since = "2.4.0", message = "") +trait T { + class X +} diff --git a/test/files/pos/t8868c/Sub_2.scala b/test/files/pos/t8868c/Sub_2.scala new file mode 100644 index 0000000000..58b44db2b3 --- /dev/null +++ b/test/files/pos/t8868c/Sub_2.scala @@ -0,0 +1,2 @@ +class Sub extends T + diff --git a/test/files/pos/t8868c/T_1.scala b/test/files/pos/t8868c/T_1.scala new file mode 100644 index 0000000000..dc541950d8 --- /dev/null +++ b/test/files/pos/t8868c/T_1.scala @@ -0,0 +1,9 @@ +class C(a: Any) extends annotation.StaticAnnotation + +@C({val x = 0; x}) +trait T { + class X + + @C({val x = 0; x}) + def foo = 42 +} diff --git a/test/files/run/t5530.flags b/test/files/run/t5530.flags deleted file mode 100644 index e1b37447c9..0000000000 --- a/test/files/run/t5530.flags +++ /dev/null @@ -1 +0,0 @@ --Xexperimental
\ No newline at end of file diff --git a/test/files/run/t5532.flags b/test/files/run/t5532.flags deleted file mode 100644 index e1b37447c9..0000000000 --- a/test/files/run/t5532.flags +++ /dev/null @@ -1 +0,0 @@ --Xexperimental
\ No newline at end of file diff --git a/test/files/run/t5614.flags b/test/files/run/t5614.flags deleted file mode 100644 index 48fd867160..0000000000 --- a/test/files/run/t5614.flags +++ /dev/null @@ -1 +0,0 @@ --Xexperimental diff --git a/test/files/run/t6622.check b/test/files/run/t6622.check new file mode 100644 index 0000000000..5d006d88e6 --- /dev/null +++ b/test/files/run/t6622.check @@ -0,0 +1,10 @@ + O1.resultVal isMemberClass = false, null +class A$1 + O1.resultDef isMemberClass = false, public void O1$.resultDef() +class A$2 + C2.resultVal isMemberClass = false, null +class $B$1 + O3.resultDef isMemberClass = false, public void O3$.resultDef() +class C$1 + O4.resultDefDefault isMemberClass = false, public java.lang.Object O4$.resultDefDefault$default$1() +class C$2 diff --git a/test/files/run/t6622.scala b/test/files/run/t6622.scala new file mode 100644 index 0000000000..de8ffa01bf --- /dev/null +++ b/test/files/run/t6622.scala @@ -0,0 +1,50 @@ +import Test.check + +object O1 { + lazy val resultVal = { + class A + check("O1.resultVal", classOf[A]) + } + + def resultDef = { + class A + check("O1.resultDef", classOf[A]) + } +} + +class C2 { + val resultVal = { + val tmp = { + class B + check("C2.resultVal", classOf[B]) + } + } +} + +object O3 { + def resultDef = { + class C + check("O3.resultDef", classOf[C]) + } +} + +object O4 { + def resultDefDefault(a: Any = { + class C + check("O4.resultDefDefault", classOf[C]) + }) = (); +} + + +object Test extends App { + def check(desc: String, clazz: Class[_]) { + println(s" $desc isMemberClass = ${clazz.isMemberClass}, ${clazz.getEnclosingMethod}") + println(reflect.runtime.currentMirror.classSymbol(clazz)) + } + + O1.resultVal + O1.resultDef + new C2().resultVal + O3.resultDef + O4.resultDefDefault() +} diff --git a/test/files/run/t8087.scala b/test/files/run/t8087.scala new file mode 100644 index 0000000000..6047211756 --- /dev/null +++ b/test/files/run/t8087.scala @@ -0,0 +1,12 @@ +trait Foo { + @volatile private[this] var x: String = "" + @volatile private var y: String = "" +} + +class Bar extends Foo + +object Test extends App { + classOf[Bar].getDeclaredFields.foreach(f => { + assert(java.lang.reflect.Modifier.isVolatile(f.getModifiers), f.getName) + }) +} diff --git a/test/files/run/t8445.check b/test/files/run/t8445.check new file mode 100644 index 0000000000..41fd6d3ed1 --- /dev/null +++ b/test/files/run/t8445.check @@ -0,0 +1 @@ +warning: there was one feature warning; re-run with -feature for details diff --git a/test/files/run/t8445.scala b/test/files/run/t8445.scala new file mode 100644 index 0000000000..ed196b62a2 --- /dev/null +++ b/test/files/run/t8445.scala @@ -0,0 +1,11 @@ +object X { + class Y + def y = new Y { + class Z + def z = classOf[Z] + } +} + +object Test extends App { + assert(X.y.z.getEnclosingClass.getName == "X$$anon$1") +} |