Skip to content

Preserve abstract signatures without runtime when translation is disabled - #1025

Merged
Morriar merged 1 commit into
mainfrom
at/abstract-without-runtime-fix
Sep 23, 2026
Merged

Morriar merged 1 commit into
mainfrom
at/abstract-without-runtime-fix

Conversation

@Morriar

@Morriar Morriar commented Sep 23, 2026

Copy link
Copy Markdown
Contributor

When translate_abstract_methods is false, abstract signatures should remain unchanged. Previously, the translator emitted member annotations before deciding to skip the signature, adding a stray # @without_runtime above T::Sig::WithoutRuntime.sig.

Filter skipped abstract signatures before generating annotations or rewriting methods. Concrete signatures continue to translate normally.

For this input:

T::Sig::WithoutRuntime.sig do
  abstract.params(query: Collect::PrivateAssociationRelation).returns(T::Array[T.attached_class])
end
def collect(query); end

Before: translation adds an annotation even though the signature is skipped.

# @without_runtime
T::Sig::WithoutRuntime.sig do
  abstract.params(query: Collect::PrivateAssociationRelation).returns(T::Array[T.attached_class])
end
def collect(query); end

After: the signature and method remain unchanged.

T::Sig::WithoutRuntime.sig do
  abstract.params(query: Collect::PrivateAssociationRelation).returns(T::Array[T.attached_class])
end
def collect(query); end

@Morriar
Morriar requested a review from a team as a code owner September 23, 2026 15:01
@Morriar
Morriar merged commit fbd9fc3 into main Sep 23, 2026
11 checks passed
@Morriar
Morriar deleted the at/abstract-without-runtime-fix branch September 23, 2026 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants