mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-24 16:52:18 +01:00
lang/check: tighten checkConstElement constraint
This commit is contained in:
1 parent
4834cb97c8
commit
95630b6677
1 file changed
+1
-1
+1
-1
@@ -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 {
|
func (c *Checker) checkConstElement(typ *a.TypeExpr, n *a.Expr, nb bounds, nLists int) error {
|
||||||
if nLists > 0 {
|
if nLists > 0 {
|
||||||
nLists--
|
nLists--
|
||||||
if !typ.IsEitherArrayType() {
|
if typ.Decorator() != t.IDRoarray {
|
||||||
return fmt.Errorf("internal error: inconsistent element type %q", typ.Str(c.tm))
|
return fmt.Errorf("internal error: inconsistent element type %q", typ.Str(c.tm))
|
||||||
}
|
}
|
||||||
cv := typ.ArrayLength().ConstValue()
|
cv := typ.ArrayLength().ConstValue()
|
||||||
|
|||||||
Reference in new issue
Block a user