]> Cypherpunks.ru repositories - gostls13.git/blob - test/assign.go
last round: non-package code
[gostls13.git] / test / assign.go
1 // errchk $G $D/$F.go
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 package main
8
9 import "sync"
10
11 type T struct {
12         int;
13         sync.Mutex;
14 }
15
16 func main() {
17         {
18                 var x, y sync.Mutex;
19                 x = y;  // ERROR "assignment\[ -~\]*Mutex"
20                 _ = x;
21         }
22         {
23                 var x, y T;
24                 x = y;  // ERROR "assignment\[ -~\]*Mutex"
25                 _ = x;
26         }
27         {
28                 var x, y [2]sync.Mutex;
29                 x = y;  // ERROR "assignment\[ -~\]*Mutex"
30                 _ = x;
31         }
32         {
33                 var x, y [2]T;
34                 x = y;  // ERROR "assignment\[ -~\]*Mutex"
35                 _ = x;
36         }
37 }