bug
bug copied to clipboard
Weird error message with compiler-generated variable names
Can you do something to avoid x$3 in error message? I think that ls instead of x$3 will be much better
type OI = Option[Int]
def boo(z: OI, ls: List[OI], rs: List[OI]): (List[OI], List[OI]) = {
val (ls,rs) = z match {
case Some(_) => (z::ls, rs)
case _ => (ls, z::rs)
}
(ls,rs)
}
/* recursive value x$3 needs type
val (ls,rs): (List[OI], List[OI]) = z match {
^
*/
Imported From: https://issues.scala-lang.org/browse/SI-7808?orig=1 Reporter: Dmitrii Kosarev (kakadu) Affected Versions: 2.10.2
Scala 3.4.0-RC3: Recursive value $1$ needs type
Scala 3 -explain-cyclic:
-- [E045] Cyclic Error: t7808.scala:5:9 --------------------------------------------------------------------------------
5 | val (ls, rs) = z match {
| ^
| Recursive value $1$ needs type
|
| The error occurred while trying to compute the signature of value $1$
| which required to compute the signature of value ls
| which required to compute the signature of value $1$
|
| Run with both -explain-cyclic and -Ydebug-cyclic to see full stack trace.
|
| longer explanation available when compiling with `-explain`
Use the single non-synthetic in the error message.
Also dotty needs -explain-everything to reduce cycles of asking for more output.