Skip to content

Context function in case-less tupled lambda parameters #16540

Open
@prolativ

Description

@prolativ

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions