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 ddc.src.checker.rules; | 5 library dev_compiler.src.checker.rules; |
6 | 6 |
7 import 'package:analyzer/src/generated/ast.dart'; | 7 import 'package:analyzer/src/generated/ast.dart'; |
8 import 'package:analyzer/src/generated/element.dart'; | 8 import 'package:analyzer/src/generated/element.dart'; |
9 import 'package:analyzer/src/generated/resolver.dart'; | 9 import 'package:analyzer/src/generated/resolver.dart'; |
10 | 10 |
11 import 'package:dev_compiler/src/info.dart'; | 11 import 'package:dev_compiler/src/info.dart'; |
12 import 'package:dev_compiler/src/options.dart'; | 12 import 'package:dev_compiler/src/options.dart'; |
13 import 'package:dev_compiler/src/report.dart' show CheckerReporter; | 13 import 'package:dev_compiler/src/report.dart' show CheckerReporter; |
14 | 14 |
15 abstract class TypeRules { | 15 abstract class TypeRules { |
(...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
492 /// Returns `true` if the expression is a dynamic function call or method | 492 /// Returns `true` if the expression is a dynamic function call or method |
493 /// invocation. | 493 /// invocation. |
494 bool isDynamicCall(Expression call) { | 494 bool isDynamicCall(Expression call) { |
495 if (options.ignoreTypes) return true; | 495 if (options.ignoreTypes) return true; |
496 var t = getStaticType(call); | 496 var t = getStaticType(call); |
497 // TODO(jmesserly): fix handling of types with `call` methods. These are not | 497 // TODO(jmesserly): fix handling of types with `call` methods. These are not |
498 // FunctionType, but they also aren't dynamic calls. | 498 // FunctionType, but they also aren't dynamic calls. |
499 return t.isDynamic || t.isDartCoreFunction || t is! FunctionType; | 499 return t.isDynamic || t.isDartCoreFunction || t is! FunctionType; |
500 } | 500 } |
501 } | 501 } |
OLD | NEW |