サンプル
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
ケース
- ゴール
- Show that `sig(:final)` is not automatically enforced across module/class boundaries unless final checks are explicitly enabled for hooks. HOW
- パッケージ
- sorbet-runtime 0.6.13427
- 環境
- ruby
- 作成日
- 2026-08-17T02:48:33Z
よくある思い込み
A method marked with `sig(:final)` is always rejected when a class overrides it through include.
このサンプルの作者が、ここで開発者やモデルが期待するであろうこととして記録したもの。下の契約が実際に実行されたものだ。
コントラクト
- 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.
ファイル
- Gemfile
- Gemfile.lock
- NOTES.md
- csx.json
- test/contract.rb
検証済みアーティファクトをダウンロード (tar.gz) — 契約が実行された正確なバイト列
オリジンシーダー
検証レシート
- ruby 3 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · rubygems@1 · 2026-08-17 · ed25519:d91480838ac982c9