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: a parameter named "_" results in invalid go code #2651

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: a parameter named "_" results in invalid go code #2651

eladb opened this issue Mar 4, 2021 · 2 comments
Labels
bug This issue is a bug. closed-for-staleness effort/small Small work item – less than a day of effort language/go Regarding GoLang bindings p2

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?

export class Foo {
  public bar(_: number) {
    return;
  }
}

Output:

./playground.go:38:17: cannot use _ as value

Verbose Log

// duplicate-names
package duplicatenames

import (
	_jsii_ "github.com/aws/jsii-runtime-go"
	_init_ "github.com/foo/bar/duplicatenames/jsii"
)

type Foo interface {
	Bar(_ string)
}

// The jsii proxy struct for Foo
type foo_jsiiProxy struct {
	_ byte // padding
}

func NewFoo() Foo {
	_init_.Initialize()

	f := foo_jsiiProxy{}

	_jsii_.Create(
		"duplicate-names.Foo",
		nil /* no parameters */,
		[]_jsii_.FQN{},
		nil, // no overrides
		&f,
	)

	return &f
}

func (f *foo_jsiiProxy) Bar(_ string) {
	_jsii_.InvokeVoid(
		f,
		"bar",
		[]interface{}{_},
	)
}
@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 added this to Backlog in Go Developer Preview via automation Mar 4, 2021
@MrArnoldPalmer MrArnoldPalmer moved this from Backlog to Punt in Go Developer Preview Mar 11, 2021
@eladb
Copy link
Contributor Author

eladb commented Mar 11, 2021

Implementation: mangle the parameter name in the go code generation

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*
@MrArnoldPalmer MrArnoldPalmer removed their assignment Mar 30, 2021
@MrArnoldPalmer MrArnoldPalmer added language/go Regarding GoLang bindings effort/small Small work item – less than a day of effort p2 and removed cdk-blocker needs-triage This issue or PR still needs to be triaged. labels Mar 30, 2021
@MrArnoldPalmer MrArnoldPalmer added this to Backlog in Go General Availability via automation Mar 30, 2021
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*
@MrArnoldPalmer MrArnoldPalmer moved this from Backlog to To do in Go General Availability Apr 18, 2021
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*
@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 Mar 31, 2023
@github-actions github-actions bot closed this as completed Apr 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/small Small work item – less than a day of effort language/go Regarding GoLang bindings p2
Projects
Status: Done
Development

No branches or pull requests

2 participants