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

Java interface proxies do not respect optional arguments in methods #175

Closed
eladb opened this issue Aug 14, 2018 · 2 comments · Fixed by #212
Closed

Java interface proxies do not respect optional arguments in methods #175

eladb opened this issue Aug 14, 2018 · 2 comments · Fixed by #212
Labels
bug This issue is a bug. language/java Related to Java bindings

Comments

@eladb
Copy link
Contributor

eladb commented Aug 14, 2018

They should convert optional members into method overloads.

Repro:

export interface InterfaceWithOptional {
  myMethod(arg1: string, optionalArg2: number?);
}

Package to java and the generated interface will include two methods (one with a single argument and one with two) but the proxy will only contain a single method. Compilation will fail.

@eladb eladb added bug This issue is a bug. language/java Related to Java bindings labels Aug 14, 2018
@RomainMuller
Copy link
Contributor

This will likely be true for constructors, as well.

@eladb
Copy link
Contributor Author

eladb commented Aug 14, 2018

@eladb eladb changed the title Java interface proxies (and builders?) do not respect optional arguments in methods Java interface proxies do not respect optional arguments in methods Sep 5, 2018
eladb pushed a commit that referenced this issue Sep 5, 2018
When generating java proxy classes for interfaces,
make sure to create an overload for methods that include
optional arguments.
@eladb eladb closed this as completed in b37101f Sep 5, 2018
mpiroc added a commit that referenced this issue Sep 6, 2018
[0.7.2](v0.7.1...v0.7.2) (2018-09-06)

Bug Fixes

* Missing types in JSII assembly, invalid Java code, confusing docs ([#208](#208)) ([b37101f](b37101f)), closes [#175](#175)

Features

* **jsii:** Re-implemented jsii to support --watch and produce better error reporting ([#188](#188)) ([76472be](76472be))
mpiroc added a commit that referenced this issue Sep 6, 2018
[0.7.2](v0.7.1...v0.7.2) (2018-09-06)

Bug Fixes

* Missing types in JSII assembly, invalid Java code, confusing docs ([#208](#208)) ([b37101f](b37101f)), closes [#175](#175)

Features

* **jsii:** Re-implemented jsii to support --watch and produce better error reporting ([#188](#188)) ([76472be](76472be))
mpiroc added a commit that referenced this issue Sep 6, 2018
* v0.7.2

[0.7.2](v0.7.1...v0.7.2) (2018-09-06)

Bug Fixes

* Missing types in JSII assembly, invalid Java code, confusing docs ([#208](#208)) ([b37101f](b37101f)), closes [#175](#175)

Features

* **jsii:** Re-implemented jsii to support --watch and produce better error reporting ([#188](#188)) ([76472be](76472be))

* Check in changes to tarball expectations.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. language/java Related to Java bindings
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants