From 2044d8b94b1fce9ac4ffd830192564239a1a7c4a Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Wed, 11 Mar 2020 17:52:17 -0700 Subject: [PATCH] cmd/go2go: use predeclared comparable in maps test (But embedding comparable doesn't work yet.) Change-Id: I977ca97597de47c79edb56b385c970392afb87f0 --- .../go2go/testdata/go2path/src/maps/maps.go2 | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/cmd/go2go/testdata/go2path/src/maps/maps.go2 b/src/cmd/go2go/testdata/go2path/src/maps/maps.go2 index 2e98264ddc..864c53a1e7 100644 --- a/src/cmd/go2go/testdata/go2path/src/maps/maps.go2 +++ b/src/cmd/go2go/testdata/go2path/src/maps/maps.go2 @@ -5,13 +5,6 @@ // Package maps implements simple functions to manipulate maps in various ways. package maps -contract comparable(T) { - T int, int8, int16, int32, int64, - uint, uint8, uint16, uint32, uint64, uintptr, - float32, float64, - string -} - // Keys returns the keys of the map m. // The keys will be an indeterminate order. func Keys(type K, V comparable(K))(m map[K]V) []K { @@ -33,8 +26,17 @@ func Values(type K, V comparable(K))(m map[K]V) []V { } contract twocomparable(K, V) { - comparable(K) - comparable(V) + // Should be + // comparable(K) + // comparable(V) + K int, int8, int16, int32, int64, + uint, uint8, uint16, uint32, uint64, uintptr, + float32, float64, + string + V int, int8, int16, int32, int64, + uint, uint8, uint16, uint32, uint64, uintptr, + float32, float64, + string } // Equal reports whether two maps contain the same key/value pairs.