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

cmd/compile: generate more error message for broken type #33947

Closed
cuonglm opened this issue Aug 29, 2019 · 1 comment
Closed

cmd/compile: generate more error message for broken type #33947

cuonglm opened this issue Aug 29, 2019 · 1 comment

Comments

@cuonglm
Copy link
Member

cuonglm commented Aug 29, 2019

In https://go-review.googlesource.com/c/go/+/191540, @mdempsky suggest to remove this check:

e87fe0f#diff-aaf437751c6b1cd31172b7003e905499R507

With that change, gc will generate more error for test/fixedbugs/issue5172.go:

package main

type foo struct {
	x bar // ERROR "undefined"
}

func main() {
	var f foo
	go f.bar()    // GCCGO_ERROR "undefined"
	defer f.bar() // GCCGO_ERROR "undefined"
}

OTOH, the same behavior with gccgo. #5172 is long time ago and I don't get full context about it.

cc @dominikh

@gopherbot
Copy link

Change https://golang.org/cl/191944 mentions this issue: cmd/compile: emit error message for broken type

tomocy pushed a commit to tomocy/go that referenced this issue Sep 1, 2019
The original report in golang#5172 was that cmd/compile was generating bogus
follow-on error messages when typechecking a struct failed. Instead of
fixing those follow-on error messages, golang.org/cl/9614044 suppress all
follow-on error messages after struct typecheck fails. We should
continue emitting error messages instead.

While at it, also add the test case for original report.

Fixes golang#33947

Change-Id: I4a5c6878977128abccd704350a12df743631c7bf
Reviewed-on: https://go-review.googlesource.com/c/go/+/191944
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
t4n6a1ka pushed a commit to t4n6a1ka/go that referenced this issue Sep 5, 2019
The original report in golang#5172 was that cmd/compile was generating bogus
follow-on error messages when typechecking a struct failed. Instead of
fixing those follow-on error messages, golang.org/cl/9614044 suppress all
follow-on error messages after struct typecheck fails. We should
continue emitting error messages instead.

While at it, also add the test case for original report.

Fixes golang#33947

Change-Id: I4a5c6878977128abccd704350a12df743631c7bf
Reviewed-on: https://go-review.googlesource.com/c/go/+/191944
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
@golang golang locked and limited conversation to collaborators Aug 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants