]> Cypherpunks repositories - gostls13.git/commit
go/exact: future-proof API: permit setting precision limit
authorRobert Griesemer <gri@golang.org>
Tue, 21 Apr 2015 19:47:11 +0000 (12:47 -0700)
committerAlan Donovan <adonovan@google.com>
Wed, 22 Apr 2015 13:11:07 +0000 (13:11 +0000)
commit3f91a017f8f67cb9a744cf5d0a8b5db34a95808d
treea52d1f9d5c0531aff62deaaf7ea002e4ff2cbfbc
parent723f86537c362f2f86c82ae827f689c23b866f00
go/exact: future-proof API: permit setting precision limit

Added a prec parameter to MakeFromLiteral (which currently must
always be 0). This will permit go/types to provide an upper limit
for the precision of constant values, eventually. Overflows can be
returned with a special Overflow value (very much like the current
Unknown values).

This is a minimal change that should prevent the need for future
backward-incompatible API changes.

Change-Id: I6c9390d7cc4810375e26c53ed3bde5a383392330
Reviewed-on: https://go-review.googlesource.com/9168
Run-TryBot: Robert Griesemer <gri@golang.org>
Reviewed-by: Alan Donovan <adonovan@google.com>
src/go/exact/exact.go
src/go/exact/exact_test.go
src/go/internal/gcimporter/gcimporter.go
src/go/types/expr.go
src/go/types/operand.go