From 8a4e258ee2b98a9e96e8f18193a6813dc3281d36 Mon Sep 17 00:00:00 2001 From: Markku Rossi Date: Wed, 23 Oct 2024 10:52:39 +0200 Subject: [PATCH] Use Type.Array() to check if the type is array-like. --- types/types.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/types.go b/types/types.go index a4fe6de..0918df2 100644 --- a/types/types.go +++ b/types/types.go @@ -246,7 +246,7 @@ func (i *Info) Instantiate(o Info) bool { return true case TPtr: - if o.ElementType.Type != TArray { + if !o.ElementType.Type.Array() { return false } // Instantiating array from pointer to array @@ -272,7 +272,7 @@ func (i *Info) Instantiate(o Info) bool { // Instantiating slice from an array. Continue below. case TPtr: - if o.ElementType.Type != TArray { + if !o.ElementType.Type.Array() { return false } // Instantiating slice from pointer to array