1
// errchk $G -e $D/$F.go
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
// Static error messages about interface conversions.
36
t = e // ERROR "need explicit|need type assertion"
38
// neither of these can work,
39
// because i has an extra method
40
// that t does not, so i cannot contain a t.
41
i = t // ERROR "incompatible|missing M method"
42
t = i // ERROR "incompatible|need type assertion"
45
i2 = i // ERROR "incompatible|missing N method"
48
i2 = I2(i) // ERROR "invalid|missing N method"
51
t = T(e) // ERROR "need explicit|need type assertion|incompatible"
60
var _ = m.(int) // ERROR "impossible type assertion"
64
func (Int) M(float64) {}
66
var _ = m.(Int) // ERROR "impossible type assertion"
71
var m1 M = ii // ERROR "incompatible|missing"
72
var m2 M = jj // ERROR "incompatible|wrong type for M method"
74
var m3 = M(ii) // ERROR "invalid|missing"
75
var m4 = M(jj) // ERROR "invalid|wrong type for M method"