Skip to content

Fix #941 #960

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

Merged
merged 6 commits into from
Nov 16, 2015
Merged

Fix #941 #960

merged 6 commits into from
Nov 16, 2015

Conversation

odersky
Copy link
Contributor

@odersky odersky commented Nov 16, 2015

Fixes #941 and #942. Review by @VladimirNik ?

Make secondary constructor type parameters aliases of the
enclosing class parameters. Test case in i941.scala. Observed
in the wild when trying to typecheck Streams.scala.
If `x` is not a function or method, then `x _` should be disallowed.
scalac accepts this and converts it to () => x instead. I'd like
to drop this because it's unnecessary and non-obvious. If
-language:Scala2 is on, the behavior is like Scala 2's but
a migration warning is issued.
Flag them as "migration warning" rather than just "warning".
The previous test was too struct, missed cases where
some arguments of the function were unbound. i583a.scala
contains a test case.
Linearize instead. It would be nice to be able to give a
migration warning here, but unfortunately we do not have
a position at the point the warning would be generated,
and it feels like overkill to do another kind of exception
that gets propagated and caught in typer.
@smarter
Copy link
Member

smarter commented Nov 16, 2015

LGTM

odersky added a commit that referenced this pull request Nov 16, 2015
@odersky odersky merged commit 6b061b5 into scala:master Nov 16, 2015
@allanrenucci allanrenucci deleted the fix-#941 branch December 14, 2017 19:19
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

Successfully merging this pull request may close these issues.

3 participants