diff --git a/bench/framework_test.go b/bench/framework_test.go index c398c87..0427a99 100644 --- a/bench/framework_test.go +++ b/bench/framework_test.go @@ -119,7 +119,7 @@ func fixFloatsToInts(in interface{}) interface{} { } return out case float64: - return int(in2) + return int64(in2) default: return in } diff --git a/bench/map_test.go b/bench/map_test.go index 9bcb88c..f9f626d 100644 --- a/bench/map_test.go +++ b/bench/map_test.go @@ -24,14 +24,14 @@ var fixture_mapAlpha = map[string]interface{}{ }, "C": map[string]interface{}{ "N": "n", - "M": 13, + "M": int64(13), }, "C2": map[string]interface{}{ "N": "n2", - "M": 14, + "M": int64(14), }, - "X": 1, - "Y": 2, + "X": int64(1), + "Y": int64(2), "Z": "3", "W": "4", } diff --git a/obj/unmarshalBuiltins.go b/obj/unmarshalBuiltins.go index ae79e25..c8a6528 100644 --- a/obj/unmarshalBuiltins.go +++ b/obj/unmarshalBuiltins.go @@ -159,9 +159,9 @@ func (mach *unmarshalMachinePrimitive) Step(_ *Unmarshaller, _ *unmarshalSlab, t case TBool: mach.rv.Set(reflect.ValueOf(tok.Bool)) case TInt: - mach.rv.Set(reflect.ValueOf(int(tok.Int))) // Unmarshalling with no particular type info should default to using plain 'int' whenever viable. + mach.rv.Set(reflect.ValueOf(int64(tok.Int))) // Unmarshalling with no particular target type info should consistently map into 'int64' to avoid passing on vagueries of codecs around numeric types. case TUint: - mach.rv.Set(reflect.ValueOf(int(tok.Uint))) // Unmarshalling with no particular type info should default to using plain 'int' whenever viable. + mach.rv.Set(reflect.ValueOf(int64(tok.Uint))) // Unmarshalling with no particular target type info should consistently map into 'int64' to avoid passing on vagueries of codecs around numeric types. case TFloat64: mach.rv.Set(reflect.ValueOf(tok.Float64)) case TNull: