We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 21f542b commit 18cf1b4Copy full SHA for 18cf1b4
compiler/src/dotty/tools/dotc/core/Types.scala
@@ -4919,7 +4919,12 @@ object Types {
4919
* is also a singleton type.
4920
*/
4921
def instantiate(fromBelow: Boolean)(using Context): Type =
4922
- instantiateWith(typeToInstantiateWith(fromBelow))
+ val tp = typeToInstantiateWith(fromBelow)
4923
+ if myInst.exists then // The line above might have triggered instantiation of the current type variable
4924
+Member
4925
+ myInst
4926
+ else
4927
+ instantiateWith(tp)
4928
4929
/** Widen unions when instantiating this variable in the current context? */
4930
def widenUnions(using Context): Boolean = !ctx.typerState.constraint.isHard(this)
0 commit comments