Skip to content

Commit

Permalink
Fix up node RBI typechecks
Browse files Browse the repository at this point in the history
  • Loading branch information
kddnewton committed Oct 3, 2024
1 parent 9f4b24d commit ef5b0ca
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions templates/rbi/prism/node.rbi.erb
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,11 @@ end
class Prism::<%= node.name -%> < Prism::Node
<%- if (node_flags = node.flags) -%>
<%- node_flags.values.each do |value| -%>

sig { returns(T::Boolean) }
def <%= value.name.downcase %>?; end
<%- end -%>

<%- end -%>
<%- end -%>
<%- node.fields.each do |field| -%>
sig { returns(<%= field.rbi_class %>) }
def <%= field.name %>; end
Expand Down Expand Up @@ -130,7 +130,6 @@ class Prism::<%= node.name -%> < Prism::Node
def <%= field.name.delete_suffix("_loc") %>; end
<%- end -%>
<%- end -%>
<%- end -%>

sig { override.returns(T::Array[Prism::Reflection::Field]) }
def fields; end
Expand Down
2 changes: 1 addition & 1 deletion templates/sig/prism/node.rbs.erb
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ module Prism
class <%= node.name -%> < Node
include _Node
<%- if (node_flags = node.flags) -%>
<%- node_flags.values.each do |value| -%>
<%- node_flags.values.each do |value| -%>
def <%= value.name.downcase %>?: () -> bool
<%- end -%>
<%- end -%>
Expand Down

0 comments on commit ef5b0ca

Please sign in to comment.