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

types2: missing error for invalid new call #43125

Closed
griesemer opened this issue Dec 10, 2020 · 4 comments
Closed

types2: missing error for invalid new call #43125

griesemer opened this issue Dec 10, 2020 · 4 comments
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@griesemer
Copy link
Contributor

types2 doesn't report an error for

package p
func _() {
	_ = new(1 + 1)
}

(go/types appears to work correctly.)

@griesemer griesemer added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Dec 10, 2020
@griesemer griesemer added this to the Go1.17 milestone Dec 10, 2020
@griesemer griesemer self-assigned this Dec 10, 2020
@griesemer
Copy link
Contributor Author

See also disabled test at end of $GOROOT/test/used.go.

@gopherbot
Copy link

Change https://golang.org/cl/277074 mentions this issue: [dev.typeparams] cmd/compile/internal/types2: report error for invalid type expression

gopherbot pushed a commit that referenced this issue Dec 11, 2020
…d type expression

This bug was introduced by the change from go/ast to syntax which
represents pointer types as (unary) operations rather than dedicated
StarExpr nodes. Accordingly, this bug does not exist for go/types.
It's still ok to backport the test.

Fixes #43125.

Change-Id: I69e60c3ec311dbbd635bcbd84103b1eaca799fe0
Reviewed-on: https://go-review.googlesource.com/c/go/+/277074
Trust: Robert Griesemer <gri@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
@griesemer
Copy link
Contributor Author

This was fixed with https://golang.org/cl/277074 in the dev.typeparams branch.

@gopherbot
Copy link

Change https://golang.org/cl/278013 mentions this issue: [dev.typeparams] cmd/compile/internal/types2: report error for invalid type expression

gopherbot pushed a commit that referenced this issue Dec 14, 2020
…d type expression

This bug was introduced by the change from go/ast to syntax which
represents pointer types as (unary) operations rather than dedicated
StarExpr nodes. Accordingly, this bug does not exist for go/types.
It's still ok to backport the test.

Fixes #43125.

Change-Id: Ic55d913f8afc92862856e1eb7c2861d07fc56cfb
Reviewed-on: https://go-review.googlesource.com/c/go/+/278013
Trust: Robert Griesemer <gri@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
@golang golang locked and limited conversation to collaborators Dec 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

2 participants