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

misc/cgo/errors: err2.go test is broken and erroneously passing #46534

Closed
mdempsky opened this issue Jun 3, 2021 · 2 comments
Closed

misc/cgo/errors: err2.go test is broken and erroneously passing #46534

mdempsky opened this issue Jun 3, 2021 · 2 comments
Labels
FrozenDueToAge help wanted NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@mdempsky
Copy link
Contributor

mdempsky commented Jun 3, 2021

This test for #26745 is intended to check that the error messages are reported at columns 13 and 6 on these lines, respectively:

// issue 26745
_ = func(i int) int {
return C.i + 1 // ERROR HERE: :13
}
_ = func(i int) {
C.fi(i) // ERROR HERE: :6
}

But that's not where we're reporting those errors:

$ go version
go version go1.16.3 linux/amd64

$ go build -gcflags=-e err2.go |& grep -E ':(9[47]|13|6):'
./err2.go:43:6: x redeclared in this block
./err2.go:47:13: not enough arguments in call to _Cfunc_fopen
./err2.go:50:6: x redeclared in this block
./err2.go:51:6: cannot use _Cfunc_transform(x) (type _Ctype_int) as type rune in assignment
./err2.go:94:14: cannot use *_Cvar_i + 1 (type _Ctype_int) as type int in return argument
./err2.go:97:7: cannot use i (type int) as type _Ctype_int in argument to _Cfunc_fi

It appears the test is currently passing simply because ":13" and ":6" appear elsewhere in the output.

I ran into this because types2 reports the line 94 and 97 diagnostics at columns 10 and 8 (!?) respectively, but then reports the "not enough arguments" error at column 6 instead, causing the ":13" match to start failing.

/cc @ianlancetaylor @iamoryanmoshe

@mdempsky mdempsky added help wanted NeedsFix The path to resolution is known, but the work has not been done. labels Jun 3, 2021
@mdempsky mdempsky added this to the Go1.18 milestone Jun 3, 2021
@gopherbot
Copy link
Contributor

Change https://golang.org/cl/325029 mentions this issue: [dev.typeparams] misc/cgo/errors: disable broken test

@gopherbot
Copy link
Contributor

Change https://golang.org/cl/324970 mentions this issue: misc/cgo/errors: use expected column numbers

@golang golang locked and limited conversation to collaborators Jun 5, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge help wanted NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

2 participants