Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RPC spec generator does not instantiate RPC responses correctly #1734

Closed
NicoleYarroch opened this issue Jul 28, 2020 · 1 comment
Closed
Labels
bug A defect in the library rpc-spec-generator Relating to the RPC spec generator

Comments

@NicoleYarroch
Copy link
Contributor

Bug Report

The RPC spec generator does not instantiate RPC responses correctly when generating convenience inits.

The generated convenience inits call super.init when they should call self.init. If self.init is not called, then the response is not created with its name (i.e. super.initWithName: is never called).

Reproduction Steps
  1. Run the generator script in the "generator" folder of the library.
Expected Behavior

Generated convenience inits for RPC response should call self.init.

For example, in the SDLSubtleAlertResponse, this init should be created:

- (instancetype)initWithTryAgainTime:(nullable NSNumber<SDLUInt> *)tryAgainTime {
    self = [self init];
    if (!self) {
        return nil;
    }
    self.tryAgainTime = tryAgainTime;
    return self;
}
Observed Behavior

In the SDLSubtleAlertResponse, this init is created:

- (instancetype)initWithTryAgainTime:(nullable NSNumber<SDLUInt> *)tryAgainTime {
    self = [super init];
    if (!self) {
        return nil;
    }
    self.tryAgainTime = tryAgainTime;
    return self;
}
OS & Version Information
  • iOS Version: n/a
  • SDL iOS Version: 6.6
  • Testing Against: n/a
@NicoleYarroch NicoleYarroch added bug A defect in the library rpc-spec-generator Relating to the RPC spec generator labels Jul 28, 2020
@NicoleYarroch NicoleYarroch changed the title RPC spec generator does instantiate RPC responses RPC spec generator does not instantiate RPC responses correctly Jul 28, 2020
@NicoleYarroch
Copy link
Contributor Author

This is an issue in the generated inits for RPC requests as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A defect in the library rpc-spec-generator Relating to the RPC spec generator
Projects
None yet
Development

No branches or pull requests

2 participants