codekingpro/portable-devtools
114k
1// run2 3// Copyright 2021 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.6 7package main8 9func f[T any](i interface{}) {10 switch i.(type) {11 case T:12 println("T")13 case int:14 println("int")15 default:16 println("other")17 }18}19 20type myint int21func (myint) foo() {22}23 24func main() {25 f[interface{}](nil)26 f[interface{}](6)27 f[interface{foo()}](nil)28 f[interface{foo()}](7)29 f[interface{foo()}](myint(8))30}31 