Skip to content

Commit 91e973c

Browse files
committed
Revert "Drop redundant butNot = Param clause in isAnchor"
This reverts commit 9d88c80. Closes #21521 The `ClassTypeParamCreationFlags` include both `TypeParam` and `Deferred`. In effect, a class type parameter was incorrectly considered as an anchor. For a failing example, one can try asserting: ```scala || sym.is(Deferred).ensuring(_ == sym.is(Deferred, butNot = Param)) ``` in `ImplicitRunInfo#isAnchor` and a test with `summon[Ordering[Int]]`. In that example, at least, the flags happen to be set by `Scala2Unpickler#readDisambiguatedSymbol` src/dotty/tools/dotc/core/unpickleScala2/Scala2Unpickler.scala:562. [Cherry-picked 1b1dd16][modified]
1 parent b33eb4f commit 91e973c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler/src/dotty/tools/dotc/typer/Implicits.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -597,7 +597,7 @@ trait ImplicitRunInfo:
597597
private def isAnchor(sym: Symbol) =
598598
sym.isClass && !isExcluded(sym)
599599
|| sym.isOpaqueAlias
600-
|| sym.is(Deferred)
600+
|| sym.is(Deferred, butNot = Param)
601601
|| sym.info.isInstanceOf[MatchAlias]
602602

603603
private def computeIScope(rootTp: Type): OfTypeImplicits =

0 commit comments

Comments
 (0)