Skip to content

Extension method doesn't show warning with type alias #23329

Closed as not planned
Closed as not planned
@threeseed

Description

@threeseed

Compiler version

3.7.0

Minimized code

type Json2 = Json

class Json:
  def foo[A](bar: AnyRef): Unit = ()

extension (j: Json2)
  def foo[A](bar: String): Unit = ()

Expectation

If the extension method was on Json a warning would be shown:

Extension method foo will never be selected
because Json already has a member with the same name and compatible parameter types.

But with the type alias in place nothing is shown even though Json2 is for all intents and purposes a Json type.
It should show a warning in both cases.

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