mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-24 00:52:18 +01:00
lang: add read-only type decorators
This commit is contained in:
1 parent
6e8349129c
commit
f3caf09d77
14 files changed
+132
-77
No files matched your search
+2
-2
@@ -375,7 +375,7 @@ func (c *Checker) checkConst(node *a.Node) error {
|
||||
|
||||
nLists := 0
|
||||
for elemTyp := typ; ; {
|
||||
if elemTyp.IsArrayType() {
|
||||
if elemTyp.IsEitherArrayType() {
|
||||
if nLists == a.MaxTypeExprDepth {
|
||||
return fmt.Errorf("check: type expression recursion depth too large")
|
||||
}
|
||||
@@ -399,7 +399,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.IsArrayType() {
|
||||
if !typ.IsEitherArrayType() {
|
||||
return fmt.Errorf("internal error: inconsistent element type %q", typ.Str(c.tm))
|
||||
}
|
||||
cv := typ.ArrayLength().ConstValue()
|
||||
|
||||
Reference in new issue
Block a user