Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(jsii): compiler allows inheriting interface-violating members (#3343
) 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
- Loading branch information
Romain Marcadier
committed
Jan 18, 2022
1 parent
3edf74c
commit b5037b9
Showing
4 changed files
with
248 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.