mirror of
https://github.com/golang/go
synced 2024-09-05 16:04:50 +00:00
parent
ff6e310b00
commit
ee6b883101
18
test/bugs/bug246.go
Normal file
18
test/bugs/bug246.go
Normal file
|
@ -0,0 +1,18 @@
|
|||
// $G $D/$F.go || echo BUG: bug246
|
||||
|
||||
// Copyright 2009 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package main
|
||||
|
||||
import "unsafe"
|
||||
|
||||
func main() {
|
||||
// works
|
||||
addr := uintptr(0)
|
||||
_ = (*int)(unsafe.Pointer(addr))
|
||||
|
||||
// fails
|
||||
_ = (*int)(unsafe.Pointer(uintptr(0)))
|
||||
}
|
|
@ -149,3 +149,8 @@ panic PC=xxx
|
|||
bad map check 13 false false
|
||||
panic PC=xxx
|
||||
BUG: tuple evaluation order
|
||||
|
||||
=========== bugs/bug246.go
|
||||
bugs/bug246.go:17: cannot convert 0 to type unsafe.Pointer
|
||||
bugs/bug246.go:17: cannot convert 0 (type uintptr) to type *int in conversion
|
||||
BUG: bug246
|
||||
|
|
Loading…
Reference in a new issue