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

callback with optional parameters do not generate nullable parameters #142

Closed
itsramiel opened this issue Sep 19, 2024 · 2 comments · Fixed by #143
Closed

callback with optional parameters do not generate nullable parameters #142

itsramiel opened this issue Sep 19, 2024 · 2 comments · Fixed by #143

Comments

@itsramiel
Copy link
Contributor

I have the following function:

pickFileCb(cb: (filepath: string | null) => void): void

but the generated swift methods is:

  func pickFileCb(cb: @escaping ((_ filepath: String) -> Void)) throws -> Void

I also tried filepth: string | undefined and filepath?: string and all doesnt work.

Note that it works with promises, so:

pickFileAsync(): Promise<string | null>

produces

  func pickFileAsync() throws -> Promise<String?>
@mrousavy
Copy link
Owner

Thanks for reporting, but this is a duplicate of #20

@mrousavy
Copy link
Owner

I found a fix for this: #143 :)

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 a pull request may close this issue.

2 participants