-
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
jsii: Compiler allows class-inherited member to violate interface #3342
Comments
RomainMuller
pushed a commit
to aws/aws-cdk
that referenced
this issue
Jan 17, 2022
The `BaseLoadBalancer.vpc` property fulfills the `IApplicationLoadBalancer.vpc` and `INetworkLoadBalancer.vpc` properties, both of which are optional. A bug in `jsii` (see aws/jsii#3342) makes this pass type system consistency checks, when it should not be allowed.
mergify bot
pushed a commit
to aws/aws-cdk
that referenced
this issue
Jan 18, 2022
The `BaseLoadBalancer.vpc` property fulfills the `IApplicationLoadBalancer.vpc` and `INetworkLoadBalancer.vpc` properties, both of which are optional. A bug in `jsii` (see aws/jsii#3342) makes this pass type system consistency checks, when it should not be allowed. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
mergify bot
pushed a commit
that referenced
this issue
Jan 18, 2022
) The compiler failed to check inherited members from a base class against interfaces declared on the inheriting class, so that it was possible to inherit members that changed the signature of the interface declarations they implemented (typically specializing them: required implementations of optional properties, etc...). While this is valid TypeScript (the implementation is allowed to be strictly more specific than the interface declaration), this is not allowed by jsii as this results in type models that cannot be represented in C# (and other languages that do not allow specialization by implementing or overriding members). In addition to fixing this issue, this change adds source bindings to diagnostics generated when property implementations are rejected, and fixes a logical error in the message for `JSII5010` (`immutable` and `mutable` were reversed so the message read the wrong way around). Fixes #3342 --- By submitting this pull request, I confirm that my contribution is made under the terms of the [Apache 2.0 license]. [Apache 2.0 license]: https://www.apache.org/licenses/LICENSE-2.0
|
TikiTDO
pushed a commit
to TikiTDO/aws-cdk
that referenced
this issue
Feb 21, 2022
The `BaseLoadBalancer.vpc` property fulfills the `IApplicationLoadBalancer.vpc` and `INetworkLoadBalancer.vpc` properties, both of which are optional. A bug in `jsii` (see aws/jsii#3342) makes this pass type system consistency checks, when it should not be allowed. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
🐛 Bug Report
What is the problem?
The compiler does not check members inherited from a base class against the type's declared interfaces, and consequently allows the contract of said interface to be violated.
The text was updated successfully, but these errors were encountered: