2009-08-17 14:30:22 -06:00
|
|
|
// $G $D/$F.go && $L $F.$A && ./$A.out
|
|
|
|
|
|
|
|
// Copyright 2009 The Go Authors. All rights reserved.
|
2009-08-12 14:57:05 -06:00
|
|
|
// Use of this source code is governed by a BSD-style
|
|
|
|
// license that can be found in the LICENSE file.
|
|
|
|
|
|
|
|
package main
|
|
|
|
|
2009-08-12 15:54:15 -06:00
|
|
|
import "os"
|
|
|
|
|
2009-08-12 14:57:05 -06:00
|
|
|
func main() {
|
|
|
|
// This bug doesn't arise with [...]int, or []interface{} or [3]interface{}.
|
|
|
|
a := [...]interface{} { 1, 2, 3 };
|
|
|
|
n := 0;
|
2009-08-12 15:54:15 -06:00
|
|
|
bug := false;
|
2009-08-12 14:57:05 -06:00
|
|
|
for _, v := range a {
|
|
|
|
if v.(int) != n {
|
2009-08-12 15:54:15 -06:00
|
|
|
println("BUG:", n, v.(int));
|
|
|
|
os.Exit(0);
|
2009-08-12 14:57:05 -06:00
|
|
|
}
|
|
|
|
n++;
|
|
|
|
}
|
|
|
|
}
|