Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for Conv4 (0.03 sec)

  1. test/typeparam/issue49027.dir/a.go

    	switch v := v.(type) {
    	case T:
    		return v
    	default:
    		var z T
    		return z
    	}
    }
    
    type Mystring string
    
    func (Mystring) Foo() {
    }
    
    func Conv4(v interface{Foo()}) Mystring {
    	return conv4[Mystring](v)
    }
    
    func conv4[T interface{Foo()}](v interface{Foo()}) T {
    	switch v := v.(type) {
    	case T:
    		return v
    	default:
    		var z T
    		return z
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Oct 19 22:47:48 UTC 2021
    - 871 bytes
    - Viewed (0)
  2. test/typeparam/issue49027.dir/main.go

    	if !ok {
    		panic("conversion failed")
    	}
    	if y != s {
    		panic(fmt.Sprintf("got %s wanted %s", y, s))
    	}
    	z := a.Conv3(s)
    	if z != s {
    		panic(fmt.Sprintf("got %s wanted %s", z, s))
    	}
    	w := a.Conv4(a.Mystring(s))
    	if w != a.Mystring(s) {
    		panic(fmt.Sprintf("got %s wanted %s", w, s))
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 24 02:14:15 UTC 2022
    - 617 bytes
    - Viewed (0)
Back to top