We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
According to SLS, a type in value definition(in method definition, too) is not determined by the local type inference, so
scala> val p = "hello" p: String = hello scala> val v = p : p.type v: p.type = hello
seems ok, but
scala> def v = p : p.type v: String
. Or SLS is wrong?
The text was updated successfully, but these errors were encountered:
Imported From: https://issues.scala-lang.org/browse/SI-9023?orig=1 Reporter: @okomok Affected Versions: 2.11.4
Sorry, something went wrong.
@retronym said: Type inference of vals, vars, and defs widen the type of the RHS. The rules are not (yet) specified.
We are reviewing this area in adriaanm/scala#12 and will specify them as part of that SIP.
@okomok said: So
scala> val v = p : p.type v: p.type = hello
will be a bug with the upcoming specifications?
@okomok said:
val p = "hello" val q = p : p.type implicitly[q.type =:= p.type]
compiles (wrongly?).
@okomok said: After all, this ticket seems a duplicate of #6767. Thanks.
adriaanm
No branches or pull requests
According to SLS, a type in value definition(in method definition, too) is not determined by the local type inference, so
seems ok, but
. Or SLS is wrong?
The text was updated successfully, but these errors were encountered: