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: nested class names can conflict with top-level names #2648

Closed
1 of 5 tasks
Tracked by #13399
eladb opened this issue Mar 4, 2021 · 2 comments
Closed
1 of 5 tasks
Tracked by #13399

go: nested class names can conflict with top-level names #2648

eladb opened this issue Mar 4, 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 4, 2021

🐛 Bug Report

Affected Languages

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

General Information

  • JSII Version: 1.24.0
  • Platform: any

What is the problem?

Consider the following jsii code (widely used in the CDK L1 generated output):

export interface CfnBrokerProps {
  readonly tags?: CfnBroker.TagsEntryProperty[];
}

export namespace CfnBroker {
  export interface TagsEntryProperty {
    readonly key: string;
    readonly value: string;
  }
}

This will result in the following go output:

// duplicate-names
package duplicatenames


type CfnBrokerProps struct {
	Tags []cfnbroker.TagsEntryProperty `json:"tags"`
}

If I would add a class to my jsii code, e.g:

export class FooBar {
  public brokerTags?: CfnBroker.TagsEntryProperty;
}

Then, the imports are added.

@eladb eladb added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Mar 4, 2021
@eladb eladb changed the title go: missing imports for namespaces if they are only referenced in structs go: nested class names can conflict with top-level names Mar 14, 2021
@eladb
Copy link
Contributor Author

eladb commented Mar 14, 2021

Fixed by #2650

@eladb eladb closed this as completed Mar 14, 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

No branches or pull requests

2 participants