Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for TestConvertibleTo (0.19 sec)

  1. src/cmd/compile/internal/types2/api_test.go

    func newDefined(underlying Type) *Named {
    	tname := NewTypeName(nopos, nil, "T", nil)
    	return NewNamed(tname, underlying, nil)
    }
    
    func TestConvertibleTo(t *testing.T) {
    	for _, test := range []struct {
    		v, t Type
    		want bool
    	}{
    		{Typ[Int], Typ[Int], true},
    		{Typ[Int], Typ[Float32], true},
    		{Typ[Int], Typ[String], true},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 07 20:08:23 UTC 2024
    - 93.3K bytes
    - Viewed (0)
  2. src/go/types/api_test.go

    // Helper function for use with TestIncompleteInterfaces only.
    func newDefined(underlying Type) *Named {
    	tname := NewTypeName(nopos, nil, "T", nil)
    	return NewNamed(tname, underlying, nil)
    }
    
    func TestConvertibleTo(t *testing.T) {
    	for _, test := range []struct {
    		v, t Type
    		want bool
    	}{
    		{Typ[Int], Typ[Int], true},
    		{Typ[Int], Typ[Float32], true},
    		{Typ[Int], Typ[String], true},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 94.2K bytes
    - Viewed (0)
  3. src/reflect/all_test.go

    	for it.Next() {
    		line := fmt.Sprintf("%v: %v", it.Key(), it.Value())
    		got = append(got, line)
    	}
    	slices.Sort(got)
    	return "[" + strings.Join(got, ", ") + "]"
    }
    
    func TestConvertibleTo(t *testing.T) {
    	t1 := ValueOf(example1.MyStruct{}).Type()
    	t2 := ValueOf(example2.MyStruct{}).Type()
    
    	// Shouldn't raise stack overflow
    	if t1.ConvertibleTo(t2) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 218.8K bytes
    - Viewed (0)
Back to top