-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix #6419: Support @compileTimeOnly #6424
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
Conversation
ae35b5e
to
4b3d0c1
Compare
} | ||
case _ => // OK | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In RefChecks.scala
, there is commented code:
/* (Not enabled yet)
* See an explanation of compileTimeOnly in its scaladoc at scala.annotation.compileTimeOnly.
*
if (sym.isCompileTimeOnly) {
def defaultMsg =
sm"""Reference to ${sym.fullLocationString} should not have survived past type checking,
|it should have been processed and eliminated during expansion of an enclosing macro."""
// The getOrElse part should never happen, it's just here as a backstop.
ctx.error(sym.compileTimeOnlyMessage getOrElse defaultMsg, pos)
}*/
Maybe we should just revive the code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, it would not take into account if it is into an erased context or not. Which is already performed in the place where I check it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As in https://github.com/lampepfl/dotty/pull/6424/files#diff-a12cb93e6ac05566103dd86ede6e5901R12, where the reference of the @compileTimeOnly
is inside an erased def
193da2e
to
d530970
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to drop scalatest changes and rebase over #6444.
Otherwise, LGTM
Caught by @compileTimeOnly
Dropped scalatest changes and rebased |
Support @compileTimeOnly and remove migration waining (see #6419 (comment)).