Changeset 2317
- Timestamp:
- 03/14/10 07:30:32 (2 years ago)
- Files:
-
- 1 modified
-
cobra/trunk/Source/Types.cobra (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
cobra/trunk/Source/Types.cobra
r2316 r2317 1008 1008 1009 1009 1010 class CharType 1011 is partial 1012 inherits PrimitiveType 1010 class CharType inherits PrimitiveType is partial 1013 1011 1014 1012 cue init … … 1020 1018 return 'char' 1021 1019 1022 def isComparableTo(b as IType) as bool 1023 r = base.isComparableTo(b) 1024 if not r and b is .compiler.stringType 1025 r = true 1026 return r 1020 def isComparableTo(t as IType) as bool 1021 return base.isComparableTo(t) or t is .compiler.stringType 1027 1022 1028 1023 def isEquatableTo(t as IType) as bool 1029 r = base.isEquatableTo(t) 1030 if not r and t is .compiler.stringType 1031 r = true 1032 return r 1033 1034 1035 class DecimalType 1036 inherits AbstractNumberType 1024 return base.isEquatableTo(t) or t is .compiler.stringType 1025 1026 1027 class DecimalType inherits AbstractNumberType 1037 1028 1038 1029 cue init … … 1045 1036 1046 1037 def isComparableTo(t as IType) as bool 1047 r = base.isComparableTo(t) 1048 if not r and t inherits IntType 1049 r = true 1050 return r 1038 return base.isComparableTo(t) or t inherits IntType 1051 1039 1052 1040 … … 1182 1170 1183 1171 def isComparableTo(t as IType) as bool 1184 r = base.isComparableTo(t) 1185 if not r 1186 if t inherits IntType 1187 r = true 1188 else if t inherits FloatType 1189 r = true 1190 return r 1172 return base.isComparableTo(t) or t inherits IntType or t inherits FloatType 1191 1173 1192 1174 def greatestCommonDenominatorWith(type as IType) as IType is override … … 1321 1303 1322 1304 def isComparableTo(t as IType) as bool 1323 r = base.isComparableTo(t) 1324 if not r 1325 if t inherits IntType 1326 r = true 1327 else if t inherits DecimalType or t inherits FloatType 1328 r = true 1329 return r 1305 return base.isComparableTo(t) or t inherits IntType or t inherits DecimalType or t inherits FloatType 1330 1306 1331 1307 def greatestCommonDenominatorWith(type as IType) as IType is override



