Source file src/cmd/vet/testdata/ifaceassert/ifaceassert.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 ifaceassert
     6  
     7  type I1 interface{ M() int }
     8  type I2 interface{ M() string }
     9  
    10  func _(x I1) {
    11  	_ = x.(I2) // ERROR "impossible type assertion"
    12  }
    13  

View as plain text