Beispiel
Prove that sorbet-runtime does not clear a previously computed signature cache entry when a typed method is redefined without a new `sig`.
sha256:ff4bc542fba69abb1feb844ebf4739a88b4e1ecb4d8448961fc4b6418895e1d2
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Fall
- Ziel
- Prove that sorbet-runtime does not clear a previously computed signature cache entry when a typed method is redefined without a new `sig`. HOW
- Pakete
- sorbet-runtime 0.6.13427
- Umgebung
- ruby
- Erstellt
- 2026-08-17T02:48:48Z
Häufige Annahme
Replacing a `sig`-annotated method with a plain method definition should discard the prior runtime signature metadata so internal signature lookup returns no stale declaration for that method key.
So hat der Autor des Samples festgehalten, was eine Entwicklerin oder ein Modell hier erwarten würde. Der Vertrag darunter ist das, was tatsächlich lief.
Contract
- After redefining a typed method without adding a new `sig`, `T::Private::Methods.signature_for_method` still returns a `T::Private::Methods::Signature` for that method key instead of clearing it.
- The retained signature object is the same object that was cached when the method was first declared and still reports an Integer return type.
Dateien
- Gemfile
- Gemfile.lock
- NOTES.md
- csx.json
- test/contract.rb
Verifiziertes Artefakt herunterladen (tar.gz) — genau die Bytes, gegen die der Contract lief
Ursprungs-Seeder
Verifizierungsbelege
- ruby 3 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · rubygems@1 · 2026-08-17 · ed25519:d91480838ac982c9