mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-24 00:52:18 +01:00
Handle structs that contain structs.
This commit is contained in:
1 parent
b3c12e05cf
commit
86c6b79e1a
9 files changed
+263
-96
No files matched your search
+7
-2
@@ -667,6 +667,7 @@ func (q *checker) tcheckTypeExpr(n *a.TypeExpr, depth uint32) error {
|
||||
}
|
||||
depth++
|
||||
|
||||
swtch:
|
||||
switch n.Decorator().Key() {
|
||||
case 0:
|
||||
if n.Name().IsNumType() {
|
||||
@@ -684,12 +685,16 @@ func (q *checker) tcheckTypeExpr(n *a.TypeExpr, depth uint32) error {
|
||||
break
|
||||
}
|
||||
if n.Min() != nil || n.Max() != nil {
|
||||
// TODO: reject.
|
||||
// TODO: reject. You can only refine numeric types.
|
||||
}
|
||||
if name := n.Name().Key(); name == t.KeyBool || name == t.KeyBuf1 {
|
||||
break
|
||||
}
|
||||
// TODO: see if name refers to a struct type.
|
||||
for _, s := range q.c.structs {
|
||||
if s.ID == n.Name() {
|
||||
break swtch
|
||||
}
|
||||
}
|
||||
return fmt.Errorf("check: %q is not a type", n.Name().String(q.tm))
|
||||
|
||||
case t.KeyPtr:
|
||||
|
||||
Reference in new issue
Block a user