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

Unified Diff: pkg/analyzer/test/src/dart/analysis/index_test.dart

Issue 2537883002: Don't attempt to record reference to a named parameter of a synthetic function. (Closed)
Patch Set: Created 4 years, 1 month 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/analysis/index.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/dart/analysis/index_test.dart
diff --git a/pkg/analyzer/test/src/dart/analysis/index_test.dart b/pkg/analyzer/test/src/dart/analysis/index_test.dart
index d090dbb85232f681bb2ad9db6c8b2eaedf6f3ec3..51fb995a9a4a7e86af1113316619843540afdb1e 100644
--- a/pkg/analyzer/test/src/dart/analysis/index_test.dart
+++ b/pkg/analyzer/test/src/dart/analysis/index_test.dart
@@ -814,6 +814,18 @@ main() {
assertThat(element)..isReferencedAt('p: 1', true);
}
+ test_isReferencedBy_synthetic_leastUpperBound() async {
+ await _indexTestUnit('''
+int f1({int p}) => 1;
+int f2({int p}) => 2;
+main(bool b) {
+ var f = b ? f1 : f2;
+ f(p: 0);
+}''');
+ // We should not crash because of reference to "p" - a named parameter
+ // of a synthetic LUB FunctionElement created for "f".
+ }
+
test_isReferencedBy_TopLevelVariableElement() async {
provider.newFile(
_p('$testProject/lib.dart'),
« no previous file with comments | « pkg/analyzer/lib/src/dart/analysis/index.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698