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 library kernel.transformations.mixin_full_resolution; | 4 library kernel.transformations.mixin_full_resolution; |
5 | 5 |
6 import '../ast.dart'; | 6 import '../ast.dart'; |
7 import '../class_hierarchy.dart'; | 7 import '../class_hierarchy.dart'; |
8 import '../clone.dart'; | 8 import '../clone.dart'; |
9 import '../core_types.dart'; | 9 import '../core_types.dart'; |
10 import '../type_algebra.dart'; | 10 import '../type_algebra.dart'; |
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
304 | 304 |
305 /// Create a fixed length list containing given expressions. | 305 /// Create a fixed length list containing given expressions. |
306 Expression _fixedLengthList(List<Expression> list) { | 306 Expression _fixedLengthList(List<Expression> list) { |
307 if (_listFrom == null) { | 307 if (_listFrom == null) { |
308 Class clazz = coreTypes.getCoreClass('dart:core', 'List'); | 308 Class clazz = coreTypes.getCoreClass('dart:core', 'List'); |
309 _listFrom = clazz.procedures.firstWhere((c) => c.name.name == "from"); | 309 _listFrom = clazz.procedures.firstWhere((c) => c.name.name == "from"); |
310 } | 310 } |
311 return new StaticInvocation( | 311 return new StaticInvocation( |
312 _listFrom, | 312 _listFrom, |
313 new Arguments([new ListLiteral(list)], | 313 new Arguments([new ListLiteral(list)], |
314 named: [new NamedExpression("growable", new BoolLiteral(false))])); | 314 named: [new NamedExpression("growable", new BoolLiteral(false))], |
| 315 types: [const DynamicType()])); |
315 } | 316 } |
316 | 317 |
317 /// Check that a call to the targetFunction is legal given the arguments. | 318 /// Check that a call to the targetFunction is legal given the arguments. |
318 /// | 319 /// |
319 /// I.e. check that the number of positional parameters and the names of the | 320 /// I.e. check that the number of positional parameters and the names of the |
320 /// given named parameters represents a valid call to the function. | 321 /// given named parameters represents a valid call to the function. |
321 bool _callIsLegal(FunctionNode targetFunction, Arguments arguments) { | 322 bool _callIsLegal(FunctionNode targetFunction, Arguments arguments) { |
322 if ((targetFunction.requiredParameterCount > arguments.positional.length) || | 323 if ((targetFunction.requiredParameterCount > arguments.positional.length) || |
323 (targetFunction.positionalParameters.length < | 324 (targetFunction.positionalParameters.length < |
324 arguments.positional.length)) { | 325 arguments.positional.length)) { |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
359 return null; | 360 return null; |
360 } | 361 } |
361 } | 362 } |
362 | 363 |
363 throw new Exception( | 364 throw new Exception( |
364 'Could not find a generative constructor named "${constructor.name}" ' | 365 'Could not find a generative constructor named "${constructor.name}" ' |
365 'in lookup class "${lookupClass.name}"!'); | 366 'in lookup class "${lookupClass.name}"!'); |
366 } | 367 } |
367 } | 368 } |
368 } | 369 } |
OLD | NEW |