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

Unified Diff: pkg/analyzer/test/generated/resolver_test.dart

Issue 1309243007: Stop propagating return types for top-level function declarations (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Added test of function expression propagation 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/incremental_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/generated/resolver_test.dart
diff --git a/pkg/analyzer/test/generated/resolver_test.dart b/pkg/analyzer/test/generated/resolver_test.dart
index 6463a7bd24ad53f3825021b6dca2585fc3d6a10d..fd2b01664661776a3364b5699a779b74329e59a0 100644
--- a/pkg/analyzer/test/generated/resolver_test.dart
+++ b/pkg/analyzer/test/generated/resolver_test.dart
@@ -13443,72 +13443,6 @@ f1(x) {
typeProvider.stringType);
}
- void test_propagatedReturnType_function_hasReturnType_returnsNull() {
- String code = r'''
-String f() => null;
-main() {
- var v = f();
-}''';
- _assertPropagatedAssignedType(
- code, typeProvider.dynamicType, typeProvider.stringType);
- }
-
- void test_propagatedReturnType_function_lessSpecificStaticReturnType() {
- String code = r'''
-Object f() => 42;
-main() {
- var v = f();
-}''';
- _assertPropagatedAssignedType(
- code, typeProvider.dynamicType, typeProvider.intType);
- }
-
- void test_propagatedReturnType_function_moreSpecificStaticReturnType() {
- String code = r'''
-int f(v) => (v as num);
-main() {
- var v = f(3);
-}''';
- _assertPropagatedAssignedType(
- code, typeProvider.dynamicType, typeProvider.intType);
- }
-
- void test_propagatedReturnType_function_noReturnTypeName_blockBody_multipleReturns() {
- String code = r'''
-f() {
- if (true) return 0;
- return 1.0;
-}
-main() {
- var v = f();
-}''';
- _assertPropagatedAssignedType(
- code, typeProvider.dynamicType, typeProvider.numType);
- }
-
- void test_propagatedReturnType_function_noReturnTypeName_blockBody_oneReturn() {
- String code = r'''
-f() {
- var z = 42;
- return z;
-}
-main() {
- var v = f();
-}''';
- _assertPropagatedAssignedType(
- code, typeProvider.dynamicType, typeProvider.intType);
- }
-
- void test_propagatedReturnType_function_noReturnTypeName_expressionBody() {
- String code = r'''
-f() => 42;
-main() {
- var v = f();
-}''';
- _assertPropagatedAssignedType(
- code, typeProvider.dynamicType, typeProvider.intType);
- }
-
void test_propagatedReturnType_localFunction() {
String code = r'''
main() {
« no previous file with comments | « pkg/analyzer/test/generated/incremental_resolver_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698