mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-19 16:47:28 +01:00
Replace "= try foo" with "=? foo"
This commit is contained in:
1 parent
ad9851ea75
commit
9741eada02
14 files changed
+75
-82
No files matched your search
@@ -769,7 +769,7 @@ func (q *checker) bcheckExprOther(n *a.Expr, depth uint32) (a.Bounds, error) {
|
||||
}
|
||||
}
|
||||
|
||||
case t.IDOpenParen, t.IDTry:
|
||||
case t.IDOpenParen:
|
||||
lhs := n.LHS().AsExpr()
|
||||
if _, err := q.bcheckExpr(lhs, depth); err != nil {
|
||||
return a.Bounds{}, err
|
||||
|
||||
+12
-12
@@ -437,7 +437,7 @@ func (q *checker) tcheckExprOther(n *a.Expr, depth uint32) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
case t.IDOpenParen, t.IDTry:
|
||||
case t.IDOpenParen:
|
||||
// n is a function call.
|
||||
return q.tcheckExprCall(n, depth)
|
||||
|
||||
@@ -578,19 +578,19 @@ func (q *checker) tcheckExprCall(n *a.Expr, depth uint32) error {
|
||||
setPlaceholderMBoundsMType(o.AsNode())
|
||||
}
|
||||
|
||||
if n.Operator() == t.IDTry {
|
||||
n.SetMType(typeExprStatus)
|
||||
} else {
|
||||
oTyp := f.Out()
|
||||
if oTyp == nil {
|
||||
n.SetMType(typeExprEmptyStruct)
|
||||
} else if genericType1 != nil && oTyp.Eq(typeExprGeneric1) {
|
||||
n.SetMType(genericType1)
|
||||
} else if genericType2 != nil && oTyp.Eq(typeExprGeneric2) {
|
||||
n.SetMType(genericType2)
|
||||
oTyp := f.Out()
|
||||
if oTyp == nil {
|
||||
if n.Effect().Optional() {
|
||||
n.SetMType(typeExprStatus)
|
||||
} else {
|
||||
n.SetMType(oTyp)
|
||||
n.SetMType(typeExprEmptyStruct)
|
||||
}
|
||||
} else if genericType1 != nil && oTyp.Eq(typeExprGeneric1) {
|
||||
n.SetMType(genericType1)
|
||||
} else if genericType2 != nil && oTyp.Eq(typeExprGeneric2) {
|
||||
n.SetMType(genericType2)
|
||||
} else {
|
||||
n.SetMType(oTyp)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user