On Wed, Jul 1, 2020 at 8:22 PM Andrey T. wrote:
>
> continuation question -- does `type intElement list.Element(int)` introduce a
> new type just like `type myInt int` does? If so, in a previous example, these
> 2 maps are not of the same type, am I right?
Yes, "type intElement list.Element(int
Ian,
continuation question -- does `type intElement list.Element(int)` introduce
a new type just like `type myInt int` does? If so, in a previous example,
these 2 maps are not of the same type, am I right?
Thank you very much,
Andrey
On Wednesday, July 1, 2020 at 10:50:07 AM UTC-6, Ian Lance
On Wed, Jul 1, 2020 at 9:39 AM wrote:
>
> Is this expected?
>
> import "list" // for 'std' list.go2
>
> func main() {
> type intElement list.Element(int)
> _ = make(map[int]intElement) // ok: compiles
>
> // nok
> _ = make(map[int]list.Element(int)) // cannot use generic type
> list.Element(type
Hi,
Is this expected?
import "list" // for 'std' list.go2
func main() {
type intElement list.Element(int)
_ = make(map[int]intElement) // ok: compiles
// nok
_ = make(map[int]list.Element(int)) // cannot use generic type
list.Element(type TElem) without instantiation
}
I don't think it is, b