2012-02-17 04:49:59 +00:00
|
|
|
// compile
|
2010-10-03 15:50:44 +00:00
|
|
|
|
2016-04-10 21:32:26 +00:00
|
|
|
// Copyright 2010 The Go Authors. All rights reserved.
|
2010-10-03 15:50:44 +00:00
|
|
|
// Use of this source code is governed by a BSD-style
|
|
|
|
// license that can be found in the LICENSE file.
|
|
|
|
|
|
|
|
// issue 1016
|
|
|
|
|
2012-02-03 19:43:24 +00:00
|
|
|
package bug309
|
2010-10-03 15:50:44 +00:00
|
|
|
|
|
|
|
func foo(t interface{}, c chan int) {
|
|
|
|
switch v := t.(type) {
|
|
|
|
case int:
|
|
|
|
select {
|
|
|
|
case <-c:
|
|
|
|
// bug was: internal compiler error: var without type, init: v
|
|
|
|
}
|
2011-11-04 16:03:50 +00:00
|
|
|
default:
|
|
|
|
_ = v
|
2010-10-03 15:50:44 +00:00
|
|
|
}
|
|
|
|
}
|