]> Cypherpunks.ru repositories - gostls13.git/commit
go/types, types2: explicitly check for non-nil type in LookupFieldOrMethod
authorRobert Griesemer <gri@golang.org>
Wed, 19 Jan 2022 03:58:14 +0000 (19:58 -0800)
committerRobert Griesemer <gri@golang.org>
Wed, 19 Jan 2022 16:33:42 +0000 (16:33 +0000)
commitefbecc7eff88a0d54f3ea9fca290e1808e197ae2
treefe6eb5b3ded05debe8ce27d3e3c588a354219f30
parent985d97e602cb39c7739c072250e09ba61e440318
go/types, types2: explicitly check for non-nil type in LookupFieldOrMethod

Document and enforce API expectation. Add a test so we don't
inadvertently change the function behavior with respect to nil
type arguments.

Fixes #50620.

Change-Id: Ic000bff7504a03006bd248a319c7a2d49dcf09c8
Reviewed-on: https://go-review.googlesource.com/c/go/+/379374
Trust: Robert Griesemer <gri@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
src/cmd/compile/internal/types2/api_test.go
src/cmd/compile/internal/types2/lookup.go
src/go/types/api_test.go
src/go/types/lookup.go