OLD | NEW |
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 '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 491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
502 var covariantD = getClassCovariantParameters(AstFinder.getClass(unit, "D")); | 502 var covariantD = getClassCovariantParameters(AstFinder.getClass(unit, "D")); |
503 expect(covariantD, null); | 503 expect(covariantD, null); |
504 | 504 |
505 var classE = AstFinder.getClass(unit, "E"); | 505 var classE = AstFinder.getClass(unit, "E"); |
506 var covariantE = getClassCovariantParameters(classE); | 506 var covariantE = getClassCovariantParameters(classE); |
507 var superCovariantE = getSuperclassCovariantParameters(classE); | 507 var superCovariantE = getSuperclassCovariantParameters(classE); |
508 expect(covariantE.toList(), []); | 508 expect(covariantE.toList(), []); |
509 expect(superCovariantE.toList(), [dAdd.element.parameters[0]]); | 509 expect(superCovariantE.toList(), [dAdd.element.parameters[0]]); |
510 } | 510 } |
511 | 511 |
512 @soloTest | |
513 test_covarianceChecks_returnFunction() async { | 512 test_covarianceChecks_returnFunction() async { |
514 var source = addSource(r''' | 513 var source = addSource(r''' |
515 typedef F<T>(T t); | 514 typedef F<T>(T t); |
516 typedef T R<T>(); | 515 typedef T R<T>(); |
517 class C<T> { | 516 class C<T> { |
518 F<T> f; | 517 F<T> f; |
519 | 518 |
520 C(); | 519 C(); |
521 factory C.fact() => new C<Null>(); | 520 factory C.fact() => new C<Null>(); |
522 | 521 |
(...skipping 3691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4214 var v = x; | 4213 var v = x; |
4215 v; // marker | 4214 v; // marker |
4216 } | 4215 } |
4217 int x = 3; | 4216 int x = 3; |
4218 '''; | 4217 '''; |
4219 CompilationUnit unit = await resolveSource(code); | 4218 CompilationUnit unit = await resolveSource(code); |
4220 assertPropagatedAssignedType(code, unit, typeProvider.intType, null); | 4219 assertPropagatedAssignedType(code, unit, typeProvider.intType, null); |
4221 assertTypeOfMarkedExpression(code, unit, typeProvider.intType, null); | 4220 assertTypeOfMarkedExpression(code, unit, typeProvider.intType, null); |
4222 } | 4221 } |
4223 } | 4222 } |
OLD | NEW |