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