Skip to content

Implicits are resolved with empty parameter lists #22439

Closed
@hamzaremmal

Description

@hamzaremmal

Compiler version

Since 3.4.2

Minimized code

implicit val x: Int = 0
def foo(implicit x: Int): Int = x
foo()

Output

Complies

Expectation

Behaves as Scala < 3.4.2 and as in the specification.

Note

This is the error message that was generated before 3.4.2

-- [E171] Type Error: ----------------------------------------------------------
1 |foo()
  |^^^^^
  |missing argument for parameter x of method foo: (implicit x: Int): Int
1 error found

and in scala 2.13.14

scala> foo()
          ^
       error: not enough arguments for method foo: (implicit x: Int): Int.
       Unspecified value parameter x.

Metadata

Metadata

Assignees

Labels

area:implicitsrelated to implicitsitype:bugregressionThis worked in a previous version but doesn't anymore

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions