Skip to content

Commit cee8162

Browse files
committed
Reinstantiate DottyByteCodeTest
Reinstantiate DottyByteCodeTest with the change proposed by @allanrenucci. This reverts commit e04918e.
1 parent 83ac988 commit cee8162

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

compiler/test/dotty/tools/backend/jvm/DottyBytecodeTests.scala

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,31 @@ class TestBCode extends DottyBytecodeTest {
401401
}
402402
}
403403

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+
404429
/** Test that type lambda applications are properly dealias */
405430
@Test def i5090 = {
406431
val source =

0 commit comments

Comments
 (0)