Skip to content

Commit e7cb6f2

Browse files
committed
UnionTypes.scala: Fix crash with recent Dotty
Types in union need to be fully applied, the previous code was wrong but happened to work before scala/scala3#3061. See scala/scala3#3161.
1 parent 25b2841 commit e7cb6f2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/scala/UnionTypes.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ object UnionTypes {
3636
// calling `either` function with union typed value.
3737
println(either(divisionResultFailure))
3838

39-
val list: Cons | Empty = Cons(1, Cons(2, Cons(3, Empty())))
40-
val emptyList: Empty | Cons = Empty()
39+
val list: Cons[Int] | Empty = Cons(1, Cons(2, Cons(3, Empty())))
40+
val emptyList: Empty | Cons[Any] = Empty()
4141
println(list)
4242
println(emptyList)
4343

0 commit comments

Comments
 (0)