Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
scabug opened this issue Jun 7, 2012 · 4 comments
Closed

Comments

@scabug
Copy link

scabug commented Jun 7, 2012

...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]
@scabug
Copy link
Author

scabug commented Jun 7, 2012

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

@scabug
Copy link
Author

scabug commented Jun 7, 2012

@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.

@scabug
Copy link
Author

scabug commented Jun 8, 2012

@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).

@scabug
Copy link
Author

scabug commented Dec 5, 2012

@retronym said:
scala/scala#1713

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants