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

Unified Diff: pkg/analyzer/test/src/task/dart_test.dart

Issue 1465303002: Propagate types for import/export closure before resolving. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 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/test/generated/resolver_test.dart ('k') | pkg/analyzer/tool/task_dependency_graph/tasks.dot » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/src/task/dart_test.dart
diff --git a/pkg/analyzer/test/src/task/dart_test.dart b/pkg/analyzer/test/src/task/dart_test.dart
index b73eeae57c51c739471bd2e94fbe15f7fb5970de..8b2bae5512988c865be34a2c9c0ec83df0b11018 100644
--- a/pkg/analyzer/test/src/task/dart_test.dart
+++ b/pkg/analyzer/test/src/task/dart_test.dart
@@ -3537,6 +3537,33 @@ class C {
expect(outputs[RESOLVE_UNIT_ERRORS], hasLength(0));
}
+ void test_perform_ensurePropagatedVariableTypes() {
+ newSource(
+ '/lib.dart',
+ '''
+class A {
+ final v = 1;
+}
+''');
+ AnalysisTarget source = newSource(
+ '/test.dart',
+ '''
+import 'lib.dart';
+main(A a) {
+ a.v.isEven;
+}
+''');
+ computeResult(new LibrarySpecificUnit(source, source), RESOLVED_UNIT10,
+ matcher: isResolveUnitTask);
+ expect(outputs[RESOLVE_UNIT_ERRORS], hasLength(0));
+ CompilationUnit unit = outputs[RESOLVED_UNIT10];
+ FunctionDeclaration main = unit.declarations[0];
+ BlockFunctionBody body = main.functionExpression.body;
+ ExpressionStatement statement = body.block.statements.single;
+ Expression expression = statement.expression;
+ expect(expression.bestType, context.typeProvider.boolType);
+ }
+
void _assertResolved(FunctionBody body) {
ResolutionVerifier verifier = new ResolutionVerifier();
body.accept(verifier);
« no previous file with comments | « pkg/analyzer/test/generated/resolver_test.dart ('k') | pkg/analyzer/tool/task_dependency_graph/tasks.dot » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698