diff options
author | Eugene Burmako <xeno.by@gmail.com> | 2012-08-06 19:37:07 +0200 |
---|---|---|
committer | Eugene Burmako <xeno.by@gmail.com> | 2012-08-06 23:09:33 +0200 |
commit | 7bcb9da47362ba862a695f7c82c0095a8205e3e2 (patch) | |
tree | f3434a982cb3104a1abc7f1fd3f4751f5e896da7 /test/files/run/reflection-sanitychecks.check | |
parent | 3cbe07f3e3ddb7201d1d174399d14d4a69df52fd (diff) | |
download | scala-7bcb9da47362ba862a695f7c82c0095a8205e3e2.tar.gz scala-7bcb9da47362ba862a695f7c82c0095a8205e3e2.tar.bz2 scala-7bcb9da47362ba862a695f7c82c0095a8205e3e2.zip |
mirrors now support overriden fields and methods
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.
Diffstat (limited to 'test/files/run/reflection-sanitychecks.check')
-rw-r--r-- | test/files/run/reflection-sanitychecks.check | 42 |
1 files changed, 30 insertions, 12 deletions
diff --git a/test/files/run/reflection-sanitychecks.check b/test/files/run/reflection-sanitychecks.check index 4881285bc0..a1df486b51 100644 --- a/test/files/run/reflection-sanitychecks.check +++ b/test/files/run/reflection-sanitychecks.check @@ -1,12 +1,30 @@ -field: 1
-method: 2
-constructor #1: scala.ScalaReflectionException: expected a constructor of class C, you provided method bar
-constructor #2: an instance of class C
-class: CC
-object: java.lang.Error: inner and nested modules are not supported yet
-field: scala.ScalaReflectionException: expected a member of class C, you provided value D.foo
-method: scala.ScalaReflectionException: expected a member of class C, you provided method D.bar
-constructor #1: scala.ScalaReflectionException: expected a constructor of class C, you provided method bar
-constructor #2: scala.ScalaReflectionException: expected a constructor of class C, you provided constructor D
-class: scala.ScalaReflectionException: expected a member of class C, you provided class D.C
-object: scala.ScalaReflectionException: expected a member of class C, you provided object D.O
+=========members of C in a mirror of D========= +field #1: 11 +method #1: 22 +field #2: 13 +method #2: 14 +constructor #1: scala.ScalaReflectionException: expected a constructor of class D, you provided method bar +constructor #2: scala.ScalaReflectionException: expected a constructor of class D, you provided constructor C +class: CC +object: java.lang.Error: inner and nested modules are not supported yet + +=========members of D in a mirror of D========= +field #1: 21 +method #1: 22 +field #2: 13 +method #2: 14 +constructor #1: scala.ScalaReflectionException: expected a constructor of class D, you provided method bar +constructor #2: an instance of class D +class: CC +object: java.lang.Error: inner and nested modules are not supported yet + +=========members of E in a mirror of D========= +field #1: scala.ScalaReflectionException: expected a member of class D, you provided value E.foo +method #1: scala.ScalaReflectionException: expected a member of class D, you provided method E.bar +field #2: scala.ScalaReflectionException: expected a member of class D, you provided value E.quux +method #2: scala.ScalaReflectionException: expected a member of class D, you provided method E.baz +constructor #1: scala.ScalaReflectionException: expected a constructor of class D, you provided method bar +constructor #2: scala.ScalaReflectionException: expected a constructor of class D, you provided constructor E +class: scala.ScalaReflectionException: expected a member of class D, you provided class E.C +object: scala.ScalaReflectionException: expected a member of class D, you provided object E.O + |