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

go: missing class methods for multiple inheritance of same interface #2700

Closed
1 of 5 tasks
eladb opened this issue Mar 15, 2021 · 2 comments
Closed
1 of 5 tasks

go: missing class methods for multiple inheritance of same interface #2700

eladb opened this issue Mar 15, 2021 · 2 comments
Assignees
Labels
bug This issue is a bug. cdk-blocker needs-triage This issue or PR still needs to be triaged.

Comments

@eladb
Copy link
Contributor

eladb commented Mar 15, 2021

🐛 Bug Report

Affected Languages

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

General Information

  • JSII Version: 1.42.0
  • Platform: any

What is the problem?

export interface IFoo {
  bar(): string;
  readonly baz: number;
}

export class Base implements IFoo {
  public readonly baz = 120;
  public bar() {
    return 'bar';
  }
}

export class Derived extends Base implements IFoo {
  public zoo() {
    return 'zoo';
  }
}

This results in the following error:

#STDERR> # github.com/aws/jsii/jsii-calc/go/jsiicalc/v3/module2700
#STDERR> module2700/module2700.go:72:9: jsiiProxy_Derived.Bar is ambiguous
#STDERR> module2700/module2700.go:72:9: cannot use &j (type *jsiiProxy_Derived) as type Derived in return argument:
#STDERR> 	*jsiiProxy_Derived does not implement Derived (missing Bar method)
#STDERR>
#STDOUT>
#STDERR> module2700/module2700.go:84:9: jsiiProxy_Derived.Baz is ambiguous
#STDERR> module2700/module2700.go:84:9: cannot use &j (type *jsiiProxy_Derived) as type Derived in return argument:
#STDERR> 	*jsiiProxy_Derived does not implement Derived (missing Baz method)
#STDERR>
#STDOUT>
@eladb eladb added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. cdk-blocker labels Mar 15, 2021
@eladb eladb changed the title go: class missing implementations for multiple inheritance of same interface go: missing class methods for multiple inheritance of same interface Mar 15, 2021
eladb pushed a commit that referenced this issue Mar 15, 2021
If a class implements an interface from multiple paths (e.g. directly and via a base), then Go compilation fails with an ambiguity issue.

Simplify by always re-implementing all methods and properties in derived classes.

Fixes #2700
@eladb eladb self-assigned this Mar 15, 2021
eladb pushed a commit that referenced this issue Mar 15, 2021
…ce (#2701)

If a class implements an interface from multiple paths (e.g. directly and via a base), then Go compilation fails with an ambiguity issue.

Simplify by always re-implementing all methods and properties in derived classes.

Fixes #2700
@eladb
Copy link
Contributor Author

eladb commented Mar 17, 2021

Fixed.

@eladb eladb closed this as completed Mar 17, 2021
@github-actions
Copy link
Contributor

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

mergify bot pushed a commit to aws/aws-cdk that referenced this issue Mar 25, 2021
Add `go` configuration to the `monocdk` and `aws-cdk-lib` packages. 

Resolves aws/jsii#2611

The following jsii bugs were fixed to enable this:

- [x] aws/jsii#2648
- [x] aws/jsii#2649
- [x] aws/jsii#2647
- [x] aws/jsii#2617
- [x] aws/jsii#2632
- [x] aws/jsii#2651
- [x] aws/jsii#2508
- [x] aws/jsii#2692
- [x] aws/jsii#2700
- [x] aws/jsii#2702

---

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
corrjo pushed a commit to corrjo/aws-cdk that referenced this issue Mar 25, 2021
Add `go` configuration to the `monocdk` and `aws-cdk-lib` packages.

Resolves aws/jsii#2611

The following jsii bugs were fixed to enable this:

- [x] aws/jsii#2648
- [x] aws/jsii#2649
- [x] aws/jsii#2647
- [x] aws/jsii#2617
- [x] aws/jsii#2632
- [x] aws/jsii#2651
- [x] aws/jsii#2508
- [x] aws/jsii#2692
- [x] aws/jsii#2700
- [x] aws/jsii#2702

---

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
hollanddd pushed a commit to hollanddd/aws-cdk that referenced this issue Mar 31, 2021
Add `go` configuration to the `monocdk` and `aws-cdk-lib` packages. 

Resolves aws/jsii#2611

The following jsii bugs were fixed to enable this:

- [x] aws/jsii#2648
- [x] aws/jsii#2649
- [x] aws/jsii#2647
- [x] aws/jsii#2617
- [x] aws/jsii#2632
- [x] aws/jsii#2651
- [x] aws/jsii#2508
- [x] aws/jsii#2692
- [x] aws/jsii#2700
- [x] aws/jsii#2702

---

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
hollanddd pushed a commit to hollanddd/aws-cdk that referenced this issue Aug 26, 2021
Add `go` configuration to the `monocdk` and `aws-cdk-lib` packages.

Resolves aws/jsii#2611

The following jsii bugs were fixed to enable this:

- [x] aws/jsii#2648
- [x] aws/jsii#2649
- [x] aws/jsii#2647
- [x] aws/jsii#2617
- [x] aws/jsii#2632
- [x] aws/jsii#2651
- [x] aws/jsii#2508
- [x] aws/jsii#2692
- [x] aws/jsii#2700
- [x] aws/jsii#2702

---

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
eladb pushed a commit to cdklabs/decdk that referenced this issue Jan 18, 2022
Add `go` configuration to the `monocdk` and `aws-cdk-lib` packages. 

Resolves aws/jsii#2611

The following jsii bugs were fixed to enable this:

- [x] aws/jsii#2648
- [x] aws/jsii#2649
- [x] aws/jsii#2647
- [x] aws/jsii#2617
- [x] aws/jsii#2632
- [x] aws/jsii#2651
- [x] aws/jsii#2508
- [x] aws/jsii#2692
- [x] aws/jsii#2700
- [x] aws/jsii#2702

---

*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
Labels
bug This issue is a bug. cdk-blocker needs-triage This issue or PR still needs to be triaged.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant