Skip to content

Commit 456b13e

Browse files
committed
Update superCallContext to include dummy capture parameters in scope
1 parent 2b004ee commit 456b13e

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

compiler/src/dotty/tools/dotc/core/Contexts.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -402,8 +402,8 @@ object Contexts {
402402
*
403403
* - as owner: The primary constructor of the class
404404
* - as outer context: The context enclosing the class context
405-
* - as scope: type parameters, the parameter accessors, and
406-
* the context bound companions in the class context,
405+
* - as scope: type parameters, the parameter accessors,
406+
* the dummy capture parameters and the context bound companions in the class context,
407407
*
408408
* The reasons for this peculiar choice of attributes are as follows:
409409
*
@@ -420,7 +420,7 @@ object Contexts {
420420
def superCallContext: Context =
421421
val locals = owner.typeParams
422422
++ owner.asClass.unforcedDecls.filter: sym =>
423-
sym.is(ParamAccessor) || sym.isContextBoundCompanion
423+
sym.is(ParamAccessor) || sym.isContextBoundCompanion || sym.isDummyCaptureParam
424424
superOrThisCallContext(owner.primaryConstructor, newScopeWith(locals*))
425425

426426
/** The context for the arguments of a this(...) constructor call.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import language.experimental.captureChecking
2+
3+
class C
4+
5+
trait A[T]
6+
7+
trait B[CC^] extends A[C^{CC}] // error: CC not found
8+
9+
trait D[CC^]:
10+
val x: Object^{CC} = ???

0 commit comments

Comments
 (0)