Skip to content

Capture Calculus doesn't track type parameter instantiation #15049

@anatoliykmetyuk

Description

@anatoliykmetyuk

Compiler version

Capture Calculus branch, commit 952a829ae39700849bf4ad98d9b7b110d3f89a1a.

Minimized code

class Session: def request = "Response" class Foo: private val session: {*} Session = new Session def withSession[T](f: ({*} Session) => T): T = f(session) @main def Test = val f = new Foo f.withSession(s => s).request

Output

Compiles successfully.

Expectation

Should fail. The following workaround fails as expected:

class Session: def request = "Response" type TrSession = {*} Session class Foo: private val session: TrSession = new Session def withSession[T](f: TrSession => T): T = f(session) @main def Test = val f = new Foo f.withSession(s => s).request // fail

Metadata

Metadata

Assignees

Labels

cc-experimentIntended to be merged with cc-experiment branch on originitype:bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions