Source file test/typeparam/issue51250a.dir/b.go

     1  // Copyright 2022 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  package b
     6  
     7  import "./a"
     8  
     9  type T struct { a int }
    10  
    11  var I interface{} = a.G[T]{}
    12  
    13  //go:noinline
    14  func F(x interface{}) {
    15  	switch x.(type) {
    16  	case a.G[T]:
    17  	case int:
    18  		panic("bad")
    19  	case float64:
    20  		panic("bad")
    21  	default:
    22  		panic("bad")
    23  	}
    24  }
    25  

View as plain text