File tree 2 files changed +26
-1
lines changed
compiler/test/dotty/tools/backend/jvm 2 files changed +26
-1
lines changed Original file line number Diff line number Diff line change @@ -450,4 +450,29 @@ class TestBCode extends DottyBytecodeTest {
450
450
}
451
451
}
452
452
453
+ /** Test that type lambda applications are properly dealias */
454
+ @ Test def i5090 = {
455
+ val source =
456
+ """ class Test {
457
+ | type T[X] = X
458
+ |
459
+ | def test(i: T[Int]): T[Int] = i
460
+ | def ref(i: Int): Int = i
461
+ |}
462
+ """ .stripMargin
463
+
464
+ checkBCode(source) { dir =>
465
+ val clsIn = dir.lookupName(" Test.class" , directory = false ).input
466
+ val clsNode = loadClassNode(clsIn)
467
+ val test = getMethod(clsNode, " test" )
468
+ val ref = getMethod(clsNode, " ref" )
469
+
470
+ val testInstructions = instructionsFromMethod(test)
471
+ val refInstructions = instructionsFromMethod(ref)
472
+
473
+ assert(testInstructions == refInstructions,
474
+ " `T[Int]` was not properly dealias" +
475
+ diffInstructions(testInstructions, refInstructions))
476
+ }
477
+ }
453
478
}
Original file line number Diff line number Diff line change 1
1
class TypeAlias {
2
2
type T [X ] = X
3
3
def a (i : T [Int ]): T [Int ] = i
4
- }
4
+ }
You can’t perform that action at this time.
0 commit comments