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
The source code below shows the minimal context that I've been able to extract that demonstrates the problem and is compilable on its own. Essentially, the problem is that a type is upper-bounded too aggressively in a match-in-match context such that an expression is considered as having type Any where it should have had type Output, and hence the program is rejected as having a type mismatch where it could actually have been accepted as type safe.
// scalac 2.6.0-final produces an error message for this at '=> Success(so)':// type mismatch, found: Any, required: Output, but so:Output _is_ knowableclassParseResult[+T]
caseclassSuccess[+T](t: T) extendsParseResult[T]
abstractclassNonterminal[Output] {
typeSubNonterminal=Nonterminal[T] forSome { typeT<:Output }
defparse:ParseResult[Output]
defparse1(nts: List[SubNonterminal]):ParseResult[Output] =
nts match {
case nt::nts => nt.parse match { caseSuccess(so) =>Success(so) }
caseNil=>thrownewError
}
}
The text was updated successfully, but these errors were encountered:
The source code below shows the minimal context that I've been able to extract that demonstrates the problem and is compilable on its own. Essentially, the problem is that a type is upper-bounded too aggressively in a match-in-match context such that an expression is considered as having type Any where it should have had type Output, and hence the program is rejected as having a type mismatch where it could actually have been accepted as type safe.
The text was updated successfully, but these errors were encountered: