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

Detect optional parameters that have "pass null" in their description #34

Merged
merged 1 commit into from
Jul 6, 2023

Conversation

nikstar
Copy link
Contributor

@nikstar nikstar commented Jun 16, 2023

Detect parameters that have "pass null" in their description similar to how "may be null" is detected. These are now correctly marked as optional.

For example, here:

/// Options to be used when a message is sent
public struct MessageSendOptions: Codable, Equatable, Hashable {

    ...

    /// Message scheduling state; pass null to send message immediately. Messages sent to a secret chat, live location messages and self-destructing messages can't be scheduled
    public let schedulingState: MessageSchedulingState? 👈

    ...
}

@Kylmakalle
Copy link
Contributor

Hi @nikstar, thank you for the contribution. It's indeed useful not to pass useless nulls.

Such pain can only be found if you're working a lot on something TDLib-based. Perhaps you can share what you're working on...?

@Kylmakalle Kylmakalle merged commit a5538ec into Swiftgram:main Jul 6, 2023
1 check passed
@nikstar
Copy link
Contributor Author

nikstar commented Jul 6, 2023

To be clear, I just wanted to configure some send options but pass null for scheduling state, which wasn't possible because schedulingState was non-optional.

Perhaps you can share what you're working on...?

Not yet, sorry :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants