File tree 1 file changed +25
-0
lines changed
compiler/test/dotty/tools/backend/jvm 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -401,6 +401,31 @@ class TestBCode extends DottyBytecodeTest {
401
401
}
402
402
}
403
403
404
+ @ Test def returnThrowInPatternMatch = {
405
+ val source =
406
+ """ class Test {
407
+ | def test(a: Any): Int = {
408
+ | a match {
409
+ | case _: Test => ???
410
+ | }
411
+ | }
412
+ |}
413
+ """ .stripMargin
414
+
415
+ checkBCode(source) { dir =>
416
+ val moduleIn = dir.lookupName(" Test.class" , directory = false )
417
+ val moduleNode = loadClassNode(moduleIn.input)
418
+ val method = getMethod(moduleNode, " test" )
419
+
420
+ val instructions = instructionsFromMethod(method)
421
+ val hasReturn = instructions.exists {
422
+ case Op (Opcodes .RETURN ) => true
423
+ case _ => false
424
+ }
425
+ assertFalse(hasReturn)
426
+ }
427
+ }
428
+
404
429
/** Test that type lambda applications are properly dealias */
405
430
@ Test def i5090 = {
406
431
val source =
You can’t perform that action at this time.
0 commit comments