Skip to content

Commit 8a4e258

Browse files
committed
Use Type.Array() to check if the type is array-like.
1 parent 21f10a8 commit 8a4e258

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

types/types.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ func (i *Info) Instantiate(o Info) bool {
246246
return true
247247

248248
case TPtr:
249-
if o.ElementType.Type != TArray {
249+
if !o.ElementType.Type.Array() {
250250
return false
251251
}
252252
// Instantiating array from pointer to array
@@ -272,7 +272,7 @@ func (i *Info) Instantiate(o Info) bool {
272272
// Instantiating slice from an array. Continue below.
273273

274274
case TPtr:
275-
if o.ElementType.Type != TArray {
275+
if !o.ElementType.Type.Array() {
276276
return false
277277
}
278278
// Instantiating slice from pointer to array

0 commit comments

Comments
 (0)