mirror of
https://github.com/golang/go.git
synced 2025-05-29 11:25:43 +00:00
gc: improve unsafe.Pointer type-check error messages
Fixes #2627. R=golang-dev, iant CC=golang-dev https://golang.org/cl/5498088
This commit is contained in:
parent
518872bf8f
commit
a15448d65e
@ -79,6 +79,7 @@ static char* _typekind[] = {
|
||||
[TSTRING] = "string",
|
||||
[TPTR32] = "pointer",
|
||||
[TPTR64] = "pointer",
|
||||
[TUNSAFEPTR] = "unsafe.Pointer",
|
||||
[TSTRUCT] = "struct",
|
||||
[TINTER] = "interface",
|
||||
[TCHAN] = "chan",
|
||||
|
16
test/fixedbugs/bug390.go
Normal file
16
test/fixedbugs/bug390.go
Normal file
@ -0,0 +1,16 @@
|
||||
// errchk $G -e $D/$F.go
|
||||
|
||||
// Copyright 2011 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.
|
||||
|
||||
// Issue 2627 -- unsafe.Pointer type isn't handled nicely in some errors
|
||||
|
||||
package main
|
||||
|
||||
import "unsafe"
|
||||
|
||||
func main() {
|
||||
var x *int
|
||||
_ = unsafe.Pointer(x) - unsafe.Pointer(x) // ERROR "operator - not defined on unsafe.Pointer"
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user