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

Unified Diff: pkg/analyzer/test/src/summary/summary_common.dart

Issue 2668493002: Issue 28547. Fix for summarizing code with invalid type parameter reference. (Closed)
Patch Set: Handle invalid type parameter reference in expressions. Created 3 years, 11 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/analyzer/test/src/summary/resynthesize_common.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/src/summary/summary_common.dart
diff --git a/pkg/analyzer/test/src/summary/summary_common.dart b/pkg/analyzer/test/src/summary/summary_common.dart
index 3dd4f0c8ce2fa8e9cf61745ce5427eef17698f15..d7a25f35190fe49516009fb11168e80499249837 100644
--- a/pkg/analyzer/test/src/summary/summary_common.dart
+++ b/pkg/analyzer/test/src/summary/summary_common.dart
@@ -7500,6 +7500,19 @@ final v = ((a, b) => 42)(1, 2);
]);
}
+ test_expr_invalid_typeParameter_asPrefix() {
+ if (skipNonConstInitializers) {
+ return;
+ }
+ var c = serializeClassText('''
+class C<T> {
+ final f = T.k;
+}
+''');
+ assertUnlinkedConst(c.fields[0].initializer.bodyExpr,
+ isValidConst: false, operators: []);
+ }
+
test_expr_invokeMethod_instance() {
if (skipNonConstInitializers) {
return;
@@ -9888,6 +9901,17 @@ void f<T, U>(bool b) {
checkDynamicTypeRef(serializeTypeText('dynamic'));
}
+ test_type_invalid_typeParameter_asPrefix() {
+ UnlinkedClass c = serializeClassText('''
+class C<T> {
+ m(T.K p) {}
+}
+''');
+ UnlinkedExecutable m = c.executables[0];
+ expect(m.name, 'm');
+ checkTypeRef(m.parameters[0].type, null, null, 'dynamic');
+ }
+
test_type_param_codeRange() {
if (!includeInformative) return;
UnlinkedClass cls =
« no previous file with comments | « pkg/analyzer/test/src/summary/resynthesize_common.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698