ObjectMirror#setField return value doesn't match docs #14816
Labels
area-core-library
SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries.
library-mirrors
This issue was originally filed by @seaneagan
From http://api.dartlang.org/docs/bleeding_edge/dart_mirrors/ObjectMirror.html#setField:
If the invocation returns a result r, this method returns the result of calling reflect.
http://api.dartlang.org/docs/bleeding_edge/dart_mirrors/ObjectMirror.html#setField
But it actually just returns the RHS of the setter call.
Example:
class SetterTest {
set foo(v) => 5;
}
class NoSuchMethodTest {
noSuchMethod(Invocation invocation) => 5;
}
main() {
print(new SetterTest().foo = 3);
print(new NoSuchMethodTest().foo = 3);
}
prints:
3
3
not:
5
5
The text was updated successfully, but these errors were encountered: