diff --git a/lib/rbs/prototype/rb.rb b/lib/rbs/prototype/rb.rb index 91792a591..9bb7c6bb4 100644 --- a/lib/rbs/prototype/rb.rb +++ b/lib/rbs/prototype/rb.rb @@ -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 diff --git a/test/rbs/rb_prototype_test.rb b/test/rbs/rb_prototype_test.rb index 359bf389b..1f8e60f14 100644 --- a/test/rbs/rb_prototype_test.rb +++ b/test/rbs/rb_prototype_test.rb @@ -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 @@ -628,7 +628,7 @@ def test_literal_types E: nil -F: ::FalseClass +F: false G: ::Array[1 | 2 | 3]