Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prohibit self type as a generics default #2022

Merged
merged 5 commits into from
Sep 19, 2024
Merged

Prohibit self type as a generics default #2022

merged 5 commits into from
Sep 19, 2024

Conversation

soutaro
Copy link
Member

@soutaro soutaro commented Sep 19, 2024

I found the semantics is really complicated.

interface _Foo[T = self]
  def foo: () -> T
end

class Foo
  def bar: () -> _Foo        # => This is translated to _Foo[self] by filling with default type, and returns _Foo[Foo]. Is this really what we want?
end

@soutaro soutaro added this to the RBS 3.6 milestone Sep 19, 2024
@soutaro soutaro added this pull request to the merge queue Sep 19, 2024
Merged via the queue into master with commit 5e334ef Sep 19, 2024
19 checks passed
@soutaro soutaro deleted the default-type-self branch September 19, 2024 06:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant