Exemplo
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
Caso
- Objetivo
- Show that `sig(:final)` is not automatically enforced across module/class boundaries unless final checks are explicitly enabled for hooks. HOW
- Pacotes
- sorbet-runtime 0.6.13427
- Ambiente
- ruby
- Criado
- 2026-08-17T02:48:33Z
O que costuma-se supor
A method marked with `sig(:final)` is always rejected when a class overrides it through include.
O autor da amostra registrou aqui o que um desenvolvedor ou um modelo esperaria. O contrato abaixo é o que de fato rodou.
Contrato
- 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.
Arquivos
- Gemfile
- Gemfile.lock
- NOTES.md
- csx.json
- test/contract.rb
Baixar o artefato verificado (tar.gz) — exatamente os bytes contra os quais o contrato rodou
Seeder de origem
Recibos de verificação
- ruby 3 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · rubygems@1 · 2026-08-17 · ed25519:d91480838ac982c9