Skip to content

SI-6178 reflective invocation of magic symbols#1048

Closed
xeno-by wants to merge 1 commit intoscala:2.10.xfrom
scalamacros:ticket/6178
Closed

SI-6178 reflective invocation of magic symbols#1048
xeno-by wants to merge 1 commit intoscala:2.10.xfrom
scalamacros:ticket/6178

Conversation

@xeno-by
Copy link
Contributor

@xeno-by xeno-by commented Aug 4, 2012

In Scala there are some methods that only exist in symbol tables,
but don't have corresponding method entries in Java class files.

To the best of my knowledge, these methods can be subdivided into four groups:

  1. stuff weaved onto Any, AnyVal and AnyRef,
  2. magic methods that Scala exposes to fix Java arrays,
  3. compile-time methods (such as classOf and all kinds of macros),
  4. miscellaneous stuff (currently only String_+).

To support these magic symbols, I've modified the checkMemberOf validator
to special case Any/AnyVal/AnyRef methods and adjusted MethodMirror and
ConstructorMirror classes to use special invokers for those instead of
relying on Java reflection.

In Scala there are some methods that only exist in symbol tables,
but don't have corresponding method entries in Java class files.

To the best of my knowledge, these methods can be subdivided into four groups:
1) stuff weaved onto Any, AnyVal and AnyRef,
2) magic methods that Scala exposes to fix Java arrays,
3) compile-time methods (such as classOf and all kinds of macros),
4) miscellaneous stuff (currently only String_+).

To support these magic symbols, I've modified the `checkMemberOf` validator
to special case Any/AnyVal/AnyRef methods and adjusted MethodMirror and
ConstructorMirror classes to use special invokers for those instead of
relying on Java reflection.
@xeno-by
Copy link
Contributor Author

xeno-by commented Aug 4, 2012

review by @paulp, @odersky or @gkossakowski

@scala-jenkins
Copy link

Started jenkins job pr-rangepos at https://scala-webapps.epfl.ch/jenkins/job/pr-rangepos/58/

@scala-jenkins
Copy link

Started jenkins job pr-scala-testsuite-linux-opt at https://scala-webapps.epfl.ch/jenkins/job/pr-scala-testsuite-linux-opt/762/

@scala-jenkins
Copy link

jenkins job pr-rangepos: Success - https://scala-webapps.epfl.ch/jenkins/job/pr-rangepos/58/

@scala-jenkins
Copy link

jenkins job pr-scala-testsuite-linux-opt: Success - https://scala-webapps.epfl.ch/jenkins/job/pr-scala-testsuite-linux-opt/762/

@paulp
Copy link
Contributor

paulp commented Aug 6, 2012

My review is: https://github.com/paulp/scala/tree/scalamacros/ticket/6178

I'd have just added it to the pull request if I could figure out how. Since I can't, can you add it?

It's a lot easier to avoid duplication as you go than it is to clean it up later (and a lot more likely to be done by someone other than me.) And bugs often turn obvious once all the noise is stripped away, as happened here.

@xeno-by
Copy link
Contributor Author

xeno-by commented Aug 6, 2012

Thanks! I'll add this commit to the ultimate pull request that will unify all the stuff currently in flight.

@xeno-by
Copy link
Contributor Author

xeno-by commented Aug 6, 2012

Will be resubmitted jointly with #1048, #1052, #1054 and #1057.

@xeno-by xeno-by closed this Aug 6, 2012
@xeno-by
Copy link
Contributor Author

xeno-by commented Aug 6, 2012

Superceded by #1067

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