| 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 analyzer.test.src.summary.summary_common; | 5 library analyzer.test.src.summary.summary_common; |
| 6 | 6 |
| 7 import 'package:analyzer/analyzer.dart'; | 7 import 'package:analyzer/analyzer.dart'; |
| 8 import 'package:analyzer/dart/ast/ast.dart'; | 8 import 'package:analyzer/dart/ast/ast.dart'; |
| 9 import 'package:analyzer/dart/element/element.dart'; | 9 import 'package:analyzer/dart/element/element.dart'; |
| 10 import 'package:analyzer/src/generated/engine.dart'; | 10 import 'package:analyzer/src/generated/engine.dart'; |
| (...skipping 3191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3202 expect(executable.isRedirectedConstructor, isTrue); | 3202 expect(executable.isRedirectedConstructor, isTrue); |
| 3203 expect(executable.isFactory, isTrue); | 3203 expect(executable.isFactory, isTrue); |
| 3204 expect(executable.redirectedConstructorName, isEmpty); | 3204 expect(executable.redirectedConstructorName, isEmpty); |
| 3205 checkTypeRef(executable.redirectedConstructor, null, null, 'named', | 3205 checkTypeRef(executable.redirectedConstructor, null, null, 'named', |
| 3206 expectedKind: ReferenceKind.constructor, | 3206 expectedKind: ReferenceKind.constructor, |
| 3207 prefixExpectations: [ | 3207 prefixExpectations: [ |
| 3208 new _PrefixExpectation(ReferenceKind.classOrEnum, 'D', | 3208 new _PrefixExpectation(ReferenceKind.classOrEnum, 'D', |
| 3209 numTypeParameters: 2) | 3209 numTypeParameters: 2) |
| 3210 ], | 3210 ], |
| 3211 allowTypeParameters: true); | 3211 allowTypeParameters: true); |
| 3212 checkParamTypeRef(executable.redirectedConstructor.typeArguments[0], 1); |
| 3213 checkParamTypeRef(executable.redirectedConstructor.typeArguments[1], 2); |
| 3212 } | 3214 } |
| 3213 | 3215 |
| 3214 test_constructor_redirected_factory_unnamed() { | 3216 test_constructor_redirected_factory_unnamed() { |
| 3215 String text = ''' | 3217 String text = ''' |
| 3216 class C { | 3218 class C { |
| 3217 factory C() = D; | 3219 factory C() = D; |
| 3218 C._(); | 3220 C._(); |
| 3219 } | 3221 } |
| 3220 class D extends C { | 3222 class D extends C { |
| 3221 D() : super._(); | 3223 D() : super._(); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 3239 D() : super._(); | 3241 D() : super._(); |
| 3240 } | 3242 } |
| 3241 '''; | 3243 '''; |
| 3242 UnlinkedExecutable executable = | 3244 UnlinkedExecutable executable = |
| 3243 serializeClassText(text, className: 'C').executables[0]; | 3245 serializeClassText(text, className: 'C').executables[0]; |
| 3244 expect(executable.isRedirectedConstructor, isTrue); | 3246 expect(executable.isRedirectedConstructor, isTrue); |
| 3245 expect(executable.isFactory, isTrue); | 3247 expect(executable.isFactory, isTrue); |
| 3246 expect(executable.redirectedConstructorName, isEmpty); | 3248 expect(executable.redirectedConstructorName, isEmpty); |
| 3247 checkTypeRef(executable.redirectedConstructor, null, null, 'D', | 3249 checkTypeRef(executable.redirectedConstructor, null, null, 'D', |
| 3248 allowTypeParameters: true, numTypeParameters: 2); | 3250 allowTypeParameters: true, numTypeParameters: 2); |
| 3251 checkParamTypeRef(executable.redirectedConstructor.typeArguments[0], 1); |
| 3252 checkParamTypeRef(executable.redirectedConstructor.typeArguments[1], 2); |
| 3249 } | 3253 } |
| 3250 | 3254 |
| 3251 test_constructor_redirected_thisInvocation_named() { | 3255 test_constructor_redirected_thisInvocation_named() { |
| 3252 String text = ''' | 3256 String text = ''' |
| 3253 class C { | 3257 class C { |
| 3254 C() : this.named(); | 3258 C() : this.named(); |
| 3255 C.named(); | 3259 C.named(); |
| 3256 } | 3260 } |
| 3257 '''; | 3261 '''; |
| 3258 UnlinkedExecutable executable = | 3262 UnlinkedExecutable executable = |
| (...skipping 2862 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6121 final String absoluteUri; | 6125 final String absoluteUri; |
| 6122 final String relativeUri; | 6126 final String relativeUri; |
| 6123 final int numTypeParameters; | 6127 final int numTypeParameters; |
| 6124 | 6128 |
| 6125 _PrefixExpectation(this.kind, this.name, | 6129 _PrefixExpectation(this.kind, this.name, |
| 6126 {this.inLibraryDefiningUnit: false, | 6130 {this.inLibraryDefiningUnit: false, |
| 6127 this.absoluteUri, | 6131 this.absoluteUri, |
| 6128 this.relativeUri, | 6132 this.relativeUri, |
| 6129 this.numTypeParameters: 0}); | 6133 this.numTypeParameters: 0}); |
| 6130 } | 6134 } |
| OLD | NEW |