-
Notifications
You must be signed in to change notification settings - Fork 1.1k
TypeTestCasts fixes and InterceptedMethods transformer #103
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
TypeTestCasts fixes and InterceptedMethods transformer #103
Conversation
Took Martin's comments into account, @gzm0 please have a look. |
Since #102 is merged, can you please rebase this. |
it's actually already rebased if you have a look on the branch itself |
It's not rebased on the merge commit in the master (e448049). This will make the commit history look like if this is a long-lived branch. |
I didn't know that, thanks. |
@@ -126,12 +126,21 @@ class Definitions { | |||
|
|||
lazy val AnyValClass: ClassSymbol = ctx.requiredClass("scala.AnyVal") | |||
|
|||
lazy val AnyVal_getClass = AnyValClass.requiredMethod(nme.getClass_) |
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.
Indent this.
|
That's all |
def p() = println().isInstanceOf[Long & Int] was rewritten to val ev$1: [T0]Boolean(x.isInstanceOf) = println().isInstanceOf println().$isInstanceOf[Long & Int].&&(println().$isInstanceOf[Long & Int])
@gzm0 I had took your comment into account, special thanks for telling me what I didn't know about hashcodes on Longs. |
Moved definitions into phase, updated commit message. |
poundPoundMethods = Set(defn.Any_##, defn.Object_##) | ||
Any_comparisons = Set(defn.Any_==, defn.Any_!=) | ||
interceptedMethods = getClassMethods ++ poundPoundMethods ++ Any_comparisons | ||
primitiveGetClassMethods = Set[Symbol](defn.Any_getClass, defn.AnyVal_getClass) ++ defn.ScalaValueClasses.map(x => x.requiredMethod(nme.getClass_)) |
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 line is too long.
Replace member references for: methods inside Any( == and !=) ## on primitives .getClass on primitives
@gzm0, can we merge? |
LGTM |
TypeTestCasts fixes and InterceptedMethods transformer
depends on #102, only commits fef2f42 652553d are new here