codekingpro/portable-devtools
114k
1// run2 3// Copyright 2022 The Go Authors. All rights reserved.4// Use of this source code is governed by a BSD-style5// license that can be found in the LICENSE file.6package main7 8 9func f[T comparable](i any) {10 var t T11 12 if i != t {13 println("FAIL: if i != t")14 }15}16 17type myint int18 19func (m myint) foo() {20}21 22type fooer interface {23 foo()24}25 26type comparableFoo interface {27 comparable28 foo()29}30 31func g[T comparableFoo](i fooer) {32 var t T33 34 if i != t {35 println("FAIL: if i != t")36 }37}38 39func main() {40 f[int](int(0))41 g[myint](myint(0))42}43 