mirror of
https://github.com/golang/go
synced 2024-11-13 16:40:22 -07:00
debca77971
Method expressions where the method is implicitly declared have no line number. The Error method of the built-in error type is one such method. We leave the line number at the use of the method expression in this case. Fixes #29389 Change-Id: I29c64bb47b1a704576abf086599eb5af7b78df53 Reviewed-on: https://go-review.googlesource.com/c/155639 Run-TryBot: Keith Randall <khr@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
18 lines
347 B
Go
18 lines
347 B
Go
// compile
|
|
|
|
// Copyright 2018 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.
|
|
|
|
// Make sure we can correctly compile method expressions
|
|
// where the method is implicitly declared.
|
|
|
|
package main
|
|
|
|
import "io"
|
|
|
|
func main() {
|
|
err := io.EOF
|
|
_ = err.Error
|
|
}
|