By the contract of Compare, if one operand is Unknown, the result must be
false.
Fixes #75137
Change-Id: I56420fae808395f89769f5e5d448f9e1df9a622f
GitHub-Last-Rev:
858ba89a91bf966223975541af739ab0ab977075
GitHub-Pull-Request: golang/go#75140
Reviewed-on: https://go-review.googlesource.com/c/go/+/698955
Reviewed-by: Sean Liao <sean@liao.dev>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Sean Liao <sean@liao.dev>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
return rtof(x1), y
}
case complexVal:
- return vtoc(x), y
+ switch x1 := x.(type) {
+ case int64Val, intVal, ratVal, floatVal:
+ return vtoc(x1), y
+ }
}
// force unknown and invalid values into "x position" in callers of match
if got := Compare(x, token.EQL, y); got {
t.Errorf("%s == %s: got true; want false", x, y)
}
+ if got := Compare(x, token.NEQ, y); got {
+ t.Errorf("%s != %s: got true; want false", x, y)
+ }
}
}
}