mirror of
https://github.com/golang/go
synced 2024-11-27 02:41:23 -07:00
83bfed916b
When we have a typed nil, we already say so; thus it is sufficient to use "nil" in all the other cases. This is closer to (1.17) compiler behavior. In cases where the 1.17 compiler prints "untyped nil" (e.g., wrong uses of "copy"), we already print a different message. We can do better in those cases as well; will be addressed in a separate CL (see #49735). Fixes #48852. Change-Id: I9a7a72e0f99185b00f80040c5510a693b1ea80f6 Reviewed-on: https://go-review.googlesource.com/c/go/+/366276 Trust: Robert Griesemer <gri@golang.org> Reviewed-by: Robert Findley <rfindley@google.com>
14 lines
365 B
Go
14 lines
365 B
Go
// errorcheck
|
|
|
|
// Copyright 2014 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.
|
|
|
|
// Issue 6402: spurious 'use of untyped nil' error
|
|
|
|
package p
|
|
|
|
func f() uintptr {
|
|
return nil // ERROR "cannot use nil as type uintptr in return argument|incompatible type|cannot use nil"
|
|
}
|