]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: improve error message if init is directly invoked
authorEmmanuel Odeke <emm.odeke@gmail.com>
Sun, 1 Jan 2017 10:08:48 +0000 (03:08 -0700)
committerMatthew Dempsky <mdempsky@google.com>
Thu, 2 Feb 2017 05:55:03 +0000 (05:55 +0000)
commitcb6e0639fb090ea0e129b1ddb956a7e645cff285
tree085ff7b4b7e603a3f35601a9dd04b02ed2d9dad0
parentdbd51ce99c140766808c17b334b8795b8040c0b3
cmd/compile: improve error message if init is directly invoked

Fixes #8481.

Inform the user that init functions cannot be directly invoked
in user code, as mandated by the spec at:
http://golang.org/ref/spec#Program_initialization_and_execution.

Change-Id: Ib12c0c08718ffd48b76b6f9b13c76bb6612d2e7b
Reviewed-on: https://go-review.googlesource.com/34790
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/cmd/compile/internal/gc/typecheck.go
test/fixedbugs/issue8481.go [new file with mode: 0644]
test/init.go