Skip to content

cmd/go2go: Type aliases of generic types fail to compile #39768

@firelizzard18

Description

@firelizzard18

The design draft (Appendix > Generic type aliases) indicates that the following would work:

package pkg

type Vector(type T) []T
type VectorAlias = Vector
var v Vector(int)

However, it doesn't: https://go2goplay.golang.org/p/Gnfiupx2_xT

type checking failed for main
prog.go2:4:20: cannot use generic type Vector(type T) without instantiation

What version of Go are you using (go version)?

go2goplay.golang.org and go version devel +da7932368b Mon Jun 22 19:06:44 2020 +0000 linux/amd64

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions