]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: add support for generic maps
authorDan Scales <danscales@google.com>
Mon, 15 Mar 2021 03:13:05 +0000 (20:13 -0700)
committerDan Scales <danscales@google.com>
Mon, 15 Mar 2021 20:28:34 +0000 (20:28 +0000)
commitc2360956389a30a27407fb857fd4916f20f8dc01
tree6d16969896a557dcfbb33a2edfc44a7811ea2144
parentdca9c11845a950130c37f4f4e5ffb55848ff7155
cmd/compile: add support for generic maps

Add support for maps in subster.typ(). Add new test cases maps.go and set.go.

Change substitution of a TFUNC in subster.typ() to always create new
param and result structs if any of the receiver, param, or result
structs get substituted. All these func structs must be copied, because
they have offset fields that are dependent, and so must have an
independent copy for each new signature (else there will be an error
later when frame offsets are calculated).

Change-Id: I576942a62f06b46b6f005abc98f65533008de8dc
Reviewed-on: https://go-review.googlesource.com/c/go/+/301670
Trust: Dan Scales <danscales@google.com>
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
src/cmd/compile/internal/noder/stencil.go
test/typeparam/maps.go [new file with mode: 0644]
test/typeparam/sets.go [new file with mode: 0644]