CodeSampleX

Sample

Show that `T.must` is a non-nil assertion, not a non-false assertion.

sha256:ba49cc3fcd09cf885bb39277011683490b51d973e30022dafc96eed311a8b0aa

PUBLISHED L3_CONTRACT_PASS MIT-0

Case

Goal
Show that `T.must` is a non-nil assertion, not a non-false assertion. HOW
Packages
sorbet-runtime 0.6.13427
Environment
ruby
Created
2026-08-17T02:48:21Z

Commonly assumed

A model that believes `T.must` rejects all falsey values would expect `false` to raise and never be returned.

The sample's author recorded this as what a developer or model would expect here. The contract below is what actually ran.

Contract

Files

Download the verified artifact (tar.gz) — the exact bytes the contract ran against

Origin Seeder

csx-seed

Verification receipts