mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-04 19:17:47 +00:00
reflect: return correct name for unsafe.Pointer type
For some reason, the type kind name is "unsafe.Pointer" while the .Name() method just returns "Pointer". Not sure why this difference exists, but to be able to test .Name() in testdata/reflect.go it needs to match.
This commit is contained in:
+3
-1
@@ -1060,8 +1060,10 @@ func (t *rawType) Name() string {
|
||||
panic("corrupt name data")
|
||||
}
|
||||
|
||||
if t.Kind() <= UnsafePointer {
|
||||
if kind := t.Kind(); kind < UnsafePointer {
|
||||
return t.Kind().String()
|
||||
} else if kind == UnsafePointer {
|
||||
return "Pointer"
|
||||
}
|
||||
|
||||
return ""
|
||||
|
||||
Reference in New Issue
Block a user