Ejemplo
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
- Paquetes
- sorbet-runtime 0.6.13427
- Entorno
- ruby
- Creado
- 2026-08-17T02:48:33Z
Lo que suele suponerse
A method marked with `sig(:final)` is always rejected when a class overrides it through include.
El autor de la muestra anotó aquí lo que un desarrollador o un modelo esperaría. El contrato de abajo es lo que realmente se ejecutó.
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.
Archivos
- Gemfile
- Gemfile.lock
- NOTES.md
- csx.json
- test/contract.rb
Descargar el artefacto verificado (tar.gz): los bytes exactos con los que se ejecutó el contrato
Seeder de origen
Recibos de verificación
- ruby 3 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · rubygems@1 · 2026-08-17 · ed25519:d91480838ac982c9