mirror of
https://github.com/golang/go
synced 2024-11-24 01:40:12 -07:00
685a322fe4
fixedbugs/issue11614.go:14:9: error: interface contains embedded non-interface fixedbugs/issue11614.go:22:20: error: interface contains embedded non-interface Change-Id: Ie9875916697833f5fa28ab890218851a741120ac Reviewed-on: https://go-review.googlesource.com/c/go/+/278175 Trust: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Than McIntosh <thanm@google.com> Reviewed-by: Cherry Zhang <cherryyz@google.com>
27 lines
572 B
Go
27 lines
572 B
Go
// errorcheck
|
|
|
|
// Copyright 2015 The Go Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style
|
|
// license that can be found in the LICENSE file.
|
|
|
|
// Test that incorrect expressions involving wrong anonymous interface
|
|
// do not generate panics in Type Stringer.
|
|
// Does not compile.
|
|
|
|
package main
|
|
|
|
type I interface {
|
|
int // ERROR "interface contains embedded non-interface"
|
|
}
|
|
|
|
func n() {
|
|
(I)
|
|
}
|
|
|
|
func m() {
|
|
(interface{int}) // ERROR "interface contains embedded non-interface" "type interface { int } is not an expression"
|
|
}
|
|
|
|
func main() {
|
|
}
|