]> Cypherpunks repositories - gostls13.git/commit
go/types: handle nil pointer when panic is written outside of a function
authorRebecca Stambler <rstambler@golang.org>
Thu, 30 Aug 2018 15:33:19 +0000 (11:33 -0400)
committerRebecca Stambler <rstambler@golang.org>
Thu, 30 Aug 2018 16:53:43 +0000 (16:53 +0000)
commitc99687f87aed84342cfe92ae78924f791237c6f6
treeb450a25653586c7d76695e11ea3f93db90d4164f
parent31389254def190938c0cc802f645f958734bc865
go/types: handle nil pointer when panic is written outside of a function

The current implementation crashes when someone writes a panic outside of
a function, which makes sense since that is broken code. This fix allows
one to type-check broken code.

Updates #22467

Change-Id: I81b90dbd918162a20c60a821340898eaf02e648d
Reviewed-on: https://go-review.googlesource.com/132235
Reviewed-by: Alan Donovan <adonovan@google.com>
src/go/types/api_test.go
src/go/types/builtins.go