summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/files/pos/sd219.scala11
-rw-r--r--test/files/run/delambdafy_t6028.check2
-rw-r--r--test/files/run/t6028.check2
-rw-r--r--test/junit/scala/tools/nsc/backend/jvm/BytecodeTest.scala8
4 files changed, 21 insertions, 2 deletions
diff --git a/test/files/pos/sd219.scala b/test/files/pos/sd219.scala
new file mode 100644
index 0000000000..3c3f4962f0
--- /dev/null
+++ b/test/files/pos/sd219.scala
@@ -0,0 +1,11 @@
+class Global { class Name }
+
+trait CommonPrintUtils {
+ val global: Global
+
+ lazy val precedence: global.Name => Int = ???
+}
+
+trait CompilerProvider { val global: Global = ??? }
+
+class AbstractPrinter extends CommonPrintUtils with CompilerProvider \ No newline at end of file
diff --git a/test/files/run/delambdafy_t6028.check b/test/files/run/delambdafy_t6028.check
index 6a15b3b003..7b319c92dd 100644
--- a/test/files/run/delambdafy_t6028.check
+++ b/test/files/run/delambdafy_t6028.check
@@ -47,7 +47,7 @@ package <empty> {
final <stable> private[this] def MethodLocalObject$1(barParam$1: String, MethodLocalObject$module$1: runtime.VolatileObjectRef): T#MethodLocalObject$2.type = {
if (MethodLocalObject$module$1.elem.$asInstanceOf[T#MethodLocalObject$2.type]().eq(null))
T.this.MethodLocalObject$lzycompute$1(barParam$1, MethodLocalObject$module$1);
- MethodLocalObject$module$1.elem.$asInstanceOf[T#MethodLocalObject$2.type]()
+ (MethodLocalObject$module$1.elem.$asInstanceOf[T#MethodLocalObject$2.type](): T#MethodLocalObject$2.type)
};
final <artifact> private[this] def $anonfun$tryy$1(tryyParam$1: String, tryyLocal$1: runtime.ObjectRef): Unit = try {
tryyLocal$1.elem = tryyParam$1
diff --git a/test/files/run/t6028.check b/test/files/run/t6028.check
index 80f8698ecf..903ea3b753 100644
--- a/test/files/run/t6028.check
+++ b/test/files/run/t6028.check
@@ -59,7 +59,7 @@ package <empty> {
final <stable> private[this] def MethodLocalObject$1(barParam$1: Int, MethodLocalObject$module$1: runtime.VolatileObjectRef): T#MethodLocalObject$2.type = {
if (MethodLocalObject$module$1.elem.$asInstanceOf[T#MethodLocalObject$2.type]().eq(null))
T.this.MethodLocalObject$lzycompute$1(barParam$1, MethodLocalObject$module$1);
- MethodLocalObject$module$1.elem.$asInstanceOf[T#MethodLocalObject$2.type]()
+ (MethodLocalObject$module$1.elem.$asInstanceOf[T#MethodLocalObject$2.type](): T#MethodLocalObject$2.type)
};
@SerialVersionUID(value = 0) final <synthetic> class $anonfun$tryy$1 extends scala.runtime.AbstractFunction0$mcV$sp with Serializable {
def <init>($outer: T, tryyParam$1: Int, tryyLocal$1: runtime.IntRef): <$anon: Function0> = {
diff --git a/test/junit/scala/tools/nsc/backend/jvm/BytecodeTest.scala b/test/junit/scala/tools/nsc/backend/jvm/BytecodeTest.scala
index b09a41969e..00b6d1cc42 100644
--- a/test/junit/scala/tools/nsc/backend/jvm/BytecodeTest.scala
+++ b/test/junit/scala/tools/nsc/backend/jvm/BytecodeTest.scala
@@ -187,4 +187,12 @@ class BytecodeTest extends BytecodeTesting {
List(Label(0), LineNumber(2, Label(0)), VarOp(ALOAD, 0), Invoke(INVOKESPECIAL, "T", "t", "()V", true), Op(RETURN), Label(4))
)
}
+
+ @Test
+ def sd233(): Unit = {
+ val code = "def f = { println(1); synchronized(println(2)) }"
+ val m = compileMethod(code)
+ val List(ExceptionHandler(_, _, _, desc)) = m.handlers
+ assert(desc == None, desc)
+ }
}