Skip to content

Commit 859450e

Browse files
committed
Update constant_helper to support constant declarations
1 parent b3eedca commit 859450e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/rbs/ast/ruby/helpers/constant_helper.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ def constant_as_type_name(node)
1515
rescue Prism::ConstantPathNode::DynamicPartsInConstantPathError
1616
nil
1717
end
18+
when Prism::ConstantWriteNode
19+
TypeName.new(name: node.name, namespace: Namespace.empty)
20+
when Prism::ConstantPathWriteNode
21+
constant_as_type_name(node.target)
1822
end
1923
end
2024
end

0 commit comments

Comments
 (0)