| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
| |
Our name mangling scheme w.r.t stuff nested into objects conflicts
with JVM's ideas of beauty, which messes up getDeclaredClasses.
Scala reflection needs getDeclaredClasses to convert between Scala and Java,
so the situation looked grim. Greg suggested a workaround described in:
https://issues.scala-lang.org/browse/SI-4023?focusedCommentId=54759#comment-54759.
Luckily the workaround worked!
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously `checkMemberOf` was blocking base fields and methods
that are overriden in receiver.getClass. Now this is fixed.
The fix also uncovered an issue with field mirrors. Currently
their `get` and `set` methods don't respect overriding and always
return field values from a base class.
After discussing this on a reflection meeting, we decided that this
behavior is desirable and that for overriding people should use
reflectMethod and then apply on getters/setters. See the discussion at:
https://github.com/scala/scala/pull/1054.
|
|
|
|
|
|
|
|
| |
In 911bbc4 I've completely overlooked the fact that
reflectConstructor exists and that is also needs sanity checks.
Now reflectConstructor checks that the incoming symbol is actually a ctor,
and that it is actually a ctor of the class reflected by the current mirror.
|
|
Factors out error raising code and introduces a special exception class
for Scala reflection errors.
Also adds membership sanity checks to reflectXXX. Previously
reflectField, reflectMethod, reflectClass and reflectModule
in InstanceMirror didn't check that the symbols being passed to them
actually correspond to some member of the related class.
|