mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-21 00:47:28 +01:00
Add reader1 and writer1 base types.
This commit is contained in:
1 parent
d16a25806f
commit
17e47fbc1e
11 files changed
+169
-138
No files matched your search
@@ -852,6 +852,10 @@ func (q *checker) bcheckTypeExpr(n *a.TypeExpr) (*big.Int, *big.Int, error) {
|
||||
case t.KeyPtr, t.KeyOpenBracket:
|
||||
return nil, nil, nil
|
||||
}
|
||||
switch n.Name().Key() {
|
||||
case t.KeyReader1, t.KeyWriter1:
|
||||
return nil, nil, nil
|
||||
}
|
||||
|
||||
b := [2]*big.Int{}
|
||||
if key := n.Name().Key(); key < t.Key(len(numTypeBounds)) {
|
||||
|
||||
+3
-3
@@ -467,9 +467,9 @@ func (q *checker) tcheckDot(n *a.Expr, depth uint32) error {
|
||||
s = q.f.Func.In()
|
||||
case t.KeyOut:
|
||||
s = q.f.Func.Out()
|
||||
case t.KeyBuf1:
|
||||
case t.KeyReader1, t.KeyWriter1:
|
||||
// TODO: remove this hack and be more principled about the built-in
|
||||
// buf1 type.
|
||||
// buf1, reader1, writer1 types.
|
||||
//
|
||||
// Another hack is using typeExprPlaceholder until a TypeExpr can
|
||||
// represent function types.
|
||||
@@ -730,7 +730,7 @@ swtch:
|
||||
if n.Min() != nil || n.Max() != nil {
|
||||
// TODO: reject. You can only refine numeric types.
|
||||
}
|
||||
if name := n.Name().Key(); name == t.KeyBool || name == t.KeyBuf1 {
|
||||
if name := n.Name().Key(); name == t.KeyBool || name == t.KeyReader1 || name == t.KeyWriter1 {
|
||||
break
|
||||
}
|
||||
for _, s := range q.c.structs {
|
||||
|
||||
Reference in new issue
Block a user