Skip to content

Commit

Permalink
Output true/false instead of TrueClass/FalseClass
Browse files Browse the repository at this point in the history
  • Loading branch information
ksss committed Mar 24, 2022
1 parent 7964e67 commit 03cbebb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions lib/rbs/prototype/rb.rb
Original file line number Diff line number Diff line change
Expand Up @@ -477,9 +477,9 @@ def literal_to_type(node)
when :DREGX
BuiltinNames::Regexp.instance_type
when :TRUE
BuiltinNames::TrueClass.instance_type
Types::Literal.new(literal: true, location: nil)
when :FALSE
BuiltinNames::FalseClass.instance_type
Types::Literal.new(literal: false, location: nil)
when :NIL
Types::Bases::Nil.new(location: nil)
when :LIT
Expand Down
6 changes: 3 additions & 3 deletions test/rbs/rb_prototype_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,9 @@ def regx: () -> ::Regexp
def dregx: () -> ::Regexp
def t: () -> ::TrueClass
def t: () -> true
def f: () -> ::FalseClass
def f: () -> false
def n: () -> nil
Expand Down Expand Up @@ -628,7 +628,7 @@ def test_literal_types
E: nil
F: ::FalseClass
F: false
G: ::Array[1 | 2 | 3]
Expand Down

0 comments on commit 03cbebb

Please sign in to comment.