1// errorcheck
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// Verify allowed and disallowed conversions.
8// Does not compile.
9
10package main
11
12// everything here is legal except the ERROR line
13
14var c chan int
15var d1 chan<- int = c
16var d2 = (chan<- int)(c)
17
18var e *[4]int
19var f1 []int = e[0:]
20var f2 = []int(e[0:])
21
22var g = []int(nil)
23
24type H []int
25type J []int
26
27var h H
28var j1 J = h // ERROR "compat|illegal|cannot"
29var j2 = J(h)
30