Skip to content

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

Merged
merged 2 commits into from
Apr 2, 2014

Conversation

DarkDimius
Copy link
Contributor

depends on #102, only commits fef2f42 652553d are new here

@DarkDimius
Copy link
Contributor Author

@odersky and @gzm0 please review

@DarkDimius
Copy link
Contributor Author

Took Martin's comments into account, @gzm0 please have a look.

@gzm0
Copy link
Contributor

gzm0 commented Apr 1, 2014

Since #102 is merged, can you please rebase this.

@DarkDimius
Copy link
Contributor Author

it's actually already rebased if you have a look on the branch itself
https://github.com/DarkDimius/dotty/compare/transform;erasure-transforms you'll see that only 2 commits differ.

@gzm0
Copy link
Contributor

gzm0 commented Apr 1, 2014

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.

@DarkDimius
Copy link
Contributor Author

I didn't know that, thanks.
I've rebased.

@@ -126,12 +126,21 @@ class Definitions {

lazy val AnyValClass: ClassSymbol = ctx.requiredClass("scala.AnyVal")

lazy val AnyVal_getClass = AnyValClass.requiredMethod(nme.getClass_)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indent this.

@gzm0
Copy link
Contributor

gzm0 commented Apr 1, 2014

InterceptedMethods has way too long lines. Please split them so the file remains readable.

@gzm0
Copy link
Contributor

gzm0 commented Apr 1, 2014

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])
@DarkDimius
Copy link
Contributor Author

@gzm0 I had took your comment into account, special thanks for telling me what I didn't know about hashcodes on Longs.
I simplified implementation now, to have only single place where hashcode values are defined - in ScalaRuntime.

@DarkDimius
Copy link
Contributor Author

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_))
Copy link
Contributor

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
@DarkDimius
Copy link
Contributor Author

@gzm0, can we merge?

@gzm0
Copy link
Contributor

gzm0 commented Apr 2, 2014

LGTM

DarkDimius added a commit that referenced this pull request Apr 2, 2014
TypeTestCasts fixes and InterceptedMethods transformer
@DarkDimius DarkDimius merged commit e52fa50 into scala:master Apr 2, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants