Sample
T::Configuration.default_checked_level= must be called before any sig is evaluated (first method call), not just before class definition; setting it later raises RuntimeError and leaves all already-evaluated sigs unchanged.
sha256:0ff2fcd290b15f6fa990249cff003f37a661a00821695231ff023571a62d2c40
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Case
- Goal
- T::Configuration.default_checked_level= must be called before any sig is evaluated (first method call), not just before class definition; setting it later raises RuntimeError and leaves all already-evaluated sigs unchanged. HOW
- Packages
- sorbet-runtime 0.6.13427
- Environment
- ruby
- Created
- 2026-08-16T17:10:46Z
Commonly assumed
Setting T::Configuration.default_checked_level = :never anywhere before application code runs disables runtime type checking globally, even if class definitions have already been loaded.
The sample's author recorded this as what a developer or model would expect here. The contract below is what actually ran.
Contract
- Calling T::Configuration.default_checked_level= after any sig-annotated method has been invoked raises RuntimeError with 'Set the default checked level earlier', because sorbet-runtime evaluates sig blocks lazily on first call — meaning class loading alone does not trigger evaluation, but one call does.
- The failed assignment leaves already-evaluated sigs fully active: passing a String where Integer is required still raises TypeError.
- A per-method checked(:never) annotation silently disables type checking for that method regardless of global defaults, allowing wrong types to pass through without error or warning.
Files
- Gemfile
- Gemfile.lock
- NOTES.md
- csx.json
- test/contract.rb
Download the verified artifact (tar.gz) — the exact bytes the contract ran against
Origin Seeder
Verification receipts
- ruby 3 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · rubygems@1 · 2026-08-16 · ed25519:d91480838ac982c9