Skip to content

Commit 1a3081d

Browse files
committed
all: prepare for formatting any as 'any' in type strings
Make a couple of small changes to support keeping track of the predeclared any by pointer identity, and formatting it as 'any'. This should allow x/tools trybots to pass on CL 363974. Updates golang/go#49583 Change-Id: I79cffee6adbf000a7251dbea4091fdd7b8fdcf0a Reviewed-on: https://go-review.googlesource.com/c/tools/+/364194 Trust: Robert Findley <[email protected]> Run-TryBot: Robert Findley <[email protected]> gopls-CI: kokoro <[email protected]> TryBot-Result: Go Bot <[email protected]> Reviewed-by: Robert Griesemer <[email protected]>
1 parent 4adea50 commit 1a3081d

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

go/internal/gcimporter/support_go118.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,8 @@ func additionalPredeclared() []types.Type {
1616
return []types.Type{
1717
// comparable
1818
types.Universe.Lookup("comparable").Type(),
19+
20+
// any
21+
types.Universe.Lookup("any").Type(),
1922
}
2023
}

internal/lsp/testdata/godef/infer_generics/inferred.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package inferred
22

3-
func app[S interface{ ~[]E }, E any](s S, e E) S {
3+
func app[S interface{ ~[]E }, E interface{}](s S, e E) S {
44
return append(s, e)
55
}
66

0 commit comments

Comments
 (0)