Changeset 1745
- Timestamp:
- 11/07/08 21:49:39 (2 months ago)
- Location:
- cobra/trunk
- Files:
-
- 3 modified
-
Developer/IntermediateReleaseNotes.text (modified) (1 diff)
-
Source/Members.cobra (modified) (1 diff)
-
Tests/120-classes/720-override/110-error-for-no-override-of-overload.cobra (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
cobra/trunk/Developer/IntermediateReleaseNotes.text
r1744 r1745 214 214 215 215 * Fixed: The error message for fixed size array syntax (`int[10]`) is misleading and uninformative. ticket:27 216 217 * Fixed: No warning for derived methods that are not marked "override" or "new" when the parameters differ by being nilable (String?) or not (String). ticket:59 -
cobra/trunk/Source/Members.cobra
r1731 r1745 278 278 if params.count <> otherParams.count 279 279 return false 280 for i = 0 ..params.count281 if params[i].type <> otherParams[i].type280 for i in params.count 281 if not _matchesForOverride(params[i].type, otherParams[i].type) 282 282 return false 283 283 return true 284 285 def _matchesForOverride(a as IType, b as IType) as bool 286 if a == b 287 return true 288 if (a inherits NilableType) <> (b inherits NilableType) 289 if a inherits NilableType, a = a.theWrappedType 290 if b inherits NilableType, b = b.theWrappedType 291 return a == b 292 return false 284 293 285 294 -
cobra/trunk/Tests/120-classes/720-override/110-error-for-no-override-of-overload.cobra
r1177 r1745 1 # .error. must specify 1 class Top 2 2 3 class Top4 3 def foo(i as int) 5 4 pass 5 6 6 def foo(i as int, j as int) 7 7 pass 8 8 9 def equals(other as Object) as bool # .error. Member "equals" also exists in the base class. You must specify 10 # ^ Missing ? on Object 11 return this is other 12 13 9 14 class Bottom 10 15 inherits Top 11 def foo(i as int) # <-- should be error for no "is override", new or base 16 17 def foo(i as int) # .error. must specify 12 18 pass 19 13 20 def main is shared 14 21 pass
