Skip to content

Commit e0427ff

Browse files
committed
Don't decorate type variables with additional capture sets
1 parent 5af9f6d commit e0427ff

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

compiler/src/dotty/tools/dotc/cc/CaptureOps.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ extension (tp: Type)
5959
def canHaveInferredCapture(using Context): Boolean = tp match
6060
case tp: TypeRef if tp.symbol.isClass =>
6161
!tp.symbol.isValueClass && tp.symbol != defn.AnyClass
62+
case _: TypeVar | _: TypeParamRef =>
63+
false
6264
case tp: TypeProxy =>
6365
tp.superType.canHaveInferredCapture
6466
case tp: AndType =>

0 commit comments

Comments
 (0)