[dev.typeparams] test: fix and update run.go's generics testing
In a late change to golang.org/cl/320609, while going back and forth
on the meaning of the boolean result value for "checkFlags", I got one
of the cases wrong. As a result, rather than testing both default
flags and -G=3, we were (redundanly) testing default flags and -G=0.
I ran into this because in my local dev tree, I'm using types2 even
for -G=0, and evidently one of the recent types2 CLs changed the error
message in fixedbugs/issue10975.go. Fortunately, there haven't been
any other regressions despite lacking test coverage.
So this CL cleans things up a bit:
1. Fixes that test to use -lang=go1.17, so types2 reports the old
error message again.
2. Renames "checkFlags" to "validForGLevel" so the boolean result is
harder to get wrong.
3. Removes the blanket deny list of all -m tests, and instead adds the
specific tests that are still failing. This effectively extends -G=3
coverage to another 27 tests that were using -m but already passing,
so we can make sure they don't regress again.
4. Adds a -f flag to force running tests even if they're in the deny
list, to make it easier to test whether they're still failing without
having to edit run.go.
Change-Id: I058d9d90d81a92189e54c6f591d95fb617fede53
Reviewed-on: https://go-review.googlesource.com/c/go/+/322612
Trust: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Robert Griesemer <gri@golang.org>
2021-05-25 15:06:56 -06:00
|
|
|
// errorcheck -lang=go1.17
|
2015-08-21 20:24:20 -06:00
|
|
|
|
2016-04-10 15:32:26 -06:00
|
|
|
// Copyright 2015 The Go Authors. All rights reserved.
|
2015-08-21 20:24:20 -06:00
|
|
|
// Use of this source code is governed by a BSD-style
|
|
|
|
// license that can be found in the LICENSE file.
|
|
|
|
|
2015-10-03 19:23:23 -06:00
|
|
|
// Issue 10975: Returning an invalid interface would cause
|
|
|
|
// `internal compiler error: getinarg: not a func`.
|
2015-08-21 20:24:20 -06:00
|
|
|
|
|
|
|
package main
|
|
|
|
|
|
|
|
type I interface {
|
2020-12-21 14:41:23 -07:00
|
|
|
int // ERROR "interface contains embedded non-interface|not an interface"
|
2015-08-21 20:24:20 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
func New() I {
|
|
|
|
return struct{}{}
|
|
|
|
}
|