fix: improve type specs for downstream type checkers#127
Merged
tsloughter merged 1 commit intoerleans:mainfrom Mar 26, 2026
Merged
fix: improve type specs for downstream type checkers#127tsloughter merged 1 commit intoerleans:mainfrom
tsloughter merged 1 commit intoerleans:mainfrom
Conversation
- Export additional types: pool/0, row/0, options/0, decode_option/0 - Fix result() type: rows field uses [row()] instead of list() - Fix result() type: num_rows uses non_neg_integer() instead of integer() - Fix checkout/checkin specs: use pgo_pool:ref() (was pool_ref/0 which doesn't exist)
tsloughter
approved these changes
Mar 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Improves type specifications in
pgo.erlfor better compatibility with gradual type checkers (eqWAlizer, Dialyzer):pool/0,row/0,options/0,decode_option/0— these are referenced in downstream code but weren't exportedresult()type:rowsfield typed as[row()]instead of barelist(),num_rowstyped asnon_neg_integer()instead ofinteger()checkout/checkinspecs: Usepgo_pool:ref()instead ofpgo_pool:pool_ref/0which doesn't exist (the exported type isref/0)Motivation
When using pgo with eqWAlizer (WhatsApp's gradual type checker for Erlang), the untyped
rows := list()and missing type exports cause cascading type errors in every downstream project. These changes are backwards-compatible and make the types more precise.Test plan
rebar3 compile— passesrebar3 eunit— 2 tests passrebar3 dialyzer— passes