Chromium Code Reviews| 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 dev_compiler.src.checker.checker; | 5 library dev_compiler.src.checker.checker; |
| 6 | 6 |
| 7 import 'package:analyzer/analyzer.dart'; | 7 import 'package:analyzer/analyzer.dart'; |
| 8 import 'package:analyzer/src/generated/ast.dart'; | 8 import 'package:analyzer/src/generated/ast.dart'; |
| 9 import 'package:analyzer/src/generated/element.dart'; | 9 import 'package:analyzer/src/generated/element.dart'; |
| 10 import 'package:analyzer/src/generated/scanner.dart' show Token, TokenType; | 10 import 'package:analyzer/src/generated/scanner.dart' show Token, TokenType; |
| (...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 465 } | 465 } |
| 466 super.visitMapLiteral(node); | 466 super.visitMapLiteral(node); |
| 467 } | 467 } |
| 468 | 468 |
| 469 // Check invocations | 469 // Check invocations |
| 470 bool checkArgumentList(ArgumentList node, FunctionType type) { | 470 bool checkArgumentList(ArgumentList node, FunctionType type) { |
| 471 NodeList<Expression> list = node.arguments; | 471 NodeList<Expression> list = node.arguments; |
| 472 int len = list.length; | 472 int len = list.length; |
| 473 for (int i = 0; i < len; ++i) { | 473 for (int i = 0; i < len; ++i) { |
| 474 Expression arg = list[i]; | 474 Expression arg = list[i]; |
| 475 ParameterElement element = node.getStaticParameterElementFor(arg); | 475 ParameterElement element = arg.propagatedParameterElement; |
|
vsm
2015/04/07 17:55:09
We haven't been using the propagated types / eleme
Siggi Cherem (dart-lang)
2015/04/07 18:06:44
Good catch - I was just changing this based on the
| |
| 476 if (element == null) { | 476 if (element == null) { |
| 477 if (type.parameters.length < len) { | 477 if (type.parameters.length < len) { |
| 478 // We found an argument mismatch, the analyzer will report this too, | 478 // We found an argument mismatch, the analyzer will report this too, |
| 479 // so no need to insert an error for this here. | 479 // so no need to insert an error for this here. |
| 480 continue; | 480 continue; |
| 481 } | 481 } |
| 482 element = type.parameters[i]; | 482 element = type.parameters[i]; |
| 483 // TODO(vsm): When can this happen? | 483 // TODO(vsm): When can this happen? |
| 484 assert(element != null); | 484 assert(element != null); |
| 485 } | 485 } |
| (...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 803 void _recordDynamicInvoke(AstNode node) { | 803 void _recordDynamicInvoke(AstNode node) { |
| 804 _reporter.log(new DynamicInvoke(_rules, node)); | 804 _reporter.log(new DynamicInvoke(_rules, node)); |
| 805 } | 805 } |
| 806 | 806 |
| 807 void _recordMessage(StaticInfo info) { | 807 void _recordMessage(StaticInfo info) { |
| 808 if (info == null) return; | 808 if (info == null) return; |
| 809 if (info.level >= logger.Level.SEVERE) _failure = true; | 809 if (info.level >= logger.Level.SEVERE) _failure = true; |
| 810 _reporter.log(info); | 810 _reporter.log(info); |
| 811 } | 811 } |
| 812 } | 812 } |
| OLD | NEW |