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

Anonymous inner class with overrides crashes Typers #77

Open
jeffrey-aguilera opened this issue Feb 1, 2016 · 3 comments
Open

Anonymous inner class with overrides crashes Typers #77

jeffrey-aguilera opened this issue Feb 1, 2016 · 3 comments

Comments

@jeffrey-aguilera
Copy link

The issue is described in more detail at https://github.com/jeffrey-aguilera/bug-scalamacros

This project demonstrates a Typers.scala assertion error with a quasiquote generated inner class.

  • sbt compile --- compiles macro
  • sbt test:compile --- attempts compilation of object annotated with macro

The problem has been reproduced for Scala 2.11.7 and 2.12.0-M3 generating 1.7 and 1.8 bytecode. For Scala 2.11.7, the assertion fails on Typers.scala:1759; and for Scala 2.12.0-M3, it fails on Typers.scala:1748.

The essence of this bug is the instantiation of an anonymous inner class. E.g., in the context of

  trait Trait { def something: Int }

an attempt to generate

  new Trait {
    override def something: Int = 3
  }

with quasiquotes or ClassDef will fail.

The corresponding hand-crafted code compiles fine.

@jeffrey-aguilera
Copy link
Author

Is there any more information that I can provide to help move this issue forward? Is this related to https://issues.scala-lang.org/browse/SI-7920 ? In both cases, it seems that an internal ClassDef does not have symbol defined.

@xeno-by
Copy link
Member

xeno-by commented Feb 20, 2016

@jeffrey-aguilera Hi again! Sorry I'm behind my email, because these days I'm travelling a lot. How urgent is this issue for you? Next week I'll be flying again, so I'll be able to take a good look only in the very end of February. Does this sound good?

@jeffrey-aguilera
Copy link
Author

I have found a work-around, which might also provide some clues to solving the problem. (It might be related to the call-by-name context where the anonymous class was instantiated.) I will provide details on the original ticket this week.

Since I have a work-around, the urgency is nil.

Thanks for all your hard work on scala macros and meta programming.

Best regards,
Jeffrey Aguilera

On Feb 20, 2016, at 6:37 AM, Eugene Burmako <[email protected]mailto:[email protected]> wrote:

@jeffrey-aguilerahttps://github.com/jeffrey-aguilera Hi again! Sorry I'm behind my email, because these days I'm travelling a lot. How urgent is this issue for you? Next week I'll be flying again, so I'll be able to take a good look only in the very end of February. Does this sound good?


Reply to this email directly or view it on GitHubhttps://github.com//issues/77#issuecomment-186618793.

SethTisue pushed a commit to scalacommunitybuild/paradise that referenced this issue Nov 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants