Skip to content

Function type parameters can be instantiated to types which capture the root cap #15058

@abgruszecki

Description

@abgruszecki

Compiler version

Head of CC experiment.

Minimized code

Both of the calls to withSession should be rejected (note the first one is also affected by #15057):

scala> class Session // defined class Session scala> def withSession[T](thunk : ({*} Session) => T): T = thunk(new Session) def withSession[T](thunk: ({*} Session) => T): T scala> withSession(t => t) val res1: Session = Session@7866a0b3 scala> withSession[{*} Session](t => t) val res2: {*} Session = Session@14e53307

Metadata

Metadata

Assignees

No one assigned

    Labels

    cc-experimentIntended to be merged with cc-experiment branch on origin

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions