You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adds a new MultiConvert instruction. MultiConvert instructions
are a catch all for conversions involving a typeparameter that
would result in multiple different types of conversion
instruction [sequences].
Updates golang/go#56849
Change-Id: I6c2f53ccef1b933406096d6ca2867f1007a13bd3
Reviewed-on: https://go-review.googlesource.com/c/tools/+/457436
gopls-CI: kokoro <noreply+kokoro@google.com>
Run-TryBot: Tim King <taking@google.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
Reviewed-by: Zvonimir Pavlinovic <zpavlinovic@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
{"slice to zero length array type parameter", "package p; var s []byte; func f[T ~[0]byte]() { tmp := (T)(s); var z T; _ = tmp == z}", nil},
30
30
{"slice to non-zero length array type parameter", "package p; var s []byte; func h[T ~[1]byte | [4]byte]() { tmp := T(s); var z T; _ = tmp == z}", nil},
31
31
{"slice to maybe-zero length array type parameter", "package p; var s []byte; func g[T ~[0]byte | [4]byte]() { tmp := T(s); var z T; _ = tmp == z}", nil},
32
+
{
33
+
"rune sequence to sequence cast patterns", `
34
+
package p
35
+
// Each of fXX functions describes a 1.20 legal cast between sequences of runes
36
+
// as []rune, pointers to rune arrays, rune arrays, or strings.
37
+
//
38
+
// Comments listed given the current emitted instructions [approximately].
39
+
// If multiple conversions are needed, these are seperated by |.
40
+
// rune was selected as it leads to string casts (byte is similar).
41
+
// The length 2 is not significant.
42
+
// Multiple array lengths may occur in a cast in practice (including 0).
0 commit comments