Skip to content

Commit dd73318

Browse files
committed
Merge pull request #1020 from dotty-staging/fix/tvar-ephemeral
Fix caching bug: don't assume that tvars instantiation cannot be retracted
2 parents b60a6ae + 0a2b676 commit dd73318

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2558,7 +2558,10 @@ object Types {
25582558
* uninstantiated
25592559
*/
25602560
def instanceOpt(implicit ctx: Context): Type =
2561-
if (inst.exists) inst else ctx.typerState.instType(this)
2561+
if (inst.exists) inst else {
2562+
ctx.typerState.ephemeral = true
2563+
ctx.typerState.instType(this)
2564+
}
25622565

25632566
/** Is the variable already instantiated? */
25642567
def isInstantiated(implicit ctx: Context) = instanceOpt.exists
File renamed without changes.

0 commit comments

Comments
 (0)