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

Avoid using instance/class types in modules #2020

Merged
merged 1 commit into from
Sep 19, 2024
Merged

Avoid using instance/class types in modules #2020

merged 1 commit into from
Sep 19, 2024

Conversation

soutaro
Copy link
Member

@soutaro soutaro commented Sep 19, 2024

The instance/class types are confusing in a module that is extended.

module Kernel
  def dup: () -> instance
end

class Object
  extend Kernel
end

What is the type of Object.dup? We might assume singleton(Object), but it is actually Object because instance type is an instance of the class declaration.

So, we should avoid using instance/class types in modules, especially when it is extended.

@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 061aa32 Sep 19, 2024
19 checks passed
@soutaro soutaro deleted the kernel-types branch September 19, 2024 05:15
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