OLD | NEW |
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 library test.src.serialization.elements_test; | 5 library test.src.serialization.elements_test; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 | 8 |
9 import 'package:analyzer/dart/ast/ast.dart'; | 9 import 'package:analyzer/dart/ast/ast.dart'; |
10 import 'package:analyzer/dart/ast/standard_resolution_map.dart'; | 10 import 'package:analyzer/dart/ast/standard_resolution_map.dart'; |
(...skipping 10275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10286 void f(dynamic value) {} | 10286 void f(dynamic value) {} |
10287 } | 10287 } |
10288 abstract class D { | 10288 abstract class D { |
10289 void f(int value); | 10289 void f(int value); |
10290 } | 10290 } |
10291 '''); | 10291 '''); |
10292 } | 10292 } |
10293 } | 10293 } |
10294 | 10294 |
10295 test_method_inferred_type_nonStatic_implicit_return() async { | 10295 test_method_inferred_type_nonStatic_implicit_return() async { |
10296 var library = await checkLibrary( | 10296 var library = await checkLibrary(''' |
10297 'class C extends D { f() => null; } abstract class D { int f(); }'); | 10297 class C extends D { |
10298 if (isStrongMode) { | 10298 f() => null; |
10299 checkElementText(library, r''' | 10299 } |
| 10300 abstract class D { |
| 10301 int f(); |
| 10302 } |
| 10303 '''); |
| 10304 checkElementText(library, r''' |
10300 class C extends D { | 10305 class C extends D { |
10301 int f() {} | 10306 int f() {} |
10302 } | 10307 } |
10303 abstract class D { | 10308 abstract class D { |
10304 int f(); | 10309 int f(); |
10305 } | 10310 } |
10306 '''); | 10311 '''); |
10307 } else { | |
10308 checkElementText(library, r''' | |
10309 class C extends D { | |
10310 dynamic f() {} | |
10311 } | |
10312 abstract class D { | |
10313 int f(); | |
10314 } | |
10315 '''); | |
10316 } | |
10317 } | 10312 } |
10318 | 10313 |
10319 test_method_type_parameter() async { | 10314 test_method_type_parameter() async { |
10320 prepareAnalysisContext(createOptions()); | 10315 prepareAnalysisContext(createOptions()); |
10321 var library = await checkLibrary('class C { T f<T, U>(U u) => null; }'); | 10316 var library = await checkLibrary('class C { T f<T, U>(U u) => null; }'); |
10322 if (isStrongMode) { | 10317 if (isStrongMode) { |
10323 checkElementText(library, r''' | 10318 checkElementText(library, r''' |
10324 class C { | 10319 class C { |
10325 T f<T, U>(U u) {} | 10320 T f<T, U>(U u) {} |
10326 } | 10321 } |
(...skipping 2809 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13136 fail('Unexpectedly tried to get unlinked summary for $uri'); | 13131 fail('Unexpectedly tried to get unlinked summary for $uri'); |
13137 } | 13132 } |
13138 return serializedUnit; | 13133 return serializedUnit; |
13139 } | 13134 } |
13140 | 13135 |
13141 @override | 13136 @override |
13142 bool hasLibrarySummary(String uri) { | 13137 bool hasLibrarySummary(String uri) { |
13143 return true; | 13138 return true; |
13144 } | 13139 } |
13145 } | 13140 } |
OLD | NEW |