Robert Findley 1170771074 go/types, types2: set an origin object for vars and funcs
Historically, Objects in go/types were canonical, meaning each entity
was represented by exactly one variable and could thus be identified by
its address. With object instantiation this is no longer the case: Var
and Func objects must be copied to hold substituted type information,
and there may be more than one Var or Func variable representing the
same source-level entity.

This CL adds Origin methods to *Var and *Func, so users can efficiently
navigate to the corresponding canonical object on the generic type.

Fixes #51682

Change-Id: Ia49e15bd6515e1db1eb3b09b88ba666659601316
Reviewed-on: https://go-review.googlesource.com/c/go/+/395535
Reviewed-by: Robert Griesemer <gri@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-05-17 21:28:43 +00:00
..
2022-04-25 23:36:50 +00:00
2022-04-13 19:04:59 +00:00
2022-04-05 18:01:26 +00:00
2022-05-17 18:55:46 +00:00
2022-05-03 15:14:09 +00:00
2022-05-17 03:26:28 +00:00
2022-04-07 14:42:13 +00:00
2022-05-04 18:05:18 +00:00
2022-04-11 16:31:52 +00:00
2022-03-27 20:23:17 +00:00