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 5af9f6d commit e0427ffCopy full SHA for e0427ff
compiler/src/dotty/tools/dotc/cc/CaptureOps.scala
@@ -59,6 +59,8 @@ extension (tp: Type)
59
def canHaveInferredCapture(using Context): Boolean = tp match
60
case tp: TypeRef if tp.symbol.isClass =>
61
!tp.symbol.isValueClass && tp.symbol != defn.AnyClass
62
+ case _: TypeVar | _: TypeParamRef =>
63
+ false
64
case tp: TypeProxy =>
65
tp.superType.canHaveInferredCapture
66
case tp: AndType =>
0 commit comments