From 95630b6677b377178352be41a5a72e83286ee710 Mon Sep 17 00:00:00 2001 From: Nigel Tao Date: Sun, 16 Apr 2023 11:50:30 +1000 Subject: [PATCH] lang/check: tighten checkConstElement constraint --- lang/check/check.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/check/check.go b/lang/check/check.go index 208b6dc3..85dd23e7 100644 --- a/lang/check/check.go +++ b/lang/check/check.go @@ -405,7 +405,7 @@ func (c *Checker) checkConst(node *a.Node) error { func (c *Checker) checkConstElement(typ *a.TypeExpr, n *a.Expr, nb bounds, nLists int) error { if nLists > 0 { nLists-- - if !typ.IsEitherArrayType() { + if typ.Decorator() != t.IDRoarray { return fmt.Errorf("internal error: inconsistent element type %q", typ.Str(c.tm)) } cv := typ.ArrayLength().ConstValue()