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

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

Issue 1331843004: Addition bug fixes for new task model (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 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/test/generated/resolver_test.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/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 f4fe1211e320d9b7eee88867d10b8472ba2a2c5d..f14bbfb2e8b44cf6d9d9a24231233695014c33a5 100644
--- a/pkg/analyzer/test/src/task/dart_test.dart
+++ b/pkg/analyzer/test/src/task/dart_test.dart
@@ -1911,7 +1911,28 @@ class Z {}
@reflectiveTest
class InferStaticVariableTypesInUnitTaskTest extends _AbstractDartTaskTest {
- void test_perform() {
+ void fail_perform_nestedDeclarations() {
+ enableStrongMode();
+ AnalysisTarget source = newSource(
+ '/test.dart',
+ '''
+var Y = (int x, int y) {
+ int squared(int value) => value * value;
+ var xSquared = squared(x);
+ var ySquared = squared(y);
+ return Math.sqrt(xSquared + ySquared);
+};
+''');
+ computeResult(new LibrarySpecificUnit(source, source), RESOLVED_UNIT6,
+ matcher: isInferStaticVariableTypesInUnitTask);
+ CompilationUnit unit = outputs[RESOLVED_UNIT6];
+ VariableDeclaration variableY = getTopLevelVariable(unit, 'Y');
+
+ InterfaceType intType = context.typeProvider.intType;
+ expect(variableY.initializer.staticType, intType);
+ }
+
+ void test_perform_recursive() {
enableStrongMode();
AnalysisTarget firstSource = newSource(
'/first.dart',
« no previous file with comments | « pkg/analyzer/test/generated/resolver_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698