Skip to content

Commit e0095ae

Browse files
rscgopherbot
authored andcommitted
go/packages: fix precedence typo in needtypes calculation
I haven't figured out exactly how to exercise it, but the code as written is clearly wrong. Change-Id: I8849bc37210d08ad8ae3bc857a84ae55b34908a5 Reviewed-on: https://go-review.googlesource.com/c/tools/+/310511 Reviewed-by: Austin Clements <[email protected]> Trust: Russ Cox <[email protected]> Run-TryBot: Russ Cox <[email protected]> Auto-Submit: Russ Cox <[email protected]> gopls-CI: kokoro <[email protected]> TryBot-Result: Gopher Robot <[email protected]>
1 parent e309672 commit e0095ae

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

go/packages/packages.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,7 @@ func (ld *loader) refine(roots []string, list ...*Package) ([]*Package, error) {
634634
needsrc := ((ld.Mode&(NeedSyntax|NeedTypesInfo) != 0 && (rootIndex >= 0 || ld.Mode&NeedDeps != 0)) ||
635635
// ... or if we need types and the exportData is invalid. We fall back to (incompletely)
636636
// typechecking packages from source if they fail to compile.
637-
(ld.Mode&NeedTypes|NeedTypesInfo != 0 && exportDataInvalid)) && pkg.PkgPath != "unsafe"
637+
(ld.Mode&(NeedTypes|NeedTypesInfo) != 0 && exportDataInvalid)) && pkg.PkgPath != "unsafe"
638638
lpkg := &loaderPackage{
639639
Package: pkg,
640640
needtypes: needtypes,

0 commit comments

Comments
 (0)