File tree 1 file changed +9
-0
lines changed
compiler/src/dotty/tools/dotc/core
1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -109,6 +109,11 @@ object Types {
109
109
/** Is this type still provisional? This is the case if the type contains, or depends on,
110
110
* uninstantiated type variables or type symbols that have the Provisional flag set.
111
111
* 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`,
114
+ * a non-provisional type could go back to being provisional after
115
+ * a call to `resetInst`. This means all caches that rely on `isProvisional`
116
+ * can likely end up returning stale results.
112
117
*/
113
118
def isProvisional (using Context ): Boolean = mightBeProvisional && testProvisional
114
119
@@ -4739,6 +4744,10 @@ object Types {
4739
4744
* is different from the variable's creation state (meaning unrolls are possible)
4740
4745
* in the current typer state.
4741
4746
*
4747
+ * FIXME: the "once" in the statement above is not true anymore now that `resetInst`
4748
+ * exists, this is problematic for caching (see `Type#isProvisional`),
4749
+ * we should try getting rid of this method.
4750
+ *
4742
4751
* @param origin the parameter that's tracked by the type variable.
4743
4752
* @param creatorState the typer state in which the variable was created.
4744
4753
* @param initNestingLevel the initial nesting level of the type variable. (c.f. nestingLevel)
You can’t perform that action at this time.
0 commit comments