Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

go/types: vague docs about "incrementally" type checking files #20124

Open
mdempsky opened this issue Apr 25, 2017 · 0 comments
Open

go/types: vague docs about "incrementally" type checking files #20124

mdempsky opened this issue Apr 25, 2017 · 0 comments
Milestone

Comments

@mdempsky
Copy link
Member

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.

/cc @griesemer @alandonovan

@griesemer griesemer self-assigned this Jun 21, 2017
@griesemer griesemer added this to the Go1.10 milestone Jun 21, 2017
@rsc rsc modified the milestones: Go1.10, Go1.11 Nov 22, 2017
@griesemer griesemer modified the milestones: Go1.11, Go1.12 Jun 27, 2018
@griesemer griesemer modified the milestones: Go1.12, Go1.13 Dec 11, 2018
@andybons andybons modified the milestones: Go1.13, Go1.14 Jul 8, 2019
@rsc rsc modified the milestones: Go1.14, Backlog Oct 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants