Skip to content

Tags: sorbet/sorbet

Tags

0.6.13297.20260612150424-b16afd94b

Toggle 0.6.13297.20260612150424-b16afd94b's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Sorbet optimizations (1/4): tests + benchmarks (#10359)

* bench: add benchmarks for the upcoming sorbet-runtime optimizations

Adds/extends benchmarks (deep_clone, enum, prop_definition,
serialize_custom_type, sigs, type_derivation, typecheck, validation, and
the bench tasks runner) so the perf impact of the following PRs in this
stack can be measured before and after each change.

Committed-By-Agent: claude

* test: pin behavior the optimization PRs must preserve

These assertions pass against master today, so they land first to lock in
current behavior before the later PRs change the implementations:
- setter_factory: set-after-soft-error across all setter entry points
- ruby2_keywords: keyword/splat forwarding through sig wrappers
- validate_override_types: override with a rest param vs fewer base positionals
Tests that depend on new behavior (e.g. the deep_clone rename) ride along
with their respective PRs instead.

Committed-By-Agent: claude

0.6.13296.20260611144534-7b69af302

Toggle 0.6.13296.20260611144534-7b69af302's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Some .lldbinit settings (#10368)

0.6.13295.20260610155541-316697511

Toggle 0.6.13295.20260610155541-316697511's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Reapply "sorbet-runtime: DSL methods for `abstract` et al (#10276)" (#…

…10354)

* prework: Track method_name in the DeclarationBlock

* Introduce T::Sig::DSL with abstract, override, final, overridable

* Add tests for T::Sig::DSL method modifiers

* Support final def self.foo (singleton class methods)

Fix ensure_valid_declare_dsl! to accept the case where the DSL caller's
self is a class but the method owner (from _on_method_added) is its
singleton class. Also fix declare_final to use previous_declaration.mod
(the actual method owner) for final bookkeeping.

* Add T::Syntax module

* More tests

* T::Sig::DSL -> T::DefMods

* Fix cop

* Error eagerly if does not override anything

* Make it work with `allow_incompatible: :visibility`

* Leave a comment about eager `super` for abstract

* Remove this comment

Even if the `original_method` were in the `DeclarationBlock`, I don't
think that we'd want to use it, because I'm not confident that the
`super_method` on the `original_method` would necessarily be the same as
the method that we're calling. e.g. at that point, the `original_method`
will have been replaced with a shim method that forces the signature. I
think that we want to grab the new method just to be sure that the
`super_method` is looking at the current override chain of the method.

* Add suggested test

0.6.13294.20260609175357-5038a39d7

Toggle 0.6.13294.20260609175357-5038a39d7's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
`--print=symbol-table`: "type-argument" → "type-parameter" (#10361)

* type-argument → type-parameter

* Update testdata exp

0.6.13293.20260608201728-2bc6f1a71

Toggle 0.6.13293.20260608201728-2bc6f1a71's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Add a `consume!` API for getting the `active_declaration` (#10344)

* no-op: Convert RBIs to use attr_accessor

* Add a `consume!` API for getting the `active_declaration`

* Force reset at the end of run_all_sig_blocks

* Ban `run_all_sig_blocks` with pending signatures

0.6.13292.20260608191603-4ef8db6d8

Toggle 0.6.13292.20260608191603-4ef8db6d8's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Keep relative constants in missing type arg autocorrect (#10358)

* Test relative constant missing type arg autocorrect

* Keep relative constants in missing type arg autocorrect

0.6.13291.20260608163157-4f90f2f71

Toggle 0.6.13291.20260608163157-4f90f2f71's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
`reset!` eagerly, after fetching the `active_declaration` (#10353)

* Add some regression tests

* `reset!` eagerly, after fetching the `active_declaration`

I'm working on a change to introduce a `consume!` method, which (among
other things), makes it look like the `active_declaration` is "dropped"
after you read it.

My first stab at this (in #10276) failed because I forgot to address how
this would affect the logic after `_check_final_ancestors`:

<bb9f012>

Looking at this change, what's not obvious from the (collapsed) diff is
that re-reading `current_declaration = (...).active_declaration` on line
205 will always be `nil`, because `consume!` dropped
`active_declaration`.

Looking back at why that assignment exists at all (see #3964), we can
maintain the original motivation by simply not having
`_check_final_ancestors` need to worry about this. As of that first PR,
we needed the reassignment because maybe `_check_final_ancestors` would
have called `reset!` as a way to signal to the caller that the sig
should **not** be stored into the `@sig_wrappers` Hash. But the easiest
way to signal that would just be to return something from
`_check_final_ancestors` that indicates that something failed, and that
we should early return directly. In particular, it was never the case
that `current_declaration = (...).active_declaration` would ever produce
a _new_, _unrelated_ declaration. So it was really just a roundabout way
to request that `current_declaration` be `nil`'d out, meaning we should
return.

0.6.13290.20260608154028-0af57af9c

Toggle 0.6.13290.20260608154028-0af57af9c's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Copy shared refs, instead of referencing them (#10355)

0.6.13289.20260608144227-06e1abcb3

Toggle 0.6.13289.20260608144227-06e1abcb3's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
sealed class postfix completion (#10347)

* completion for sealed subclasses

* fix message

* add some tests

* fix tests

* Update main/lsp/requests/completion.cc

Co-authored-by: Jake Zimmerman <zimmerman.jake@gmail.com>

* Update main/lsp/requests/completion.cc

Co-authored-by: Jake Zimmerman <zimmerman.jake@gmail.com>

* flip condition

* style

* remove comment

* add crash test

* add empty test

* fix tests and add to exclude for prism

* .

* add monkeypatch case test

* add two cases for monkeypatch test

* rename test files

* add comment

* rename test file name

* fix ignore

---------

Co-authored-by: Brian Shu <bshu@stripe.com>
Co-authored-by: Jake Zimmerman <zimmerman.jake@gmail.com>

0.6.13288.20260608072051-4aa9b30ac

Toggle 0.6.13288.20260608072051-4aa9b30ac's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Add sigs for allbits? and anybits? in Integer (#10352)