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', |