-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Use inline flag instead of @inline annotation #1677
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -521,6 +521,7 @@ class Namer { typer: Typer => | |
mergeCompanionDefs() | ||
val ctxWithStats = (ctx /: stats) ((ctx, stat) => indexExpanded(stat)(ctx)) | ||
createCompanionLinks(ctxWithStats) | ||
//stats foreach enterAnnotations | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Stray comment? |
||
ctxWithStats | ||
} | ||
|
||
|
@@ -568,19 +569,9 @@ class Namer { typer: Typer => | |
val cls = typedAheadAnnotation(annotTree) | ||
val ann = Annotation.deferred(cls, implicit ctx => typedAnnotation(annotTree)) | ||
denot.addAnnotation(ann) | ||
if (cls == defn.InlineAnnot) { | ||
hasInlineAnnot = true | ||
addInlineInfo(denot, original) | ||
} | ||
} | ||
if (!hasInlineAnnot && denot.is(InlineMethod)) { | ||
// create a @inline annotation. Currently, the inlining trigger | ||
// is really the annotation, not the flag. This is done so that | ||
// we can still compile inline methods from Scala2x. Once we stop | ||
// being compatible with Scala2 we should revise the logic to | ||
// be based on the flag. Then creating a separate annotation becomes unnecessary. | ||
denot.addAnnotation(Annotation(defn.InlineAnnot)) | ||
addInlineInfo(denot, original) | ||
if (cls == defn.InlineAnnot && denot.is(Method, butNot = Accessor)) | ||
denot.setFlag(Inline) | ||
if (denot.isInlineMethod) addInlineInfo(denot, original) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This means that |
||
} | ||
case _ => | ||
} | ||
|
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.
Is the
butNot
still necessary? Do accessors get the inline flag too somehow?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.
They might if we have an accessor of an inline val. Better play it safe.