Skip to content

Commit 8dd9ae1

Browse files
committed
Give up static analysis of self.
1 parent 39f47c9 commit 8dd9ae1

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

lib/rbs/prototype/rb.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -671,7 +671,7 @@ def literal_to_type(node)
671671
BuiltinNames::Hash.instance_type(key_type, value_type)
672672
end
673673
when :SELF
674-
Types::Bases::Self.new(location: nil)
674+
Types::Bases::Any.new(location: nil)
675675
when :CALL
676676
receiver, method_name, * = node.children
677677
case method_name

test/rbs/rb_prototype_test.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ def hash3: () -> { foo: { bar: 42 }, x: { y: untyped } }
174174
175175
def hash4: () -> ::Hash[:foo | untyped, 1 | untyped]
176176
177-
def self1: () -> self
177+
def self1: () -> untyped
178178
end
179179
EOF
180180
end
@@ -763,7 +763,7 @@ def test_literal_types
763763
764764
H: { id: 123 }
765765
766-
I: self
766+
I: untyped
767767
EOF
768768
end
769769

0 commit comments

Comments
 (0)