]> Cypherpunks repositories - gostls13.git/commit
test: comment out failing cases from sinit.go
authorIan Lance Taylor <iant@golang.org>
Tue, 4 Nov 2014 18:20:35 +0000 (10:20 -0800)
committerIan Lance Taylor <iant@golang.org>
Tue, 4 Nov 2014 18:20:35 +0000 (10:20 -0800)
commitc6e53fea107563225ec85889b4d88d5ffbd85c17
treed33a6ddfbc98b2676f9bd65c52e9ba88ca9129fe
parent516d9ef53b656aa5e6eebdc2c09e8d257b13e033
test: comment out failing cases from sinit.go

One failing case this removes is:

var bytes = []byte("hello, world")
var copy_bytes = bytes

We could handle this in the compiler, but it requires special
case for a variable that is initialized to the value of a
variable that is initialized to a string literal converted to
[]byte.  This seems an unlikely case--it never occurs in the
standrd library--and it seems unnecessary to write the code to
handle it.

If we do want to support this case, one approach is
https://golang.org/cl/171840043.

The other failing cases are of the form

var bx bool
var copy_bx = bx

The compiler used to initialize copy_bx to false.  However,
that led to issue 7665, since bx may be initialized in non-Go
code.  The compiler no longer assumes that bx must be false,
so copy_bx can not be statically initialized.

We can fix these with https://golang.org/cl/169040043
if we also pass -complete to the compiler as part of this
test.  This is OK but it's too late in the release cycle.

Fixes #8746.

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/165400043
test/sinit.go