]> Cypherpunks repositories - gostls13.git/commit
[dev.typeparams] go/types: import unify.go and infer.go from dev.go2go
authorRob Findley <rfindley@google.com>
Wed, 9 Dec 2020 19:31:39 +0000 (14:31 -0500)
committerRobert Findley <rfindley@google.com>
Tue, 15 Dec 2020 14:48:53 +0000 (14:48 +0000)
commit96999296e6dd8bccf1765d4fab1835436c1d758d
tree14526b17b3a7abda4cfe8356c1a6b9ea476ab41e
parent5aff757efc1562e14e53c74bb17b2374b45bc172
[dev.typeparams] go/types: import unify.go and infer.go from dev.go2go

After review, the only non-superficial change was to delegate the call
to under(...) to structuralType. Otherwise, update a few stale comments:
 + correct indices in the documentation for tparamsList
 + update smap->substMap in a few places
 + update type parameter syntax in a couple places

I've spent a good amount of time reviewing this code, and it
fundamentally LGTM (though I wish we didn't have to copy the logic from
identical0). However, as demonstrated in #43056, this code is
complicated and not always easy to reason about, particularly in the
context of type checking where not all types may be complete.

To further understand and verify this code I'd like to write more tests,
but that must wait until the rest of the changes in go/types are
imported from dev.go2go.

Change-Id: Iabb9d3a6af988a2e1b3445cde6bc2431a80f8bfe
Reviewed-on: https://go-review.googlesource.com/c/go/+/276692
Run-TryBot: Robert Findley <rfindley@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Robert Findley <rfindley@google.com>
Reviewed-by: Robert Griesemer <gri@golang.org>
src/go/types/infer.go [new file with mode: 0644]
src/go/types/unify.go [new file with mode: 0644]