mirror of
https://github.com/golang/go
synced 2024-11-19 10:04:56 -07:00
a222fb47e2
We downrank untyped constant candidates so that we prefer candidates whose type matches exactly. However, this was causing builtin constants like "true" to be outranked by candidates that fuzzily match "true". Fix by not downranking builtin constants. Fixes golang/go#36363. Change-Id: I14801688c96efdbb7ff9fee69f66028530df984c Reviewed-on: https://go-review.googlesource.com/c/tools/+/213137 Reviewed-by: Rebecca Stambler <rstambler@golang.org> Run-TryBot: Rebecca Stambler <rstambler@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
20 lines
330 B
Go
20 lines
330 B
Go
package builtins
|
|
|
|
func _() {
|
|
const (
|
|
foo = iota //@complete(" //", iota)
|
|
)
|
|
|
|
iota //@complete(" //")
|
|
|
|
var iota int //@item(iotaVar, "iota", "int", "var")
|
|
|
|
iota //@complete(" //", iotaVar)
|
|
}
|
|
|
|
func _() {
|
|
var twoRedUpEnd bool //@item(TRUEVar, "twoRedUpEnd", "bool", "var")
|
|
|
|
var _ bool = true //@rank(" //", _true, TRUEVar)
|
|
}
|