@@ -406,7 +406,7 @@ class TestBCode extends DottyBytecodeTest {
406
406
""" class Test {
407
407
| def test(a: Any): Int = {
408
408
| a match {
409
- | case _: Test => 1
409
+ | case _: Test => ???
410
410
| }
411
411
| }
412
412
|}
@@ -423,22 +423,26 @@ class TestBCode extends DottyBytecodeTest {
423
423
VarOp (Opcodes .ASTORE , 2 ),
424
424
VarOp (Opcodes .ALOAD , 2 ),
425
425
TypeOp (Opcodes .INSTANCEOF , " Test" ),
426
- Jump (Opcodes .IFEQ , Label (10 )),
426
+ Jump (Opcodes .IFEQ , Label (11 )),
427
427
VarOp (Opcodes .ALOAD , 2 ),
428
428
TypeOp (Opcodes .CHECKCAST , " Test" ),
429
429
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 ),
433
434
FrameEntry (1 , List (" java/lang/Object" ), List ()),
434
435
TypeOp (Opcodes .NEW , " scala/MatchError" ),
435
436
Op (Opcodes .DUP ),
436
437
VarOp (Opcodes .ALOAD , 2 ),
437
438
Invoke (Opcodes .INVOKESPECIAL , " scala/MatchError" , " <init>" , " (Ljava/lang/Object;)V" , false ),
438
439
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 )
442
446
)
443
447
assert(instructions == expected,
444
448
" `test` was not properly generated\n " + diffInstructions(instructions, expected))
0 commit comments