10000 Unexpected same type after erasure error · Issue #5196 · scala-js/scala-js · GitHub
[go: up one dir, main page]

Skip to content
Unexpected same type after erasure error #5196
Closed as not planned
Closed as not planned
@threeseed

Description

@threeseed

Code:

import scala.scalajs
640D
.js

abstract class A:
  type Props
  def apply(p: Props) = ()

object B extends A:
  case class Props()
  def apply(a: js.UndefOr[String]) = ()

https://scastie.scala-lang.org/wIU34JJtTi2xlNfVldcClg

Error:

Name clash between defined and inherited member:
def apply(p: A.this.Props): Unit in class A at line 7 and
def apply(a: scala.scalajs.js.UndefOr[String]): Unit in object B at line 12
have the same type after erasure.

Consider adding a @targetName annotation to one of the conflicting definitions
for disambiguation

Notes:
The following code works suggesting some issue with js.UndefOr:

import scala.scalajs.js

abstract class A:
  type Props
  def apply(p: Props) = ()

object B extends A:
  case class Props()
  def apply(a: String) = ()

Versions Tested:
3.3.6, 3.7.0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    as-designedThe observed behavior is as-designed, it need not be fixed.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0