Skip to content

Commit

Permalink
Merge pull request #24 from paracycle/patch-2
Browse files Browse the repository at this point in the history
`T::Props#props` is expected to be a hash not an array
  • Loading branch information
kddnewton authored Feb 14, 2024
2 parents 40afe4e + 14d313b commit b57d897
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/sorbet/eraser/t/props.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def self.included(base)
# them and not raise errors and for bookkeeping.
module ClassMethods
def props
@props ||= []
@props ||= {}
end

def prop(name, rules = {})
Expand All @@ -32,8 +32,7 @@ def const(name, rules = {})
private

def create_prop(name, rules)
props << [name, rules]
props.sort_by!(&:first)
props[name] = rules
end
end

Expand Down

0 comments on commit b57d897

Please sign in to comment.