Skip to content

isAsSpecific: restrict usage of fullyDefinedType #3276

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 1 commit into from
Oct 9, 2017

Conversation

smarter
Copy link
Member

@smarter smarter commented Oct 6, 2017

We only need to fully define the bounds of the PolyType parameters, not the
whole PolyType.

@smarter smarter force-pushed the fix-deep-subtypes-2 branch from 3e56949 to 9c5e179 Compare October 6, 2017 11:24
@smarter
Copy link
Member Author

smarter commented Oct 6, 2017

test performance please

We only need to fully define the bounds of the PolyType parameters, not the
whole PolyType.
@smarter smarter force-pushed the fix-deep-subtypes-2 branch from 9c5e179 to f49e653 Compare October 6, 2017 11:25
@dottybot
Copy link
Member

dottybot commented Oct 6, 2017

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

@smarter smarter requested a review from odersky October 6, 2017 11:26
fullyDefinedType(tp1Params, "type parameters of alternative", alt1.symbol.pos)

val tparams = ctx.newTypeParams(alt1.symbol, tp1.paramNames, EmptyFlags, tp1.instantiateBounds)
isAsSpecific(alt1, tp1.instantiate(tparams.map(_.typeRef)), alt2, tp2)
Copy link
Contributor

Choose a reason for hiding this comment

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

I have the impression it would be easier to just scan the type parameter bounds whether a fullyDefinedType is needed and, if yes, instantiate the whole type.

@dottybot
Copy link
Member

dottybot commented Oct 6, 2017

Performance test finished successfully:

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

Benchmarks is based on merging with master (2ecd3d2)

@allanrenucci allanrenucci merged commit a116bd0 into scala:master Oct 9, 2017
@allanrenucci allanrenucci deleted the fix-deep-subtypes-2 branch December 14, 2017 19:20
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