Skip to content

Optimize typeSymbol and classSymbol #9887

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
Sep 27, 2020

Conversation

odersky
Copy link
Contributor

@odersky odersky commented Sep 26, 2020

Make typeSymbol and classSymbol also work for Singleton types by going to
the underlying type. Previously, they returned NoType.

Changing this behavior makes code shorter and removes a common pitfall.

@odersky odersky force-pushed the optimize-widening branch 3 times, most recently from b20b8f0 to b6c139a Compare September 26, 2020 16:47
typeSymbol now follows underlying type for SingletonTypes,
same as for other TypeProxys.
The dropped condition is vacuously true for all singleton prefixes, since for them
classSymbol is NoSymbol. If we make it work as was intended using widen in front of
classSymbol on both sides, then EeraseAnd and dotty bootstrap fail.
Analogius to the change for typeSymbol
@odersky
Copy link
Contributor Author

odersky commented Sep 26, 2020

test performance please

@dottybot
Copy link
Member

performance test scheduled: 2 job(s) in queue, 1 running.

@dottybot
Copy link
Member

Performance test finished successfully:

Visit http://dotty-bench.epfl.ch/9887/ to see the changes.

Benchmarks is based on merging with master (8a9e0e9)

Copy link
Contributor

@liufengyun liufengyun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@liufengyun liufengyun merged commit d084b8b into scala:master Sep 27, 2020
@liufengyun liufengyun deleted the optimize-widening branch September 27, 2020 11:44
@Kordyjan Kordyjan added this to the 3.0.0 milestone Aug 2, 2023
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.

4 participants