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

Unified Diff: tests/lib/mirrors/metadata_allowed_values_test.dart

Issue 1534033003: VM: Fix crash parsing metadata with a closure as a const constructor argument. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years 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 | « tests/lib/lib.status ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/lib/mirrors/metadata_allowed_values_test.dart
diff --git a/tests/lib/mirrors/metadata_allowed_values_test.dart b/tests/lib/mirrors/metadata_allowed_values_test.dart
index ce1011b44f550971bfade059e526f61931e295aa..76a5c58b575526d60d435ce08e459cc41dfa6caf 100644
--- a/tests/lib/mirrors/metadata_allowed_values_test.dart
+++ b/tests/lib/mirrors/metadata_allowed_values_test.dart
@@ -149,6 +149,30 @@ class KK {
}
get kk => const KK();
+@LL(() => 42) /// 28: compile-time error
+class LL {
+ final field;
+ const LL(this.field);
+}
+
+@MM((x) => 42) /// 29: compile-time error
+class MM {
+ final field;
+ const MM(this.field);
+}
+
+@NN(() {}) /// 30: compile-time error
+class NN {
+ final field;
+ const NN(this.field);
+}
+
+@OO(() { () {} }) /// 31: compile-time error
+class OO {
+ final field;
+ const OO(this.field);
+}
+
checkMetadata(DeclarationMirror mirror, List expectedMetadata) {
Expect.listEquals(expectedMetadata.map(reflect).toList(), mirror.metadata);
}
@@ -191,4 +215,8 @@ main() {
reflectClass(II).metadata;
reflectClass(JJ).metadata;
reflectClass(KK).metadata;
+ reflectClass(LL).metadata;
+ reflectClass(MM).metadata;
+ reflectClass(NN).metadata;
+ reflectClass(OO).metadata;
}
« no previous file with comments | « tests/lib/lib.status ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698