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

Unified Diff: pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/classes.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/test/compile_error_tests.dart ('k') | tests/lib_strong/mirrors/field_metadata_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/classes.dart
diff --git a/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/classes.dart b/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/classes.dart
index 69281b050e70a008d938238b3818fbf5cadd69f0..c7b57180345c52a334056562f02a5b89a16c61ca 100644
--- a/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/classes.dart
+++ b/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/classes.dart
@@ -237,6 +237,14 @@ getSetterType(type, name) {
if (type != null) {
// TODO(jmesserly): it would be nice not to encode setters with a full
// function type.
+ if (JS('bool', '# instanceof Array', type)) {
+ // The type has metadata attached. Pull out just the type.
+ // TODO(vsm): Come up with a more robust encoding for this or remove
+ // if we can deprecate mirrors.
+ // Essentially, we've got a FunctionType or a
+ // [FunctionType, metadata1, ..., metadataN].
+ type = JS('', '#[0]', type);
+ }
return JS('', '#.args[0]', type);
}
}
« no previous file with comments | « pkg/dev_compiler/test/compile_error_tests.dart ('k') | tests/lib_strong/mirrors/field_metadata_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698