Skip to content
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

Skipping an optional property in an abstract class generates invalid C# code #2040

Closed
1 of 4 tasks
skinny85 opened this issue Sep 23, 2020 · 1 comment
Closed
1 of 4 tasks
Labels
bug This issue is a bug. closed-for-staleness effort/medium Medium work item – a couple days of effort language/dotnet Related to .NET bindings (C#, F#, ...) module/pacmak Issues affecting the `jsii-pacmak` module p1

Comments

@skinny85
Copy link
Contributor

🐛 Bug Report

Affected Languages

  • TypeScript or Javascript
  • Python
  • Java
  • .NET (C#, F#, ...)

General Information

  • JSII Version: 1.12.0
  • Platform: Darwin 186590cdb71d.ant.amazon.com 18.7.0 Darwin Kernel Version 18.7.0: Thu Jun 18 20:50:10 PDT 2020; root:xnu-4903.278.43~1/RELEASE_X86_64 x86_64

What is the problem?

The following CDK PR: aws/aws-cdk#10488 broke C# compilation:

#STDOUT> Amazon/CDK/AWS/RDS/DatabaseClusterBaseProxy.cs(86,60): error CS0115: 'DatabaseClusterBaseProxy.Engine': no suitable method found to override [/tmp/npm-pack8yL6Iq/Amazon.CDK.MonoCDK.Experiment/Amazon.CDK.MonoCDK.Experiment.csproj]
#STDOUT> Amazon/CDK/AWS/RDS/DatabaseInstanceBaseProxy.cs(88,61): error CS0115: 'DatabaseInstanceBaseProxy.Engine': no suitable method found to override [/tmp/npm-pack8yL6Iq/Amazon.CDK.MonoCDK.Experiment/Amazon.CDK.MonoCDK.Experiment.csproj]
#STDOUT> Amazon/CDK/AWS/RDS/DatabaseClusterBaseProxy.cs(86,60): error CS0115: 'DatabaseClusterBaseProxy.Engine': no suitable method found to override [/tmp/npm-pack8yL6Iq/Amazon.CDK.AWS.RDS/Amazon.CDK.AWS.RDS.csproj]
#STDOUT> Amazon/CDK/AWS/RDS/DatabaseInstanceBaseProxy.cs(88,61): error CS0115: 'DatabaseInstanceBaseProxy.Engine': no suitable method found to override [/tmp/npm-pack8yL6Iq/Amazon.CDK.AWS.RDS/Amazon.CDK.AWS.RDS.csproj]

The code is roughly:

interface ISomeInterface {
  readonly optProp?: string;

  // just to make it clear this is not a struct
  bind(options: string): string;
}

abstract class SomeBase implements ISomeInterface {
  public bind(options: string): string { return options; }
}

export class Some extends SomeBase {
  public readonly optProp = 'Some';
}
@skinny85 skinny85 added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Sep 23, 2020
skinny85 added a commit to skinny85/aws-cdk that referenced this issue Sep 23, 2020
mergify bot pushed a commit to aws/aws-cdk that referenced this issue Sep 24, 2020
…build (#10502)

Caused by JSII issue: aws/jsii#2040

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
@RomainMuller RomainMuller added p1 effort/medium Medium work item – a couple days of effort language/dotnet Related to .NET bindings (C#, F#, ...) module/pacmak Issues affecting the `jsii-pacmak` module and removed needs-triage This issue or PR still needs to be triaged. labels Sep 24, 2020
@MrArnoldPalmer MrArnoldPalmer removed their assignment Jun 28, 2021
@github-actions
Copy link
Contributor

This issue has not received any attention in 2 years. If you want to keep this issue open, please leave a comment below and auto-close will be canceled.

@github-actions github-actions bot added closing-soon This issue will automatically close in 4 days unless further comments are made. closed-for-staleness and removed closing-soon This issue will automatically close in 4 days unless further comments are made. labels Jun 29, 2023
@github-actions github-actions bot closed this as completed Jul 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. closed-for-staleness effort/medium Medium work item – a couple days of effort language/dotnet Related to .NET bindings (C#, F#, ...) module/pacmak Issues affecting the `jsii-pacmak` module p1
Projects
None yet
Development

No branches or pull requests

3 participants