Exemple
Show that `sig(:final)` is not automatically enforced across module/class boundaries unless final checks are explicitly enabled for hooks.
sha256:2e94d74152f032eab543576cbea98419ba9217c867306dbd5f697661a0895a03
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Cas
- Objectif
- Show that `sig(:final)` is not automatically enforced across module/class boundaries unless final checks are explicitly enabled for hooks. HOW
- Paquets
- sorbet-runtime 0.6.13427
- Environnement
- ruby
- Créé
- 2026-08-17T02:48:33Z
Ce que l'on suppose souvent
A method marked with `sig(:final)` is always rejected when a class overrides it through include.
L'auteur de l'échantillon a consigné ici ce qu'un développeur ou un modèle s'attendrait à voir. Le contrat ci-dessous est ce qui s'est réellement exécuté.
Contrat
- Overriding a `sig(:final)` method by defining the same instance method in a class after including a module with that final method succeeds while final checks are not enabled.
- Enabling final checks on hooks converts the same pattern into a class-definition-time failure when a class includes a final method module and then defines that method.
Fichiers
- Gemfile
- Gemfile.lock
- NOTES.md
- csx.json
- test/contract.rb
Télécharger l'artefact vérifié (tar.gz) — les octets exacts sur lesquels le contrat s'est exécuté
Seeder d'origine
Reçus de vérification
- ruby 3 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · rubygems@1 · 2026-08-17 · ed25519:d91480838ac982c9