Skip to content

Context function in case-less tupled lambda parameters #16540

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
prolativ opened this issue Dec 16, 2022 · 0 comments
Open

Context function in case-less tupled lambda parameters #16540

prolativ opened this issue Dec 16, 2022 · 0 comments

Comments

@prolativ
Copy link
Contributor

Compiler version

3.3.0-RC1-bin-20221215-ef653b6-NIGHTLY and before

Minimized code

trait Ctx

val opt1 = Some((ctx: Ctx) ?=> 123).map{ f => 0 }
val opt2 = Some(((ctx: Ctx) ?=> 123, "abc")).map{ fs => 0 }
val opt3 = Some(((ctx: Ctx) ?=> 123, "abc")).map{ (f, s) => 0 }
val opt4 = Some(((ctx: Ctx) ?=> 123, "abc")).map{ case (f, s) => 0 }

Output

-- [E172] ContextFun.scala:5:51 
5 |val opt3 = Some(((ctx: Ctx) ?=> 123, "abc")).map{ (f, s) => 0 }
  |                                                   ^
  |    No given instance of type Ctx was found for parameter of (Ctx) ?=> Int

Expectation

This should compile. The compiler should not try to apply a context function inside a tupled pattern of function parameters

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants