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

Add support for methods which wrap arguments in implicit classes #9

Closed
isaacflaum opened this issue Jun 22, 2021 · 1 comment
Closed
Assignees
Labels
bug Something isn't working

Comments

@isaacflaum
Copy link

val a: String = null
?(a.toInt) // throws NumberFormatException

The above snippet fails due to Scala wrapping a in an implicit class and the macro not knowing how to check for null properly in this instance. The snippet below is what the above code compiles to. The macro should instead check if a is != null and apply the wrapper in the body of the if.

{
  <synthetic> val fresh$macro$1: scala.collection.StringOps = scala.Predef.augmentString(a);
  if (fresh$macro$1.$bang$eq(null))
    fresh$macro$1.toInt
  else
    null
}
@ryanstull ryanstull self-assigned this Dec 22, 2022
@ryanstull ryanstull added the bug Something isn't working label Dec 22, 2022
@ryanstull
Copy link
Owner

ryanstull commented Dec 22, 2022

Fixed in version 1.2.6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants