diff options
Diffstat (limited to '')
-rw-r--r-- | test/import2.dir/import2.go | 42 | ||||
-rw-r--r-- | test/import2.dir/import3.go | 52 |
2 files changed, 94 insertions, 0 deletions
diff --git a/test/import2.dir/import2.go b/test/import2.dir/import2.go new file mode 100644 index 0000000..9c54a1b --- /dev/null +++ b/test/import2.dir/import2.go @@ -0,0 +1,42 @@ +// Copyright 2010 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Various declarations of exported variables and functions. + +package p + +var C1 chan <- chan int = (chan<- (chan int))(nil) +var C2 chan (<- chan int) = (chan (<-chan int))(nil) +var C3 <- chan chan int = (<-chan (chan int))(nil) +var C4 chan chan <- int = (chan (chan<- int))(nil) + +var C5 <- chan <- chan int = (<-chan (<-chan int))(nil) +var C6 chan <- <- chan int = (chan<- (<-chan int))(nil) +var C7 chan <- chan <- int = (chan<- (chan<- int))(nil) + +var C8 <- chan <- chan chan int = (<-chan (<-chan (chan int)))(nil) +var C9 <- chan chan <- chan int = (<-chan (chan<- (chan int)))(nil) +var C10 chan <- <- chan chan int = (chan<- (<-chan (chan int)))(nil) +var C11 chan <- chan <- chan int = (chan<- (chan<- (chan int)))(nil) +var C12 chan chan <- <- chan int = (chan (chan<- (<-chan int)))(nil) +var C13 chan chan <- chan <- int = (chan (chan<- (chan<- int)))(nil) + +var R1 chan<- (chan int) = (chan <- chan int)(nil) +var R3 <-chan (chan int) = (<- chan chan int)(nil) +var R4 chan (chan<- int) = (chan chan <- int)(nil) + +var R5 <-chan (<-chan int) = (<- chan <- chan int)(nil) +var R6 chan<- (<-chan int) = (chan <- <- chan int)(nil) +var R7 chan<- (chan<- int) = (chan <- chan <- int)(nil) + +var R8 <-chan (<-chan (chan int)) = (<- chan <- chan chan int)(nil) +var R9 <-chan (chan<- (chan int)) = (<- chan chan <- chan int)(nil) +var R10 chan<- (<-chan (chan int)) = (chan <- <- chan chan int)(nil) +var R11 chan<- (chan<- (chan int)) = (chan <- chan <- chan int)(nil) +var R12 chan (chan<- (<-chan int)) = (chan chan <- <- chan int)(nil) +var R13 chan (chan<- (chan<- int)) = (chan chan <- chan <- int)(nil) + +var F1 func() func() int +func F2() func() func() int +func F3(func() func() int) diff --git a/test/import2.dir/import3.go b/test/import2.dir/import3.go new file mode 100644 index 0000000..3bf9cb0 --- /dev/null +++ b/test/import2.dir/import3.go @@ -0,0 +1,52 @@ +// Copyright 2010 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Test that all the types from import2.go made it +// intact and with the same meaning, by assigning to or using them. + +package main + +import "./import2" + +func f3(func() func() int) + +func main() { + p.F3(p.F1) + p.F3(p.F2()) + f3(p.F1) + f3(p.F2()) + + p.C1 = (chan<- (chan int))(nil) + p.C2 = (chan (<-chan int))(nil) + p.C3 = (<-chan (chan int))(nil) + p.C4 = (chan (chan<- int))(nil) + + p.C5 = (<-chan (<-chan int))(nil) + p.C6 = (chan<- (<-chan int))(nil) + p.C7 = (chan<- (chan<- int))(nil) + + p.C8 = (<-chan (<-chan (chan int)))(nil) + p.C9 = (<-chan (chan<- (chan int)))(nil) + p.C10 = (chan<- (<-chan (chan int)))(nil) + p.C11 = (chan<- (chan<- (chan int)))(nil) + p.C12 = (chan (chan<- (<-chan int)))(nil) + p.C13 = (chan (chan<- (chan<- int)))(nil) + + p.R1 = (chan <- chan int)(nil) + p.R3 = (<- chan chan int)(nil) + p.R4 = (chan chan <- int)(nil) + + p.R5 = (<- chan <- chan int)(nil) + p.R6 = (chan <- <- chan int)(nil) + p.R7 = (chan <- chan <- int)(nil) + + p.R8 = (<- chan <- chan chan int)(nil) + p.R9 = (<- chan chan <- chan int)(nil) + p.R10 = (chan <- <- chan chan int)(nil) + p.R11 = (chan <- chan <- chan int)(nil) + p.R12 = (chan chan <- <- chan int)(nil) + p.R13 = (chan chan <- chan <- int)(nil) + +} + |