Russ Cox | d2cc988 | 2012-02-16 23:50:37 -0500 | [diff] [blame] | 1 | // compile |
Russ Cox | 917aa35 | 2009-05-08 15:40:14 -0700 | [diff] [blame] | 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 | |
Rob Pike | 501f0b5 | 2012-02-23 18:47:26 +1100 | [diff] [blame] | 7 | // Test that when import gives multiple names |
| 8 | // to a single type, they still all refer to the same type. |
Russ Cox | 917aa35 | 2009-05-08 15:40:14 -0700 | [diff] [blame] | 9 | |
| 10 | package main |
| 11 | |
| 12 | import _os_ "os" |
| 13 | import "os" |
| 14 | import . "os" |
| 15 | |
Russ Cox | 64f78c9 | 2011-10-27 19:41:39 -0700 | [diff] [blame] | 16 | func f(e *os.File) |
Russ Cox | 917aa35 | 2009-05-08 15:40:14 -0700 | [diff] [blame] | 17 | |
| 18 | func main() { |
Russ Cox | 64f78c9 | 2011-10-27 19:41:39 -0700 | [diff] [blame] | 19 | var _e_ *_os_.File |
| 20 | var dot *File |
Russ Cox | 917aa35 | 2009-05-08 15:40:14 -0700 | [diff] [blame] | 21 | |
Rob Pike | 4f61fc9 | 2010-09-04 10:36:13 +1000 | [diff] [blame] | 22 | f(_e_) |
| 23 | f(dot) |
Russ Cox | 917aa35 | 2009-05-08 15:40:14 -0700 | [diff] [blame] | 24 | } |