aboutsummaryrefslogtreecommitdiffhomepage
path: root/testdata
diff options
context:
space:
mode:
authorAyke van Laethem <[email protected]>2022-08-21 23:26:42 +0200
committerRon Evans <[email protected]>2022-08-22 10:31:30 +0200
commitf6e6aca8d9fdd716f04da03b1a26da657fdfde3e (patch)
treef44eadbdb5d9b298cb4007daf35b1ef8e7b396d2 /testdata
parentc4d99e5297b52fca4491717561b62fa43d222fe6 (diff)
downloadtinygo-f6e6aca8d9fdd716f04da03b1a26da657fdfde3e.tar.gz
tinygo-f6e6aca8d9fdd716f04da03b1a26da657fdfde3e.zip
compiler: fix incorrect DWARF type in some generic parameters
For some reason, the type of a function parameter can sometimes be of interface type, while it should be the underlying type. This might be a bug in the x/tools/go/ssa package but this is a simple workaround.
Diffstat (limited to 'testdata')
-rw-r--r--testdata/generics.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/testdata/generics.go b/testdata/generics.go
index c2877dfd8..bc7e5145b 100644
--- a/testdata/generics.go
+++ b/testdata/generics.go
@@ -12,6 +12,8 @@ func main() {
var c C[int]
c.F() // issue 2951
+ SliceOp([]int(nil)) // issue 3002
+
testa.Test()
testb.Test()
}
@@ -28,3 +30,6 @@ func Add[T Integer](a, b T) T {
type C[V any] struct{}
func (c *C[V]) F() {}
+
+// Test for https://github.com/tinygo-org/tinygo/issues/3002
+func SliceOp[S ~[]E, E any](s S) {}