You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The project I'm working on is proprietary unfortunately & my laptop is about to die so you won't be getting a minimum viable bug replication today. :(
However, I believe this is the bit that caused the compiler error:
total := func() int64 {
var total int64
var dones int
for {
select {
case total += <-sizes:
case <-done:
dones += 1
if dones == len(o) {
return total
}
}
}
}()
What did you expect to see?
I was expecting to see a type error or syntax related error, or maybe even no compilation errors at all!!
What did you see instead?
It asks me to "Please file a bug report including a short program that triggers the error."
Not sure if this is supposed to make my code compile?
Compiling the (proprietary) project results in:
# mvd
select case
. ASOP-ADD AsOp:ADD tc(1) # overlay.go:158:15,overlay.go:167:3
. . NAME-main.total esc(no) Class:PAUTO Offset:0 InlLocal OnStack Used int64 tc(1) # overlay.go:154:7,overlay.go:167:3
. . RECV int64 tc(1) # overlay.go:158:18,overlay.go:167:3
. . . NAME-main.sizes esc(no) Class:PAUTO Offset:0 Byval OnStack CHAN-chan int64 tc(1) # overlay.go:133:2
./overlay.go:167:3: internal compiler error: unknown op in select ASOP
Please file a bug report including a short program that triggers the error.
https://go.dev/issue/new
The text was updated successfully, but these errors were encountered:
Thanks. Here is a complete test case that reproduces the problem in Go 1.19:
package p
funcF(c1, c2chanint) int {
vartotalintselect {
casetotal+=<-c1:
case<-c2:
}
returntotal
}
In Go 1.20 this prints
foo.go:6:13: select case must be receive, send or assign recv
This code is invalid so this is basically a really bad error message in Go 1.19. Since it's fixed in Go 1.20, and since I don't think we should backport the fix, I'm going to close this issue. Thanks for reporting the problem.
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
The project I'm working on is proprietary unfortunately & my laptop is about to die so you won't be getting a minimum viable bug replication today. :(
However, I believe this is the bit that caused the compiler error:
What did you expect to see?
I was expecting to see a type error or syntax related error, or maybe even no compilation errors at all!!
What did you see instead?
It asks me to "Please file a bug report including a short program that triggers the error."
Not sure if this is supposed to make my code compile?
Compiling the (proprietary) project results in:
The text was updated successfully, but these errors were encountered: