2012-02-16 21:49:59 -07:00
|
|
|
// compile
|
2010-10-03 09:50:44 -06:00
|
|
|
|
|
|
|
// 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.
|
|
|
|
|
|
|
|
// issue 1016
|
|
|
|
|
2012-02-03 12:43:24 -07:00
|
|
|
package bug309
|
2010-10-03 09:50:44 -06: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 10:03:50 -06:00
|
|
|
default:
|
|
|
|
_ = v
|
2010-10-03 09:50:44 -06:00
|
|
|
}
|
|
|
|
}
|