Skip to content

Capture set variable does not work for class parameter #23737

@odersky

Description

@odersky

Compiler version

3.8 nightly

Minimized example

class C

trait A[T]

trait B[CC^] extends A[C^{CC}] // error: CC not found

trait D[CC^]:
  val x: Object^{CC} = ???

Output

-- [E006] Not Found Error: cap-inheritance.scala:6:26 --------------------------
6 |trait B[CC^] extends A[C^{CC}] // error: CC not found
  |                          ^^
  |                          Not found: capability CC - did you mean CT?
  |
  | longer explanation available when compiling with `-explain`
1 error found

Expectation

Should compile. Note that trait D does compile. So it seems the term surrogate for CC in B is created, but is created too late to be visible in the parent clause.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions