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

Side by Side Diff: pkg/analyzer/test/generated/strong_mode_test.dart

Issue 2209293002: fix #26414, infer return types of local functions (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: mark failing ast inference Created 4 years, 4 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library analyzer.test.generated.strong_mode_test; 5 library analyzer.test.generated.strong_mode_test;
6 6
7 import 'package:analyzer/dart/ast/ast.dart'; 7 import 'package:analyzer/dart/ast/ast.dart';
8 import 'package:analyzer/dart/element/element.dart'; 8 import 'package:analyzer/dart/element/element.dart';
9 import 'package:analyzer/dart/element/type.dart'; 9 import 'package:analyzer/dart/element/type.dart';
10 import 'package:analyzer/src/dart/element/element.dart'; 10 import 'package:analyzer/src/dart/element/element.dart';
(...skipping 1727 matching lines...) Expand 10 before | Expand all | Expand 10 after
1738 } 1738 }
1739 1739
1740 void test_genericMethod_nestedFunctions() { 1740 void test_genericMethod_nestedFunctions() {
1741 resolveTestUnit(r''' 1741 resolveTestUnit(r'''
1742 /*=S*/ f/*<S>*/(/*=S*/ x) { 1742 /*=S*/ f/*<S>*/(/*=S*/ x) {
1743 g/*<S>*/(/*=S*/ x) => f; 1743 g/*<S>*/(/*=S*/ x) => f;
1744 return null; 1744 return null;
1745 } 1745 }
1746 '''); 1746 ''');
1747 expectIdentifierType('f', '<S>(S) → S'); 1747 expectIdentifierType('f', '<S>(S) → S');
1748 expectIdentifierType('g', '<S>(S) → dynamic'); 1748 expectIdentifierType('g', '<S>(S) → <S>(S) → S');
1749 } 1749 }
1750 1750
1751 void test_genericMethod_override() { 1751 void test_genericMethod_override() {
1752 resolveTestUnit(r''' 1752 resolveTestUnit(r'''
1753 class C { 1753 class C {
1754 /*=T*/ f/*<T>*/(/*=T*/ x) => null; 1754 /*=T*/ f/*<T>*/(/*=T*/ x) => null;
1755 } 1755 }
1756 class D extends C { 1756 class D extends C {
1757 /*=T*/ f/*<T>*/(/*=T*/ x) => null; // from D 1757 /*=T*/ f/*<T>*/(/*=T*/ x) => null; // from D
1758 } 1758 }
(...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after
2308 main() { 2308 main() {
2309 var v = x; 2309 var v = x;
2310 v; // marker 2310 v; // marker
2311 } 2311 }
2312 int x = 3; 2312 int x = 3;
2313 '''; 2313 ''';
2314 assertPropagatedAssignedType(code, typeProvider.intType, null); 2314 assertPropagatedAssignedType(code, typeProvider.intType, null);
2315 assertTypeOfMarkedExpression(code, typeProvider.intType, null); 2315 assertTypeOfMarkedExpression(code, typeProvider.intType, null);
2316 } 2316 }
2317 } 2317 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/generated/static_type_analyzer.dart ('k') | pkg/analyzer/test/src/summary/resynthesize_ast_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698