Skip to content

Commit 6ed8097

Browse files
committed
Remove workaround for old Prism
1 parent d8234a8 commit 6ed8097

2 files changed

Lines changed: 3 additions & 10 deletions

File tree

lib/typeprof/core/ast.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -346,8 +346,7 @@ def self.parse_cpath(raw_node, cref)
346346
break
347347
when :constant_path_node, :constant_path_target_node
348348
if raw_node.parent
349-
# temporarily support old Prism https://bugs.ruby-lang.org/issues/20467
350-
names << (raw_node.respond_to?(:name) ? raw_node.name : raw_node.child.name)
349+
names << raw_node.name
351350
raw_node = raw_node.parent
352351
else
353352
return names.reverse

lib/typeprof/core/ast/const.rb

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,8 @@ def initialize(raw_node, lenv)
1717
@cbase = nil
1818
@toplevel = true
1919
end
20-
# temporarily support old Prism https://bugs.ruby-lang.org/issues/20467
21-
if raw_node.respond_to?(:name)
22-
@cname = raw_node.name
23-
@cname_code_range = TypeProf::CodeRange.from_node(raw_node.name_loc)
24-
else
25-
@cname = raw_node.child.name
26-
@cname_code_range = TypeProf::CodeRange.from_node(raw_node.child.location)
27-
end
20+
@cname = raw_node.name
21+
@cname_code_range = TypeProf::CodeRange.from_node(raw_node.name_loc)
2822
else
2923
raise raw_node.type.to_s
3024
end

0 commit comments

Comments
 (0)