macrame icon indicating copy to clipboard operation
macrame copied to clipboard

`@delegate` does not properly forward type aliases

Open Atry opened this issue 8 years ago • 2 comments

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

Atry avatar Nov 22 '16 02:11 Atry

It would be great if @delegate creates a type AnySeq = Foo.AnySeq alias

Atry avatar Nov 22 '16 02:11 Atry

As per the documentation, @delegate forwards method calls. I would accept a PR to add this behavior though.

ClaireNeveu avatar Nov 22 '16 10:11 ClaireNeveu