Skip to content

Fix #4863: Add tests #6308

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
Apr 15, 2019
Merged

Fix #4863: Add tests #6308

merged 1 commit into from
Apr 15, 2019

Conversation

liufengyun
Copy link
Contributor

@liufengyun liufengyun commented Apr 15, 2019

Fix #4863: Add tests

@LPTK
Copy link
Contributor

LPTK commented Apr 15, 2019

Will it be possible to compose the message at compile-time using inline methods with constant folding or staging?

Also, an additional compileTimeError method would be useful, to avoid the roundabout @compileTimeOnly("...") val res = ???; res pattern.

@liufengyun
Copy link
Contributor Author

Clarify the relation to erased.

case S(m) => m
case Z =>
@compileTimeOnly("n cannot be Z") val res = ???
res
Copy link
Contributor Author

Choose a reason for hiding this comment

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

scala.compiletime.error("n cannot be Z") does the job.

@liufengyun
Copy link
Contributor Author

@LPTK Const folding will work for scala.compiletime.error in macros, if the parameter is inline -- for just inline methods, currently the compiler does not do that.

@liufengyun liufengyun changed the title Fix #4863: support @compileTimeOnly Fix #4863: Add tests Apr 15, 2019
@liufengyun liufengyun merged commit defe9ab into scala:master Apr 15, 2019
@liufengyun liufengyun deleted the fix-4863 branch April 15, 2019 16:23
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.

Prevent Pattern Match Exhaustivity Warning for transparent
3 participants