Skip to content

confusing treatment of context function literal  #20896

Open
@symingz

Description

@symingz

Compiler version

3.4.2

Minimized code

File1:

def foo() =
  (x: Int) ?=> x + 1

File2:

def foo() =
  println()
  (x: Int) ?=> x + 1

Output

File1: no error

File2:

-- [E172] Type Error: Main.scala:3:20 ------------------------------------------
3 |  (x: Int) ?=> x + 1
  |                    ^
  |    No given instance of type Int was found for parameter of (Int) ?=> Int
1 error found

Expectation

Both files should compile. Or both files should fail to compile.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions