3 // Copyright 2009 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.
7 // Verify compiler messages about erroneous static interface conversions.
41 t = e // ERROR "need explicit|need type assertion"
43 // neither of these can work,
44 // because i has an extra method
45 // that t does not, so i cannot contain a t.
46 i = t // ERROR "incompatible|missing M method"
47 t = i // ERROR "incompatible|assignment$"
50 i2 = i // ERROR "incompatible|missing N method"
53 i2 = I2(i) // ERROR "invalid|missing N method"
56 t = T(e) // ERROR "need explicit|need type assertion|incompatible" "as type [*]T"
65 var _ = m.(int) // ERROR "impossible type assertion"
69 func (Int) M(float64) {}
71 var _ = m.(Int) // ERROR "impossible type assertion"
73 var _ = m.(X) // ERROR "pointer receiver"
78 var m1 M = ii // ERROR "incompatible|missing"
79 var m2 M = jj // ERROR "incompatible|wrong type for M method"
81 var m3 = M(ii) // ERROR "invalid|missing"
82 var m4 = M(jj) // ERROR "invalid|wrong type for M method"