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

Addressing 'macro has not been expanded' error Scala 2.13.0 or newer #56

Merged

Conversation

meshake
Copy link

@meshake meshake commented Apr 3, 2020

It looks like on Scala 2.13.0 or newer version, contextual does not work and simply throws "macro has not been expanded" error when trying to use a defined interpolator.

I narrowed it down to the apply function in the Prefix class that references "interpolator.Input" and "interpolator.type"on the provided interpolator. I do not fully understand the problem, but I tried to fix this issue by avoiding passing the interpolator as a parameter to the default constructor and instead passing the needed information via type parameters. So I added the "InputType" as a type parameter to the Prefix class. The "type" is already passed as a type parameter "InterpolatorType", so I simply changed the "interpolator.type" to "InterpolatorType". This seems to fix the problem.

Additionally, Scala 2.13.1 was complaining about incompatible Seq types, as it expects an immutable sequence, so I changed the interpolator code to use "root.scala.collection.immutable.Seq".

Fixes #54

@propensive
Copy link
Owner

Thank you for the contribution @meshake! I'll try to publish a release as soon as possible.

@propensive propensive merged commit 0d4c86f into propensive:master Apr 12, 2020
@regadas
Copy link

regadas commented Apr 26, 2020

Hi @propensive! just stumbled upon this as well. Hopefully you can find some time to release this! Thanks 🙏

@martingd
Copy link

martingd commented May 6, 2020

Hi @propensive
If you would have time to publish a new release with this fix it would be highly appreciated. :)

@propensive
Copy link
Owner

Thanks for the reminder! It is very much on my agenda, albeit indirectly...

@martingd
Copy link

martingd commented Jun 4, 2020

Thanks for the reminder! It is very much on my agenda, albeit indirectly...

@propensive I understand you are probably busy doing other stuff, but maybe you could tell if Contextual is effectively discontinued or if you intend to do a release for Scala 2.13.

@laughedelic
Copy link

@martingd FYI support for 2.13 is already in master, but not released, unfortunately.

@martingd
Copy link

martingd commented Jun 4, 2020

@laughedelic I know this issue has been merged, but not yet released.

@laughedelic
Copy link

Right, I didn't realize that I'm pointing out the obvious 😅

@propensive
Copy link
Owner

I'm still working on it... sorry! Hopefully I'll get it published today.

@Ben-Woolley
Copy link

Hello hello @propensive! Any update on releasing this?

@propensive
Copy link
Owner

I've just released version 3.0.0 (since 2.0.0 was basically broken) for Scala 2.13 and 2.12.

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

Successfully merging this pull request may close these issues.

Error macro has not been expanded in Scala 2.13.0
6 participants