blob: c92c0a6630fde050b1e83222812e651934c8a2c3 [file] [log] [blame]
Chris Manghane77d77712014-12-08 19:17:37 -08001// errorcheck
2
3// Copyright 2014 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 9083: map/chan error messages show non-explicit capacity.
8
9package main
10
11// untyped constant
12const zero = 0
13
14func main() {
15 var x int
16 x = make(map[int]int) // ERROR "cannot use make\(map\[int\]int\)|incompatible"
17 x = make(map[int]int, 0) // ERROR "cannot use make\(map\[int\]int, 0\)|incompatible"
18 x = make(map[int]int, zero) // ERROR "cannot use make\(map\[int\]int, zero\)|incompatible"
19 x = make(chan int) // ERROR "cannot use make\(chan int\)|incompatible"
20 x = make(chan int, 0) // ERROR "cannot use make\(chan int, 0\)|incompatible"
21 x = make(chan int, zero) // ERROR "cannot use make\(chan int, zero\)|incompatible"
22}