title: TypeTooLarge layout: article

TypeTooLarge occurs if unsafe.Sizeof or unsafe.Offsetof is
called with an expression whose type is too large.

Example:
 import "unsafe"

 type E [1 {{raw "<"}}{{raw "<"}} 31 - 1]int
 var a [1 {{raw "<"}}{{raw "<"}} 31]E
 var _ = unsafe.Sizeof(a)

Example:
 import "unsafe"

 type E [1 {{raw "<"}}{{raw "<"}} 31 - 1]int
 var s struct {
 	_ [1 {{raw "<"}}{{raw "<"}} 31]E
 	x int
 }
var _ = unsafe.Offsetof(s.x)