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

Unified Diff: pkg/analyzer/lib/src/summary/link.dart

Issue 2351133004: Fix for out of scope type parameters in members. (Closed)
Patch Set: Created 4 years, 3 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/lib/src/dart/element/member.dart ('k') | pkg/analyzer/test/src/dart/element/element_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/summary/link.dart
diff --git a/pkg/analyzer/lib/src/summary/link.dart b/pkg/analyzer/lib/src/summary/link.dart
index 6ed601185e1a7c4d0260281fb60d9171fdbf4651..c805aebf36d9b8fdce6f91e5cddf7c0d5dcf8fb5 100644
--- a/pkg/analyzer/lib/src/summary/link.dart
+++ b/pkg/analyzer/lib/src/summary/link.dart
@@ -189,10 +189,8 @@ EntityRefBuilder _createLinkedType(
result.paramReference =
typeParameterContext.typeParameterNestingLevel - element.nestingLevel;
} else {
- // Out-of-scope type parameters only occur in circumstances where they
- // are irrelevant (i.e. when a type parameter is unused). So we can
- // safely convert them to `dynamic`.
- result.reference = compilationUnit.addRawReference('dynamic');
+ throw new StateError('The type parameter $type (in ${element?.location}) '
+ 'is out of scope on ${typeParameterContext?.location}.');
}
return result;
} else if (type is FunctionType) {
« no previous file with comments | « pkg/analyzer/lib/src/dart/element/member.dart ('k') | pkg/analyzer/test/src/dart/element/element_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698