Merge pull request #2985 from thomasvl/class_check_tweaks
Tighten up class usage/checks.
This commit is contained in:
commit
a3873cafae
1 changed files with 2 additions and 2 deletions
|
@ -130,7 +130,7 @@ static NSError *ErrorFromException(NSException *exception) {
|
|||
|
||||
static void CheckExtension(GPBMessage *self,
|
||||
GPBExtensionDescriptor *extension) {
|
||||
if ([self class] != extension.containingMessageClass) {
|
||||
if (![self isKindOfClass:extension.containingMessageClass]) {
|
||||
[NSException
|
||||
raise:NSInvalidArgumentException
|
||||
format:@"Extension %@ used on wrong class (%@ instead of %@)",
|
||||
|
@ -3189,7 +3189,7 @@ static void ResolveIvarSet(GPBFieldDescriptor *field,
|
|||
|
||||
+ (BOOL)resolveClassMethod:(SEL)sel {
|
||||
// Extensions scoped to a Message and looked up via class methods.
|
||||
if (GPBResolveExtensionClassMethod(self, sel)) {
|
||||
if (GPBResolveExtensionClassMethod([self descriptor].messageClass, sel)) {
|
||||
return YES;
|
||||
}
|
||||
return [super resolveClassMethod:sel];
|
||||
|
|
Loading…
Add table
Reference in a new issue