summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/files/neg/switch.check5
-rw-r--r--test/files/neg/switch.scala4
-rw-r--r--test/files/neg/t2796.check4
-rw-r--r--test/files/neg/t2796.flags1
-rw-r--r--test/files/neg/t2796.scala28
-rw-r--r--test/files/neg/t5830.check4
-rw-r--r--test/files/neg/t5830.flags1
-rw-r--r--test/files/neg/t5830.scala9
-rw-r--r--test/files/neg/t5969.check7
-rw-r--r--test/files/neg/t5969.scala11
-rw-r--r--test/files/neg/t6013.check7
-rw-r--r--test/files/neg/t6013/Abstract.java7
-rw-r--r--test/files/neg/t6013/Base.java10
-rw-r--r--test/files/neg/t6013/DerivedScala.scala7
-rw-r--r--test/files/neg/t649.check2
-rw-r--r--test/files/pos/t6033.scala5
-rw-r--r--test/files/run/abstypetags_core.check56
-rw-r--r--test/files/run/abstypetags_core.scala4
-rw-r--r--test/files/run/classtags_core.check4
-rw-r--r--test/files/run/classtags_core.scala4
-rw-r--r--test/files/run/inline-ex-handlers.check58
-rw-r--r--test/files/run/patmat-finally.scala25
-rw-r--r--test/files/run/t5830.check6
-rw-r--r--test/files/run/t5830.flags1
-rw-r--r--test/files/run/t5830.scala56
-rw-r--r--test/files/run/test-cpp.check138
-rw-r--r--test/files/run/typetags_core.check56
-rw-r--r--test/files/run/typetags_core.scala4
28 files changed, 363 insertions, 161 deletions
diff --git a/test/files/neg/switch.check b/test/files/neg/switch.check
index 8955c94b32..e4730b6459 100644
--- a/test/files/neg/switch.check
+++ b/test/files/neg/switch.check
@@ -1,10 +1,7 @@
-switch.scala:28: error: could not emit switch for @switch annotated match
- def fail1(c: Char) = (c: @switch) match {
- ^
switch.scala:38: error: could not emit switch for @switch annotated match
def fail2(c: Char) = (c: @switch @unchecked) match {
^
switch.scala:45: error: could not emit switch for @switch annotated match
def fail3(c: Char) = (c: @unchecked @switch) match {
^
-three errors found
+two errors found
diff --git a/test/files/neg/switch.scala b/test/files/neg/switch.scala
index a3dfd869d6..198583fe41 100644
--- a/test/files/neg/switch.scala
+++ b/test/files/neg/switch.scala
@@ -24,8 +24,8 @@ object Main {
case _ => false
}
- // has a guard
- def fail1(c: Char) = (c: @switch) match {
+ // has a guard, but since SI-5830 that's ok
+ def succ_guard(c: Char) = (c: @switch) match {
case 'A' | 'B' | 'C' => true
case x if x == 'A' => true
case _ => false
diff --git a/test/files/neg/t2796.check b/test/files/neg/t2796.check
new file mode 100644
index 0000000000..aeb18497ed
--- /dev/null
+++ b/test/files/neg/t2796.check
@@ -0,0 +1,4 @@
+t2796.scala:7: error: Implementation restriction: early definitions in traits are not initialized before the super class is initialized.
+ val abstractVal = "T1.abstractVal" // warn
+ ^
+one error found
diff --git a/test/files/neg/t2796.flags b/test/files/neg/t2796.flags
new file mode 100644
index 0000000000..e8fb65d50c
--- /dev/null
+++ b/test/files/neg/t2796.flags
@@ -0,0 +1 @@
+-Xfatal-warnings \ No newline at end of file
diff --git a/test/files/neg/t2796.scala b/test/files/neg/t2796.scala
new file mode 100644
index 0000000000..3bcc9df562
--- /dev/null
+++ b/test/files/neg/t2796.scala
@@ -0,0 +1,28 @@
+trait Base {
+ val abstractVal: String
+ final val useAbstractVal = abstractVal
+}
+
+trait T1 extends {
+ val abstractVal = "T1.abstractVal" // warn
+} with Base
+
+trait T2 extends {
+ type X = Int // okay
+} with Base
+
+
+class C1 extends {
+ val abstractVal = "C1.abstractVal" // okay
+} with Base
+
+object Test {
+ def main(args: Array[String]) {
+ assert(new C1 ().useAbstractVal == "C1.abstractVal")
+ // This currently fails. a more ambitious approach to this ticket would add $earlyinit$
+ // to traits and call it from the right places in the right order.
+ //
+ // For now, we'll just issue a warning.
+ assert(new T1 {}.useAbstractVal == "T1.abstractVal")
+ }
+}
diff --git a/test/files/neg/t5830.check b/test/files/neg/t5830.check
new file mode 100644
index 0000000000..85cb84378f
--- /dev/null
+++ b/test/files/neg/t5830.check
@@ -0,0 +1,4 @@
+t5830.scala:6: error: unreachable code
+ case 'a' => println("b") // unreachable
+ ^
+one error found
diff --git a/test/files/neg/t5830.flags b/test/files/neg/t5830.flags
new file mode 100644
index 0000000000..e8fb65d50c
--- /dev/null
+++ b/test/files/neg/t5830.flags
@@ -0,0 +1 @@
+-Xfatal-warnings \ No newline at end of file
diff --git a/test/files/neg/t5830.scala b/test/files/neg/t5830.scala
new file mode 100644
index 0000000000..c2df3dec8b
--- /dev/null
+++ b/test/files/neg/t5830.scala
@@ -0,0 +1,9 @@
+import scala.annotation.switch
+
+class Test {
+ def unreachable(ch: Char) = (ch: @switch) match {
+ case 'a' => println("b") // ok
+ case 'a' => println("b") // unreachable
+ case 'c' =>
+ }
+} \ No newline at end of file
diff --git a/test/files/neg/t5969.check b/test/files/neg/t5969.check
new file mode 100644
index 0000000000..9d8ac9a3a5
--- /dev/null
+++ b/test/files/neg/t5969.check
@@ -0,0 +1,7 @@
+t5969.scala:9: error: overloaded method value g with alternatives:
+ (x: C2)String <and>
+ (x: C1)String
+ cannot be applied to (String)
+ if (false) List(g(x)) else List[C1]() map g
+ ^
+one error found
diff --git a/test/files/neg/t5969.scala b/test/files/neg/t5969.scala
new file mode 100644
index 0000000000..62f87fd7ab
--- /dev/null
+++ b/test/files/neg/t5969.scala
@@ -0,0 +1,11 @@
+class C1
+class C2
+class A {
+ def f(x: Any) = x
+ def g(x: C1): String = "A"
+ def g(x: C2): String = "B"
+
+ def crash() = f(List[String]() flatMap { x =>
+ if (false) List(g(x)) else List[C1]() map g
+ })
+}
diff --git a/test/files/neg/t6013.check b/test/files/neg/t6013.check
new file mode 100644
index 0000000000..502da999f5
--- /dev/null
+++ b/test/files/neg/t6013.check
@@ -0,0 +1,7 @@
+DerivedScala.scala:4: error: class C needs to be abstract, since there is a deferred declaration of method foo in class B of type => Int which is not implemented in a subclass
+class C extends B
+ ^
+DerivedScala.scala:7: error: class DerivedScala needs to be abstract, since there is a deferred declaration of method foo in class Abstract of type ()Boolean which is not implemented in a subclass
+class DerivedScala extends Abstract
+ ^
+two errors found
diff --git a/test/files/neg/t6013/Abstract.java b/test/files/neg/t6013/Abstract.java
new file mode 100644
index 0000000000..c0ef046bbd
--- /dev/null
+++ b/test/files/neg/t6013/Abstract.java
@@ -0,0 +1,7 @@
+public abstract class Abstract extends Base {
+ // overrides Base#bar under the erasure model
+ public void bar(java.util.List<java.lang.Integer> foo) { return; }
+
+ // must force re-implementation in derived classes
+ public abstract boolean foo();
+}
diff --git a/test/files/neg/t6013/Base.java b/test/files/neg/t6013/Base.java
new file mode 100644
index 0000000000..b73d7fd821
--- /dev/null
+++ b/test/files/neg/t6013/Base.java
@@ -0,0 +1,10 @@
+abstract public class Base {
+ // This must considered to be overridden by Abstract#foo based
+ // on the erased signatures. This special case is handled by
+ // `javaErasedOverridingSym` in `RefChecks`.
+ public abstract void bar(java.util.List<java.lang.String> foo) { return; }
+
+ // But, a concrete method in a Java superclass must not excuse
+ // a deferred method in the Java subclass!
+ public boolean foo() { return true; }
+}
diff --git a/test/files/neg/t6013/DerivedScala.scala b/test/files/neg/t6013/DerivedScala.scala
new file mode 100644
index 0000000000..fc0c55d398
--- /dev/null
+++ b/test/files/neg/t6013/DerivedScala.scala
@@ -0,0 +1,7 @@
+// Scala extending Scala (this case was working fine before this bug.)
+class A { def foo: Int = 0 }
+abstract class B extends A { def foo: Int }
+class C extends B
+
+// Scala extending Java
+class DerivedScala extends Abstract
diff --git a/test/files/neg/t649.check b/test/files/neg/t649.check
index a6670886b5..5a270d4751 100644
--- a/test/files/neg/t649.check
+++ b/test/files/neg/t649.check
@@ -1,4 +1,4 @@
t649.scala:3: error: overloaded method foo needs result type
def foo[A] = foo[A]
- ^
+ ^
one error found
diff --git a/test/files/pos/t6033.scala b/test/files/pos/t6033.scala
new file mode 100644
index 0000000000..60142af6be
--- /dev/null
+++ b/test/files/pos/t6033.scala
@@ -0,0 +1,5 @@
+object Test extends App {
+ val b = new java.math.BigInteger("123")
+ val big1 = BigInt(b)
+ val big2: BigInt = b
+}
diff --git a/test/files/run/abstypetags_core.check b/test/files/run/abstypetags_core.check
index ec93221a30..8d20e099c4 100644
--- a/test/files/run/abstypetags_core.check
+++ b/test/files/run/abstypetags_core.check
@@ -1,26 +1,30 @@
-true
-TypeTag[Byte]
-true
-TypeTag[Short]
-true
-TypeTag[Char]
-true
-TypeTag[Int]
-true
-TypeTag[Long]
-true
-TypeTag[Float]
-true
-TypeTag[Double]
-true
-TypeTag[Boolean]
-true
-TypeTag[Unit]
-true
-TypeTag[Any]
-true
-TypeTag[java.lang.Object]
-true
-TypeTag[Null]
-true
-TypeTag[Nothing]
+true
+TypeTag[Byte]
+true
+TypeTag[Short]
+true
+TypeTag[Char]
+true
+TypeTag[Int]
+true
+TypeTag[Long]
+true
+TypeTag[Float]
+true
+TypeTag[Double]
+true
+TypeTag[Boolean]
+true
+TypeTag[Unit]
+true
+TypeTag[Any]
+true
+TypeTag[AnyVal]
+true
+TypeTag[AnyRef]
+true
+TypeTag[java.lang.Object]
+true
+TypeTag[Null]
+true
+TypeTag[Nothing]
diff --git a/test/files/run/abstypetags_core.scala b/test/files/run/abstypetags_core.scala
index dbe9b5e11d..226de94055 100644
--- a/test/files/run/abstypetags_core.scala
+++ b/test/files/run/abstypetags_core.scala
@@ -21,6 +21,10 @@ object Test extends App {
println(implicitly[AbsTypeTag[Unit]])
println(implicitly[AbsTypeTag[Any]] eq AbsTypeTag.Any)
println(implicitly[AbsTypeTag[Any]])
+ println(implicitly[AbsTypeTag[AnyVal]] eq AbsTypeTag.AnyVal)
+ println(implicitly[AbsTypeTag[AnyVal]])
+ println(implicitly[AbsTypeTag[AnyRef]] eq AbsTypeTag.AnyRef)
+ println(implicitly[AbsTypeTag[AnyRef]])
println(implicitly[AbsTypeTag[Object]] eq AbsTypeTag.Object)
println(implicitly[AbsTypeTag[Object]])
println(implicitly[AbsTypeTag[Null]] eq AbsTypeTag.Null)
diff --git a/test/files/run/classtags_core.check b/test/files/run/classtags_core.check
index ce7793e188..6519db2178 100644
--- a/test/files/run/classtags_core.check
+++ b/test/files/run/classtags_core.check
@@ -21,6 +21,10 @@ ClassTag[class java.lang.Object]
true
ClassTag[class java.lang.Object]
true
+ClassTag[class java.lang.Object]
+true
+ClassTag[class java.lang.Object]
+true
ClassTag[class scala.runtime.Null$]
true
ClassTag[class scala.runtime.Nothing$]
diff --git a/test/files/run/classtags_core.scala b/test/files/run/classtags_core.scala
index ad5e12a8c2..0e174d8243 100644
--- a/test/files/run/classtags_core.scala
+++ b/test/files/run/classtags_core.scala
@@ -21,6 +21,10 @@ object Test extends App {
println(implicitly[ClassTag[Unit]])
println(implicitly[ClassTag[Any]] eq ClassTag.Any)
println(implicitly[ClassTag[Any]])
+ println(implicitly[ClassTag[AnyVal]] eq ClassTag.AnyVal)
+ println(implicitly[ClassTag[AnyVal]])
+ println(implicitly[ClassTag[AnyRef]] eq ClassTag.AnyRef)
+ println(implicitly[ClassTag[AnyRef]])
println(implicitly[ClassTag[Object]] eq ClassTag.Object)
println(implicitly[ClassTag[Object]])
println(implicitly[ClassTag[Null]] eq ClassTag.Null)
diff --git a/test/files/run/inline-ex-handlers.check b/test/files/run/inline-ex-handlers.check
index 708fcc6985..7d96c447b0 100644
--- a/test/files/run/inline-ex-handlers.check
+++ b/test/files/run/inline-ex-handlers.check
@@ -20,14 +20,14 @@
409c408,417
< 103 THROW(MyException)
---
-> ? STORE_LOCAL(value ex5)
+> ? STORE_LOCAL(value ex6)
> ? JUMP 17
>
> 17:
-> 101 LOAD_LOCAL(value ex5)
-> 101 STORE_LOCAL(value x3)
-> 101 SCOPE_ENTER value x3
-> 106 LOAD_LOCAL(value x3)
+> 101 LOAD_LOCAL(value ex6)
+> 101 STORE_LOCAL(value x4)
+> 101 SCOPE_ENTER value x4
+> 106 LOAD_LOCAL(value x4)
> 106 IS_INSTANCE REF(class MyException)
> 106 CZJUMP (BOOL)NE ? 5 : 11
422,424d429
@@ -125,29 +125,29 @@
737c786,793
< 172 THROW(MyException)
---
-> ? STORE_LOCAL(value ex5)
+> ? STORE_LOCAL(value ex6)
> ? JUMP 32
>
> 32:
-> 170 LOAD_LOCAL(value ex5)
-> 170 STORE_LOCAL(value x3)
-> 170 SCOPE_ENTER value x3
+> 170 LOAD_LOCAL(value ex6)
+> 170 STORE_LOCAL(value x4)
+> 170 SCOPE_ENTER value x4
> 170 JUMP 18
793c849,850
< 177 THROW(MyException)
---
-> ? STORE_LOCAL(value ex5)
+> ? STORE_LOCAL(value ex6)
> ? JUMP 33
797c854,861
< 170 THROW(Throwable)
---
-> ? STORE_LOCAL(value ex5)
+> ? STORE_LOCAL(value ex6)
> ? JUMP 33
>
> 33:
-> 169 LOAD_LOCAL(value ex5)
-> 169 STORE_LOCAL(value x3)
-> 169 SCOPE_ENTER value x3
+> 169 LOAD_LOCAL(value ex6)
+> 169 STORE_LOCAL(value x4)
+> 169 SCOPE_ENTER value x4
> 169 JUMP 5
830c894,895
< 182 THROW(MyException)
@@ -188,13 +188,13 @@
909c988,995
< 124 THROW(MyException)
---
-> ? STORE_LOCAL(value ex5)
+> ? STORE_LOCAL(value ex6)
> ? JUMP 20
>
> 20:
-> 122 LOAD_LOCAL(value ex5)
-> 122 STORE_LOCAL(value x3)
-> 122 SCOPE_ENTER value x3
+> 122 LOAD_LOCAL(value ex6)
+> 122 STORE_LOCAL(value x4)
+> 122 SCOPE_ENTER value x4
> 122 JUMP 7
969c1055
< catch (IllegalArgumentException) in ArrayBuffer(6, 7, 8, 11, 14, 16, 17, 19) starting at: 3
@@ -207,14 +207,14 @@
1019c1105,1114
< 148 THROW(MyException)
---
-> ? STORE_LOCAL(value ex5)
+> ? STORE_LOCAL(value ex6)
> ? JUMP 20
>
> 20:
-> 145 LOAD_LOCAL(value ex5)
-> 145 STORE_LOCAL(value x3)
-> 145 SCOPE_ENTER value x3
-> 154 LOAD_LOCAL(value x3)
+> 145 LOAD_LOCAL(value ex6)
+> 145 STORE_LOCAL(value x4)
+> 145 SCOPE_ENTER value x4
+> 154 LOAD_LOCAL(value x4)
> 154 IS_INSTANCE REF(class MyException)
> 154 CZJUMP (BOOL)NE ? 5 : 11
1040,1042d1134
@@ -243,19 +243,19 @@
1372c1471,1472
< 203 THROW(MyException)
---
-> ? STORE_LOCAL(value ex5)
+> ? STORE_LOCAL(value ex6)
> ? JUMP 20
1392c1492,1501
< 209 THROW(MyException)
---
-> ? STORE_LOCAL(value ex5)
+> ? STORE_LOCAL(value ex6)
> ? JUMP 20
>
> 20:
-> 200 LOAD_LOCAL(value ex5)
-> 200 STORE_LOCAL(value x3)
-> 200 SCOPE_ENTER value x3
-> 212 LOAD_LOCAL(value x3)
+> 200 LOAD_LOCAL(value ex6)
+> 200 STORE_LOCAL(value x4)
+> 200 SCOPE_ENTER value x4
+> 212 LOAD_LOCAL(value x4)
> 212 IS_INSTANCE REF(class MyException)
> 212 CZJUMP (BOOL)NE ? 5 : 11
1405,1407d1513
diff --git a/test/files/run/patmat-finally.scala b/test/files/run/patmat-finally.scala
new file mode 100644
index 0000000000..6f769b30a0
--- /dev/null
+++ b/test/files/run/patmat-finally.scala
@@ -0,0 +1,25 @@
+/** Test pattern matching and finally, see SI-5929. */
+object Test extends App {
+ def bar(s1: Object, s2: Object) {
+ s1 match {
+ case _ =>
+ }
+
+ try {
+ ()
+ } finally {
+ s2 match {
+ case _ =>
+ }
+ }
+ }
+
+ def x = {
+ null match { case _ => }
+
+ try { 1 } finally { while(false) { } }
+ }
+
+ bar(null, null)
+ x
+}
diff --git a/test/files/run/t5830.check b/test/files/run/t5830.check
new file mode 100644
index 0000000000..675387eb8e
--- /dev/null
+++ b/test/files/run/t5830.check
@@ -0,0 +1,6 @@
+a with oef
+a with oef
+a
+def with oef
+def
+default
diff --git a/test/files/run/t5830.flags b/test/files/run/t5830.flags
new file mode 100644
index 0000000000..e8fb65d50c
--- /dev/null
+++ b/test/files/run/t5830.flags
@@ -0,0 +1 @@
+-Xfatal-warnings \ No newline at end of file
diff --git a/test/files/run/t5830.scala b/test/files/run/t5830.scala
new file mode 100644
index 0000000000..5d808bfa28
--- /dev/null
+++ b/test/files/run/t5830.scala
@@ -0,0 +1,56 @@
+import scala.annotation.switch
+
+object Test extends App {
+ // TODO: should not emit a switch
+ // def noSwitch(ch: Char, eof: Boolean) = (ch: @switch) match {
+ // case 'a' if eof => println("a with oef") // then branch
+ // }
+
+ def onlyThen(ch: Char, eof: Boolean) = (ch: @switch) match {
+ case 'a' if eof => println("a with oef") // then branch
+ case 'c' =>
+ }
+
+ def ifThenElse(ch: Char, eof: Boolean) = (ch: @switch) match {
+ case 'a' if eof => println("a with oef") // then branch
+ case 'a' if eof => println("a with oef2") // unreachable, but the analysis is not that sophisticated
+ case 'a' => println("a") // else-branch
+ case 'c' =>
+ }
+
+ def defaultUnguarded(ch: Char, eof: Boolean) = (ch: @switch) match {
+ case ' ' if eof => println("spacey oef")
+ case _ => println("default")
+ }
+
+ def defaults(ch: Char, eof: Boolean) = (ch: @switch) match {
+ case _ if eof => println("def with oef") // then branch
+ case _ if eof => println("def with oef2") // unreachable, but the analysis is not that sophisticated
+ case _ => println("def") // else-branch
+ }
+
+ // test binders in collapsed cases (no need to run, it's "enough" to know it doesn't crash the compiler)
+ def guard(x: Any): Boolean = true
+ def testBinders =
+ try { println("") } // work around SI-6015
+ catch {
+ case _ if guard(null) =>
+ case x if guard(x) => throw x
+ }
+
+ // def unreachable(ch: Char) = (ch: @switch) match {
+ // case 'a' => println("b") // ok
+ // case 'a' => println("b") // unreachable
+ // case 'c' =>
+ // }
+
+ // noSwitch('a', true)
+ onlyThen('a', true) // 'a with oef'
+ ifThenElse('a', true) // 'a with oef'
+ ifThenElse('a', false) // 'a'
+ defaults('a', true) // 'def with oef'
+ defaults('a', false) // 'def'
+
+ // test that it jumps to default case, no match error
+ defaultUnguarded(' ', false) // default
+} \ No newline at end of file
diff --git a/test/files/run/test-cpp.check b/test/files/run/test-cpp.check
index 40a976119f..a7163edb5f 100644
--- a/test/files/run/test-cpp.check
+++ b/test/files/run/test-cpp.check
@@ -1,73 +1,65 @@
-37c37
-< locals: value args, value x, value y
----
-> locals: value args
-42,43d41
-< 52 CONSTANT(2)
-< 52 STORE_LOCAL(value x)
-45,46d42
-< 53 LOAD_LOCAL(value x)
-< 53 STORE_LOCAL(value y)
-49c45
-< 54 LOAD_LOCAL(value y)
----
-> 54 CONSTANT(2)
-92c88
-< locals: value args, value x, value y
----
-> locals: value args, value x
-101,102d96
-< 82 LOAD_LOCAL(value x)
-< 82 STORE_LOCAL(value y)
-105c99
-< 83 LOAD_LOCAL(value y)
----
-> 83 LOAD_LOCAL(value x)
-135c129
-< locals: value args, value x, value y
----
-> locals: value args
-140,141d133
-< 66 THIS(TestAliasChainDerefThis)
-< 66 STORE_LOCAL(value x)
-143,144d134
-< 67 LOAD_LOCAL(value x)
-< 67 STORE_LOCAL(value y)
-147c137
-< 68 LOAD_LOCAL(value y)
----
-> 68 THIS(Object)
-176c166
-< locals: value x, value y
----
-> locals: value x
-181,182d170
-< 29 LOAD_LOCAL(value x)
-< 29 STORE_LOCAL(value y)
-185c173
-< 30 LOAD_LOCAL(value y)
----
-> 30 LOAD_LOCAL(value x)
-223,224d210
-< 97 LOAD_LOCAL(variable x)
-< 97 STORE_LOCAL(variable y)
-227c213
-< 98 LOAD_LOCAL(variable y)
----
-> 98 LOAD_LOCAL(variable x)
-233,234d218
-< 101 LOAD_LOCAL(variable y)
-< 101 STORE_LOCAL(variable x)
-236c220
-< 102 LOAD_LOCAL(variable x)
----
-> 102 LOAD_LOCAL(variable y)
-345c329
-< 41 THIS(TestSetterInline)
----
-> 41 THIS(Object)
-347c331
-< 41 CALL_METHOD TestSetterInline._postSetHook_$eq (static-instance)
----
-> 41 STORE_FIELD variable _postSetHook (dynamic)
-
+37c37
+< locals: value args, value x, value y
+---
+> locals: value args
+42,43d41
+< 52 CONSTANT(2)
+< 52 STORE_LOCAL(value x)
+45,46d42
+< 53 LOAD_LOCAL(value x)
+< 53 STORE_LOCAL(value y)
+49c45
+< 54 LOAD_LOCAL(value y)
+---
+> 54 CONSTANT(2)
+92c88
+< locals: value args, value x, value y
+---
+> locals: value args, value x
+101,102d96
+< 82 LOAD_LOCAL(value x)
+< 82 STORE_LOCAL(value y)
+105c99
+< 83 LOAD_LOCAL(value y)
+---
+> 83 LOAD_LOCAL(value x)
+135c129
+< locals: value args, value x, value y
+---
+> locals: value args
+140,141d133
+< 66 THIS(TestAliasChainDerefThis)
+< 66 STORE_LOCAL(value x)
+143,144d134
+< 67 LOAD_LOCAL(value x)
+< 67 STORE_LOCAL(value y)
+147c137
+< 68 LOAD_LOCAL(value y)
+---
+> 68 THIS(Object)
+176c166
+< locals: value x, value y
+---
+> locals: value x
+181,182d170
+< 29 LOAD_LOCAL(value x)
+< 29 STORE_LOCAL(value y)
+185c173
+< 30 LOAD_LOCAL(value y)
+---
+> 30 LOAD_LOCAL(value x)
+223,224d210
+< 97 LOAD_LOCAL(variable x)
+< 97 STORE_LOCAL(variable y)
+227c213
+< 98 LOAD_LOCAL(variable y)
+---
+> 98 LOAD_LOCAL(variable x)
+233,234d218
+< 101 LOAD_LOCAL(variable y)
+< 101 STORE_LOCAL(variable x)
+236c220
+< 102 LOAD_LOCAL(variable x)
+---
+> 102 LOAD_LOCAL(variable y)
+
diff --git a/test/files/run/typetags_core.check b/test/files/run/typetags_core.check
index ec93221a30..8d20e099c4 100644
--- a/test/files/run/typetags_core.check
+++ b/test/files/run/typetags_core.check
@@ -1,26 +1,30 @@
-true
-TypeTag[Byte]
-true
-TypeTag[Short]
-true
-TypeTag[Char]
-true
-TypeTag[Int]
-true
-TypeTag[Long]
-true
-TypeTag[Float]
-true
-TypeTag[Double]
-true
-TypeTag[Boolean]
-true
-TypeTag[Unit]
-true
-TypeTag[Any]
-true
-TypeTag[java.lang.Object]
-true
-TypeTag[Null]
-true
-TypeTag[Nothing]
+true
+TypeTag[Byte]
+true
+TypeTag[Short]
+true
+TypeTag[Char]
+true
+TypeTag[Int]
+true
+TypeTag[Long]
+true
+TypeTag[Float]
+true
+TypeTag[Double]
+true
+TypeTag[Boolean]
+true
+TypeTag[Unit]
+true
+TypeTag[Any]
+true
+TypeTag[AnyVal]
+true
+TypeTag[AnyRef]
+true
+TypeTag[java.lang.Object]
+true
+TypeTag[Null]
+true
+TypeTag[Nothing]
diff --git a/test/files/run/typetags_core.scala b/test/files/run/typetags_core.scala
index 0d86fac25b..5257d55118 100644
--- a/test/files/run/typetags_core.scala
+++ b/test/files/run/typetags_core.scala
@@ -21,6 +21,10 @@ object Test extends App {
println(implicitly[TypeTag[Unit]])
println(implicitly[TypeTag[Any]] eq TypeTag.Any)
println(implicitly[TypeTag[Any]])
+ println(implicitly[TypeTag[AnyVal]] eq TypeTag.AnyVal)
+ println(implicitly[TypeTag[AnyVal]])
+ println(implicitly[TypeTag[AnyRef]] eq TypeTag.AnyRef)
+ println(implicitly[TypeTag[AnyRef]])
println(implicitly[TypeTag[Object]] eq TypeTag.Object)
println(implicitly[TypeTag[Object]])
println(implicitly[TypeTag[Null]] eq TypeTag.Null)