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

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

Issue 1827243003: Allow values to be returned from implicitly typed setters (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 9 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 1951 matching lines...) Expand 10 before | Expand all | Expand 10 after
1962 class A { 1962 class A {
1963 set f(String s) { 1963 set f(String s) {
1964 return '42'; 1964 return '42';
1965 } 1965 }
1966 } 1966 }
1967 set g(int x) => 42; 1967 set g(int x) => 42;
1968 '''); 1968 ''');
1969 computeLibrarySourceErrors(source); 1969 computeLibrarySourceErrors(source);
1970 assertErrors(source, [ 1970 assertErrors(source, [
1971 StaticTypeWarningCode.RETURN_OF_INVALID_TYPE, 1971 StaticTypeWarningCode.RETURN_OF_INVALID_TYPE,
1972 StaticTypeWarningCode.RETURN_OF_INVALID_TYPE
1973 ]); 1972 ]);
1974 verify([source]); 1973 verify([source]);
1975 } 1974 }
1976 1975
1977 void test_setterWithNoVoidType_returningVoid() { 1976 void test_setterWithNoVoidType_returningVoid() {
1978 Source source = addSource(r''' 1977 Source source = addSource(r'''
1979 void returnsVoid() {} 1978 void returnsVoid() {}
1980 class A { 1979 class A {
1981 set f(String s) => returnsVoid(); 1980 set f(String s) => returnsVoid();
1982 } 1981 }
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
2271 main() { 2270 main() {
2272 var v = x; 2271 var v = x;
2273 v; // marker 2272 v; // marker
2274 } 2273 }
2275 int x = 3; 2274 int x = 3;
2276 '''; 2275 ''';
2277 assertPropagatedAssignedType(code, typeProvider.intType, null); 2276 assertPropagatedAssignedType(code, typeProvider.intType, null);
2278 assertTypeOfMarkedExpression(code, typeProvider.intType, null); 2277 assertTypeOfMarkedExpression(code, typeProvider.intType, null);
2279 } 2278 }
2280 } 2279 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/generated/error_verifier.dart ('k') | pkg/analyzer/test/src/task/strong/checker_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698