Skip to content

Commit

Permalink
Merge pull request #143 from AaronC81/2024-12-19-fix-sorbet
Browse files Browse the repository at this point in the history
Fix new Sorbet type error on suffix-if usage
  • Loading branch information
AaronC81 authored Dec 19, 2024
2 parents a0fadad + e4336e0 commit 8789d41
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/parlour/rbi_generator/constant.rb
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,11 @@ def describe_attrs

sig { override.void }
def generalize_from_rbi!
# There's a good change this is an untyped constant, so rescue
# ParseError and use untyped
@value = (TypeParser.parse_single_type(@value) if String === @value) rescue Types::Untyped.new
if @value.is_a?(String)
# There's a good chance this is an untyped constant, so rescue
# ParseError and use untyped
@value = TypeParser.parse_single_type(@value) rescue Types::Untyped.new
end
end
end
end
Expand Down

0 comments on commit 8789d41

Please sign in to comment.