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
too many error messages are too opaque #3092
Comments
Imported From: https://issues.scala-lang.org/browse/SI-3092?orig=1 |
@paulp said: |
@harrah said: Compiling this code: object T {
var X = 3
val y =
5 match {
case X => true
case _ => false
}
} gives the error message: A.scala:5: not found: value X
case X => true
^ An improvement might be "X is not a stable identifier" or similar. |
@paulp said: I'm trying to use the keySet method on a Map but get this error: not enough arguments for method apply: (elem: com.google.appengine.api.datastore.Key)Boolean in trait SetLike. Unspecified value parameter elem. |
Pavol Vaskovic (pali-at-pali.sk) said: class Test {
def foo {
private def bar {}
}
} produces [[BR]] I'm unsure what would be better message, but the point is that the private modifier in this context is useless, because I'm already nested in a block. I find the current message puzzling, as I don't see a statement here. |
@paulp said: CollectionType[_] <: java.util.Collection[_] when what they mean is CollectionType[X] <: java.util.Collection[X] |
@paulp said: found : Int
required: String ...understandably enough, because they just happen to be doing something with '+' and the compiler unhelpfully interprets their efforts as something involving any2stringadd. Boy I'd sure like to turn that light off someday. |
@paulp said: Let's just agree that you'd be considered a light-year more awesome if
you could train the compiler to say "Please see �8.5 of the Scala
Reference" rather than the blather about x0$$1 and expanded functions. Clearly this suggestion has priority since it comes with a quantified awesomeness increase. |
nikolaj lindberg (nikolaj) said: // Eg.scala
class Eg(name: String) {
this() = this("DEFAULT")
}
$$ scalac Eg.scala
Eg.scala:2: error: value update is not a member of Eg
this() = this("DEFAULT")
^
one error found (I now immediately recognise the problem and simply add the missing "def", but the first few times, I found the error message a tiny bit cryptic.) |
@retronym said: scala> case class C(a: Any)
defined class C
scala> (new C(())) match {
| case C =>
| }
<console>:9: error: pattern type is incompatible with expected type;
found : object C
required: C
case C =>
^ Suggested type diagnostics: "Note: you referred to the companion object of the class C. Perhaps you meant '_ : C' or 'C(_)' |
hanna said: scala> val test = true match { case true => <br/><br/> case false => <br/> }
<console>:7: error: kinds of the type arguments (Seq[Any]) do not conform to the expected
kinds of the type parameters (type CC) in class GenericCompanion.
Seq[Any]'s type parameters do not match type CC's expected parameters: trait Seq has one
type parameter, but type CC has one
val test = true match { case true => <br/><br/> case false => <br/> }
^ |
@paulp said:
|
@acruise said: |
That's a nice vague summary! It's OK though because I'm assigning it to myself. My motivation of the moment is as described in an email quoted below, but I have others in mind, and hopefully people can remind me of their least favorites in the comments.
The text was updated successfully, but these errors were encountered: