Source file src/cmd/compile/internal/ssa/testdata/i81705b.go

     1  // Copyright 2026 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 main
     6  
     7  func typeSwitch(x any) {
     8  	switch x.(type) {
     9  	case interface{ M() }:
    10  		println("M")
    11  	default:
    12  		println("default")
    13  	}
    14  }
    15  
    16  func main() {
    17  	typeSwitch(1)
    18  }
    19  

View as plain text