-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Simplify ClassfileParser#innerClasses#classSymbol #3813
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
smarter
commented
Jan 11, 2018
- Avoid redundant calls to get
- Fix indentation of getMember and add some brackets to make it clearer
val owner = classNameToSymbol(outerName) | ||
val result = ctx.atPhaseNotLaterThan(ctx.typerPhase) { implicit ctx => | ||
getMember(owner, innerName.toTypeName) | ||
} |
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.
Simpler?
getMember(owner, innerName.toTypeName)(ctx.withPhaseNoLater(ctx.typerPhase))
} | ||
assert(result ne NoSymbol, | ||
i"""failure to resolve inner class: | ||
|externalName = ${entry.externalName}, |
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.
Indentation is off
} | ||
} | ||
else { | ||
if (sym == classRoot.symbol) |
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.
You could reduce nesting:
if (isStatic(entry.jflags)) {
...
}
else if (sym == classRoot.symbol)
instanceScope.lookup(name)
else
sym.info.member(name).symbol
- Avoid redundant calls to get - Fix indentation of getMember and add some brackets to make it clearer
1a1e932
to
3c0efe8
Compare
Comments addressed, thanks @allanrenucci ! |