]> Cypherpunks.ru repositories - gostls13.git/commit
[dev.typeparams] cmd/compile: get type aliases working with generic types
authorDan Scales <danscales@google.com>
Mon, 24 May 2021 21:15:48 +0000 (14:15 -0700)
committerDan Scales <danscales@google.com>
Wed, 26 May 2021 21:38:54 +0000 (21:38 +0000)
commitb7f7d1cd7b3d965ec25d365b3e5057ef3278c729
treee6a87b391b05e89d62714c9c0894188e6e312dca
parent95748d1b741d2c612cf90d9b6f4f8bdb81800e23
[dev.typeparams] cmd/compile:  get type aliases working with generic types

Generic types can the source type of a type alias, so modify g.typ0() to
be able to deal with base generic types.

Added test aliasimp.go that tests aliasing of local generic types and
imported generic types.

Change-Id: I1c398193819d47a36b014cc1f9bb55107e9a565b
Reviewed-on: https://go-review.googlesource.com/c/go/+/322194
Trust: Dan Scales <danscales@google.com>
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
src/cmd/compile/internal/noder/types.go
test/typeparam/aliasimp.dir/a.go [new file with mode: 0644]
test/typeparam/aliasimp.dir/main.go [new file with mode: 0644]
test/typeparam/aliasimp.go [new file with mode: 0644]