Skip to content

Wrong subcapture check result when capture parameter presents #22005

Closed
@noti0na1

Description

@noti0na1

Compiler version

Current version
3.6.4-RC1-bin-SNAPSHOT-nonbootstrapped-git-c933560

Minimized code

import language.experimental.captureChecking
import caps.*

class IO
class File(io: IO^)
class Handler[C^]:
  def f(file: File^): File^{C^} = file // should be error!
  def g(file: File^{C^}): File^ = file // ok

def test(io1: IO^, io2: IO^, h: Handler[CapSet^{io2}]) =
  val f1: File^{io1} = ???
  val f2: File^{io2} = h.f(f1) // problem!

Output

Compiled

Expectation

Should reject f

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions