Shopify/tapioca

Invalid RBI for Prism?

andyw8 opened this issue · 4 comments

I haven't yet determined if this is an issue in Prism or Tapioca:

When generating the RBI for the latest Prism (v0.25.0), it fails with:

  RBIs exported by `prism` contain errors and can't be used:
Cause: duplicated argument name. (/Users/andyw8/.gem/ruby/3.3.0/gems/prism-0.25.0/rbi/prism.rbi:50:58)

The RBI entry contains the offset argument twice:

  sig { params(source: String, filepath: T.nilable(String), line: T.nilable(Integer), offset: T.nilable(Integer), encoding: T.nilable(Encoding), frozen_string_literal: T.nilable(T::Boolean), verbose: T.nilable(T::Boolean), scopes: T.nilable(T::Array[T::Array[Symbol]])).returns(T::Boolean) }
  def self.parse_failure?(source, offset: nil, line: nil, offset: nil, encoding: nil, frozen_string_literal: nil, verbose: nil, scopes: nil); end

but it's not duplicated in
https://github.com/ruby/prism/blob/5146cc2c12e2a273d7672ba7d8711c637babade0/rbi/prism.rbi#L49-L50

I tried again and didn't encounter this, so I'll close for now.

Ok I can reproduce on Shopify/ruby-lsp#1913 with bundle exec tapioca gem prism

@kddnewton were there are changes around RBI generation that might relate to this?

I don't think so, I think this is a hand-written file. Can you open a PR?

I think I already fixed it in ruby/prism#2685.