Commit f6020366 authored by Austin Clements's avatar Austin Clements

Bug involving ... initializers and interface values.

R=rsc
APPROVED=rsc
DELTA=22  (22 added, 0 deleted, 0 changed)
OCL=33053
CL=33104
parent 96a2a2ef
// Copyright 2009 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// $G $D/$F.go && $L $F.$A && ./$A.out
package main
func main() {
// This bug doesn't arise with [...]int, or []interface{} or [3]interface{}.
a := [...]interface{} { 1, 2, 3 };
n := 0;
for _, v := range a {
if v.(int) != n {
panicln("BUG:", n, v.(int));
}
n++;
}
}
...@@ -153,3 +153,10 @@ BUG: should fail ...@@ -153,3 +153,10 @@ BUG: should fail
=========== bugs/bug169.go =========== bugs/bug169.go
BUG: errchk: command succeeded unexpectedly BUG: errchk: command succeeded unexpectedly
=========== bugs/bug187.go
BUG: 0 1
SIGSEGV: segmentation violation
Faulting address: 0x40a1f0
PC=0x40a1f0
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment