-
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
Conversation
Convert `@inline` annotations to `inline` flags, not the other way round as was done before.
is(Method, butNot = Accessor) && | ||
!isCompleting && // don't force method type; recursive inlines are ignored anyway. | ||
hasAnnotation(defn.InlineAnnot) | ||
def isInlineMethod(implicit ctx: Context): Boolean = is(InlineMethod, butNot = Accessor) |
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.
@@ -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 comment
The reason will be displayed to describe this comment to others. Learn more.
Stray comment?
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 comment
The reason will be displayed to describe this comment to others. Learn more.
This means that addInlineInfo
will be called for every annotation if the method is marked inline, previously hasInlineAnnot
prevented that.
Merging now, because there's more to come... |
Convert
@inline
annotations toinline
flags, not theother way round as was done before.
This is the first step to fixing #1647, which requires a reorganization how
annotations are handled.
I wanted to get the irregular treatement of inline annotations out of the way before trying this.
Review by @smarter. Feel free to cherry-pick for getting the new repo structure to work.