blob: fc734377ee066927f1fee88eead4e2607b594f1e [file] [log] [blame]
Russ Cox8f194bf2009-03-12 19:04:38 -07001// $G $D/$F.go && $L $F.$A && ./$A.out
2
3// Copyright 2009 The Go Authors. All rights reserved.
4// Use of this source code is governed by a BSD-style
5// license that can be found in the LICENSE file.
6
7package main
8
9import "fmt"
10
11type T int
12func (t T) String() string {
13 return fmt.Sprintf("T%d", t);
14}
15
16const (
17 A T = 1<<(1<<iota);
18 B;
19 C;
20 D;
21 E;
22)
23
24func main() {
25 s := fmt.Sprintf("%v %v %v %v %v", A, B, C, D, E);
26 if s != "T2 T4 T16 T256 T65536" {
27 panicln("type info didn't propagate in const: got", s);
28 }
29}