mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/compile: use type position for error message in align.go
This helps the compiler reports the right place where the type declared, instead of relying on global lineno, which maybe set to wrong value at the time the error is reported. Fixes #42058 Change-Id: I06d34aa9b0236d122f4a0d72e66675ded022baac Reviewed-on: https://go-review.googlesource.com/c/go/+/263597 Trust: Cuong Manh Le <cuong.manhle.vn@gmail.com> Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com> Reviewed-by: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Go Bot <gobot@golang.org>
This commit is contained in:
parent
a505312c89
commit
bccdd31252
4 changed files with 33 additions and 5 deletions
13
test/fixedbugs/issue42058a.go
Normal file
13
test/fixedbugs/issue42058a.go
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
// errorcheck
|
||||
|
||||
// Copyright 2020 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 p
|
||||
|
||||
var c chan [2 << 16]byte // ERROR "channel element type too large"
|
||||
|
||||
type T [1 << 17]byte
|
||||
|
||||
var x chan T // ERROR "channel element type too large"
|
||||
Loading…
Add table
Add a link
Reference in a new issue