Skip to content

Commit

Permalink
Add FIXMEs regarding TypeVar#resetInst potentially breaking caching
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
smarter committed Jun 28, 2023
1 parent 5fb5ebe commit d84d6d6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions compiler/src/dotty/tools/dotc/core/Types.scala
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ object Types {
/** Is this type still provisional? This is the case if the type contains, or depends on,
* uninstantiated type variables or type symbols that have the Provisional flag set.
* This is an antimonotonic property - once a type is not provisional, it stays so forever.
*
* FIXME: The semantic of this flag are broken by the existence of `TypeVar#resetInst`.
*/
def isProvisional(using Context): Boolean = mightBeProvisional && testProvisional

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

0 comments on commit d84d6d6

Please sign in to comment.