Skip to content

Macros lead to forwarders being generated for methods which do not exist #5894

Closed

Description

@scabug

...and NoSuchMethodError is the outcome for anyone unlucky enough to call the forwarder. Here are the methods in scala.reflect.makro.internal.package$ .


public <T> api.Exprs$Expr<ArrayTag<T>> materializeArrayTag_impl(makro.Context, api.Exprs$Expr<api.Universe>, api.TypeTags$TypeTag<T>);
public <T> api.Exprs$Expr<ErasureTag<T>> materializeErasureTag_impl(makro.Context, api.Exprs$Expr<api.Universe>, api.TypeTags$TypeTag<T>);
public <T> api.Exprs$Expr<ClassTag<T>> materializeClassTag_impl(makro.Context, api.Exprs$Expr<api.Universe>, api.TypeTags$TypeTag<T>);
public <T> api.Exprs$Expr<api.TypeTags$TypeTag<T>> materializeTypeTag_impl(makro.Context, api.Exprs$Expr<api.Universe>, api.TypeTags$TypeTag<T>);
public <T> api.Exprs$Expr<api.TypeTags$ConcreteTypeTag<T>> materializeConcreteTypeTag_impl(makro.Context, api.Exprs$Expr<api.Universe>, api.TypeTags$TypeTag<T>);
public makro.internal.Utils context2utils(makro.Context);

Here are the ones in scala.reflect.makro.internal.package, which should only be forwarders to the above.

public static makro.internal.Utils context2utils(makro.Context);
public static <T> api.Exprs$Expr<api.TypeTags$ConcreteTypeTag<T>> materializeConcreteTypeTag_impl(makro.Context, api.Exprs$Expr<api.Universe>, api.TypeTags$TypeTag<T>);
public static <T> api.TypeTags$ConcreteTypeTag<T> materializeConcreteTypeTag(api.Universe);
public static <T> api.Exprs$Expr<api.TypeTags$TypeTag<T>> materializeTypeTag_impl(makro.Context, api.Exprs$Expr<api.Universe>, api.TypeTags$TypeTag<T>);
public static <T> api.TypeTags$TypeTag<T> materializeTypeTag(api.Universe);
public static <T> api.Exprs$Expr<ClassTag<T>> materializeClassTag_impl(makro.Context, api.Exprs$Expr<api.Universe>, api.TypeTags$TypeTag<T>);
public static <T> ClassTag<T> materializeClassTag(api.Universe);
public static <T> api.Exprs$Expr<ErasureTag<T>> materializeErasureTag_impl(makro.Context, api.Exprs$Expr<api.Universe>, api.TypeTags$TypeTag<T>);
public static <T> ErasureTag<T> materializeErasureTag(api.Universe);
public static <T> api.Exprs$Expr<ArrayTag<T>> materializeArrayTag_impl(makro.Context, api.Exprs$Expr<api.Universe>, api.TypeTags$TypeTag<T>);
public static <T> ArrayTag<T> materializeArrayTag(api.Universe);

Notice the addition of:

public static <T> api.TypeTags$ConcreteTypeTag<T> materializeConcreteTypeTag(api.Universe);
public static <T> api.TypeTags$TypeTag<T> materializeTypeTag(api.Universe);
public static <T> ClassTag<T> materializeClassTag(api.Universe);
public static <T> ErasureTag<T> materializeErasureTag(api.Universe);
public static <T> ArrayTag<T> materializeArrayTag(api.Universe);

Those methods have these implementations ("threatened implementations" I guess.)

def materializeArrayTag[T](u: Universe): ArrayTag[T] = macro materializeArrayTag_impl[T]
def materializeErasureTag[T](u: Universe): ErasureTag[T] = macro materializeErasureTag_impl[T]
def materializeClassTag[T](u: Universe): ClassTag[T] = macro materializeClassTag_impl[T]
def materializeTypeTag[T](u: Universe): u.TypeTag[T] = macro materializeTypeTag_impl[T]
def materializeConcreteTypeTag[T](u: Universe): u.ConcreteTypeTag[T] = macro materializeConcreteTypeTag_impl[T]

Activity

  1. scabug commented on Jun 7, 2012

    @scabug
    Author

    Imported From: https://issues.scala-lang.org/browse/SI-5894?orig=1
    Reporter: @paulp
    Affected Versions: 2.10.0

  2. scabug commented on Jun 7, 2012

    @scabug
    Author

    @paulp said:
    I sent an email to scala-internals; it appears to be enough to add MACRO to excluded forwarder flags, but since it has to be done in two places, I resist.

  3. scabug commented on Jun 8, 2012

    @scabug
    Author

    @magarciaEPFL said:
    From the discussion it looks to me the only workable solution is for GenASM to deprecate GenJVM. Ideas are welcome on how to get there faster (besides #5836).

  4. scabug commented on Dec 5, 2012

    @scabug
    Author
  5. added this to the 2.10.1 milestone on Apr 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions