Skip to content

Confusing error for constructor proxy shadowing #17153

Closed
@odersky

Description

@odersky

Compiler version

3.3.0

Minimized example

class Number(n: Int)
val x = Number(3)

Output

2 |val x = Number(3)
  |        ^^^^^^
  |        Reference to constructor proxy for class Number
  |        shadows outer reference to object Number in package java.lang

Expectation

  1. java.lang.Number cannot possibly be applied, so one could avoid the error
  2. The error message could be better and could contain some suggestions how to fix the problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:reportingError reporting including formatting, implicit suggestions, etc

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions