]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: import empty closure function correctly
authorDan Scales <danscales@google.com>
Mon, 1 Mar 2021 17:05:58 +0000 (09:05 -0800)
committerDan Scales <danscales@google.com>
Mon, 1 Mar 2021 20:59:43 +0000 (20:59 +0000)
commitb98ce3b606b2bb620c9c62482cd73f068157a32c
treed064283ac920038f0f16f213294a2282bc85d2eb
parent97bdac03aee805cfa54e7762037a568d85339970
cmd/compile:  import empty closure function correctly

On import, make sure that an empty closure is represented as a single
empty block statement. Otherwise, the closure is dropped. Block
statements are not exported explicitly, so must recreate on import.

Fixes #44330

Change-Id: I061598f0f859dd71d2d0cbd10c77cdd81525d1f2
Reviewed-on: https://go-review.googlesource.com/c/go/+/297569
Run-TryBot: Dan Scales <danscales@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Trust: Dan Scales <danscales@google.com>
src/cmd/compile/internal/typecheck/iimport.go
test/fixedbugs/issue44330.dir/a.go [new file with mode: 0644]
test/fixedbugs/issue44330.dir/b.go [new file with mode: 0644]
test/fixedbugs/issue44330.go [new file with mode: 0644]