Skip to content

doc(macros): typo and other improvements #8307

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

Merged
merged 1 commit into from
Feb 13, 2020

Conversation

robstoll
Copy link
Contributor

I was thinking about revising the section about getValue in addition in this PR but are unsure if I interpret the docs correctly (unfortunately I don't have time to setup a dotty project and scastie cannot run macros as they are defined in the same file).
The text is very vague expression containing constants. I guess getValue works if the expression is constant, correct? In other words '(2).getValue and '(1+1).getValue both yield Some(2). Correct? If so then I'll create another PR improving the corresponding section

@nicolasstucki
Copy link
Contributor

In general, getValue will only get a value if the source contains explicitly the value. But literal constants may get constant folded before macro expansion, hence '(1+1) will be constant folded to '(2) before the evaluation of the macro.

@nicolasstucki nicolasstucki merged commit b117214 into scala:master Feb 13, 2020
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.

2 participants