Skip to content

Document meaning of constant expressions #4527

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 2 commits into from
May 14, 2018

Conversation

Blaisorblade
Copy link
Contributor

@Blaisorblade Blaisorblade commented May 14, 2018

Clarification following #4431.

The error checking's done by Checking.checkInlineConformant(tree, isFinal = false, "argument to inline parameter"), and checkInlineConformant uses
ConstantType which characterizes constant expressions.

@TomasMikula opinions? (Since you asked what "constant expression" means).


Right-hand sides of inline values and of arguments for inline parameters
must be constant expressions in the sense defined by the [SLS §
6.24](https://www.scala-lang.org/files/archive/spec/2.12/06-expressions.html#constant-expressions)),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have one ) to many.

Copy link
Contributor

@nicolasstucki nicolasstucki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otherwise LGTM

Clarification following scala#4431.

The error checking's done by `Checking.checkInlineConformant(tree, isFinal =
false, "argument to inline parameter")`, and `checkInlineConformant` uses
`ConstantType` which characterizes constant expressions.
@Blaisorblade Blaisorblade force-pushed the constant-expr-clarify branch from 98388f4 to 3039eca Compare May 14, 2018 17:22
@Blaisorblade Blaisorblade self-assigned this May 14, 2018
@TomasMikula
Copy link
Contributor

Seems sufficient as a documentation.

@Blaisorblade Blaisorblade merged commit 5d004dc into scala:master May 14, 2018
@Blaisorblade Blaisorblade deleted the constant-expr-clarify branch May 14, 2018 18:52
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.

3 participants