Skip to content

array type size incorrect #1155

@visualfc

Description

@visualfc
package main

import (
	"fmt"
	"reflect"
	"unsafe"
)

type T [8]int

func main() {
	var t1 T
	var t2 [8]int
	fmt.Println(unsafe.Sizeof(t1))
	fmt.Println(unsafe.Sizeof(t2))
	fmt.Println(reflect.TypeOf(t1).Size())
	fmt.Println(reflect.TypeOf(t2).Size())
}

gopherjs run main.go

32
32
32
12 // error array type size

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions