package main

type Ptr[E any] *E

type MyConstraint interface {
    Ptr[int]
}

type YourConstraint interface {
    *int
}

func foo[T MyConstraint](x T) {
}

func bar[T YourConstraint](x T) {
}

func main() {
    var x = new(int)
    foo(x) // *int does not implement MyConstraint
    bar(x)
}

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/e252f550-b5ae-43ca-b25d-12ce076fd74cn%40googlegroups.com.

Reply via email to