| 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 /// Defines static information collected by the type checker and used later by | 5 /// Defines static information collected by the type checker and used later by |
| 6 /// emitters to generate code. | 6 /// emitters to generate code. |
| 7 library dev_compiler.src.info; | 7 library dev_compiler.src.info; |
| 8 | 8 |
| 9 import 'dart:mirrors'; | 9 import 'dart:mirrors'; |
| 10 | 10 |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 | 158 |
| 159 AstNode get node => expression; | 159 AstNode get node => expression; |
| 160 DartType _convertedType; | 160 DartType _convertedType; |
| 161 | 161 |
| 162 Conversion(this.rules, this.expression) { | 162 Conversion(this.rules, this.expression) { |
| 163 this._convertedType = _getConvertedType(); | 163 this._convertedType = _getConvertedType(); |
| 164 } | 164 } |
| 165 | 165 |
| 166 DartType get baseType => rules.getStaticType(expression); | 166 DartType get baseType => rules.getStaticType(expression); |
| 167 DartType get convertedType => _convertedType; | 167 DartType get convertedType => _convertedType; |
| 168 DartType get staticType => _convertedType; |
| 168 | 169 |
| 169 DartType _getConvertedType(); | 170 DartType _getConvertedType(); |
| 170 | 171 |
| 171 // safe iff this cannot throw | 172 // safe iff this cannot throw |
| 172 bool get safe => false; | 173 bool get safe => false; |
| 173 | 174 |
| 174 Level get level => safe ? Level.CONFIG : Level.INFO; | 175 Level get level => safe ? Level.CONFIG : Level.INFO; |
| 175 | 176 |
| 176 String get description => '${this.runtimeType}: $baseType to $convertedType'; | 177 String get description => '${this.runtimeType}: $baseType to $convertedType'; |
| 177 | 178 |
| (...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 722 for (var cls in declarations.where((d) => d is ClassMirror)) { | 723 for (var cls in declarations.where((d) => d is ClassMirror)) { |
| 723 if (cls.isSubtypeOf(infoMirror)) { | 724 if (cls.isSubtypeOf(infoMirror)) { |
| 724 allTypes.add(cls); | 725 allTypes.add(cls); |
| 725 baseTypes.add(cls.superclass); | 726 baseTypes.add(cls.superclass); |
| 726 } | 727 } |
| 727 } | 728 } |
| 728 allTypes.removeAll(baseTypes); | 729 allTypes.removeAll(baseTypes); |
| 729 return new List<Type>.from(allTypes.map((mirror) => mirror.reflectedType)) | 730 return new List<Type>.from(allTypes.map((mirror) => mirror.reflectedType)) |
| 730 ..sort((t1, t2) => '$t1'.compareTo('$t2')); | 731 ..sort((t1, t2) => '$t1'.compareTo('$t2')); |
| 731 }(); | 732 }(); |
| OLD | NEW |