Use "T[..inclMax]" instead of "T[:exclMax]".

This commit is contained in:
Nigel Tao committed 2017-05-20 15:11:30 +10:00
1 parent d3eba13223
commit 9184e2682e
9 files changed
+53 -44

No files matched your search

+3 -3
View File
@@ -348,14 +348,14 @@ func (q *checker) bcheckTypeExpr(n *a.TypeExpr) (*big.Int, *big.Int, error) {
return nil, nil, fmt.Errorf("check: internal error: unknown bounds for %q", n.String(q.idMap))
}
if n.IsRefined() {
if x := n.InclMin(); x != nil {
if x := n.Min(); x != nil {
if cv := x.ConstValue(); cv != nil && b[0].Cmp(cv) < 0 {
b[0] = cv
}
}
if x := n.ExclMax(); x != nil {
if x := n.Max(); x != nil {
if cv := x.ConstValue(); cv != nil && b[1].Cmp(cv) > 0 {
b[1] = sub1(cv)
b[1] = cv
}
}
}