Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(227)

Unified Diff: tests/lib_strong/mirrors/field_metadata_test.dart

Issue 2986673002: Fix getSetterType in presence of metadata (Closed)
Patch Set: Rebase Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/classes.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/lib_strong/mirrors/field_metadata_test.dart
diff --git a/tests/lib_strong/mirrors/field_metadata_test.dart b/tests/lib_strong/mirrors/field_metadata_test.dart
index d64144dffbed799c8b0662409a82e6cc80b27987..a8db33dfb3c297d32d8954a6e397b18557543226 100644
--- a/tests/lib_strong/mirrors/field_metadata_test.dart
+++ b/tests/lib_strong/mirrors/field_metadata_test.dart
@@ -17,6 +17,11 @@ class Foo {
@Bar('baz')
final String y = 'hi';
+
+ @Bar('foo')
+ void set z(int val) {
+ x = val;
+ }
}
void main() {
@@ -28,6 +33,12 @@ void main() {
Expect.equals(f.x, 42);
Expect.equals(f.y, 'hi');
+ Expect.throws(() {
+ f.z = 'hello';
+ });
+ f.z = 0;
+ Expect.equals(f.x, 0);
+
var members = reflect(f).type.declarations;
var x = members[#x] as VariableMirror;
var y = members[#y] as VariableMirror;
« no previous file with comments | « pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/classes.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698