You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 5, 2023. It is now read-only.
vala:Foo=newJustList(List(1, 2, 3))
a match {
caseJustList(list) |PathAndList(_, list) => println(list)
caseEmpty=> println("Empty")
}
Where the variable list would type check to List[Int] | List[Int] which could be further reduced to List[Int].
Currently the compiler issues the error Illegal variable list in pattern alternative.
The remaining scenarios could be type checked as follows:
case JustList(list) | PathAndList(list, _) => would typecheck to List[Int] | String
case JustList(list) | PathAndList(_, _) => would typecheck to List[Int] | Null
The text was updated successfully, but these errors were encountered:
For the following ADT hierarchy:
The following code could compile:
Where the variable
list
would type check toList[Int] | List[Int]
which could be further reduced toList[Int]
.Currently the compiler issues the error
Illegal variable list in pattern alternative
.The remaining scenarios could be type checked as follows:
case JustList(list) | PathAndList(list, _) =>
would typecheck toList[Int] | String
case JustList(list) | PathAndList(_, _) =>
would typecheck toList[Int] | Null
The text was updated successfully, but these errors were encountered: