Skip to content

Commit eb42a4d

Browse files
Revert "Drop redundant butNot = Param clause in isAnchor" (#21566)
This reverts commit 9d88c80. Closes #21521 The `ClassTypeParamCreationFlags` include both `TypeParam` and `Deferred`. In effect, a class type parameter was considered an anchor for implicit search, by `sym.is(Deferred)` as a sufficient condition. 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`: https://github.com/scala/scala3/blob/614170f4545ea6da8f07e0c4b0f2fdfe01377270/compiler/src/dotty/tools/dotc/core/unpickleScala2/Scala2Unpickler.scala#L560
2 parents e5be3a1 + 1b1dd16 commit eb42a4d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: compiler/src/dotty/tools/dotc/typer/Implicits.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -636,7 +636,7 @@ trait ImplicitRunInfo:
636636
private def isAnchor(sym: Symbol) =
637637
sym.isClass && !isExcluded(sym)
638638
|| sym.isOpaqueAlias
639-
|| sym.is(Deferred)
639+
|| sym.is(Deferred, butNot = Param)
640640
|| sym.info.isMatchAlias
641641

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

0 commit comments

Comments
 (0)