mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-08 13:03:39 +00:00
reflect: implement Sizeof and Alignof for func values
This is a small change that appears to be necessary for encoding/json support. It's simple enough to implement.
This commit is contained in:
committed by
Ron Evans
parent
16e7dd83a3
commit
4f6d598ea8
@@ -150,6 +150,9 @@ func (s *stdSizes) Sizeof(T types.Type) int64 {
|
||||
return s.PtrSize * 2
|
||||
case *types.Pointer:
|
||||
return s.PtrSize
|
||||
case *types.Signature:
|
||||
// Func values in TinyGo are two words in size.
|
||||
return s.PtrSize * 2
|
||||
default:
|
||||
panic("unknown type: " + t.String())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user