You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix signature computation involving nested type variables
Signatures used for overloading/overriding resolution are cached and therefore
should not depend on uninstantiated type variables, this is handled in
`TypeErasure#sigName` by using the name `tpnme.Uninstantiated` when
encountering an uninstantiated type variable (this name is handled specially in
`Signature`). But before this commit, `sigName` only checked for type variables
at the top-level of the type, even though nested type variables can still have
an impact on type erasure, in particular when they appear as part of:
- an intersection
- a union
- an underlying type of a derived value class
- the element type of an array type
- an element type of a tuple (... *: X *: ...)
We fix this by using `Type#isProvisional` as in other caching mechanisms, this
required tweaking the implementation of `isProvisional` to force LazyRefs.
assert(sig.isUnderDefined == expectedIsUnderDefined, i"Signature of `$meth` with prefix `$prefix` and type `${meth.info}` should be $what but is `$sig`")
77
+
78
+
checkSignatures(expectedIsUnderDefined =true)
79
+
80
+
inContext(ctx.fresh.setNewTyperState()):
81
+
assert(isFullyDefined(tvar, force =ForceDegree.all), s"Could not instantiate $tvar")
82
+
// Signatures are still underdefined if the instantiation can be retracted.
83
+
checkSignatures(expectedIsUnderDefined =true)
84
+
85
+
assert(isFullyDefined(tvar, force =ForceDegree.all), s"Could not instantiate $tvar")
0 commit comments