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

Add error when using type variables in an extend statement #838

Closed
hjwylde opened this issue Dec 8, 2021 · 2 comments · Fixed by #840
Closed

Add error when using type variables in an extend statement #838

hjwylde opened this issue Dec 8, 2021 · 2 comments · Fixed by #840

Comments

@hjwylde
Copy link
Contributor

hjwylde commented Dec 8, 2021

We came across a case with rbs validate recently that we think should have an error:

class Foo[A]
  extend Bar[A]
end

module Bar[A]
end

We think that Bar[A] should have an error because extend is adding the methods to the singleton class, so it won't have access to instance type variables. This is similar to the other cases of singleton methods, class variables, etc.

@soutaro soutaro linked a pull request Dec 12, 2021 that will close this issue
@soutaro
Copy link
Member

soutaro commented Dec 13, 2021

@hjwylde RBS 1.8.1 is out with an update for this. Thank you for this report!

@hjwylde
Copy link
Contributor Author

hjwylde commented Dec 13, 2021

Thanks @soutaro for the fast addition!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

2 participants