//> using dep io.github.kitlangton::stubby:0.1.2
import scala.annotation.*
import stubby.*
trait Foo {
@targetName("a1")
def a(i: Int): Unit
@targetName("a2")
def a(i: Int): Unit
}
stubbed[Foo] // Not OK
$ scala-cli a.sc
Compiling project (Scala 3.4.1, JVM (21))
[error] ./a.sc:16:1
[error] Double definition:
[error] def a(i: Int): Unit in class FooStubbed and
[error] def a(i: Int): Unit in class FooStubbed
[error] have the same type after erasure.
[error]
[error] Consider adding a @targetName annotation to one of the conflicting definitions
[error] for disambiguation.
[error] stubbed[Foo] // Not OK
[error] ^^^^^^^^^^^^
Error compiling project (Scala 3.4.1, JVM (21))
Compilation failed
https://scastie.scala-lang.org/bUxsi5nPTi2Gm1o4SonRzQ