Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Weird error message with compiler-generated variable names #7808

Open
scabug opened this issue Sep 3, 2013 · 3 comments · May be fixed by scala/scala#10680
Open

Weird error message with compiler-generated variable names #7808

scabug opened this issue Sep 3, 2013 · 3 comments · May be fixed by scala/scala#10680

Comments

@scabug
Copy link

scabug commented Sep 3, 2013

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 {
           ^
*/
@scabug
Copy link
Author

scabug commented Sep 3, 2013

Imported From: https://issues.scala-lang.org/browse/SI-7808?orig=1
Reporter: Dmitrii Kosarev (kakadu)
Affected Versions: 2.10.2

@SethTisue
Copy link
Member

SethTisue commented Jan 29, 2024

Scala 3.4.0-RC3: Recursive value $1$ needs type

@SethTisue SethTisue added this to the Backlog milestone Jan 29, 2024
@som-snytt
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants