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 pattern parser halts when it sees stars. This means it does not handle infix notation for a case class named "*". (This is an edgy use case.)
Also, the error reporting around syntax errors could be improved, both to provide helpful hints and for recovery, to report subsequent errors.
This is related to #3189, which no longer crashes, but doesn't yet report nicely.
objectTest {
caseclass*(a: Int, b: Int)
typeStar=*caseclassP(a: Int, b: Star) // alias still requireddefmain(args: Array[String]) {
valv=new*(6,7)
valx* y = v // OK, where sequence pattern not allowed
printf("%d,%d\n",x,y)
valp=P(5, v)
valP(a, b * c) = p // error
printf("%d,%d,%d\n",a,b,c)
}
}
Sample improved message:
t3189.scala:2:error: use _* to match a sequence
valArray(a,b*) = ("":Any)
^
one error found
A patch is forthcoming.
The text was updated successfully, but these errors were encountered:
The patch tries to honor the history of the code, e.g., #3480, #1764, #1878 and the proximate #3189, by not being too ambitious. As usual, this was a GLE (great learning experience) and hopefully the tests provide adequate coverage (as in cover me).
The pattern parser halts when it sees stars. This means it does not handle infix notation for a case class named "*". (This is an edgy use case.)
Also, the error reporting around syntax errors could be improved, both to provide helpful hints and for recovery, to report subsequent errors.
This is related to #3189, which no longer crashes, but doesn't yet report nicely.
Sample improved message:
A patch is forthcoming.
The text was updated successfully, but these errors were encountered: