-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Avoid most deep subtypes in test #3272
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
dc0a053
to
bde360b
Compare
test performance please |
performance test scheduled: 9 job(s) in queue, 1 running. |
The only remaining testcase requiring deep subtype is t8146a.scala for good reasons.
bde360b
to
eb2fdf2
Compare
Performance test finished successfully: Visit http://dotty-bench.epfl.ch/3272/ to see the changes. Benchmarks is based on merging with master (af528a1) |
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.
Great work! LGTM
// below never contain TypeRefs whose underling types contain | ||
// uninstantiated TypeVars, this could lead to cycles in `isSubType` | ||
// as a TypeVar might get constrained by a TypeRef it's part of. | ||
val tp1a = fullyDefinedType(tp1, "alternative", alt1.symbol.pos).asInstanceOf[PolyType] |
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.
I wonder whether we could optimize this so that we do the fullyDefinedType only if the type parameter bounds are non-trivial. fullyDefinedType is somewhat expensive.
val tparams = ctx.newTypeParams(alt1.symbol, tp1.paramNames, EmptyFlags, tp1.instantiateBounds) | ||
isAsSpecific(alt1, tp1.instantiate(tparams.map(_.typeRef)), alt2, tp2) | ||
val nestedCtx = ctx.fresh.setExploreTyperState() | ||
|
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.
I believe we can use TyperState.test here/ It's cheaper and easier to use.
The only remaining testcase requiring deep subtype is t8146a.scala for
good reasons.