From 1924892ab6ab56b00b27e43e2e4450efe2a5272e Mon Sep 17 00:00:00 2001 From: Sasha Koshka Date: Tue, 11 Oct 2022 23:51:55 -0400 Subject: [PATCH] Fixed isSingular --- analyzer/analyzer.go | 2 ++ analyzer/type.go | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/analyzer/analyzer.go b/analyzer/analyzer.go index 54e7af9..6849681 100644 --- a/analyzer/analyzer.go +++ b/analyzer/analyzer.go @@ -232,6 +232,8 @@ func (analyzer *AnalysisOperation) typeCheck ( return } +// doIndent perfroms a fmt.Sprint operation on input, indenting the string. This +// does not add a trailing newline. func doIndent (indent int, input ...any) (output string) { for index := 0; index < indent; index ++ { output += "\t" diff --git a/analyzer/type.go b/analyzer/type.go index f532b6b..d0f04d7 100644 --- a/analyzer/type.go +++ b/analyzer/type.go @@ -127,6 +127,11 @@ func (what Type) isSingular () (singular bool) { return } + if what.length > 0 { + singular = true + return + } + // decide whether or not to recurse if what.kind != TypeKindBasic { return } actual := what.actual