]> Cypherpunks repositories - gostls13.git/commitdiff
go/constant: document that BinaryOp doesn't handle comparisons or shifts
authorRobert Griesemer <gri@golang.org>
Sat, 5 Nov 2016 20:14:23 +0000 (13:14 -0700)
committerRobert Griesemer <gri@golang.org>
Sat, 5 Nov 2016 23:59:04 +0000 (23:59 +0000)
Fixes #17797.

Change-Id: I544df81c4bcf3cbd36a793be40050f14f9a9974f
Reviewed-on: https://go-review.googlesource.com/32761
Reviewed-by: Dominik Honnef <dominik@honnef.co>
src/go/constant/value.go

index 90c04df88d7d5c2681c0a43833b1f75346169cb6..85f53b4d169f53e7f0a97ce3f5af82888df893ee 100644 (file)
@@ -936,6 +936,9 @@ func match(x, y Value) (_, _ Value) {
 // BinaryOp returns the result of the binary expression x op y.
 // The operation must be defined for the operands. If one of the
 // operands is Unknown, the result is Unknown.
+// BinaryOp doesn't handle comparisons or shifts; use Compare
+// or Shift instead.
+//
 // To force integer division of Int operands, use op == token.QUO_ASSIGN
 // instead of token.QUO; the result is guaranteed to be Int in this case.
 // Division by zero leads to a run-time panic.