Daniel Morsing | bf59aaf | 2012-12-12 16:43:54 +0100 | [diff] [blame] | 1 | // errorcheck |
| 2 | |
| 3 | // Copyright 2012 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 | // Issue 3925: wrong line number for error message "missing key in map literal" |
| 8 | |
| 9 | // also a test for correct line number in other malformed composite literals. |
| 10 | |
| 11 | package foo |
| 12 | |
| 13 | var _ = map[string]string{ |
| 14 | "1": "2", |
Rémy Oudompheng | 004dd3d7 | 2013-06-20 08:21:14 +0200 | [diff] [blame] | 15 | "3", "4", // ERROR "missing key|must have keys" |
Daniel Morsing | bf59aaf | 2012-12-12 16:43:54 +0100 | [diff] [blame] | 16 | } |
| 17 | |
| 18 | var _ = []string{ |
| 19 | "foo", |
| 20 | "bar", |
Rémy Oudompheng | 004dd3d7 | 2013-06-20 08:21:14 +0200 | [diff] [blame] | 21 | 20, // ERROR "cannot use|incompatible type" |
Daniel Morsing | bf59aaf | 2012-12-12 16:43:54 +0100 | [diff] [blame] | 22 | } |
| 23 | |