You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the issue #16 it was discovered that sometimes the presence of a 2nd overloaded method with an extra argument can sometimes "trick" Scala 2 into thinking a correct macro-method is correct.
It was discovered that when you add a 2nd "dummy method" for example:
The Something class can be anything. I tried java.util.Regex which has nothing to do with anything. Note that the 2nd value can also be of type regex and that the 2nd thing does not even need to be a macro.
In order to do this:
val out =
defer {
val i = Ref.make(0).run
while (i.get.run < 3)
i.getAndUpdate(i => i + 1).run
i.get.run
}
In the issue #16 it was discovered that sometimes the presence of a 2nd overloaded method with an extra argument can sometimes "trick" Scala 2 into thinking a correct macro-method is correct.
It was discovered that when you add a 2nd "dummy method" for example:
The following above code that normally throws a "macro has not been expanded" error will somehow work.
This is shown in the following branch.
https://github.com/zio/zio-direct/tree/crazy-macro-expansion-error
There are other scenarios where "macro has not been expanded" will occur. for example, if you have a macro the wrong number of arguments:
Need to watch out for potential similar issues and think about mitigations.
The text was updated successfully, but these errors were encountered: