| 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 ddc.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:ddc/src/info.dart'; | 11 import 'package:dev_compiler/src/info.dart'; |
| 12 import 'package:ddc/src/options.dart'; | 12 import 'package:dev_compiler/src/options.dart'; |
| 13 import 'package:ddc/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 { |
| 16 final TypeProvider provider; | 16 final TypeProvider provider; |
| 17 LibraryInfo currentLibraryInfo = null; | 17 LibraryInfo currentLibraryInfo = null; |
| 18 | 18 |
| 19 TypeRules(TypeProvider this.provider); | 19 TypeRules(TypeProvider this.provider); |
| 20 | 20 |
| 21 bool isSubTypeOf(DartType t1, DartType t2); | 21 bool isSubTypeOf(DartType t1, DartType t2); |
| 22 bool isAssignable(DartType t1, DartType t2); | 22 bool isAssignable(DartType t1, DartType t2); |
| 23 | 23 |
| (...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 487 /// Returns `true` if the expression is a dynamic function call or method | 487 /// Returns `true` if the expression is a dynamic function call or method |
| 488 /// invocation. | 488 /// invocation. |
| 489 bool isDynamicCall(Expression call) { | 489 bool isDynamicCall(Expression call) { |
| 490 if (options.ignoreTypes) return true; | 490 if (options.ignoreTypes) return true; |
| 491 var t = getStaticType(call); | 491 var t = getStaticType(call); |
| 492 // TODO(jmesserly): fix handling of types with `call` methods. These are not | 492 // TODO(jmesserly): fix handling of types with `call` methods. These are not |
| 493 // FunctionType, but they also aren't dynamic calls. | 493 // FunctionType, but they also aren't dynamic calls. |
| 494 return t.isDynamic || t.isDartCoreFunction || t is! FunctionType; | 494 return t.isDynamic || t.isDartCoreFunction || t is! FunctionType; |
| 495 } | 495 } |
| 496 } | 496 } |
| OLD | NEW |