diff options
Diffstat (limited to 'test/const1.go')
-rw-r--r-- | test/const1.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/const1.go b/test/const1.go index 1580b76c6..a170ce9e7 100644 --- a/test/const1.go +++ b/test/const1.go @@ -9,6 +9,8 @@ package main +import "unsafe" + type I interface{} const ( @@ -86,3 +88,7 @@ func main() { } const ptr = nil // ERROR "const.*nil" +const _ = string([]byte(nil)) // ERROR "is not a constant" +const _ = uintptr(unsafe.Pointer((*int)(nil))) // ERROR "is not a constant" +const _ = unsafe.Pointer((*int)(nil)) // ERROR "cannot be nil" +const _ = (*int)(nil) // ERROR "cannot be nil" |