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
{{ message }}
Repository navigation
cmd/compile: panic message for failed assertion of generic type mentions shape type, not user type #53276
The above program reports at run-time "panic: interface conversion: interface { T() go.shape.int_0 } is nil, not int".
I think the correct error is "panic: interface conversion: interface { T() int } is nil, not int".
The problem is the call to s.reflectType(src) in ssagen/ssa.go. This is too late to do dictionary lookups, so we end up using the *runtime._type for the shape type, rather than the user type.
We should push all the reflectdata.TypePtr / reflectdata.TypeLinksym calls earlier into the frontend, so they can be replaced with dictionary accesses when appropriate. Same applies to reflectdata.ITabAddr and reflectdata.ITabLSym.
Activity
gopherbot commentedon Jun 10, 2022
Change https://go.dev/cl/411695 mentions this issue:
[dev.unified] test: add regress tests for #53276 and #53328[dev.unified] test: add regress tests for #53276 and #53328
gopherbot commentedon Jun 21, 2022
Change https://go.dev/cl/413357 mentions this issue:
[dev.unified] cmd/compile: avoid reflectType in ssagen[dev.unified] cmd/compile: avoid reflectType in ssagen
gopherbot commentedon Aug 4, 2022
Change https://go.dev/cl/421374 mentions this issue:
all: REVERSE MERGE dev.unified (d558507) into masterall: REVERSE MERGE dev.unified (d558507) into master
[dev.unified] test: add regress tests for golang#53276 and golang#53328
[dev.unified] cmd/compile: avoid reflectType in ssagen
[dev.unified] test: add regress tests for golang#53276 and golang#53328
cuonglm commentedon Sep 30, 2022
@mdempsky seems we can close this now?
mdempsky commentedon Sep 30, 2022
@cuonglm Yes, thanks.