Skip to content

Commit

Permalink
NSObject: Change return type of setVersion: from id to void
Browse files Browse the repository at this point in the history
  • Loading branch information
hmelder committed Nov 11, 2023
1 parent ec051d1 commit bd4d2ec
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Headers/Foundation/NSObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ GS_EXPORT_CLASS GS_ROOT_CLASS
+ (BOOL) isSubclassOfClass: (Class)aClass;
+ (id) new;
+ (void) poseAsClass: (Class)aClassObject;
+ (id) setVersion: (NSInteger)aVersion;
+ (void) setVersion: (NSInteger)aVersion;
+ (NSInteger) version;

- (id) awakeAfterUsingCoder: (NSCoder*)aDecoder;
Expand Down
3 changes: 1 addition & 2 deletions Source/NSObject.m
Original file line number Diff line number Diff line change
Expand Up @@ -2220,14 +2220,13 @@ + (BOOL) resolveInstanceMethod: (SEL)name
/**
* Sets the version number of the receiving class. Should be nonnegative.
*/
+ (id) setVersion: (NSInteger)aVersion
+ (void) setVersion: (NSInteger)aVersion
{
if (aVersion < 0)
[NSException raise: NSInvalidArgumentException
format: @"%s +setVersion: may not set a negative version",
GSClassNameFromObject(self)];
class_setVersion(self, aVersion);
return self;
}

/**
Expand Down

0 comments on commit bd4d2ec

Please sign in to comment.