yob / pdf-reader

The PDF::Reader library implements a PDF parser conforming as much as possible to the PDF specification from Adobe.
MIT License
1.81k stars 271 forks source link

Fix broken type sigs for resource methods #471

Closed yob closed 2 years ago

yob commented 2 years ago

in #423 I refactored the resource methods to be handled via a subclass rather than a mixin. Primarily to make it easier to work with sorbet type sigs.

Unfortunately I failed to update the rbi file to match, oops. I'm really not liking the way I need to maintain type sigs in a separate file - it's super easy for it to get out of sync with the code and sorbet not to flag it.

This aligns the rbi file with the code again, and tests it works by removing the T.untyped from the xobjects sig. Code around pdf-reader assumes the xobject values are a Stream, so we should ensure that's always true.