OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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.resolver_test; | 5 library analyzer.test.generated.resolver_test; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 import 'dart:collection'; | 8 import 'dart:collection'; |
9 | 9 |
10 import 'package:analyzer/dart/ast/ast.dart'; | 10 import 'package:analyzer/dart/ast/ast.dart'; |
(...skipping 3115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3126 'C', null, null, AstTestFactory.typeName(classB, []), withClause, null); | 3126 'C', null, null, AstTestFactory.typeName(classB, []), withClause, null); |
3127 alias.name.staticElement = classC; | 3127 alias.name.staticElement = classC; |
3128 _resolveNode(alias, [classT, classB, classM, classC]); | 3128 _resolveNode(alias, [classT, classB, classM, classC]); |
3129 expect(classC.constructors, hasLength(1)); | 3129 expect(classC.constructors, hasLength(1)); |
3130 ConstructorElement constructor = classC.constructors[0]; | 3130 ConstructorElement constructor = classC.constructors[0]; |
3131 expect(constructor.isFactory, isFalse); | 3131 expect(constructor.isFactory, isFalse); |
3132 expect(constructor.isSynthetic, isTrue); | 3132 expect(constructor.isSynthetic, isTrue); |
3133 expect(constructor.name, 'c1'); | 3133 expect(constructor.name, 'c1'); |
3134 expect(constructor.functions, hasLength(0)); | 3134 expect(constructor.functions, hasLength(0)); |
3135 expect(constructor.labels, hasLength(0)); | 3135 expect(constructor.labels, hasLength(0)); |
3136 expect(constructor.localVariables, hasLength(0)); | |
3137 expect(constructor.parameters, isEmpty); | 3136 expect(constructor.parameters, isEmpty); |
3138 } | 3137 } |
3139 | 3138 |
3140 test_visitClassTypeAlias_constructorWithParams() async { | 3139 test_visitClassTypeAlias_constructorWithParams() async { |
3141 // class T {} | 3140 // class T {} |
3142 // class B { | 3141 // class B { |
3143 // B(T a0); | 3142 // B(T a0); |
3144 // } | 3143 // } |
3145 // class M {} | 3144 // class M {} |
3146 // class C = B with M | 3145 // class C = B with M |
(...skipping 10 matching lines...) Expand all Loading... |
3157 'C', null, null, AstTestFactory.typeName(classB, []), withClause, null); | 3156 'C', null, null, AstTestFactory.typeName(classB, []), withClause, null); |
3158 alias.name.staticElement = classC; | 3157 alias.name.staticElement = classC; |
3159 _resolveNode(alias, [classT, classB, classM, classC]); | 3158 _resolveNode(alias, [classT, classB, classM, classC]); |
3160 expect(classC.constructors, hasLength(1)); | 3159 expect(classC.constructors, hasLength(1)); |
3161 ConstructorElement constructor = classC.constructors[0]; | 3160 ConstructorElement constructor = classC.constructors[0]; |
3162 expect(constructor.isFactory, isFalse); | 3161 expect(constructor.isFactory, isFalse); |
3163 expect(constructor.isSynthetic, isTrue); | 3162 expect(constructor.isSynthetic, isTrue); |
3164 expect(constructor.name, ''); | 3163 expect(constructor.name, ''); |
3165 expect(constructor.functions, hasLength(0)); | 3164 expect(constructor.functions, hasLength(0)); |
3166 expect(constructor.labels, hasLength(0)); | 3165 expect(constructor.labels, hasLength(0)); |
3167 expect(constructor.localVariables, hasLength(0)); | |
3168 expect(constructor.parameters, hasLength(1)); | 3166 expect(constructor.parameters, hasLength(1)); |
3169 expect(constructor.parameters[0].type, equals(classT.type)); | 3167 expect(constructor.parameters[0].type, equals(classT.type)); |
3170 expect(constructor.parameters[0].name, | 3168 expect(constructor.parameters[0].name, |
3171 equals(constructorB.parameters[0].name)); | 3169 equals(constructorB.parameters[0].name)); |
3172 } | 3170 } |
3173 | 3171 |
3174 test_visitClassTypeAlias_defaultConstructor() async { | 3172 test_visitClassTypeAlias_defaultConstructor() async { |
3175 // class B {} | 3173 // class B {} |
3176 // class M {} | 3174 // class M {} |
3177 // class C = B with M | 3175 // class C = B with M |
(...skipping 10 matching lines...) Expand all Loading... |
3188 'C', null, null, AstTestFactory.typeName(classB, []), withClause, null); | 3186 'C', null, null, AstTestFactory.typeName(classB, []), withClause, null); |
3189 alias.name.staticElement = classC; | 3187 alias.name.staticElement = classC; |
3190 _resolveNode(alias, [classB, classM, classC]); | 3188 _resolveNode(alias, [classB, classM, classC]); |
3191 expect(classC.constructors, hasLength(1)); | 3189 expect(classC.constructors, hasLength(1)); |
3192 ConstructorElement constructor = classC.constructors[0]; | 3190 ConstructorElement constructor = classC.constructors[0]; |
3193 expect(constructor.isFactory, isFalse); | 3191 expect(constructor.isFactory, isFalse); |
3194 expect(constructor.isSynthetic, isTrue); | 3192 expect(constructor.isSynthetic, isTrue); |
3195 expect(constructor.name, ''); | 3193 expect(constructor.name, ''); |
3196 expect(constructor.functions, hasLength(0)); | 3194 expect(constructor.functions, hasLength(0)); |
3197 expect(constructor.labels, hasLength(0)); | 3195 expect(constructor.labels, hasLength(0)); |
3198 expect(constructor.localVariables, hasLength(0)); | |
3199 expect(constructor.parameters, isEmpty); | 3196 expect(constructor.parameters, isEmpty); |
3200 } | 3197 } |
3201 | 3198 |
3202 test_visitFieldFormalParameter_functionType() async { | 3199 test_visitFieldFormalParameter_functionType() async { |
3203 InterfaceType intType = _typeProvider.intType; | 3200 InterfaceType intType = _typeProvider.intType; |
3204 TypeName intTypeName = AstTestFactory.typeName4("int"); | 3201 TypeName intTypeName = AstTestFactory.typeName4("int"); |
3205 String innerParameterName = "a"; | 3202 String innerParameterName = "a"; |
3206 SimpleFormalParameterImpl parameter = | 3203 SimpleFormalParameterImpl parameter = |
3207 AstTestFactory.simpleFormalParameter3(innerParameterName); | 3204 AstTestFactory.simpleFormalParameter3(innerParameterName); |
3208 parameter.element = parameter.identifier.staticElement = | 3205 parameter.element = parameter.identifier.staticElement = |
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3619 */ | 3616 */ |
3620 class _StaleElement extends ElementImpl { | 3617 class _StaleElement extends ElementImpl { |
3621 _StaleElement() : super("_StaleElement", -1); | 3618 _StaleElement() : super("_StaleElement", -1); |
3622 | 3619 |
3623 @override | 3620 @override |
3624 get kind => throw "_StaleElement's kind shouldn't be accessed"; | 3621 get kind => throw "_StaleElement's kind shouldn't be accessed"; |
3625 | 3622 |
3626 @override | 3623 @override |
3627 T accept<T>(_) => throw "_StaleElement shouldn't be visited"; | 3624 T accept<T>(_) => throw "_StaleElement shouldn't be visited"; |
3628 } | 3625 } |
OLD | NEW |