File tree Expand file tree Collapse file tree
lib/prism/translation/parser Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1157,7 +1157,17 @@ def visit_it_local_variable_read_node(node)
11571157 # -> { it }
11581158 # ^^^^^^^^^
11591159 def visit_it_parameters_node ( node )
1160- builder . itarg
1160+ # FIXME: The builder _should_ always be a subclass of the prism builder.
1161+ # Currently RuboCop passes in its own builder that always inherits from the
1162+ # parser builder (which is lacking the `itarg` method). Once rubocop-ast
1163+ # opts in to use the custom prism builder a warning can be emitted when
1164+ # it is not the expected class, and eventually raise.
1165+ # https://github.com/rubocop/rubocop-ast/pull/354
1166+ if builder . is_a? ( Translation ::Parser ::Builder )
1167+ builder . itarg
1168+ else
1169+ builder . args ( nil , [ ] , nil , false )
1170+ end
11611171 end
11621172
11631173 # foo(bar: baz)
You can’t perform that action at this time.
0 commit comments