summaryrefslogtreecommitdiff
path: root/src/go
Commit message (Collapse)AuthorAgeFilesLines
...
| * go/internal/typeparams: remove typeparams.{Get,Set} (cleanup)Robert Findley2021-08-317-50/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These helper functions are no longer necessary, now that type parameters are enabled; we can access type parameters directly. When considering the existence or non-existence of type parameters, we can either check whether node.TParams != nil, or whether node.TParams.NumFields() > 0. The heuristic I'm using for deciding between these checks is as follows: - For data access, just check node.TParams != nil. - For producing errors if type parameters exist, check NumFields() > 0. Change-Id: I6597536898e975564e9e8bf6a3a91bc798e0f110 Reviewed-on: https://go-review.googlesource.com/c/go/+/346549 Trust: Robert Findley <rfindley@google.com> Run-TryBot: Robert Findley <rfindley@google.com> Reviewed-by: Robert Griesemer <gri@golang.org> TryBot-Result: Go Bot <gobot@golang.org>
| * go/types: fix type set printing and add a testRobert Findley2021-08-312-8/+72
| | | | | | | | | | | | | | | | | | | | | | This is a port of CL 344873 to go/types. Change-Id: Iad41d6de166214178adf2123ac05023895f5208b Reviewed-on: https://go-review.googlesource.com/c/go/+/346435 Trust: Robert Findley <rfindley@google.com> Run-TryBot: Robert Findley <rfindley@google.com> Reviewed-by: Robert Griesemer <gri@golang.org> TryBot-Result: Go Bot <gobot@golang.org>
| * go/types: rename IsMethodSet to IsConstraint (cleanup)Robert Findley2021-08-313-6/+4
| | | | | | | | | | | | | | | | | | | | | | This is a port of CL 344872 to go/types. Change-Id: Id794f1fc3b86779ee32dbe5e656ffc747d44c3e2 Reviewed-on: https://go-review.googlesource.com/c/go/+/346434 Trust: Robert Findley <rfindley@google.com> Run-TryBot: Robert Findley <rfindley@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Robert Griesemer <gri@golang.org>
| * go/types: add error reporting for 1.18 syntax if GoVersion is below 1.18Robert Findley2021-08-3111-22/+129
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a port of CL 344871 to go/types. Unlike the compiler, go/parser is already always producing 1.18 syntax, so the effect of this CL is to add some additional errors when Config.GoVersion is below 1.18. This is a non-trivial port, both due to different error reporting APIs and due to interacting with declaration syntax nodes, which differ between go/ast and cmd/compile/internal/syntax. Change-Id: I8003a014e6eec5e554c24e9a6cfc0548ec534834 Reviewed-on: https://go-review.googlesource.com/c/go/+/346433 Trust: Robert Findley <rfindley@google.com> Run-TryBot: Robert Findley <rfindley@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Robert Griesemer <gri@golang.org>
| * go/types: allow composite literals of type parameter typeRobert Findley2021-08-312-2/+17
| | | | | | | | | | | | | | | | | | | | | | This is a port of CL 342690 to go/types. Change-Id: I27dcde237e400a84c3394a3579805014777830bc Reviewed-on: https://go-review.googlesource.com/c/go/+/346432 Trust: Robert Findley <rfindley@google.com> Run-TryBot: Robert Findley <rfindley@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Robert Griesemer <gri@golang.org>
| * go/types, types2: union terms must be instantiatedRobert Griesemer2021-08-312-1/+10
| | | | | | | | | | | | | | | | | | Fixes #48083. Change-Id: I77899d3e6edc806dee770403b3c3c4e2974d0e50 Reviewed-on: https://go-review.googlesource.com/c/go/+/346293 Trust: Robert Griesemer <gri@golang.org> Reviewed-by: Robert Findley <rfindley@google.com>
| * go/types, types2: add a test for invalid import of "init"Robert Findley2021-08-301-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This error reporting code path did not have test coverage, and panics in 1.17 (filed as #48082). Add a test that would have reproduced the panic, for both go/types and cmd/compile/internal/types2. Change-Id: Icd5f54f8407e4ab57d432f44a129ecf6b2755feb Reviewed-on: https://go-review.googlesource.com/c/go/+/346309 Trust: Robert Findley <rfindley@google.com> Run-TryBot: Robert Findley <rfindley@google.com> Reviewed-by: Robert Griesemer <gri@golang.org> TryBot-Result: Go Bot <gobot@golang.org>
| * go/types, types2: types in method expressions must be instantiatedQuim Muntal2021-08-302-9/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use varType instead of instantiatedOperand to check if the type of a method expressions is instantiated. This removes the last usage of instantiatedOperand, so it can be deleted. Fixes #48048 Change-Id: I2b219dafe2bba3603100bb8f25b8ff4e8ef53841 Reviewed-on: https://go-review.googlesource.com/c/go/+/345970 Trust: Robert Griesemer <gri@golang.org> Trust: Matthew Dempsky <mdempsky@google.com> Run-TryBot: Robert Griesemer <gri@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Robert Griesemer <gri@golang.org>
| * go/types, types2: types in type switch cases must be instantiatedRobert Griesemer2021-08-283-33/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We already have a function that does all the right checks and it's called varType. The only reason it wasn't used for type switch cases was that we also have to accept the nil value. That was handled with typeOrNil. But that function (typeOrNil) was only used for this specific purpose and I long wished to get rid of it. It turns out that there's only one way to write the untyped value nil, which is to actually write "nil" (maybe with parentheses). So looking for that turned out to be simpler than using typeOrNil. The new code does exactly that, and now we can just use varType and delete typeOrNil. With this, there is now less code (excluding the test) and the code is simpler and more correct. Fixes #48008. Change-Id: I8f2d80e61ae663c886924909f22bbfa634e7779c Reviewed-on: https://go-review.googlesource.com/c/go/+/345790 Trust: Robert Griesemer <gri@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
| * go/types, types2: don't re-evaluate context string for each function ↵Robert Griesemer2021-08-251-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | argument (optimization) Change-Id: Ie1b4d5b64350ea42484adea14df84cacd1d2653b Reviewed-on: https://go-review.googlesource.com/c/go/+/344576 Trust: Robert Griesemer <gri@golang.org> Trust: Dan Scales <danscales@google.com> Run-TryBot: Robert Griesemer <gri@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Dan Scales <danscales@google.com>
| * go/types: implement NewTypeList and use it instead of composite literalsRobert Griesemer2021-08-255-8/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also, simplify a bit of code in predicates.go. This is a backport of changes in CL 344615 that were made in addition to the changes of the original CL 343933; it brings go/types in sync with types2. Change-Id: I14cd4d4704d29894d0fbb8d129744d65e332ad22 Reviewed-on: https://go-review.googlesource.com/c/go/+/344570 Trust: Robert Griesemer <gri@golang.org> Trust: Dan Scales <danscales@google.com> Run-TryBot: Robert Griesemer <gri@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Dan Scales <danscales@google.com>
| * go/token: match the implementation of index selection with sort.Searchsubham sarkar2021-08-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | name old time/op new time/op delta SearchInts-8 15.5ns ± 2% 13.7ns ± 4% -11.87% (p=0.008 n=5+5) (see CL 36332 for the original change to sort.Search) Change-Id: If452818185b92b8b3548b066f475e493d604ea29 GitHub-Last-Rev: 32dd3cffa6b54b332948ac6a2929458defd4838f GitHub-Pull-Request: golang/go#47293 Reviewed-on: https://go-review.googlesource.com/c/go/+/335809 Reviewed-by: Robert Griesemer <gri@golang.org> Trust: Robert Griesemer <gri@golang.org> Trust: Than McIntosh <thanm@google.com>
| * go/types: use TypeList in the Inferred structRobert Findley2021-08-233-7/+8
| | | | | | | | | | | | | | | | | | | | | | | | This is for consistency with how we report TArgs elsewhere, and in case we ever want to share an internal slice with inference reporting. Change-Id: Ia8b705a155f4f82bd8da8dc2457289810f875f5e Reviewed-on: https://go-review.googlesource.com/c/go/+/343934 Trust: Robert Findley <rfindley@google.com> Run-TryBot: Robert Findley <rfindley@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Robert Griesemer <gri@golang.org>
| * go/types: use a TypeList type to hold type argumentsRobert Findley2021-08-2311-69/+96
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This resolves an asymmetry between the TParams and TArgs APIs, and reduces the size of the Named struct at the cost of some additional nil checks. While at it, move TParamList and TypeList to a new file:typelists.go, and change TParamList to access the tparams slice directly in At. There is no reason to guard against a nil receiver, as accessing an index on the empty slice will panic anyway. Change-Id: I9b65247e06c697a57a4efe40c3390e0faff91441 Reviewed-on: https://go-review.googlesource.com/c/go/+/343933 Trust: Robert Findley <rfindley@google.com> Run-TryBot: Robert Findley <rfindley@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Robert Griesemer <gri@golang.org>
| * go/types: use []*TypeParam rather than []*TypeName type param listsRobert Findley2021-08-2311-59/+57
| | | | | | | | | | | | | | | | | | | | | | | | Making this change improves type safety slightly, and avoids many internal type assertions. Change-Id: I26519b0e57068e944e8243983ae90553d79e59c2 Reviewed-on: https://go-review.googlesource.com/c/go/+/343932 Trust: Robert Findley <rfindley@google.com> Run-TryBot: Robert Findley <rfindley@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Robert Griesemer <gri@golang.org>
| * go/types: add the TypeParam.Obj methodRobert Findley2021-08-231-0/+3
| | | | | | | | | | | | | | | | | | | | | | Users should be able to access the type name associated with a type parameter. Change-Id: I495c3b4377f9d4807b1e78ad341e573d4d3c7bff Reviewed-on: https://go-review.googlesource.com/c/go/+/343931 Trust: Robert Findley <rfindley@google.com> Run-TryBot: Robert Findley <rfindley@google.com> Reviewed-by: Robert Griesemer <gri@golang.org>
| * go/types: move to an opaque environment for InstantiateRobert Findley2021-08-231-5/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | To match the API proposal, switch the first argument to Instantiate to an opaque Environment handle, though for now this handle is unimplemented. Change-Id: I6207f0beafdf8497587abdad37db92f927db29b6 Reviewed-on: https://go-review.googlesource.com/c/go/+/343930 Trust: Robert Findley <rfindley@google.com> Run-TryBot: Robert Findley <rfindley@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Robert Griesemer <gri@golang.org>
| * go/types: return an error from InstantiateRobert Findley2021-08-237-131/+201
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a port of CL 342152 to go/types. Additionally, a panic was removed from interface substitution, which is a fix from CL 333155 that was previously missed. A check for a nil Checker was also removed from types2.instantiate, since check must not be nil in that method. Change-Id: I4ea6bdccbd50ea2008ee6d870f702bee5cdd5a8e Reviewed-on: https://go-review.googlesource.com/c/go/+/342671 Trust: Robert Findley <rfindley@google.com> Run-TryBot: Robert Findley <rfindley@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Robert Griesemer <gri@golang.org>
| * go/types: report argument type for unsafe.OffsetOfRobert Griesemer2021-08-222-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | This is a clean port of CL 344252 to go/types. For #47895. Change-Id: I48cbb97ec28fcfb4fdf483594be9d29426c117ac Reviewed-on: https://go-review.googlesource.com/c/go/+/344254 Trust: Robert Griesemer <gri@golang.org> Trust: Dan Scales <danscales@google.com> Run-TryBot: Robert Griesemer <gri@golang.org> Reviewed-by: Dan Scales <danscales@google.com>
| * go/types: don't override x.mode before using itRobert Griesemer2021-08-211-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Changing the mode of x before using the old value is clearly wrong. And x is not needed anymore afterward so besides being misplaced, the assignment is not needed in the first place. Tested manually as it's a bit complicated to set up a test. Needs to be back-ported to 1.17. Fixes #47777. Change-Id: I06f1fa9443eb98009b4276f566d557fd52f1d6d3 Reviewed-on: https://go-review.googlesource.com/c/go/+/343809 Trust: Robert Griesemer <gri@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
| * go/types: change Checker.verify to return an errorRobert Findley2021-08-202-36/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | This is a port of CL 342151 to go/types, adjusted for errors and positions. Checker.sprintf was refactored to facilitate formatting error messages with a nil Checker. Change-Id: Ib2e5c942e55edaff7b5e77cf68a72bad70fea0b9 Reviewed-on: https://go-review.googlesource.com/c/go/+/342670 Trust: Robert Findley <rfindley@google.com> Run-TryBot: Robert Findley <rfindley@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Robert Griesemer <gri@golang.org>
| * go/types: no need to validate substituted instancesRobert Findley2021-08-201-3/+8
| | | | | | | | | | | | | | | | | | | | | | This is a straightforward port of CL 342150 to go/types. Change-Id: I7363e4642ade7ab30ca822a2be71f4d2804cc4a9 Reviewed-on: https://go-review.googlesource.com/c/go/+/342669 Trust: Robert Findley <rfindley@google.com> Run-TryBot: Robert Findley <rfindley@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Robert Griesemer <gri@golang.org>
| * go/types: consolidate verification logicRobert Findley2021-08-202-25/+26
| | | | | | | | | | | | | | | | | | | | | | This is a straightforward port of CL 342149 to go/types. Change-Id: I468c5154b7545b7816bb3f240b8db91e7a1fd3f6 Reviewed-on: https://go-review.googlesource.com/c/go/+/342488 Trust: Robert Findley <rfindley@google.com> Run-TryBot: Robert Findley <rfindley@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Robert Griesemer <gri@golang.org>
| * go/types: clean up panics in instantiationRobert Findley2021-08-202-23/+29
| | | | | | | | | | | | | | | | | | | | This is a straightforward port of CL 341862 to go/types. Change-Id: I4214c08d2889e2daf40254385656c6beed79571d Reviewed-on: https://go-review.googlesource.com/c/go/+/342487 Trust: Robert Findley <rfindley@google.com> Run-TryBot: Robert Findley <rfindley@google.com> Reviewed-by: Robert Griesemer <gri@golang.org>
| * go/types: fix method lookup for type-parameter based typesRobert Griesemer2021-08-172-3/+74
| | | | | | | | | | | | | | | | | | | | | | | | | | This is a clean port of CL 342990. Fixes #47747. Change-Id: I2e86fb8b70d42a220ac1ba25798d9e58227ba5f6 Reviewed-on: https://go-review.googlesource.com/c/go/+/342991 Trust: Robert Griesemer <gri@golang.org> Run-TryBot: Robert Griesemer <gri@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Robert Findley <rfindley@google.com>
| * go/types: check if the interface is already complete in CompleteRobert Findley2021-08-171-12/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Once Interfaces have been completed they must never be written again, as they may be used concurrently. Avoid writing Interface.complete unnecessarily in Complete. Also, update documentation to reflect that Complete must be called before the Interface may be considered safe for concurrent use. For #47726 Change-Id: Ic9fd1395ab0dd6d3499f7a698dadf315abcddab8 Reviewed-on: https://go-review.googlesource.com/c/go/+/342749 Trust: Robert Findley <rfindley@google.com> Run-TryBot: Robert Findley <rfindley@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Robert Griesemer <gri@golang.org>
| * Revert "go/types: make Interface.Complete a no-op"Robert Findley2021-08-173-6/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit fda8ee8b077dd8a5819cac7c52c3af1499a0674e. Reason for revert: Interface.Complete is still necessary for safe concurrency. For #47726 Change-Id: I8b924ca5f4af8c7d7e2b5a27bb03a5a5ed9b1d22 Reviewed-on: https://go-review.googlesource.com/c/go/+/342710 Trust: Robert Findley <rfindley@google.com> Run-TryBot: Robert Findley <rfindley@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Robert Griesemer <gri@golang.org>
| * go/types: use the orig object for Named.ObjRobert Findley2021-08-161-3/+6
| | | | | | | | | | | | | | | | | | | | | | This is a port of CL 341858 to go/types. Change-Id: I9fba8941069aaacd641a19e3068de3a769e14e50 Reviewed-on: https://go-review.googlesource.com/c/go/+/342482 Trust: Robert Findley <rfindley@google.com> Run-TryBot: Robert Findley <rfindley@google.com> Reviewed-by: Robert Griesemer <gri@golang.org> TryBot-Result: Go Bot <gobot@golang.org>
| * go/types: rename TypeParams to TParamListRobert Findley2021-08-164-15/+15
| | | | | | | | | | | | | | | | | | | | | | This is a straightforward port of CL 341861 to go/types. Change-Id: I4f21170eb2ea1e5395a6eba5132f34aa1d53bb20 Reviewed-on: https://go-review.googlesource.com/c/go/+/342481 Trust: Robert Findley <rfindley@google.com> Run-TryBot: Robert Findley <rfindley@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Robert Griesemer <gri@golang.org>
| * go/types: remove targs from substMapRobert Findley2021-08-162-53/+35
| | | | | | | | | | | | | | | | | | | | | | This is a straightforward port of CL 341859 to go/types. Change-Id: I5d2508f516b5cf4d8775c3a77cc8bed5d4bec338 Reviewed-on: https://go-review.googlesource.com/c/go/+/342480 Trust: Robert Findley <rfindley@google.com> Run-TryBot: Robert Findley <rfindley@google.com> Reviewed-by: Robert Griesemer <gri@golang.org> TryBot-Result: Go Bot <gobot@golang.org>
| * go/types: simplify Named.underRobert Findley2021-08-161-33/+19
| | | | | | | | | | | | | | | | | | | | | | This is a straighforward port of CL 341857 to go/types. Change-Id: I3407676232b595662c1470627771a13263703061 Reviewed-on: https://go-review.googlesource.com/c/go/+/342479 Trust: Robert Findley <rfindley@google.com> Run-TryBot: Robert Findley <rfindley@google.com> Reviewed-by: Robert Griesemer <gri@golang.org> TryBot-Result: Go Bot <gobot@golang.org>
| * go/types: define Identical for instancesRobert Findley2021-08-163-5/+50
| | | | | | | | | | | | | | | | | | | | | | | | This is a port of CL 341856 to go/types. It is adjusted to use the NumTArgs/TArg API of go/types, which has not yet been ported to types2. Change-Id: I6faeec027f4ae08634267001f473263703e80c5b Reviewed-on: https://go-review.googlesource.com/c/go/+/342478 Trust: Robert Findley <rfindley@google.com> Run-TryBot: Robert Findley <rfindley@google.com> Reviewed-by: Robert Griesemer <gri@golang.org> TryBot-Result: Go Bot <gobot@golang.org>
| * go/types: merge Instantiate and InstantiateLazyRobert Findley2021-08-1614-58/+86
| | | | | | | | | | | | | | | | | | | | | | This is a straightforward port of CL 341855 to go/types. Change-Id: I42a74df7a54f5d03aab31ad75dfeb3d1ba775354 Reviewed-on: https://go-review.googlesource.com/c/go/+/342477 Trust: Robert Findley <rfindley@google.com> Run-TryBot: Robert Findley <rfindley@google.com> Reviewed-by: Robert Griesemer <gri@golang.org> TryBot-Result: Go Bot <gobot@golang.org>
| * go/types: remove Named.SetTArgsRobert Findley2021-08-161-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | This is a port of CL 341290 to go/types; SetTArgs is a potentially error-prone API. Change-Id: I484e62d71a0e09be1e19f8e63994912a88364eca Reviewed-on: https://go-review.googlesource.com/c/go/+/342476 Trust: Robert Findley <rfindley@google.com> Run-TryBot: Robert Findley <rfindley@google.com> Reviewed-by: Robert Griesemer <gri@golang.org> TryBot-Result: Go Bot <gobot@golang.org>
| * go/types: parameterized functions must have a bodyRobert Findley2021-08-1620-104/+106
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a port of CL 340911 to go/types. The new check differs slightly, due to go/ast storing type parameters on the function type, rather than declaration. The error was positioned on the function name for consistency with types2 (and because that's a better position). Change-Id: Icdfc76cd65fab215139180b710293a0d79709297 Reviewed-on: https://go-review.googlesource.com/c/go/+/342475 Trust: Robert Findley <rfindley@google.com> Run-TryBot: Robert Findley <rfindley@google.com> Reviewed-by: Robert Griesemer <gri@golang.org> TryBot-Result: Go Bot <gobot@golang.org>
| * go/types: expand is only required for *Named typesRobert Findley2021-08-169-29/+16
| | | | | | | | | | | | | | | | | | | | | | This is a port of CL 340749 to go/types. Change-Id: I2af602d357486ee2f45b91c11c4b02ec6b58ed38 Reviewed-on: https://go-review.googlesource.com/c/go/+/342474 Trust: Robert Findley <rfindley@google.com> Run-TryBot: Robert Findley <rfindley@google.com> Reviewed-by: Robert Griesemer <gri@golang.org> TryBot-Result: Go Bot <gobot@golang.org>
| * go/types,types2: superficial changes to align types and types2Robert Findley2021-08-163-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This CL contains an assortment of superficial fixes noticed while self-reviewing the most recent stack of ports. It also makes a couple adjustments to termlist_test.go, in both go/types and cmd/compile/internal/types2. Change-Id: I64c8cda5e1704e86ac11c6ffc86d55248f44ef79 Reviewed-on: https://go-review.googlesource.com/c/go/+/342490 Trust: Robert Findley <rfindley@google.com> Run-TryBot: Robert Findley <rfindley@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Robert Griesemer <gri@golang.org>
| * go/types: make Interface.Complete a no-opRobert Findley2021-08-163-19/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a partial port of CL 340255 to go/types. Of course we can't delete Interface.Complete, but make it a no-op. Completing interfaces is no longer necessary. Change-Id: Ida3c84cc94713f14a646c7682f5d4ae5339a0faa Reviewed-on: https://go-review.googlesource.com/c/go/+/342489 Trust: Robert Findley <rfindley@google.com> Run-TryBot: Robert Findley <rfindley@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Robert Griesemer <gri@golang.org>
| * go/types: limit termlist lengthsRobert Findley2021-08-164-4/+116
| | | | | | | | | | | | | | | | | | | | | | | | This is a port of CL 340254 to go/types, with minor adjustments for errors and positions. Change-Id: I49ea1d1de8d6e27484f167b813267615d142d31c Reviewed-on: https://go-review.googlesource.com/c/go/+/342438 Trust: Robert Findley <rfindley@google.com> Run-TryBot: Robert Findley <rfindley@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Robert Griesemer <gri@golang.org>
| * go/types: change types2.Union API to accept a list of TermsRobert Findley2021-08-165-35/+33
| | | | | | | | | | | | | | | | | | | | | | This is a straightforward port of CL 340250 to go/types. Change-Id: I8fc1c78833b5393fb39344fd248529df57870a72 Reviewed-on: https://go-review.googlesource.com/c/go/+/342437 Trust: Robert Findley <rfindley@google.com> Run-TryBot: Robert Findley <rfindley@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Robert Griesemer <gri@golang.org>
| * go/types: add defined type to term/termlist testsRobert Findley2021-08-163-10/+83
| | | | | | | | | | | | | | | | | | | | | | This is a port of CL 339905 to go/types. Change-Id: I9afac9e84bde6f34bb65c7e3d726986d2c648a91 Reviewed-on: https://go-review.googlesource.com/c/go/+/342436 Trust: Robert Findley <rfindley@google.com> Run-TryBot: Robert Findley <rfindley@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Robert Griesemer <gri@golang.org>
| * go/types: minor cleanup of writeTParamListRobert Findley2021-08-162-10/+14
| | | | | | | | | | | | | | | | | | | | | | This is a port of CL 339903 to go/types. Change-Id: Iaf5fe7321d907df4421128c66cf8c58129eaae8b Reviewed-on: https://go-review.googlesource.com/c/go/+/342435 Trust: Robert Findley <rfindley@google.com> Run-TryBot: Robert Findley <rfindley@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Robert Griesemer <gri@golang.org>
| * go/types: fix make with type parameter argumentRobert Findley2021-08-162-74/+47
| | | | | | | | | | | | | | | | | | | | | | | | This is a port of CL 339899 to go/types. A test assertion is adjusted to place the 'not enough arguments' error on the ')'. Change-Id: Ia13eccc66586f9b84a8b99d462bb406d363a3288 Reviewed-on: https://go-review.googlesource.com/c/go/+/342434 Trust: Robert Findley <rfindley@google.com> Run-TryBot: Robert Findley <rfindley@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Robert Griesemer <gri@golang.org>
| * go/types: fix range over exprs of type parameter typeRobert Findley2021-08-163-72/+113
| | | | | | | | | | | | | | | | | | | | | | | | | | This is a port of CL 339897 to go/types. In addition, an error message that was adjusted in CL 274974 is ported to go/types (CL 274974 was only considered necessary for compiler compatibility). Change-Id: Idfe44d759c925f9fed353a2d1898d3d4d8d85452 Reviewed-on: https://go-review.googlesource.com/c/go/+/342433 Trust: Robert Findley <rfindley@google.com> Run-TryBot: Robert Findley <rfindley@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Robert Griesemer <gri@golang.org>
| * go/types: better names for things (cleanup)Robert Findley2021-08-168-100/+97
| | | | | | | | | | | | | | | | | | | | | | This is a port of CL 339891 to go/types. Change-Id: If4d9bbb3ace45bec0f40082dd42ed2dd249100ec Reviewed-on: https://go-review.googlesource.com/c/go/+/342432 Trust: Robert Findley <rfindley@google.com> Run-TryBot: Robert Findley <rfindley@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Robert Griesemer <gri@golang.org>
| * go/types: cleanup panic callsRobert Findley2021-08-1611-24/+24
| | | | | | | | | | | | | | | | | | | | | | | | This is a port of CL 339969 to go/types. It differs slightly in errors.go, due to the differing API. Change-Id: Ie2bf84ebf312ea3872ee6706615dfc6169a32405 Reviewed-on: https://go-review.googlesource.com/c/go/+/342431 Trust: Robert Findley <rfindley@google.com> Run-TryBot: Robert Findley <rfindley@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Robert Griesemer <gri@golang.org>
| * go/types: remove TestIncompleteInterfaces (cleanup)Robert Findley2021-08-163-75/+14
| | | | | | | | | | | | | | | | | | | | | | This is a straightforward port of CL 339832 to go/types. Change-Id: Ibcb1b130ea474bbbfe9cb5138170e27b466313cf Reviewed-on: https://go-review.googlesource.com/c/go/+/342430 Trust: Robert Findley <rfindley@google.com> Run-TryBot: Robert Findley <rfindley@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Robert Griesemer <gri@golang.org>
| * go/types: remove unused gcCompatibilityMode flag (cleanup)Robert Findley2021-08-161-84/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a port of CL 339831 to go/types. gcCompatibilityMode is unused, and x/tools/go/types no longer exists, so delete it. Change-Id: I886d8c24b7aa6511934ac78549f07a88a18e950b Reviewed-on: https://go-review.googlesource.com/c/go/+/342429 Trust: Robert Findley <rfindley@google.com> Run-TryBot: Robert Findley <rfindley@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Robert Griesemer <gri@golang.org>
| * go/types: implement type sets with term listsRobert Findley2021-08-1623-418/+333
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a port of CL 338310 to go/types. It is superficially adjusted for different error reporting and AST APIs. It also fixes a bug in CL 338310 that only manifests in go/types (TestFixedbugs/issue39755.go2) due to go/types preserving untyped nil. In that CL, operand.go is checking if optype is a TypeParam, which can never be the case. A fix for types2 will be mailed in a separate CL. Change-Id: Icf3394e74baec536842267d99f7511d25ab32a8a Reviewed-on: https://go-review.googlesource.com/c/go/+/342331 Trust: Robert Findley <rfindley@google.com> Run-TryBot: Robert Findley <rfindley@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Robert Griesemer <gri@golang.org>
| * go/types: implement term listsRobert Findley2021-08-162-0/+445
| | | | | | | | | | | | | | | | | | | | | | | | This is a straightforward port of CL 339596 to go/types, differing only in the package declaration. Change-Id: If5bf8fd5667bee91b04fdb797702e6045d5fba7b Reviewed-on: https://go-review.googlesource.com/c/go/+/342330 Trust: Robert Findley <rfindley@google.com> Run-TryBot: Robert Findley <rfindley@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Robert Griesemer <gri@golang.org>