diff options
author | Matthew Dempsky <mdempsky@google.com> | 2021-07-09 19:47:45 -0700 |
---|---|---|
committer | Matthew Dempsky <mdempsky@google.com> | 2021-07-11 17:21:28 +0000 |
commit | 0dcab98fd829e845a83fed996025f96b8b1165b1 (patch) | |
tree | 4fac8c93850a741a917bb0b87067f2b73ff3c815 /src/cmd/compile/internal/typecheck/iimport.go | |
parent | 3c3c1d8d2856e7859f4ba36b19c91f1538546d2a (diff) | |
download | go-0dcab98fd829e845a83fed996025f96b8b1165b1.tar.gz go-0dcab98fd829e845a83fed996025f96b8b1165b1.zip |
[dev.typeparams] cmd/compile: slightly more incremental unified typecheck
This CL pushes the typecheck.Expr calls further down to the IR
construction points. It turns out we don't really care about
typecheck.AssignExpr, because it's only used to distinguish whether
ir.BlankNode is allowed. We can avoid that issue by just skipping the
call to typecheck.Expr for blank nodes.
Similarly, for typecheck.Callee, only two details matter: (1) don't
report errors for builtin functions (which aren't allowed outside of
callee contexts); and (2) method-value selector expressions need to
have Op ODOTMETH/ODOTINTER rather than OMETHVALUE. The first can be
handled by simply skipping typecheck on Names (as with ir.BlankNode,
we don't need to typecheck these). The second currently requires
adding a 'callee bool' parameter to disambiguate the context.
The other option would be for exprCall to reset the fun's Op from
OMETHVALUE to OXDOT and let typecheck handle it a second time. But I
anticipate needing to add extra logic in the exprSelector case which
would be harder to undo, so this seems somewhat better.
Change-Id: I1a8dfb6af04265ab466fd7f4cb6ee8b479e92282
Reviewed-on: https://go-review.googlesource.com/c/go/+/333769
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Trust: Matthew Dempsky <mdempsky@google.com>
Diffstat (limited to 'src/cmd/compile/internal/typecheck/iimport.go')
0 files changed, 0 insertions, 0 deletions