From 1300f87cb5385b808af21ac369cfd7b9d9e21a1b Mon Sep 17 00:00:00 2001 From: Sasha Koshka Date: Thu, 29 Sep 2022 20:28:51 -0400 Subject: [PATCH] when you --- analyzer/type-section_test.go | 2 +- analyzer/type.go | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/analyzer/type-section_test.go b/analyzer/type-section_test.go index 1adb0c5..af7174c 100644 --- a/analyzer/type-section_test.go +++ b/analyzer/type-section_test.go @@ -5,6 +5,6 @@ import "testing" func TestTypeSection (test *testing.T) { checkTree ("../tests/analyzer/typeSection", false, `typeSection ../tests/analyzer/typeSection.basicInt - type basic Int + type 1 basic Int `, test) } diff --git a/analyzer/type.go b/analyzer/type.go index 92757af..c42e772 100644 --- a/analyzer/type.go +++ b/analyzer/type.go @@ -76,7 +76,8 @@ func (analyzer AnalysisOperation) analyzeType ( err error, ) { outputType.mutable = inputType.Mutable() - if inputType.Length() < 1 { + outputType.length = inputType.Length() + if outputType.length < 1 { err = inputType.NewError ( "cannot specify a length of zero", infoerr.ErrorKindError)