Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
trying to fix #305
It seems that AST that our macro produces is spliced into AST of the expression provided to Expecty.expect
Then it tries to evaluate this composed AST, but it fails, I'm not exactly sure why, maybe some local vals in macro arent simply available in the scope where expecty evaluates them.
I think Expecty.expect should expand only AST of expression provided to it (and do not follow macros and splice ASTs generated by them)
This PR rewrites macro a little bit not to use values calculated in macro itself (it also removes potentially problematic Expr.apply call). As a consequence we have to make a segmentsFromString public, because call to it is also inlined.
This change fixes compilation of expecty macros, but due to the fact that expecty expands AST too much, its assertion clues will be malformed anyway, but I don't think we would be able to solve this in os-lib.
Note:
Using scala 2 there is no bug.