Skip to content

Commit b50da7e

Browse files
committed
Add FIXMEs regarding TypeVar#resetInst breaking all our assumptions
I'm afraid we'll have to get rid of it if we want our caches to be correct, but I don't have the time to look into it right now.
1 parent f274112 commit b50da7e

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

compiler/src/dotty/tools/dotc/core/TypeErasure.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -894,6 +894,8 @@ class TypeErasure(sourceLanguage: SourceLanguage, semiEraseVCs: Boolean, isConst
894894
* `tpnme.Uninstantiated` which is used to signal an underdefined signature
895895
* is used.
896896
*
897+
* FIXME: This does not account for instantiations being retracted by `TypeVar#resetInst`.
898+
*
897899
* Note: Need to ensure correspondence with erasure!
898900
*/
899901
private def sigName(tp: Type | Null)(using Context): TypeName = try

compiler/src/dotty/tools/dotc/core/Types.scala

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,8 @@ object Types {
109109
/** Is this type still provisional? This is the case if the type contains, or depends on,
110110
* uninstantiated type variables or type symbols that have the Provisional flag set.
111111
* This is an antimonotonic property - once a type is not provisional, it stays so forever.
112+
*
113+
* FIXME: The semantics of this flag are broken by the existence of `TypeVar#resetInst`.
112114
*/
113115
def isProvisional(using Context): Boolean = mightBeProvisional && testProvisional
114116

@@ -4739,6 +4741,10 @@ object Types {
47394741
* is different from the variable's creation state (meaning unrolls are possible)
47404742
* in the current typer state.
47414743
*
4744+
* FIXME: the "once" in the statement above is not true anymore now that `resetInst`
4745+
* exists, this is problematic for caching
4746+
* (see `Type#isProvisional`, `TypeErasure#sigName`).
4747+
*
47424748
* @param origin the parameter that's tracked by the type variable.
47434749
* @param creatorState the typer state in which the variable was created.
47444750
* @param initNestingLevel the initial nesting level of the type variable. (c.f. nestingLevel)

0 commit comments

Comments
 (0)