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 7f0e259 commit 3964599Copy full SHA for 3964599
compiler/src/dotty/tools/dotc/cc/Setup.scala
@@ -98,7 +98,10 @@ extends tpd.TreeTraverser:
98
def addCaptureRefinements(tp: Type): Type = tp match
99
case _: TypeRef | _: AppliedType if tp.typeParams.isEmpty =>
100
tp.typeSymbol match
101
- case cls: ClassSymbol if !defn.isFunctionClass(cls) =>
+ case cls: ClassSymbol
102
+ if !defn.isFunctionClass(cls) && !cls.is(JavaDefined) =>
103
+ // We assume that Java classes can refer to capturing Scala types only indirectly,
104
+ // using type parameters. Hence, no need to refine them.
105
cls.paramGetters.foldLeft(tp) { (core, getter) =>
106
if getter.termRef.isTracked then
107
val getterType = tp.memberInfo(getter).strippedDealias
0 commit comments