macrame
macrame copied to clipboard
`@delegate` does not properly forward type aliases
package myPackage
import macrame.delegate
object Foo {
type AnySeq = Seq[_]
def emptySeq: AnySeq = Nil
}
object Bar {
@delegate
val underlying: Foo.type = Foo
}
object Main {
def main(args: Array[String]): Unit = {
val x: AnySeq = Bar.emptySeq
}
}
/private/tmp/TypeDelegate/TypeDelegate.scala:23: type AnySeq is not a member of object myPackage.Bar
val x: Bar.AnySeq = Bar.emptySeq
^
one error found
It would be great if @delegate
creates a type AnySeq = Foo.AnySeq
alias
As per the documentation, @delegate
forwards method calls. I would accept a PR to add this behavior though.