Merge pull request #874 from cpunion/fix-closure

ssa: fix wrong reflect type of closure
This commit is contained in:
xushiwei
2024-11-25 11:05:04 +08:00
committed by GitHub
5 changed files with 162 additions and 0 deletions

View File

@@ -92,6 +92,9 @@ func (p goTypes) cvtType(typ types.Type) (raw types.Type, cvt bool) {
return types.NewMap(key, elem), true
}
case *types.Struct:
if isClosure(t) {
return typ, false
}
return p.cvtStruct(t)
case *types.Named:
if v, ok := p.typbg.Load(namedLinkname(t)); ok && v.(Background) == InC {