@@ -8,11 +8,12 @@ import (
8
8
)
9
9
10
10
var (
11
- typeInt = types .Typ [types .Int ]
12
- typeString = types .Typ [types .String ]
13
- typeInt32 = types .Typ [types .Int32 ]
14
- typeUint8 = types .Typ [types .Uint8 ]
15
- typeEstruct = types .NewStruct (nil , nil )
11
+ typeInt = types .Typ [types .Int ]
12
+ typeString = types .Typ [types .String ]
13
+ typeInt32 = types .Typ [types .Int32 ]
14
+ typeUint8 = types .Typ [types .Uint8 ]
15
+ typeUnsafePtr = types .Typ [types .UnsafePointer ]
16
+ typeEstruct = types .NewStruct (nil , nil )
16
17
17
18
stringerIface = types .NewInterfaceType ([]* types.Func {
18
19
types .NewFunc (token .NoPos , nil , "String" ,
@@ -91,6 +92,9 @@ func TestIdentical(t *testing.T) {
91
92
{`[]rune` , types .NewSlice (typeInt32 )},
92
93
{`[8]byte` , types .NewArray (typeUint8 , 8 )},
93
94
95
+ {`unsafe.Pointer` , typeUnsafePtr },
96
+ {`[]unsafe.Pointer` , types .NewSlice (typeUnsafePtr )},
97
+
94
98
{`func()` , types .NewSignature (nil , nil , nil , false )},
95
99
{`func(int)` , types .NewSignature (nil , types .NewTuple (intVar ), nil , false )},
96
100
{`func(int, string)` , types .NewSignature (nil , types .NewTuple (intVar , stringVar ), nil , false )},
@@ -176,6 +180,10 @@ func TestIdenticalNegative(t *testing.T) {
176
180
{`map[int]int` , types .NewMap (typeString , typeInt )},
177
181
{`map[int]int` , types .NewMap (typeInt , typeString )},
178
182
183
+ {`unsafe.Pointer` , typeInt },
184
+ {`unsafe.Pointer` , types .NewPointer (typeInt )},
185
+ {`[]unsafe.Pointer` , types .NewSlice (typeInt )},
186
+
179
187
{`interface{}` , typeInt },
180
188
{`interface{ $*_ }` , typeString },
181
189
{`interface{ $*_ }` , types .NewArray (typeString , 10 )},
0 commit comments