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

Unified Diff: pkg/analyzer/test/src/context/context_test.dart

Issue 2161163003: Fix closure parameter types propagation after limited invalidation. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 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/analyzer/lib/src/generated/resolver.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/context/context_test.dart
diff --git a/pkg/analyzer/test/src/context/context_test.dart b/pkg/analyzer/test/src/context/context_test.dart
index c0a9b318cab0574a00ad4e75d9463d7307543eb3..bde82f90eaaa0197652e59ba87bc42e27d2d7670 100644
--- a/pkg/analyzer/test/src/context/context_test.dart
+++ b/pkg/analyzer/test/src/context/context_test.dart
@@ -3470,6 +3470,35 @@ class A {
expect(context.getErrors(b).errors, hasLength(1));
}
+ void test_sequence_closeParameterTypesPropagation() {
+ Source a = addSource(
+ '/a.dart',
+ r'''
+main() {
+ f((p) => 4.2);
+}
+f(c(int p)) {}
+''');
+ _performPendingAnalysisTasks();
+ LibrarySpecificUnit targetA = new LibrarySpecificUnit(a, a);
+ // Update and analyze.
+ String newCode = r'''
+newFunction() {}
+main() {
+ f((p) => 4.2);
+}
+f(c(int p)) {}
+''';
+ context.setContents(a, newCode);
+ _performPendingAnalysisTasks();
+ // Validate "(p) => 4.2" types.
+ CompilationUnit unit = context.getResult(targetA, RESOLVED_UNIT2);
+ SimpleIdentifier parameterName =
+ EngineTestCase.findSimpleIdentifier(unit, newCode, 'p) => 4.2);');
+ expect(parameterName.staticType, context.typeProvider.dynamicType);
+ expect(parameterName.propagatedType, context.typeProvider.intType);
+ }
+
void test_sequence_inBodyChange_addRef_deltaChange() {
Source a = addSource(
'/a.dart',
« no previous file with comments | « pkg/analyzer/lib/src/generated/resolver.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698