-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add more detail pages for implicit/dependent functions and class Shadowing #5331
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
Conversation
|
||
> Why do we want to make this change to the language? | ||
|
||
tbd |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@odersky Do you have any input on that? I couldn't find anything on the motivation in history...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shadowing is a irregular case. We don't do that for any other kind of member. In both theory and the new compiler implementation the only way to implement it would be to invent a new mangled name for each inner class, which is really clunky.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Otherwise LGTM.
= Si` is assumed. If the expected type of the anonymous implicit function is | ||
some other type, all implicit parameter types must be explicitly given, and | ||
the expected type of `e` is undefined. The type of the anonymous implicit | ||
function is `scala.ImplicitFunctionN[S1, ...,Sn, T]`, where `T` is the packed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The term "packed" does not exist anymore in Scala 3. The term to use is probably something like "widened" (i.e singleton type are widened), but we'd need to define that centrally for the new spec.
Note: The closing paragraph of the [Anonymous Functions section](https://www | ||
.scala-lang.org/files/archive/spec/2.12/06-expressions.html#anonymous- | ||
functions) of the Scala 2.12 is subsumed by implicit function types and should | ||
be remove. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed.
|
||
> Why do we want to make this change to the language? | ||
|
||
tbd |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copy the gist of my comment in there.
79db7ab
to
1d07a22
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good now!
No description provided.