"sync"
)
-// An Context is an opaque type checking context. It may be used to share
+// A Context is an opaque type checking context. It may be used to share
// identical type instances across type-checked packages or calls to
-// Instantiate.
+// Instantiate. Contexts are safe for concurrent use.
//
-// It is safe for concurrent use.
+// The use of a shared context does not guarantee that identical instances are
+// deduplicated in all cases.
type Context struct {
mu sync.Mutex
typeMap map[string][]ctxtEntry // type hash -> instances entries
// previous instances with the same identity. As a special case, generic
// *Signature origin types are only considered identical if they are pointer
// equivalent, so that instantiating distinct (but possibly identical)
-// signatures will yield different instances.
+// signatures will yield different instances. The use of a shared context does
+// not guarantee that identical instances are deduplicated in all cases.
//
// If validate is set, Instantiate verifies that the number of type arguments
// and parameters match, and that the type arguments satisfy their
"sync"
)
-// An Context is an opaque type checking context. It may be used to share
+// A Context is an opaque type checking context. It may be used to share
// identical type instances across type-checked packages or calls to
-// Instantiate.
+// Instantiate. Contexts are safe for concurrent use.
//
-// It is safe for concurrent use.
+// The use of a shared context does not guarantee that identical instances are
+// deduplicated in all cases.
type Context struct {
mu sync.Mutex
typeMap map[string][]ctxtEntry // type hash -> instances entries
// previous instances with the same identity. As a special case, generic
// *Signature origin types are only considered identical if they are pointer
// equivalent, so that instantiating distinct (but possibly identical)
-// signatures will yield different instances.
+// signatures will yield different instances. The use of a shared context does
+// not guarantee that identical instances are deduplicated in all cases.
//
// If validate is set, Instantiate verifies that the number of type arguments
// and parameters match, and that the type arguments satisfy their