8000 Implement context validation on parse by ksss · Pull Request #2336 · ruby/rbs · GitHub
[go: up one dir, main page]

Skip to content

Implement context validation on parse #2336

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

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
Give up static analysis of self.
  • Loading branch information
ksss committed May 27, 2025
commit 792c889833058dfd2993e1d8180e471bf0f072df
2 changes: 1 addition & 1 deletion lib/rbs/prototype/rb.rb
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,7 @@ def literal_to_type(node)
BuiltinNames::Hash.instance_type(key_type, value_type)
end
when :SELF
Types::Bases::Self.new(location: nil)
Types::Bases::Any.new(location: nil)
when :CALL
receiver, method_name, * = node.children
case method_name
Expand Down
4 changes: 2 additions & 2 deletions test/rbs/rb_prototype_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ def hash3: () -> { foo: { bar: 42 }, x: { y: untyped } }

def hash4: () -> ::Hash[:foo | untyped, 1 | untyped]

def self1: () -> self
def self1: () -> untyped
end
EOF
end
Expand Down Expand Up @@ -763,7 +763,7 @@ def test_literal_types

H: { id: 123 }

I: self
I: untyped
EOF
end

Expand Down
0