blob: 658b1a92fa89c2dba8f622435a44cdd8e212cfe5 [file] [log] [blame]
Russ Cox54b00652009-05-22 09:53:37 -07001// $G $D/$F.go && $L $F.$A && ./$A.out
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// Check that static interface conversion of
8// interface value nil succeeds.
9
10package main
11
Rob Pike4f61fc92010-09-04 10:36:13 +100012type R interface { R() }
13type RW interface { R(); W() }
Russ Cox54b00652009-05-22 09:53:37 -070014
15var e interface {}
Rob Pike4f61fc92010-09-04 10:36:13 +100016var r R
17var rw RW
Russ Cox54b00652009-05-22 09:53:37 -070018
19func main() {
Rob Pike4f61fc92010-09-04 10:36:13 +100020 r = r
21 r = rw
22 e = r
23 e = rw
24 rw = rw
Russ Cox54b00652009-05-22 09:53:37 -070025}