diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/files/neg/macro-qmarkqmarkqmark.check | 13 | ||||
-rw-r--r-- | test/files/neg/macro-qmarkqmarkqmark.scala | 13 | ||||
-rw-r--r-- | test/files/pos/macro-qmarkqmarkqmark.check | 0 | ||||
-rw-r--r-- | test/files/pos/macro-qmarkqmarkqmark.scala | 7 | ||||
-rw-r--r-- | test/files/pos/t5886.scala | 18 | ||||
-rw-r--r-- | test/files/pos/t7486.scala | 8 | ||||
-rw-r--r-- | test/files/run/reflection-fieldmirror-getsetval.check | 2 | ||||
-rw-r--r-- | test/files/run/reflection-fieldmirror-getsetval.scala | 12 | ||||
-rw-r--r-- | test/files/run/t6989.check | 84 | ||||
-rw-r--r-- | test/files/run/t6989/JavaClass_1.java | 2 | ||||
-rw-r--r-- | test/files/run/t7359.check | 1 | ||||
-rw-r--r-- | test/files/run/t7359/Cyclic_1.java | 3 | ||||
-rw-r--r-- | test/files/run/t7359/Test_2.scala | 6 |
13 files changed, 84 insertions, 85 deletions
diff --git a/test/files/neg/macro-qmarkqmarkqmark.check b/test/files/neg/macro-qmarkqmarkqmark.check new file mode 100644 index 0000000000..afd49e7d90 --- /dev/null +++ b/test/files/neg/macro-qmarkqmarkqmark.check @@ -0,0 +1,13 @@ +macro-qmarkqmarkqmark.scala:5: error: macro implementation is missing + foo1 + ^ +macro-qmarkqmarkqmark.scala:8: error: macros cannot be partially applied + foo2 + ^ +macro-qmarkqmarkqmark.scala:9: error: macro implementation is missing + foo2(1) + ^ +macro-qmarkqmarkqmark.scala:12: error: macro implementation is missing + foo3[Int] + ^ +four errors found diff --git a/test/files/neg/macro-qmarkqmarkqmark.scala b/test/files/neg/macro-qmarkqmarkqmark.scala new file mode 100644 index 0000000000..c8d8550fd8 --- /dev/null +++ b/test/files/neg/macro-qmarkqmarkqmark.scala @@ -0,0 +1,13 @@ +import language.experimental.macros + +object Macros { + def foo1 = macro ??? + foo1 + + def foo2(x: Int) = macro ??? + foo2 + foo2(1) + + def foo3[T] = macro ??? + foo3[Int] +}
\ No newline at end of file diff --git a/test/files/pos/macro-qmarkqmarkqmark.check b/test/files/pos/macro-qmarkqmarkqmark.check new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/test/files/pos/macro-qmarkqmarkqmark.check diff --git a/test/files/pos/macro-qmarkqmarkqmark.scala b/test/files/pos/macro-qmarkqmarkqmark.scala new file mode 100644 index 0000000000..a91e4320b6 --- /dev/null +++ b/test/files/pos/macro-qmarkqmarkqmark.scala @@ -0,0 +1,7 @@ +import language.experimental.macros + +object Macros { + def foo1 = macro ??? + def foo2(x: Int) = macro ??? + def foo3[T] = macro ??? +}
\ No newline at end of file diff --git a/test/files/pos/t5886.scala b/test/files/pos/t5886.scala new file mode 100644 index 0000000000..066187322d --- /dev/null +++ b/test/files/pos/t5886.scala @@ -0,0 +1,18 @@ +object A { + def f0[T](x: T): T = x + def f1[T](x: => T): T = x + def f2[T](x: () => T): T = x() + + f0(this.getClass) // ok + f1(this.getClass) + f2(this.getClass) // ok + + // a.scala:7: error: type mismatch; + // found : Class[_ <: A.type] + // required: Class[?0(in value x1)] where type ?0(in value x1) <: A.type + // Note: A.type >: ?0, but Java-defined class Class is invariant in type T. + // You may wish to investigate a wildcard type such as `_ >: ?0`. (SLS 3.2.10) + // val x1 = f1(this.getClass) + // ^ + // one error found +} diff --git a/test/files/pos/t7486.scala b/test/files/pos/t7486.scala new file mode 100644 index 0000000000..6dd7f4c4ac --- /dev/null +++ b/test/files/pos/t7486.scala @@ -0,0 +1,8 @@ +object Test{ + var locker = 0 + // remove implicit, or change to `locker = locker + 1` to make it compile. + implicit val davyJones0 = { + locker += 0 + 0 + } +} diff --git a/test/files/run/reflection-fieldmirror-getsetval.check b/test/files/run/reflection-fieldmirror-getsetval.check index 82fef37c25..1e959a9900 100644 --- a/test/files/run/reflection-fieldmirror-getsetval.check +++ b/test/files/run/reflection-fieldmirror-getsetval.check @@ -1,2 +1,2 @@ 42 -cannot set an immutable field x +2 diff --git a/test/files/run/reflection-fieldmirror-getsetval.scala b/test/files/run/reflection-fieldmirror-getsetval.scala index 67c54d9708..90221481d4 100644 --- a/test/files/run/reflection-fieldmirror-getsetval.scala +++ b/test/files/run/reflection-fieldmirror-getsetval.scala @@ -12,13 +12,7 @@ object Test extends App { val cs = im.symbol val f = cs.typeSignature.declaration(newTermName("x" + nme.LOCAL_SUFFIX_STRING)).asTerm val fm: FieldMirror = im.reflectField(f) - try { - println(fm.get) - fm.set(2) - println(fm.get) - println("this indicates a failure") - } catch { - case ex: Throwable => - println(ex.getMessage) - } + println(fm.get) + fm.set(2) + println(fm.get) } diff --git a/test/files/run/t6989.check b/test/files/run/t6989.check index 3a94f6e8df..8943792115 100644 --- a/test/files/run/t6989.check +++ b/test/files/run/t6989.check @@ -113,18 +113,6 @@ isProtected = false isPublic = false privateWithin = <none> ============ -sym = class $PrivateJavaClass, signature = ClassInfoType(...), owner = class JavaClass_1 -isPrivate = true -isProtected = false -isPublic = false -privateWithin = <none> -============ -sym = value this$0, signature = foo.JavaClass_1, owner = class $PrivateJavaClass -isPrivate = false -isProtected = false -isPublic = false -privateWithin = package foo -============ sym = class $ProtectedJavaClass, signature = ClassInfoType(...), owner = class JavaClass_1 isPrivate = false isProtected = true @@ -143,18 +131,6 @@ isProtected = false isPublic = false privateWithin = package foo ============ -sym = class $ProtectedJavaClass, signature = ClassInfoType(...), owner = class JavaClass_1 -isPrivate = false -isProtected = true -isPublic = false -privateWithin = package foo -============ -sym = value this$0, signature = foo.JavaClass_1, owner = class $ProtectedJavaClass -isPrivate = false -isProtected = false -isPublic = false -privateWithin = package foo -============ sym = class $PublicJavaClass, signature = ClassInfoType(...), owner = class JavaClass_1 isPrivate = false isProtected = false @@ -179,97 +155,55 @@ isProtected = false isPublic = true privateWithin = <none> ============ -sym = class $PublicJavaClass, signature = ClassInfoType(...), owner = class JavaClass_1 -isPrivate = false -isProtected = false -isPublic = true -privateWithin = <none> -============ -sym = constructor $PublicJavaClass, signature = (x$1: foo.JavaClass_1)JavaClass_1.this.$PublicJavaClass, owner = class $PublicJavaClass +sym = constructor JavaClass_1, signature = ()foo.JavaClass_1, owner = class JavaClass_1 isPrivate = false isProtected = false isPublic = true privateWithin = <none> ============ -sym = value this$0, signature = foo.JavaClass_1, owner = class $PublicJavaClass -isPrivate = false -isProtected = false -isPublic = false -privateWithin = package foo -============ -sym = constructor JavaClass_1, signature = ()foo.JavaClass_1, owner = class JavaClass_1 +sym = object JavaClass_1, signature = foo.JavaClass_1.type, owner = package foo isPrivate = false isProtected = false isPublic = true privateWithin = <none> ============ -sym = class PrivateStaticJavaClass, signature = ClassInfoType(...), owner = class JavaClass_1 +sym = class PrivateStaticJavaClass, signature = ClassInfoType(...), owner = object JavaClass_1 isPrivate = true isProtected = false isPublic = false privateWithin = <none> ============ -sym = object PrivateStaticJavaClass, signature = JavaClass_1.this.PrivateStaticJavaClass.type, owner = class JavaClass_1 +sym = object PrivateStaticJavaClass, signature = foo.JavaClass_1.PrivateStaticJavaClass.type, owner = object JavaClass_1 isPrivate = true isProtected = false isPublic = false privateWithin = <none> ============ -sym = class ProtectedStaticJavaClass, signature = ClassInfoType(...), owner = class JavaClass_1 +sym = class ProtectedStaticJavaClass, signature = ClassInfoType(...), owner = object JavaClass_1 isPrivate = true isProtected = false isPublic = false privateWithin = <none> ============ -sym = object ProtectedStaticJavaClass, signature = JavaClass_1.this.ProtectedStaticJavaClass.type, owner = class JavaClass_1 +sym = object ProtectedStaticJavaClass, signature = foo.JavaClass_1.ProtectedStaticJavaClass.type, owner = object JavaClass_1 isPrivate = true isProtected = false isPublic = false privateWithin = <none> ============ -sym = class PublicStaticJavaClass, signature = ClassInfoType(...), owner = class JavaClass_1 -isPrivate = false -isProtected = false -isPublic = true -privateWithin = <none> -============ -sym = constructor PublicStaticJavaClass, signature = ()JavaClass_1.this.PublicStaticJavaClass, owner = class PublicStaticJavaClass -isPrivate = false -isProtected = false -isPublic = true -privateWithin = <none> -============ -sym = object PublicStaticJavaClass, signature = JavaClass_1.this.PublicStaticJavaClass.type, owner = class JavaClass_1 +sym = class PublicStaticJavaClass, signature = ClassInfoType(...), owner = object JavaClass_1 isPrivate = false isProtected = false isPublic = true privateWithin = <none> ============ -sym = object JavaClass_1, signature = foo.JavaClass_1.type, owner = package foo -isPrivate = false -isProtected = false -isPublic = true -privateWithin = <none> -============ -sym = class PrivateStaticJavaClass, signature = ClassInfoType(...), owner = class JavaClass_1 -isPrivate = true -isProtected = false -isPublic = false -privateWithin = <none> -============ -sym = class ProtectedStaticJavaClass, signature = ClassInfoType(...), owner = class JavaClass_1 -isPrivate = true -isProtected = false -isPublic = false -privateWithin = <none> -============ -sym = class PublicStaticJavaClass, signature = ClassInfoType(...), owner = class JavaClass_1 +sym = constructor PublicStaticJavaClass, signature = ()foo.JavaClass_1.PublicStaticJavaClass, owner = class PublicStaticJavaClass isPrivate = false isProtected = false isPublic = true privateWithin = <none> ============ -sym = constructor PublicStaticJavaClass, signature = ()JavaClass_1.this.PublicStaticJavaClass, owner = class PublicStaticJavaClass +sym = object PublicStaticJavaClass, signature = foo.JavaClass_1.PublicStaticJavaClass.type, owner = object JavaClass_1 isPrivate = false isProtected = false isPublic = true diff --git a/test/files/run/t6989/JavaClass_1.java b/test/files/run/t6989/JavaClass_1.java index eb26a08700..72ec4d6ab6 100644 --- a/test/files/run/t6989/JavaClass_1.java +++ b/test/files/run/t6989/JavaClass_1.java @@ -7,6 +7,8 @@ package foo; // I'm leaving the incorrect results of FromJavaClassCompleters in the check // file, so that we get notified when something changes there. +// ^^^ It's not clear what those incorrect results were, but the fix for SI-7359 +// (backport of fix for SI-6548) has probably resolved some of these. OP, please revisit this comment. class PackagePrivateJavaClass { private int privateField = 0; diff --git a/test/files/run/t7359.check b/test/files/run/t7359.check new file mode 100644 index 0000000000..9766475a41 --- /dev/null +++ b/test/files/run/t7359.check @@ -0,0 +1 @@ +ok diff --git a/test/files/run/t7359/Cyclic_1.java b/test/files/run/t7359/Cyclic_1.java new file mode 100644 index 0000000000..42b46c1aed --- /dev/null +++ b/test/files/run/t7359/Cyclic_1.java @@ -0,0 +1,3 @@ +abstract class Cyclic { + static interface Inner<T extends Inner> { } +}
\ No newline at end of file diff --git a/test/files/run/t7359/Test_2.scala b/test/files/run/t7359/Test_2.scala new file mode 100644 index 0000000000..bb6f4cb2d9 --- /dev/null +++ b/test/files/run/t7359/Test_2.scala @@ -0,0 +1,6 @@ +import scala.reflect.runtime.universe._ + +object Test extends App { + typeOf[Cyclic].members + println("ok") +}
\ No newline at end of file |