Skip to content

Commit 8ae5c19

Browse files
committed
Test some LUBs.
1 parent 61a16f5 commit 8ae5c19

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

test/junit/scala/reflect/internal/TypesTest.scala

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,12 @@ class TypesTest {
3232
val uniquelyNarrowed2 = refinedType(boolWithString1narrow2 :: Nil, NoSymbol)
3333
assert(uniquelyNarrowed1 =:= uniquelyNarrowed2)
3434
}
35+
36+
@Test
37+
def testLub(): Unit = {
38+
assert(lub(List(LiteralType(Constant(0)), LiteralType(Constant(1)))) =:= IntTpe)
39+
assert(lub(List(LiteralType(Constant(1)), LiteralType(Constant(1)))) =:= LiteralType(Constant(1)))
40+
assert(lub(List(LiteralType(Constant("a")), LiteralType(Constant("b")))) =:= StringTpe)
41+
assert(lub(List(LiteralType(Constant("a")), LiteralType(Constant("a")))) =:= LiteralType(Constant("a")))
42+
}
3543
}

0 commit comments

Comments
 (0)