Skip to content

misleading error message when missing return value on recursive type-parametric function #34

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

Closed
scabug opened this issue Aug 31, 2007 · 3 comments
Assignees

Comments

@scabug
Copy link

scabug commented Aug 31, 2007

Not exactly a showstopper, but in 2.6.0-RC2, if you evaluate:

def fl1[A](l: List[List[A]])= l match {
  case List() => List[A]();
  case x :: xs => x ::: fl1(xs);
}

you get:

<console>:7: error: illegal cyclic reference involving method fl1
  case x :: xs => x ::: fl1(xs);
                    ^

Which wasn't very illuminating. I would have expected something like:

<console>:7: error: recursive method fl1 needs result type
  case x :: xs => x ::: fl1(xs);

which is what you get if you remove the type-parameterization

@scabug
Copy link
Author

scabug commented Aug 31, 2007

Imported From: https://issues.scala-lang.org/browse/SI-34?orig=1
Reporter: Commit Message Bot (anonymous)

@scabug
Copy link
Author

scabug commented Nov 20, 2007

@odersky said:
fixed in r13315

@scabug
Copy link
Author

scabug commented Jan 14, 2009

@odersky said:
Milestone 2.6.1 deleted

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

No branches or pull requests

2 participants