@@ -406,7 +406,7 @@ class TestBCode extends DottyBytecodeTest {
406406 """ class Test {
407407 | def test(a: Any): Int = {
408408 | a match {
409- | case _: Test => 1
409+ | case _: Test => ???
410410 | }
411411 | }
412412 |}
@@ -423,22 +423,26 @@ class TestBCode extends DottyBytecodeTest {
423423 VarOp (Opcodes .ASTORE , 2 ),
424424 VarOp (Opcodes .ALOAD , 2 ),
425425 TypeOp (Opcodes .INSTANCEOF , " Test" ),
426- Jump (Opcodes .IFEQ , Label (10 )),
426+ Jump (Opcodes .IFEQ , Label (11 )),
427427 VarOp (Opcodes .ALOAD , 2 ),
428428 TypeOp (Opcodes .CHECKCAST , " Test" ),
429429 VarOp (Opcodes .ASTORE , 3 ),
430- Op (Opcodes .ICONST_1 ),
431- Jump (Opcodes .GOTO , Label (17 )),
432- Label (10 ),
430+ Field (Opcodes .GETSTATIC , " scala/Predef$" , " MODULE$" , " Lscala/Predef$;" ),
431+ Invoke (Opcodes .INVOKEVIRTUAL , " scala/Predef$" , " $qmark$qmark$qmark" , " ()Lscala/runtime/Nothing$;" , false ),
432+ Op (Opcodes .ATHROW ),
433+ Label (11 ),
433434 FrameEntry (1 , List (" java/lang/Object" ), List ()),
434435 TypeOp (Opcodes .NEW , " scala/MatchError" ),
435436 Op (Opcodes .DUP ),
436437 VarOp (Opcodes .ALOAD , 2 ),
437438 Invoke (Opcodes .INVOKESPECIAL , " scala/MatchError" , " <init>" , " (Ljava/lang/Object;)V" , false ),
438439 Op (Opcodes .ATHROW ),
439- Label (17 ),
440- FrameEntry (0 , List (" Test" , " java/lang/Object" , " java/lang/Object" , " Test" ), List (1 )),
441- Op (Opcodes .IRETURN )
440+ Label (18 ),
441+ FrameEntry (0 , List (), List (" java/lang/Throwable" )),
442+ Op (Opcodes .ATHROW ),
443+ Label (21 ),
444+ FrameEntry (4 , List (), List (" java/lang/Throwable" )),
445+ Op (Opcodes .ATHROW )
442446 )
443447 assert(instructions == expected,
444448 " `test` was not properly generated\n " + diffInstructions(instructions, expected))
0 commit comments