Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 class Type implements Named, Hashable { | 5 class Type implements Named, Hashable { |
| 6 final String name; | 6 final String name; |
| 7 bool isTested; | 7 bool isTested; |
| 8 | 8 |
| 9 /** | 9 /** |
| 10 * For core types (int, String, etc) this is the generated type assertion | 10 * For core types (int, String, etc) this is the generated type assertion |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 54 bool get isObject() => false; | 54 bool get isObject() => false; |
| 55 bool get isString() => false; | 55 bool get isString() => false; |
| 56 bool get isBool() => false; | 56 bool get isBool() => false; |
| 57 bool get isFunction() => false; | 57 bool get isFunction() => false; |
| 58 bool get isList() => false; | 58 bool get isList() => false; |
| 59 bool get isNum() => false; | 59 bool get isNum() => false; |
| 60 bool get isInt() => false; | 60 bool get isInt() => false; |
| 61 bool get isDouble() => false; | 61 bool get isDouble() => false; |
| 62 bool get isVoid() => false; | 62 bool get isVoid() => false; |
| 63 | 63 |
| 64 // True for all types in the Dart type system. We track non-nullabiltity | |
| 65 // as an optimization for booleans to generate better code in checked mode. | |
|
jimhug
2011/11/12 00:26:36
Nice!
| |
| 66 bool get isNullable() => true; | |
| 67 | |
| 64 // Strangely Dart treats calls on Function much like calls on var. | 68 // Strangely Dart treats calls on Function much like calls on var. |
| 65 bool get isVarOrFunction() => isVar || isFunction; | 69 bool get isVarOrFunction() => isVar || isFunction; |
| 66 | 70 |
| 67 /** Gets the $call method for a function type. */ | 71 /** Gets the $call method for a function type. */ |
| 68 MethodMember getCallMethod() => null; | 72 MethodMember getCallMethod() => null; |
| 69 | 73 |
| 70 /** These types may not be implemented or extended by user code. */ | 74 /** These types may not be implemented or extended by user code. */ |
| 71 bool get isClosed() => isString || isBool || isNum || isFunction || isVar; | 75 bool get isClosed() => isString || isBool || isNum || isFunction || isVar; |
| 72 | 76 |
| 73 bool get isUsed() => false; | 77 bool get isUsed() => false; |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 311 SourceSpan get span() => typeParameter.span; | 315 SourceSpan get span() => typeParameter.span; |
| 312 | 316 |
| 313 ParameterType(String name, this.typeParameter): super(name); | 317 ParameterType(String name, this.typeParameter): super(name); |
| 314 | 318 |
| 315 Map<String, MethodMember> get constructors() { | 319 Map<String, MethodMember> get constructors() { |
| 316 world.internalError('no constructors on type parameters yet'); | 320 world.internalError('no constructors on type parameters yet'); |
| 317 } | 321 } |
| 318 | 322 |
| 319 MethodMember getCallMethod() => extendsType.getCallMethod(); | 323 MethodMember getCallMethod() => extendsType.getCallMethod(); |
| 320 | 324 |
error: old chunk mismatch | |
| OLD | NEW |