-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Add message parameter to @experimental
annotation
#19935
Add message parameter to @experimental
annotation
#19935
Conversation
4972375
to
e99f5e5
Compare
It has been decided to be included in the 3.5.0 release. |
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.
Some small comments.
@@ -131,12 +131,7 @@ object Feature: | |||
|
|||
def checkExperimentalFeature(which: String, srcPos: SrcPos, note: => String = "")(using Context) = |
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.
It looks like the note
parameter is never used anymore.
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.
It is used here
report.error(experimentalUseSite(which) + note, srcPos)
^^^^
and comes from
// Checking.scala
Feature.checkExperimentalFeature("features", imp.srcPos,
s"\n\nNote: the scope enclosing the import is not considered experimental because it contains the\nnon-experimental $stable")
import Annotations.Annotation | ||
import Constants.Constant |
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.
Spurious changes.
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.
Removed
then | ||
sym.addAnnotation(Annotation(defn.ExperimentalAnnot, sym.span)) | ||
if sym.is(Module) then | ||
sym.companionClass.getAnnotation(defn.ExperimentalAnnot).foreach(sym.addAnnotation) |
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.
I don't think it is safe to take an annotation tree and put it in two different places in the AST. Consider creating an accurate copy instead.
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.
Added some helper methods in Annotations.ExperimentalAnnotation
.
e99f5e5
to
dbdfcff
Compare
I have an experimental function added to |
Once we bootstrap this addition, we will be able to enhance the messages of
@experimental
definitions in the library, the annotations added-experimental
and the ones we plan to add for language features in #19807.