Identical static methods in parent/child classes are mistakenly marked as overrides in java resulting in a compilation error #2358
Labels
bug
This issue is a bug.
effort/small
Small work item – less than a day of effort
language/dotnet
Related to .NET bindings (C#, F#, ...)
language/java
Related to Java bindings
module/pacmak
Issues affecting the `jsii-pacmak` module
p1
Milestone
🐛 Bug Report
Affected Languages
TypeScript
orJavascript
Python
Java
C#
,F#
, ...) [Probably]General Information
What is the problem?
We encountered a scenario in
aws-cdk
that generates illegal java code, annotating static methods with the@Override
annotation.This happens when a child class has the same static method as its parent.
This code will generate a JSII assembly that marks the
Child.hello
function both as static and as overrides ofParent.hello
.The generated java code will look like:
Resulting in a compilation error:
method does not override or implement a method from a supertype
See aws/aws-cdk#12091 for the full scenario.
The text was updated successfully, but these errors were encountered: