For #48538.
Change-Id: I258b0c8af5801692ad238e47397dde0b4e3c44c1
Reviewed-on: https://go-review.googlesource.com/c/go/+/359275
Trust: Robert Griesemer <gri@golang.org>
Trust: Dan Scales <danscales@google.com>
Reviewed-by: Dan Scales <danscales@google.com>
return true
}
+// Structure is exported for the compiler.
+
+// If typ is a type parameter, Structure returns the single underlying
+// type of all types in the corresponding type constraint if it exists,
+// or nil otherwise. If typ is not a type parameter, Structure returns
+// the underlying type.
+func Structure(typ Type) Type {
+ return structure(typ)
+}
+
// If typ is a type parameter, structure returns the single underlying
// type of all types in the corresponding type constraint if it exists,
// or nil otherwise. If typ is not a type parameter, structure returns