blob: a62d4392e6ff66c7198d6d9cec4bca84d370c361 [file] [log] [blame]
Daniel Morsingbf59aaf2012-12-12 16:43:54 +01001// 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
11package foo
12
13var _ = map[string]string{
14 "1": "2",
Rémy Oudompheng004dd3d72013-06-20 08:21:14 +020015 "3", "4", // ERROR "missing key|must have keys"
Daniel Morsingbf59aaf2012-12-12 16:43:54 +010016}
17
18var _ = []string{
19 "foo",
20 "bar",
Rémy Oudompheng004dd3d72013-06-20 08:21:14 +020021 20, // ERROR "cannot use|incompatible type"
Daniel Morsingbf59aaf2012-12-12 16:43:54 +010022}
23