Skip to content

Paths to abstract CapSet members within capture sets are rejected #21870

Closed
@bracevac

Description

@bracevac

Compiler version

Latest NIGHTLY

Minimized code

import language.experimental.captureChecking
import caps._

trait Foo extends Capability

trait CaptureSet:
  type C <: CapSet^

def test =
  val x: Foo^ = ???

  object X extends CaptureSet:
    type C = CapSet^{x}

  val y: Foo^{X.C^} = x // error

Output

-- Error: local/ccpaths.scala:70:15 --------------------------------------------
70 |  val u: Foo^{X.C^} = x
   |              ^^^^
   |X.C is not a legal prefix for `^` here,
   |is must be a type parameter or abstract type with a caps.CapSet upper bound.

Expectation

It should be accepted (+ the error message has a typo).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions