{newDefined(new(Struct)), new(Struct), true},
{newDefined(Typ[Int]), new(Struct), false},
{Typ[UntypedInt], Typ[Int], true},
+ {NewSlice(Typ[Int]), NewPointer(NewArray(Typ[Int], 10)), true},
+ {NewSlice(Typ[Int]), NewArray(Typ[Int], 10), false},
+ {NewSlice(Typ[Int]), NewPointer(NewArray(Typ[Uint], 10)), false},
// Untyped string values are not permitted by the spec, so the below
// behavior is undefined.
{Typ[UntypedString], Typ[String], true},
return true
}
+ // "x is a slice, T is a pointer-to-array type,
+ // and the slice and array types have identical element types."
+ if s := asSlice(V); s != nil {
+ if p := asPointer(T); p != nil {
+ if a := asArray(p.Elem()); a != nil {
+ if check.identical(s.Elem(), a.Elem()) {
+ return true
+ }
+ }
+ }
+ }
+
return false
}
"embedfunc.go", // tests //go:embed
"embedvers.go", // tests //go:embed
"linkname2.go", // go/types doesn't check validity of //go:xxx directives
-
- "convert2.go", // temporary: go/types doesn't know yet about converting from slices to array pointers
- "convert4.go", // temporary: go/types doesn't know yet about converting from slices to array pointers
- "escape_slice.go", // temporary: go/types doesn't know yet about converting from slices to array pointers
)
}