-
Notifications
You must be signed in to change notification settings - Fork 245
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
When a JSII interface has a name like IFoo
, the generated .NET interface is named IIFoo
#109
Comments
After talking with Romain, we chose to: Not prefix with I anymore for interfaces that are NOT datatype ( |
Do we really need interfaces for data types? I was under the impression that in .NET we can express these data types without interfaces. |
See my comment here: Right now for each interface we create the interface, the interface proxy and the interface datatype class (implementing the original interface). In the case of a datatype (props), we could do with JUST the datatype, not implementing any interface. Relates: #480 Given that props objects are datatypes, they would live by themselves. |
So if I understand correctly the answer is that we can get rid of interfaces for data types (formally known as “structs”). Correct? |
Yes |
@assyadh – so the work for this task now, is just to remove the generation of interfaces for struct/data classes? |
After discussion with Romain at the bindings meeting, looks like the interfaces are here to stay. There is usecases of interfaces implementations that are allowed by the language. Removing them would be a deal breaker. I'll let @RomainMuller chime in on the specifics. |
The current state of things is that data types support multiple inheritance, which implies supporting interfaces in |
After discussion with @RomainMuller , we can remove the added I in the interfaces as it JSII is already enforcing the I for an interface. |
…728) Drop the useless I prefix for non datatype interfaces as they are guaranteed by jsii to start with I. This removes a bunch of II* interfaces. Updated the tests, and tested with the CDK successfully. BREAKING CHANGE: names of .NET behavioral interfaces have changed (the duplicate prefix I was removed). Fixes #109
We should detect the case where the interface already has the
I
- prefix, and skip adding an additionalI
- prefix in this case.Open question: What if the interface is named something like
IAMFoo
? I.e. it begins withI<capital letter>
, but theI
isn't intended as a prefix.The text was updated successfully, but these errors were encountered: