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 fasta.analyzer.mock_element; | 5 library fasta.analyzer.mock_element; |
6 | 6 |
7 import 'package:analyzer/dart/ast/ast.dart'; | 7 import 'package:analyzer/dart/ast/ast.dart'; |
8 import 'package:analyzer/dart/element/element.dart'; | 8 import 'package:analyzer/dart/element/element.dart'; |
9 import 'package:analyzer/dart/element/type.dart'; | 9 import 'package:analyzer/dart/element/type.dart'; |
10 | 10 import 'package:analyzer/src/generated/source.dart'; |
11 import 'package:front_end/src/fasta/builder/builder.dart' show Builder; | 11 import 'package:front_end/src/fasta/builder/builder.dart' show Builder; |
12 | |
13 import 'package:front_end/src/fasta/errors.dart' show internalError; | 12 import 'package:front_end/src/fasta/errors.dart' show internalError; |
14 import 'package:analyzer/src/generated/source.dart'; | |
15 | 13 |
16 abstract class MockElement extends Builder implements Element, LocalElement { | 14 abstract class MockElement extends Builder implements Element, LocalElement { |
| 15 @override |
17 final ElementKind kind; | 16 final ElementKind kind; |
18 | 17 |
19 MockElement(this.kind) : super(null, -1, null); | 18 MockElement(this.kind) : super(null, -1, null); |
20 | 19 |
| 20 @override |
21 get librarySource => internalError("not supported."); | 21 get librarySource => internalError("not supported."); |
22 | 22 |
| 23 @override |
23 get source => internalError("not supported."); | 24 get source => internalError("not supported."); |
24 | 25 |
| 26 @override |
25 get context => internalError("not supported."); | 27 get context => internalError("not supported."); |
26 | 28 |
| 29 @override |
27 String get displayName => internalError("not supported."); | 30 String get displayName => internalError("not supported."); |
28 | 31 |
| 32 @override |
29 String get documentationComment => internalError("not supported."); | 33 String get documentationComment => internalError("not supported."); |
30 | 34 |
| 35 @override |
31 Element get enclosingElement => internalError("not supported."); | 36 Element get enclosingElement => internalError("not supported."); |
32 | 37 |
| 38 @override |
33 int get id => internalError("not supported."); | 39 int get id => internalError("not supported."); |
34 | 40 |
| 41 @override |
35 bool get isDeprecated => internalError("not supported."); | 42 bool get isDeprecated => internalError("not supported."); |
36 | 43 |
| 44 @override |
37 bool get isFactory => internalError("not supported."); | 45 bool get isFactory => internalError("not supported."); |
38 | 46 |
| 47 @override |
39 bool get isJS => internalError("not supported."); | 48 bool get isJS => internalError("not supported."); |
40 | 49 |
| 50 @override |
41 bool get isOverride => internalError("not supported."); | 51 bool get isOverride => internalError("not supported."); |
42 | 52 |
| 53 @override |
43 bool get isPrivate => internalError("not supported."); | 54 bool get isPrivate => internalError("not supported."); |
44 | 55 |
| 56 @override |
45 bool get isProtected => internalError("not supported."); | 57 bool get isProtected => internalError("not supported."); |
46 | 58 |
| 59 @override |
47 bool get isPublic => internalError("not supported."); | 60 bool get isPublic => internalError("not supported."); |
48 | 61 |
| 62 @override |
49 bool get isRequired => internalError("not supported."); | 63 bool get isRequired => internalError("not supported."); |
50 | 64 |
| 65 @override |
51 bool get isSynthetic => internalError("not supported."); | 66 bool get isSynthetic => internalError("not supported."); |
52 | 67 |
| 68 @override |
53 LibraryElement get library => internalError("not supported."); | 69 LibraryElement get library => internalError("not supported."); |
54 | 70 |
| 71 @override |
55 get location => internalError("not supported."); | 72 get location => internalError("not supported."); |
56 | 73 |
| 74 @override |
57 get metadata => internalError("not supported."); | 75 get metadata => internalError("not supported."); |
58 | 76 |
| 77 @override |
59 String get name => internalError("not supported."); | 78 String get name => internalError("not supported."); |
60 | 79 |
| 80 @override |
61 String get fullNameForErrors => name; | 81 String get fullNameForErrors => name; |
62 | 82 |
| 83 @override |
63 int get nameLength => internalError("not supported."); | 84 int get nameLength => internalError("not supported."); |
64 | 85 |
| 86 @override |
65 int get nameOffset => -1; | 87 int get nameOffset => -1; |
66 | 88 |
| 89 @override |
67 get unit => internalError("not supported."); | 90 get unit => internalError("not supported."); |
68 | 91 |
| 92 @override |
69 accept<T>(visitor) => internalError("not supported."); | 93 accept<T>(visitor) => internalError("not supported."); |
70 | 94 |
| 95 @override |
71 String computeDocumentationComment() => internalError("not supported."); | 96 String computeDocumentationComment() => internalError("not supported."); |
72 | 97 |
| 98 @override |
73 computeNode() => internalError("not supported."); | 99 computeNode() => internalError("not supported."); |
74 | 100 |
| 101 @override |
75 getAncestor<E>(predicate) => internalError("not supported."); | 102 getAncestor<E>(predicate) => internalError("not supported."); |
76 | 103 |
| 104 @override |
77 String getExtendedDisplayName(String shortName) { | 105 String getExtendedDisplayName(String shortName) { |
78 return internalError("not supported."); | 106 return internalError("not supported."); |
79 } | 107 } |
80 | 108 |
| 109 @override |
81 bool isAccessibleIn(LibraryElement library) { | 110 bool isAccessibleIn(LibraryElement library) { |
82 return internalError("not supported."); | 111 return internalError("not supported."); |
83 } | 112 } |
84 | 113 |
| 114 @override |
85 void visitChildren(visitor) => internalError("not supported."); | 115 void visitChildren(visitor) => internalError("not supported."); |
86 | 116 |
87 String get uri => internalError("not supported."); | 117 String get uri => internalError("not supported."); |
88 | 118 |
89 int get uriEnd => internalError("not supported."); | 119 int get uriEnd => internalError("not supported."); |
90 | 120 |
91 int get uriOffset => internalError("not supported."); | 121 int get uriOffset => internalError("not supported."); |
92 | 122 |
93 List<ParameterElement> get parameters => internalError("not supported."); | 123 List<ParameterElement> get parameters => internalError("not supported."); |
94 | 124 |
95 List<FunctionElement> get functions => internalError("not supported."); | 125 List<FunctionElement> get functions => internalError("not supported."); |
96 | 126 |
97 bool get hasImplicitReturnType => internalError("not supported."); | 127 bool get hasImplicitReturnType => internalError("not supported."); |
98 | 128 |
99 bool get isAbstract => internalError("not supported."); | 129 bool get isAbstract => internalError("not supported."); |
100 | 130 |
101 bool get isAsynchronous => internalError("not supported."); | 131 bool get isAsynchronous => internalError("not supported."); |
102 | 132 |
103 bool get isExternal => internalError("not supported."); | 133 bool get isExternal => internalError("not supported."); |
104 | 134 |
105 bool get isGenerator => internalError("not supported."); | 135 bool get isGenerator => internalError("not supported."); |
106 | 136 |
107 bool get isOperator => internalError("not supported."); | 137 bool get isOperator => internalError("not supported."); |
108 | 138 |
| 139 @override |
109 bool get isStatic => internalError("not supported."); | 140 bool get isStatic => internalError("not supported."); |
110 | 141 |
111 bool get isSynchronous => internalError("not supported."); | 142 bool get isSynchronous => internalError("not supported."); |
112 | 143 |
113 List<LabelElement> get labels => internalError("not supported."); | 144 List<LabelElement> get labels => internalError("not supported."); |
114 | 145 |
| 146 @override |
115 get visibleRange => internalError("not supported."); | 147 get visibleRange => internalError("not supported."); |
116 | 148 |
117 bool get hasImplicitType => internalError("not supported."); | 149 bool get hasImplicitType => internalError("not supported."); |
118 | 150 |
119 FunctionElement get initializer => internalError("not supported."); | 151 FunctionElement get initializer => internalError("not supported."); |
120 | 152 |
| 153 @override |
121 bool get isConst => internalError("not supported."); | 154 bool get isConst => internalError("not supported."); |
122 | 155 |
| 156 @override |
123 bool get isFinal => internalError("not supported."); | 157 bool get isFinal => internalError("not supported."); |
124 | 158 |
125 bool get isPotentiallyMutatedInClosure => internalError("not supported."); | 159 bool get isPotentiallyMutatedInClosure => internalError("not supported."); |
126 | 160 |
127 bool get isPotentiallyMutatedInScope => internalError("not supported."); | 161 bool get isPotentiallyMutatedInScope => internalError("not supported."); |
128 } | 162 } |
129 | 163 |
130 abstract class MockLibraryElement extends MockElement | 164 abstract class MockLibraryElement extends MockElement |
131 implements LibraryElement { | 165 implements LibraryElement { |
132 MockLibraryElement() : super(ElementKind.LIBRARY); | 166 MockLibraryElement() : super(ElementKind.LIBRARY); |
133 | 167 |
| 168 @override |
134 CompilationUnitElement get definingCompilationUnit { | 169 CompilationUnitElement get definingCompilationUnit { |
135 return internalError("not supported."); | 170 return internalError("not supported."); |
136 } | 171 } |
137 | 172 |
| 173 @override |
138 FunctionElement get entryPoint => internalError("not supported."); | 174 FunctionElement get entryPoint => internalError("not supported."); |
139 | 175 |
| 176 @override |
140 List<LibraryElement> get exportedLibraries { | 177 List<LibraryElement> get exportedLibraries { |
141 return internalError("not supported."); | 178 return internalError("not supported."); |
142 } | 179 } |
143 | 180 |
| 181 @override |
144 get exportNamespace => internalError("not supported."); | 182 get exportNamespace => internalError("not supported."); |
145 | 183 |
| 184 @override |
146 get exports => internalError("not supported."); | 185 get exports => internalError("not supported."); |
147 | 186 |
| 187 @override |
148 bool get hasExtUri => internalError("not supported."); | 188 bool get hasExtUri => internalError("not supported."); |
149 | 189 |
| 190 @override |
150 bool get hasLoadLibraryFunction => internalError("not supported."); | 191 bool get hasLoadLibraryFunction => internalError("not supported."); |
151 | 192 |
| 193 @override |
152 String get identifier => internalError("not supported."); | 194 String get identifier => internalError("not supported."); |
153 | 195 |
| 196 @override |
154 List<LibraryElement> get importedLibraries { | 197 List<LibraryElement> get importedLibraries { |
155 return internalError("not supported."); | 198 return internalError("not supported."); |
156 } | 199 } |
157 | 200 |
| 201 @override |
158 get imports => internalError("not supported."); | 202 get imports => internalError("not supported."); |
159 | 203 |
| 204 @override |
160 bool get isBrowserApplication => internalError("not supported."); | 205 bool get isBrowserApplication => internalError("not supported."); |
161 | 206 |
| 207 @override |
162 bool get isDartAsync => internalError("not supported."); | 208 bool get isDartAsync => internalError("not supported."); |
163 | 209 |
| 210 @override |
164 bool get isDartCore => internalError("not supported."); | 211 bool get isDartCore => internalError("not supported."); |
165 | 212 |
| 213 @override |
166 bool get isInSdk => internalError("not supported."); | 214 bool get isInSdk => internalError("not supported."); |
167 | 215 |
| 216 @override |
168 List<LibraryElement> get libraryCycle => internalError("not supported."); | 217 List<LibraryElement> get libraryCycle => internalError("not supported."); |
169 | 218 |
| 219 @override |
170 FunctionElement get loadLibraryFunction => internalError("not supported."); | 220 FunctionElement get loadLibraryFunction => internalError("not supported."); |
171 | 221 |
| 222 @override |
172 List<CompilationUnitElement> get parts => internalError("not supported."); | 223 List<CompilationUnitElement> get parts => internalError("not supported."); |
173 | 224 |
| 225 @override |
174 List<PrefixElement> get prefixes => internalError("not supported."); | 226 List<PrefixElement> get prefixes => internalError("not supported."); |
175 | 227 |
| 228 @override |
176 get publicNamespace => internalError("not supported."); | 229 get publicNamespace => internalError("not supported."); |
177 | 230 |
| 231 @override |
178 List<CompilationUnitElement> get units => internalError("not supported."); | 232 List<CompilationUnitElement> get units => internalError("not supported."); |
179 | 233 |
| 234 @override |
180 getImportsWithPrefix(PrefixElement prefix) { | 235 getImportsWithPrefix(PrefixElement prefix) { |
181 return internalError("not supported."); | 236 return internalError("not supported."); |
182 } | 237 } |
183 | 238 |
| 239 @override |
184 ClassElement getType(String className) => internalError("not supported."); | 240 ClassElement getType(String className) => internalError("not supported."); |
185 } | 241 } |
186 | 242 |
187 abstract class MockCompilationUnitElement extends MockElement | 243 abstract class MockCompilationUnitElement extends MockElement |
188 implements CompilationUnitElement { | 244 implements CompilationUnitElement { |
189 MockCompilationUnitElement() : super(ElementKind.COMPILATION_UNIT); | 245 MockCompilationUnitElement() : super(ElementKind.COMPILATION_UNIT); |
190 | 246 |
| 247 @override |
191 List<PropertyAccessorElement> get accessors { | 248 List<PropertyAccessorElement> get accessors { |
192 return internalError("not supported."); | 249 return internalError("not supported."); |
193 } | 250 } |
194 | 251 |
| 252 @override |
195 LibraryElement get enclosingElement => internalError("not supported."); | 253 LibraryElement get enclosingElement => internalError("not supported."); |
196 | 254 |
| 255 @override |
197 List<ClassElement> get enums => internalError("not supported."); | 256 List<ClassElement> get enums => internalError("not supported."); |
198 | 257 |
| 258 @override |
199 List<FunctionElement> get functions => internalError("not supported."); | 259 List<FunctionElement> get functions => internalError("not supported."); |
200 | 260 |
| 261 @override |
201 List<FunctionTypeAliasElement> get functionTypeAliases { | 262 List<FunctionTypeAliasElement> get functionTypeAliases { |
202 return internalError("not supported."); | 263 return internalError("not supported."); |
203 } | 264 } |
204 | 265 |
| 266 @override |
205 bool get hasLoadLibraryFunction => internalError("not supported."); | 267 bool get hasLoadLibraryFunction => internalError("not supported."); |
206 | 268 |
207 @override | 269 @override |
208 LineInfo get lineInfo => internalError("not supported."); | 270 LineInfo get lineInfo => internalError("not supported."); |
209 | 271 |
| 272 @override |
210 List<TopLevelVariableElement> get topLevelVariables { | 273 List<TopLevelVariableElement> get topLevelVariables { |
211 return internalError("not supported."); | 274 return internalError("not supported."); |
212 } | 275 } |
213 | 276 |
| 277 @override |
214 List<ClassElement> get types => internalError("not supported."); | 278 List<ClassElement> get types => internalError("not supported."); |
215 | 279 |
| 280 @override |
216 ClassElement getEnum(String name) => internalError("not supported."); | 281 ClassElement getEnum(String name) => internalError("not supported."); |
217 | 282 |
| 283 @override |
218 ClassElement getType(String name) => internalError("not supported."); | 284 ClassElement getType(String name) => internalError("not supported."); |
219 | 285 |
| 286 @override |
220 CompilationUnit computeNode() => internalError("not supported."); | 287 CompilationUnit computeNode() => internalError("not supported."); |
221 } | 288 } |
222 | 289 |
223 abstract class MockClassElement extends MockElement implements ClassElement { | 290 abstract class MockClassElement extends MockElement implements ClassElement { |
224 MockClassElement() : super(ElementKind.CLASS); | 291 MockClassElement() : super(ElementKind.CLASS); |
225 | 292 |
226 List<PropertyAccessorElement> get accessors { | 293 List<PropertyAccessorElement> get accessors { |
227 return internalError("not supported."); | 294 return internalError("not supported."); |
228 } | 295 } |
229 | 296 |
| 297 @override |
230 get allSupertypes => internalError("not supported."); | 298 get allSupertypes => internalError("not supported."); |
231 | 299 |
| 300 @override |
232 List<ConstructorElement> get constructors => internalError("not supported."); | 301 List<ConstructorElement> get constructors => internalError("not supported."); |
233 | 302 |
| 303 @override |
234 List<FieldElement> get fields => internalError("not supported."); | 304 List<FieldElement> get fields => internalError("not supported."); |
235 | 305 |
| 306 @override |
236 bool get hasNonFinalField => internalError("not supported."); | 307 bool get hasNonFinalField => internalError("not supported."); |
237 | 308 |
| 309 @override |
238 bool get hasReferenceToSuper => internalError("not supported."); | 310 bool get hasReferenceToSuper => internalError("not supported."); |
239 | 311 |
| 312 @override |
240 bool get hasStaticMember => internalError("not supported."); | 313 bool get hasStaticMember => internalError("not supported."); |
241 | 314 |
| 315 @override |
242 get interfaces => internalError("not supported."); | 316 get interfaces => internalError("not supported."); |
243 | 317 |
| 318 @override |
244 bool get isAbstract => internalError("not supported."); | 319 bool get isAbstract => internalError("not supported."); |
245 | 320 |
| 321 @override |
246 bool get isEnum => internalError("not supported."); | 322 bool get isEnum => internalError("not supported."); |
247 | 323 |
| 324 @override |
248 bool get isMixinApplication => internalError("not supported."); | 325 bool get isMixinApplication => internalError("not supported."); |
249 | 326 |
| 327 @override |
250 bool get isOrInheritsProxy => internalError("not supported."); | 328 bool get isOrInheritsProxy => internalError("not supported."); |
251 | 329 |
| 330 @override |
252 bool get isProxy => internalError("not supported."); | 331 bool get isProxy => internalError("not supported."); |
253 | 332 |
| 333 @override |
254 bool get isValidMixin => internalError("not supported."); | 334 bool get isValidMixin => internalError("not supported."); |
255 | 335 |
| 336 @override |
256 get typeParameters => internalError("not supported."); | 337 get typeParameters => internalError("not supported."); |
257 | 338 |
| 339 @override |
258 List<MethodElement> get methods => internalError("not supported."); | 340 List<MethodElement> get methods => internalError("not supported."); |
259 | 341 |
| 342 @override |
260 get mixins => internalError("not supported."); | 343 get mixins => internalError("not supported."); |
261 | 344 |
| 345 @override |
262 get supertype => internalError("not supported."); | 346 get supertype => internalError("not supported."); |
263 | 347 |
| 348 @override |
264 ConstructorElement get unnamedConstructor => internalError("not supported."); | 349 ConstructorElement get unnamedConstructor => internalError("not supported."); |
265 | 350 |
| 351 @override |
266 FieldElement getField(String name) => internalError("not supported."); | 352 FieldElement getField(String name) => internalError("not supported."); |
267 | 353 |
| 354 @override |
268 PropertyAccessorElement getGetter(String name) { | 355 PropertyAccessorElement getGetter(String name) { |
269 return internalError("not supported."); | 356 return internalError("not supported."); |
270 } | 357 } |
271 | 358 |
| 359 @override |
272 MethodElement getMethod(String name) => internalError("not supported."); | 360 MethodElement getMethod(String name) => internalError("not supported."); |
273 | 361 |
| 362 @override |
274 ConstructorElement getNamedConstructor(String name) { | 363 ConstructorElement getNamedConstructor(String name) { |
275 return internalError("not supported."); | 364 return internalError("not supported."); |
276 } | 365 } |
277 | 366 |
| 367 @override |
278 PropertyAccessorElement getSetter(String name) { | 368 PropertyAccessorElement getSetter(String name) { |
279 return internalError("not supported."); | 369 return internalError("not supported."); |
280 } | 370 } |
281 | 371 |
| 372 @override |
282 bool isSuperConstructorAccessible(ConstructorElement constructor) { | 373 bool isSuperConstructorAccessible(ConstructorElement constructor) { |
283 return internalError("not supported."); | 374 return internalError("not supported."); |
284 } | 375 } |
285 | 376 |
| 377 @override |
286 MethodElement lookUpConcreteMethod( | 378 MethodElement lookUpConcreteMethod( |
287 String methodName, LibraryElement library) { | 379 String methodName, LibraryElement library) { |
288 return internalError("not supported."); | 380 return internalError("not supported."); |
289 } | 381 } |
290 | 382 |
| 383 @override |
291 PropertyAccessorElement lookUpGetter( | 384 PropertyAccessorElement lookUpGetter( |
292 String getterName, LibraryElement library) { | 385 String getterName, LibraryElement library) { |
293 return internalError("not supported."); | 386 return internalError("not supported."); |
294 } | 387 } |
295 | 388 |
| 389 @override |
296 PropertyAccessorElement lookUpInheritedConcreteGetter( | 390 PropertyAccessorElement lookUpInheritedConcreteGetter( |
297 String getterName, LibraryElement library) { | 391 String getterName, LibraryElement library) { |
298 return internalError("not supported."); | 392 return internalError("not supported."); |
299 } | 393 } |
300 | 394 |
| 395 @override |
301 MethodElement lookUpInheritedConcreteMethod( | 396 MethodElement lookUpInheritedConcreteMethod( |
302 String methodName, LibraryElement library) { | 397 String methodName, LibraryElement library) { |
303 return internalError("not supported."); | 398 return internalError("not supported."); |
304 } | 399 } |
305 | 400 |
| 401 @override |
306 PropertyAccessorElement lookUpInheritedConcreteSetter( | 402 PropertyAccessorElement lookUpInheritedConcreteSetter( |
307 String setterName, LibraryElement library) { | 403 String setterName, LibraryElement library) { |
308 return internalError("not supported."); | 404 return internalError("not supported."); |
309 } | 405 } |
310 | 406 |
| 407 @override |
311 MethodElement lookUpInheritedMethod( | 408 MethodElement lookUpInheritedMethod( |
312 String methodName, LibraryElement library) { | 409 String methodName, LibraryElement library) { |
313 return internalError("not supported."); | 410 return internalError("not supported."); |
314 } | 411 } |
315 | 412 |
| 413 @override |
316 MethodElement lookUpMethod(String methodName, LibraryElement library) { | 414 MethodElement lookUpMethod(String methodName, LibraryElement library) { |
317 return internalError("not supported."); | 415 return internalError("not supported."); |
318 } | 416 } |
319 | 417 |
| 418 @override |
320 PropertyAccessorElement lookUpSetter( | 419 PropertyAccessorElement lookUpSetter( |
321 String setterName, LibraryElement library) { | 420 String setterName, LibraryElement library) { |
322 return internalError("not supported."); | 421 return internalError("not supported."); |
323 } | 422 } |
324 | 423 |
| 424 @override |
325 NamedCompilationUnitMember computeNode() => internalError("not supported."); | 425 NamedCompilationUnitMember computeNode() => internalError("not supported."); |
326 | 426 |
| 427 @override |
327 InterfaceType get type => internalError("not supported."); | 428 InterfaceType get type => internalError("not supported."); |
328 } | 429 } |
329 | 430 |
330 abstract class MockFunctionElement extends MockElement | 431 abstract class MockFunctionElement extends MockElement |
331 implements FunctionElement { | 432 implements FunctionElement { |
332 MockFunctionElement() : super(ElementKind.FUNCTION); | 433 MockFunctionElement() : super(ElementKind.FUNCTION); |
333 | 434 |
| 435 @override |
334 bool get isEntryPoint => internalError("not supported."); | 436 bool get isEntryPoint => internalError("not supported."); |
335 | 437 |
| 438 @override |
336 get typeParameters => internalError("not supported."); | 439 get typeParameters => internalError("not supported."); |
337 | 440 |
| 441 @override |
338 FunctionType get type => internalError("not supported."); | 442 FunctionType get type => internalError("not supported."); |
| 443 |
| 444 @override |
339 DartType get returnType => internalError("not supported."); | 445 DartType get returnType => internalError("not supported."); |
340 | 446 |
| 447 @override |
341 FunctionDeclaration computeNode() => internalError("not supported."); | 448 FunctionDeclaration computeNode() => internalError("not supported."); |
342 } | 449 } |
343 | 450 |
344 abstract class MockFunctionTypeAliasElement extends MockElement | 451 abstract class MockFunctionTypeAliasElement extends MockElement |
345 implements FunctionTypeAliasElement { | 452 implements FunctionTypeAliasElement { |
346 MockFunctionTypeAliasElement() : super(ElementKind.FUNCTION_TYPE_ALIAS); | 453 MockFunctionTypeAliasElement() : super(ElementKind.FUNCTION_TYPE_ALIAS); |
347 | 454 |
| 455 @override |
348 CompilationUnitElement get enclosingElement { | 456 CompilationUnitElement get enclosingElement { |
349 return internalError("not supported."); | 457 return internalError("not supported."); |
350 } | 458 } |
351 | 459 |
| 460 @override |
352 TypeAlias computeNode() => internalError("not supported."); | 461 TypeAlias computeNode() => internalError("not supported."); |
353 } | 462 } |
354 | 463 |
355 abstract class MockParameterElement extends MockElement | 464 abstract class MockParameterElement extends MockElement |
356 implements ParameterElement { | 465 implements ParameterElement { |
357 MockParameterElement() : super(ElementKind.PARAMETER); | 466 MockParameterElement() : super(ElementKind.PARAMETER); |
358 | 467 |
| 468 @override |
359 String get defaultValueCode => internalError("not supported."); | 469 String get defaultValueCode => internalError("not supported."); |
360 | 470 |
| 471 @override |
361 bool get isCovariant => internalError("not supported."); | 472 bool get isCovariant => internalError("not supported."); |
362 | 473 |
| 474 @override |
363 bool get isInitializingFormal => internalError("not supported."); | 475 bool get isInitializingFormal => internalError("not supported."); |
364 | 476 |
| 477 @override |
365 get parameterKind => internalError("not supported."); | 478 get parameterKind => internalError("not supported."); |
366 | 479 |
| 480 @override |
367 List<ParameterElement> get parameters => internalError("not supported."); | 481 List<ParameterElement> get parameters => internalError("not supported."); |
368 | 482 |
| 483 @override |
369 get type => null; | 484 get type => null; |
370 | 485 |
| 486 @override |
371 get typeParameters => internalError("not supported."); | 487 get typeParameters => internalError("not supported."); |
372 | 488 |
| 489 @override |
373 get constantValue => internalError("not supported."); | 490 get constantValue => internalError("not supported."); |
374 | 491 |
| 492 @override |
375 computeConstantValue() => internalError("not supported."); | 493 computeConstantValue() => internalError("not supported."); |
376 | 494 |
| 495 @override |
377 void appendToWithoutDelimiters(StringBuffer buffer) { | 496 void appendToWithoutDelimiters(StringBuffer buffer) { |
378 return internalError("not supported."); | 497 return internalError("not supported."); |
379 } | 498 } |
380 | 499 |
| 500 @override |
381 FormalParameter computeNode() => internalError("not supported."); | 501 FormalParameter computeNode() => internalError("not supported."); |
382 } | 502 } |
OLD | NEW |