Dan Willemsen | 6ff2325 | 2015-09-15 13:49:18 -0700 | [diff] [blame] | 1 | // compile |
| 2 | |
Dan Willemsen | 0c15709 | 2016-07-08 13:57:52 -0700 | [diff] [blame] | 3 | // Copyright 2015 The Go Authors. All rights reserved. |
Dan Willemsen | 6ff2325 | 2015-09-15 13:49:18 -0700 | [diff] [blame] | 4 | // Use of this source code is governed by a BSD-style |
| 5 | // license that can be found in the LICENSE file. |
| 6 | |
| 7 | // Issue 10047: gccgo failed to compile a type switch where the switch variable |
| 8 | // and the base type of a case share the same identifier. |
| 9 | |
| 10 | package main |
| 11 | |
| 12 | func main() { |
| 13 | type t int |
| 14 | var p interface{} |
| 15 | switch t := p.(type) { |
| 16 | case t: |
| 17 | _ = t |
| 18 | } |
| 19 | } |