tapi...@gmail.com's profile photo

https://groups.google.com/g/golang-nuts/c/JIZuVoUNAlE

tapi…@gmail.com

1:09 AM (8 hours ago) to golang-nuts
The tip spec states that the core type of a constraint is born from the type set of the constraint. https://tip.golang.org/ref/spec#Core_types
So the C constraint in the following program should have no core type,because its type set is blank. But the foo function compiles okay,which indicates the current implementation thinks C has a core type.
Maybe, the core type of a constraint should be born from the specific types of the constraint?
package main

func main() {}

type C interface {
        map[int]int
        M()
}

func foo[T C]() {
        var _ = make(T)
}

By admin

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.