Skip to content

Change is volatile 2 #1072

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 27 commits into from
Feb 19, 2016
Merged

Change is volatile 2 #1072

merged 27 commits into from
Feb 19, 2016

Conversation

odersky
Copy link
Contributor

@odersky odersky commented Feb 9, 2016

Only last commit is new. Rest is based on add-named-params. Both branches conflict a lot
in PostTyper/Checker. So I thought it best to immediately base on last commit instead of
going through another painful rebase.

Review by @smarter

@smarter
Copy link
Member

smarter commented Feb 9, 2016

Last commit LGTM, thanks

Changes needed to support simple named type parameters.
Not yet implemented: named arguments.
Types#underlyingClassRef and PostTyper#normalizeTree need to be changed so they can
deal with partial named parameter lists.
After unpickling we might see an alias

    X = pre.X

where pre =:= the ThisType of the enclosing class. But it
might not be `eq` to it.
Named parameters cause some elements to be unpickled
in a different order as they are pickled. In particular
term parameter aliases and type parameter aliases seem to be swapped.
There is a before/after difference having to do with the
order in which class declarations show up.
Needs to work also if named arg refers to an abstract type,
not a parameter.
We had same fleyness in number of errors of cycle.scala
which prompted this.
Also, add an unrelated test file to pos.
Was not fixed by accident then, so we do it here now.
The current Scala spec only considers methods without default parameters
for overloading resolution (unless only a single one remains anyway after
filtering by shape). This is needlessly restrictive. But dropping this
restriction (as dotty does) can lead to ambiguity errors, which is why
run/t8197 did not compile anymore.

We fix the problem by a last try rule: If after asSpecific tests there are
still several alternatives, and only one of them is without default arguments,
pick that one.

I tried an alternative rule which would make the distinction on default params
earlier but that one fails for the overloaded tree copier functions in Trees.scala
(the method with default parameters is also the one which is more specific).
Lets one also pass named arguments to methods.
Addendum to change-isVolatile. Changes did not make it in
by accident before that branch was merged.
@odersky odersky force-pushed the change-isVolatile-2 branch from bd91eb0 to cecaa4b Compare February 19, 2016 13:03
@odersky
Copy link
Contributor Author

odersky commented Feb 19, 2016

Rebased to master. If tests pass I am getting this merged now. I am losing too many cycles with constant rebasing.

odersky added a commit that referenced this pull request Feb 19, 2016
@odersky odersky merged commit 2217a4e into scala:master Feb 19, 2016
@allanrenucci allanrenucci deleted the change-isVolatile-2 branch December 14, 2017 16:58
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.

2 participants