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

Side by Side Diff: test/checker/inferred_type_test.dart

Issue 1174643003: expose strong checker API, for use by analyzer_cli (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 6 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
« no previous file with comments | « lib/strong_mode.dart ('k') | test/checker/self_host_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 /// Tests for type inference. 5 /// Tests for type inference.
6 library dev_compiler.test.inferred_type_test; 6 library dev_compiler.test.inferred_type_test;
7 7
8 import 'package:test/test.dart'; 8 import 'package:test/test.dart';
9 9
10 import 'package:dev_compiler/src/testing.dart'; 10 import 'package:dev_compiler/src/testing.dart';
(...skipping 937 matching lines...) Expand 10 before | Expand all | Expand 10 after
948 } 948 }
949 949
950 foo () { 950 foo () {
951 int y = /*severe:StaticTypeError*/new B<String>().m(null, null).value; 951 int y = /*severe:StaticTypeError*/new B<String>().m(null, null).value;
952 String z = new B<String>().m(null, null).value; 952 String z = new B<String>().m(null, null).value;
953 } 953 }
954 ''' 954 '''
955 }, inferFromOverrides: true); 955 }, inferFromOverrides: true);
956 }); 956 });
957 957
958 test('do not infer overriden fields that explicitly say dynamic', () { 958 test('do not infer overridden fields that explicitly say dynamic', () {
959 for (bool infer in [true, false]) { 959 for (bool infer in [true, false]) {
960 testChecker({ 960 testChecker({
961 '/main.dart': ''' 961 '/main.dart': '''
962 class A { 962 class A {
963 int x = 2; 963 int x = 2;
964 } 964 }
965 965
966 class B implements A { 966 class B implements A {
967 /*severe:InvalidMethodOverride*/dynamic get x => 3; 967 /*severe:InvalidMethodOverride*/dynamic get x => 3;
968 } 968 }
(...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after
1517 }); 1517 });
1518 1518
1519 test('inferred initializing formal checks default value', () => testChecker({ 1519 test('inferred initializing formal checks default value', () => testChecker({
1520 '/main.dart': ''' 1520 '/main.dart': '''
1521 class Foo { 1521 class Foo {
1522 var x = 1; 1522 var x = 1;
1523 Foo([this.x = /*severe:StaticTypeError*/"1"]); 1523 Foo([this.x = /*severe:StaticTypeError*/"1"]);
1524 }''' 1524 }'''
1525 })); 1525 }));
1526 } 1526 }
OLDNEW
« no previous file with comments | « lib/strong_mode.dart ('k') | test/checker/self_host_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698