bind: fallback to const.Value.String for pre go1.6

Fixes golang/go#14615

Change-Id: I75e130e5b7b2534660098907fa1f044390c01d01
Reviewed-on: https://go-review.googlesource.com/20164
Reviewed-by: Elias Naur <elias.naur@gmail.com>
This commit is contained in:
Hyang-Ah Hana Kim
2016-03-04 12:00:05 +00:00
parent 6fca37c69e
commit c2b8429cd1
3 changed files with 17 additions and 2 deletions
+1 -1
View File
@@ -535,7 +535,7 @@ func (g *javaGen) genConst(o *types.Const) {
// TODO(hyangah): should const names use upper cases + "_"?
// TODO(hyangah): check invalid names.
jType := g.javaType(o.Type())
val := o.Val().ExactString()
val := constExactString(o)
switch b := o.Type().(*types.Basic); b.Kind() {
case types.Int64, types.UntypedInt:
i, exact := constant.Int64Val(o.Val())