mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-05 19:43:44 +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
Vendored
+1
@@ -148,6 +148,7 @@ func main() {
|
||||
assertSize(reflect.TypeOf(uintptr(0)).Size() == unsafe.Sizeof(uintptr(0)), "uintptr")
|
||||
assertSize(reflect.TypeOf("").Size() == unsafe.Sizeof(""), "string")
|
||||
assertSize(reflect.TypeOf(new(int)).Size() == unsafe.Sizeof(new(int)), "*int")
|
||||
assertSize(reflect.TypeOf(zeroFunc).Size() == unsafe.Sizeof(zeroFunc), "func()")
|
||||
|
||||
// SetBool
|
||||
rv := reflect.ValueOf(new(bool)).Elem()
|
||||
|
||||
Reference in New Issue
Block a user