-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed as not planned
Labels
Description
Compiler version
3.7.2
Minimized code
//> using scala 3.7.2
trait Special[A]
object syntax:
given Special[Option[Long]] = ???
given Special[Option[Int]] = ???Output
-- [E120] Naming Error: --------------------------------------------------------
3 | given Special[Option[Int]] = ???
| ^
|Double definition:
|final lazy given val given_Special_Option: Special[Option[Long]] in object syntax at line 2 and
|final lazy given val given_Special_Option: Special[Option[Int]] in object syntax at line 3
1 error foundExpectation
The generated names for givens should not be limited to 2 nested types.
Workaround
//> using scala 3.7.2
import scala.annotation.targetName
trait Special[A]
object syntax:
@targetName("Special_Option_Long")
given Special[Option[Long]] = ???
@targetName("Special_Option_Int")
given Special[Option[Int]] = ???