@@ -359,12 +359,13 @@ func loadPackageEx(dedup Deduper, ld *loader, lpkg *loaderPackage) {
359359 smallCap = 4
360360 }
361361 lpkg .TypesInfo = & types.Info {
362- Types : make (map [ast.Expr ]types.TypeAndValue , typeInfoCap ),
363- Defs : make (map [* ast.Ident ]types.Object , identCap ),
364- Uses : make (map [* ast.Ident ]types.Object , identCap ),
365- Implicits : make (map [ast.Node ]types.Object , smallCap ),
366- Instances : make (map [* ast.Ident ]types.Instance , smallCap ),
367- Scopes : make (map [ast.Node ]* types.Scope , smallCap ),
362+ Types : make (map [ast.Expr ]types.TypeAndValue , typeInfoCap ),
363+ Defs : make (map [* ast.Ident ]types.Object , identCap ),
364+ Uses : make (map [* ast.Ident ]types.Object , identCap ),
365+ Implicits : make (map [ast.Node ]types.Object , smallCap ),
366+ Instances : make (map [* ast.Ident ]types.Instance , smallCap ),
367+ // Scopes are not consumed by LLGo or x/tools/go/ssa during compilation.
368+ // Leaving it nil avoids recording every lexical scope during type checking.
368369 Selections : make (map [* ast.SelectorExpr ]* types.Selection , smallCap ),
369370 }
370371 lpkg .TypesSizes = ld .sizes
0 commit comments