1
0
mirror of https://github.com/golang/go synced 2024-11-14 21:50:30 -07:00
go/test/fixedbugs/issue8183.go
Robert Griesemer cd15a48036 [dev.typeparams] cmd/compile/internal/types2: correct error position for inherited const init expression
Enabled fixedbugs/issue8183.go for run.go with new typechecker
now that issue is fixed.

Fixes #42992.
Updates #42991.

Change-Id: I23451999983b740d5f37ce3fa75ee756daf1a44f
Reviewed-on: https://go-review.googlesource.com/c/go/+/275517
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
2020-12-07 16:44:07 +00:00

24 lines
554 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.
// Tests correct reporting of line numbers for errors involving iota,
// Issue #8183.
package foo
const (
ok = byte(iota + 253)
bad
barn
bard // ERROR "constant 256 overflows byte|cannot convert"
)
const (
c = len([1 - iota]int{})
d
e // ERROR "array bound must be non-negative|invalid array length"
f // ERROR "array bound must be non-negative|invalid array length"
)