mirror of
https://github.com/golang/go
synced 2024-11-18 07:34:53 -07:00
fd54ae8b0c
Add union support in types1, and allow exporting of unions, and importing unions back into types1 and types2. Added new test mincheck.go/mincheck.dir that tests that type lists (type sets) are correctly exported/imported, so that types2 gives correct errors that an instantiation doesn't fit the type list in the type param constraint. Change-Id: I8041c6c79289c870a95ed5a1b10e4c1c16985b12 Reviewed-on: https://go-review.googlesource.com/c/go/+/322609 Trust: Dan Scales <danscales@google.com> Trust: Robert Griesemer <gri@golang.org> Run-TryBot: Dan Scales <danscales@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Robert Griesemer <gri@golang.org>
28 lines
672 B
Go
28 lines
672 B
Go
// errorcheck -lang=go1.17
|
|
|
|
// Copyright 2009 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.
|
|
|
|
package main
|
|
|
|
type I1 interface{ I2 } // ERROR "interface"
|
|
type I2 int
|
|
|
|
type I3 interface{ int } // ERROR "interface"
|
|
|
|
type S struct {
|
|
x interface{ S } // ERROR "interface"
|
|
}
|
|
type I4 interface { // GC_ERROR "invalid recursive type I4\n\tLINE: I4 refers to\n\tLINE: I4$"
|
|
I4 // GCCGO_ERROR "interface"
|
|
}
|
|
|
|
type I5 interface { // GC_ERROR "invalid recursive type I5\n\tLINE: I5 refers to\n\tLINE+4: I6 refers to\n\tLINE: I5$"
|
|
I6
|
|
}
|
|
|
|
type I6 interface {
|
|
I5 // GCCGO_ERROR "interface"
|
|
}
|