The unsafe package is pretty much virtual. The compiler is aware of it and implements the operations defined by the spec <https://golang.org/ref/spec#Package_unsafe> to be in it.
On Thu, Feb 16, 2017 at 6:54 AM, <lael.cell...@gmail.com> wrote: > Hello, > > I'm trying to redeclare the Pointer type > I found unsafe/unsafe.go inside compiler source where the Pointer type is > declared like this : > type ArbitraryType int > type Pointer *ArbitraryType. > but obviously, this isn’t the declaration which used with Pointer() inside > normal programs : > package main > > type ArbitraryType int > type Pointer *ArbitraryType > > func main() { > f := *(*func() int)(Pointer(uintptr(0))) > f() > } > > main.go:7: cannot convert Pointer(uintptr(0)) (type Pointer) to type *func() > int > > > So where is the Pointer type declared ? > > -- > You received this message because you are subscribed to the Google Groups > "golang-nuts" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to golang-nuts+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.