diff --git a/lib/prism/translation/parser.rb b/lib/prism/translation/parser.rb index 7117643cdcd168..c9e4f148ce20b8 100644 --- a/lib/prism/translation/parser.rb +++ b/lib/prism/translation/parser.rb @@ -116,7 +116,7 @@ def unwrap(result, offset_cache) diagnostics.process(Diagnostic.new(error.message, :error, location)) end result.warnings.each do |warning| - next unless valid_error?(warning) + next unless valid_warning?(warning) location = build_range(warning.location, offset_cache) diagnostics.process(Diagnostic.new(warning.message, :warning, location))