blob: cc47189e1684ef55f7356a00d2c60156013a6b8e [file] [log] [blame]
Russ Cox80803842012-02-16 23:49:59 -05001// errorcheck
Russ Cox307a8992010-01-08 00:01:03 -08002
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
7// Test case for issue 471. This file shouldn't compile.
8
9package main
10
Ian Lance Taylora91e5242010-01-30 11:38:06 -080011const a *int = 1 // ERROR "convert|wrong|invalid"
12const b [2]int = 2 // ERROR "convert|wrong|invalid"
13const c map[int]int = 3 // ERROR "convert|wrong|invalid"
14const d chan int = 4 // ERROR "convert|wrong|invalid"
15const e func() = 5 // ERROR "convert|wrong|invalid"
16const f struct{} = 6 // ERROR "convert|wrong|invalid"
17const g interface{} = 7 // ERROR "constant|wrong|invalid"
Russ Coxfe01d4c2010-01-19 15:25:44 -080018const h bool = false
19const i int = 2
Russ Coxf2b5a072011-01-19 23:09:00 -050020const j float64 = 5
Russ Cox307a8992010-01-08 00:01:03 -080021