Russ Cox | 8080384 | 2012-02-16 23:49:59 -0500 | [diff] [blame] | 1 | // errorcheck |
Russ Cox | 307a899 | 2010-01-08 00:01:03 -0800 | [diff] [blame] | 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 | |
| 7 | // Test case for issue 471. This file shouldn't compile. |
| 8 | |
| 9 | package main |
| 10 | |
Ian Lance Taylor | a91e524 | 2010-01-30 11:38:06 -0800 | [diff] [blame] | 11 | const a *int = 1 // ERROR "convert|wrong|invalid" |
| 12 | const b [2]int = 2 // ERROR "convert|wrong|invalid" |
| 13 | const c map[int]int = 3 // ERROR "convert|wrong|invalid" |
| 14 | const d chan int = 4 // ERROR "convert|wrong|invalid" |
| 15 | const e func() = 5 // ERROR "convert|wrong|invalid" |
| 16 | const f struct{} = 6 // ERROR "convert|wrong|invalid" |
| 17 | const g interface{} = 7 // ERROR "constant|wrong|invalid" |
Russ Cox | fe01d4c | 2010-01-19 15:25:44 -0800 | [diff] [blame] | 18 | const h bool = false |
| 19 | const i int = 2 |
Russ Cox | f2b5a07 | 2011-01-19 23:09:00 -0500 | [diff] [blame] | 20 | const j float64 = 5 |
Russ Cox | 307a899 | 2010-01-08 00:01:03 -0800 | [diff] [blame] | 21 | |