Skip to content

Update shopify-money annotations for 4.2.0 - #443

Merged
egiurleo merged 1 commit into
Shopify:mainfrom
olivier-thatch:shopify-money-4.2.0
Nov 12, 2026
Merged

egiurleo merged 1 commit into
Shopify:mainfrom
olivier-thatch:shopify-money-4.2.0

Conversation

@olivier-thatch

Copy link
Copy Markdown
Contributor

Type of Change

  • Add RBI for a new gem
  • Modify RBI for an existing gem
  • Other:

Changes

shopify-money 4.2.0 changed the arity of several Money methods, so the current annotations fail repo check static against 4.2.0 with srb.help/4010 ("redefined without matching argument count"):

  • zero?, nonzero?, positive?, negative?, to_i, to_f, hash were def_delegators :@value, ... (*args, **, &block). They are now plain zero-arg methods (Shopify/money#fd5386d).
  • clamp(min, max) is now clamp(...) and forwards to Comparable#clamp, so it also accepts a Range and nil bounds (Shopify/money#23e8d18, #4d9b012).

The old signatures stay under # @version < 4.2.0. The new ones are under # @version >= 4.2.0. This follows the same pattern as graphql.rbi.

RBI annotations can't hold overloads, so the new clamp sig types each splat element as T.nilable(T.any(Numeric, Money, T::Range[T.nilable(T.any(Numeric, Money))])). It declares **kwargs and &block because Sorbet requires the arity to match the Tapioca-generated clamp(*_arg0, **_arg1, &_arg2).

Verification

  • repo check static shopify-money against 4.2.0: passes (fails on main with 8× 4010)
  • repo check static shopify-money against v4.1.1 (pinned with a temporary path in index.json): passes
  • repo check runtime shopify-money and repo check rubocop: pass

@olivier-thatch
olivier-thatch marked this pull request as ready for review November 11, 2026 21:42
@olivier-thatch
olivier-thatch requested a review from a team as a code owner November 11, 2026 21:42
@egiurleo
egiurleo merged commit b813ff0 into Shopify:main Nov 12, 2026
4 checks passed
@olivier-thatch
olivier-thatch deleted the shopify-money-4.2.0 branch November 14, 2026 00:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants