-
Notifications
You must be signed in to change notification settings - Fork 18.5k
Description
The go/types documentation twice mentions "incrementally":
Alternatively, create a new type checker with NewChecker and invoke it incrementally by calling Checker.Files.
NewChecker returns a new Checker instance for a given package. Package files may be added incrementally via checker.Files.
However, it's unclear to me what that's supposed to mean. The types tutorial doesn't mention "incrementally" at all either, or even describe using the types.Checker API.
Intuitively, I would think an "incremental" API means the caller only needs to supply new information; e.g., to call Files({A}) and then Files({B}). But looking at the implementation, it appears the second call actually needs to be Files({A,B}). That's fine (and can't change now anyway), but I'm not clear in what sense it's "incremental." It doesn't build on any previous work, except to reuse the same maps previously allocated.