]> Cypherpunks repositories - gostls13.git/commitdiff
go/types: move Identical* predicates into api.go file (cleanup)
authorRobert Griesemer <gri@golang.org>
Wed, 18 Sep 2019 16:25:28 +0000 (09:25 -0700)
committerRobert Griesemer <gri@golang.org>
Thu, 19 Sep 2019 18:22:19 +0000 (18:22 +0000)
Follow-up CL removing a TODO.

Change-Id: If900d2f999f6a3e2f2ead29283375547e03cac86
Reviewed-on: https://go-review.googlesource.com/c/go/+/196337
Reviewed-by: Alan Donovan <adonovan@google.com>
src/go/types/api.go
src/go/types/predicates.go

index 1252aade35f9ae6a5e0e6fc0125d24e760f9cc64..6699231fce1072d1f98623e867a215d66735442d 100644 (file)
@@ -374,3 +374,15 @@ func Implements(V Type, T *Interface) bool {
        f, _ := MissingMethod(V, T, true)
        return f == nil
 }
+
+// Identical reports whether x and y are identical types.
+// Receivers of Signature types are ignored.
+func Identical(x, y Type) bool {
+       return (*Checker)(nil).identical(x, y)
+}
+
+// IdenticalIgnoreTags reports whether x and y are identical types if tags are ignored.
+// Receivers of Signature types are ignored.
+func IdenticalIgnoreTags(x, y Type) bool {
+       return (*Checker)(nil).identicalIgnoreTags(x, y)
+}
index faaf753cd820763e3c3c2983a74a334233ba9273..057908eacd8da57c3d9c585e2595a84906c509ab 100644 (file)
@@ -110,29 +110,14 @@ func hasNil(typ Type) bool {
        return false
 }
 
-// The functions Identical and IdenticalIgnoreTags are
-// provided for external use only, after interface types
-// were fully set up (completed). During type-checking,
-// use the methods identical and identicalIgnoreTags
-// which take a non-nil *Checker receiver.
-// TODO(gri) factor these out into api.go.
-
-// Identical reports whether x and y are identical types.
+// identical reports whether x and y are identical types.
 // Receivers of Signature types are ignored.
-func Identical(x, y Type) bool {
-       return (*Checker)(nil).identical(x, y)
-}
-
 func (check *Checker) identical(x, y Type) bool {
        return check.identical0(x, y, true, nil)
 }
 
-// IdenticalIgnoreTags reports whether x and y are identical types if tags are ignored.
+// identicalIgnoreTags reports whether x and y are identical types if tags are ignored.
 // Receivers of Signature types are ignored.
-func IdenticalIgnoreTags(x, y Type) bool {
-       return (*Checker)(nil).identicalIgnoreTags(x, y)
-}
-
 func (check *Checker) identicalIgnoreTags(x, y Type) bool {
        return check.identical0(x, y, false, nil)
 }