mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
[dev.typeparams] cmd/compile: pass -lang flag value to new type checker
This enables another test. Change-Id: I80763b97d939e225158a083299b2e0d189268bc7 Reviewed-on: https://go-review.googlesource.com/c/go/+/289569 Trust: Robert Griesemer <gri@golang.org> Trust: Dan Scales <danscales@google.com> Reviewed-by: Dan Scales <danscales@google.com>
This commit is contained in:
parent
1ff2fdaaf1
commit
721488498a
3 changed files with 3 additions and 3 deletions
|
|
@ -35,6 +35,7 @@ func check2(noders []*noder) {
|
||||||
|
|
||||||
// typechecking
|
// typechecking
|
||||||
conf := types2.Config{
|
conf := types2.Config{
|
||||||
|
GoVersion: base.Flag.Lang,
|
||||||
InferFromConstraints: true,
|
InferFromConstraints: true,
|
||||||
IgnoreLabels: true, // parser already checked via syntax.CheckBranches mode
|
IgnoreLabels: true, // parser already checked via syntax.CheckBranches mode
|
||||||
CompilerErrorMessages: true, // use error strings matching existing compiler errors
|
CompilerErrorMessages: true, // use error strings matching existing compiler errors
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ package p
|
||||||
|
|
||||||
// numeric literals
|
// numeric literals
|
||||||
const (
|
const (
|
||||||
_ = 1_000 // ERROR "underscores in numeric literals requires go1.13 or later \(-lang was set to go1.12; check go.mod\)"
|
_ = 1_000 // ERROR "underscores in numeric literals requires go1.13 or later \(-lang was set to go1.12; check go.mod\)|requires go1.13"
|
||||||
_ = 0b111 // ERROR "binary literals requires go1.13 or later"
|
_ = 0b111 // ERROR "binary literals requires go1.13 or later"
|
||||||
_ = 0o567 // ERROR "0o/0O-style octal literals requires go1.13 or later"
|
_ = 0o567 // ERROR "0o/0O-style octal literals requires go1.13 or later"
|
||||||
_ = 0xabc // ok
|
_ = 0xabc // ok
|
||||||
|
|
@ -29,6 +29,6 @@ const (
|
||||||
// signed shift counts
|
// signed shift counts
|
||||||
var (
|
var (
|
||||||
s int
|
s int
|
||||||
_ = 1 << s // ERROR "invalid operation: 1 << s \(signed shift count type int\) requires go1.13 or later"
|
_ = 1 << s // ERROR "invalid operation: 1 << s \(signed shift count type int\) requires go1.13 or later|signed shift count"
|
||||||
_ = 1 >> s // ERROR "signed shift count"
|
_ = 1 >> s // ERROR "signed shift count"
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -1963,7 +1963,6 @@ var excluded = map[string]bool{
|
||||||
"fixedbugs/issue25958.go": true, // types2 doesn't report a follow-on error (pref: types2)
|
"fixedbugs/issue25958.go": true, // types2 doesn't report a follow-on error (pref: types2)
|
||||||
"fixedbugs/issue28079b.go": true, // types2 reports follow-on errors
|
"fixedbugs/issue28079b.go": true, // types2 reports follow-on errors
|
||||||
"fixedbugs/issue28268.go": true, // types2 reports follow-on errors
|
"fixedbugs/issue28268.go": true, // types2 reports follow-on errors
|
||||||
"fixedbugs/issue31747.go": true, // types2 is missing support for -lang flag
|
|
||||||
"fixedbugs/issue33460.go": true, // types2 reports alternative positions in separate error
|
"fixedbugs/issue33460.go": true, // types2 reports alternative positions in separate error
|
||||||
"fixedbugs/issue34329.go": true, // types2 is missing support for -lang flag
|
"fixedbugs/issue34329.go": true, // types2 is missing support for -lang flag
|
||||||
"fixedbugs/issue41575.go": true, // types2 reports alternative positions in separate error
|
"fixedbugs/issue41575.go": true, // types2 reports alternative positions in separate error
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue