Source file test/fixedbugs/issue10047.go

     1  // compile
     2  
     3  // Copyright 2015 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  
     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  }
    20  

View as plain text