Skip to content

Use is not properly recorded #24335

@odersky

Description

@odersky

Compiler version

3.8

Minimized example

class IO extends caps.SharedCapability:
  def write(): Unit = ()

class C(val io: IO):
  val c = C(io)
  val l1 = () => c.io.write()
  val _: () -> Unit = l1     // should be error

Output

Compiles

Expectation

l1 should have type () ->{c.io} Unit, so the last line should not typecheck.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions