lang: change const array to const roarray

This commit is contained in:
Nigel Tao committed 2023-04-10 16:06:10 +10:00
1 parent f3caf09d77
commit ea3fbc37f5
11 files changed
+42 -42

No files matched your search

+2 -2
View File
@@ -375,14 +375,14 @@ func (c *Checker) checkConst(node *a.Node) error {
nLists := 0
for elemTyp := typ; ; {
if elemTyp.IsEitherArrayType() {
if dec := elemTyp.Decorator(); dec == t.IDRoarray {
if nLists == a.MaxTypeExprDepth {
return fmt.Errorf("check: type expression recursion depth too large")
}
nLists++
elemTyp = elemTyp.Inner()
continue
} else if elemTyp.Decorator() != 0 {
} else if dec != 0 {
return fmt.Errorf("check: invalid const type %q for %s", n.XType().Str(c.tm), qid.Str(c.tm))
}
break