You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fully qualify T and NilClass references in generated RBI output
When a class defines a type member named `T` (e.g., via `#: [T]` in RBS),
Tapioca's generated RBI files contained unqualified `T::Boolean`,
`T.nilable(...)`, etc. These resolve to the type member instead of
Sorbet's `::T` module, causing type-checking errors.
This commit qualifies all `T` references as `::T` and `NilClass` as
`::NilClass` in generated RBI output. These types come from RBS
translations (e.g., `bool` → `T::Boolean`, `nil` → `NilClass`) and
unambiguously always refer to the top-level constants.
Changes:
- Add qualification regex to `sanitize_signature_types` as a catch-all
for type strings produced by Sorbet's `.to_s`
- Update all hardcoded type string literals across DSL compilers/helpers
- Qualify `.to_s` output on Sorbet types in gem pipeline listeners
- Update `as_nilable_type` to produce `::T.nilable(...)`
- Update all test expectations to match qualified output
Co-Authored-By: Brad Lindsay <brad.lindsay@shopify.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
0 commit comments