-
Notifications
You must be signed in to change notification settings - Fork 257
Closed
Labels
bugThis issue is a bug.This issue is a bug.effort/smallSmall work item – less than a day of effortSmall work item – less than a day of effortlanguage/dotnetRelated to .NET bindings (C#, F#, ...)Related to .NET bindings (C#, F#, ...)language/javaRelated to Java bindingsRelated to Java bindingsmodule/pacmakIssues affecting the `jsii-pacmak` moduleIssues affecting the `jsii-pacmak` modulep1
Milestone
Description
🐛 Bug Report
Affected Languages
-
TypeScriptorJavascript -
Python -
Java - .NET (
C#,F#, ...) [Probably]
General Information
- JSII Version: 1.15.0 (build 585166b), typescript 3.9.7
- Platform: MacOS, CodeBuild (jsii/superchain)
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.
export class Parent {
public static hello() {}
}
export class Child extends Parent {
public static hello() {}
}This code will generate a JSII assembly that marks the Child.hello function both as static and as overrides of Parent.hello.
The generated java code will look like:
public class Child extends Parent {
@Override
public static hello() {}
}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.
Metadata
Metadata
Assignees
Labels
bugThis issue is a bug.This issue is a bug.effort/smallSmall work item – less than a day of effortSmall work item – less than a day of effortlanguage/dotnetRelated to .NET bindings (C#, F#, ...)Related to .NET bindings (C#, F#, ...)language/javaRelated to Java bindingsRelated to Java bindingsmodule/pacmakIssues affecting the `jsii-pacmak` moduleIssues affecting the `jsii-pacmak` modulep1