Skip to content

Error about Contextual function's parameter refer to its synthetic name without explantation #18188

@Sporarum

Description

@Sporarum

Compiler version

3.3.1-RC1

Minimized code

class A1[T](action: A1[T] ?=> String = "")

Output

-- [E081] Type Error: ----------------------------------------------------------
1 |class A1[T](action: A1[T] ?=> String = "")
  |                                       ^
  |                   Missing parameter type
  |
  |                   I could not infer the type of the parameter evidence$1.
  |                   What I could infer was: A1[<?>]
1 error found

Expectation

The error mentions evidence$1 which is not defined anywhere
(neither in user-facing code, nor in the error message)

This example was taken from tests/neg/i11350.scala in the compiler, but affects any AnonymousFunctionMissingParamType on contextual functions, and potentially other errors

Metadata

Metadata

Assignees

No one assigned

    Labels

    SpreeSuitable for a future Spreearea:implicitsrelated to implicitsarea:inferarea:reportingError reporting including formatting, implicit suggestions, etcbetter-errorsIssues concerned with improving confusing/unhelpful diagnostic messagesitype:bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions