Skip to content

Commit dd655c7

Browse files
committed
{TrueClass,FalseClass}#inspect should be aliases of #to_s, like in CRuby
1 parent 70411ed commit dd655c7

File tree

2 files changed

+2
-14
lines changed

2 files changed

+2
-14
lines changed

src/main/ruby/truffleruby/core/false.rb

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,10 @@
2727
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2828

2929
class FalseClass
30-
3130
def to_s
3231
'false'
3332
end
34-
35-
def inspect
36-
# Call #to_s rather than alias it so that people can change #to_s if they
37-
# wish.
38-
to_s
39-
end
33+
alias_method :inspect, :to_s
4034

4135
alias_method :===, :===
4236

src/main/ruby/truffleruby/core/true.rb

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,10 @@
2727
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2828

2929
class TrueClass
30-
3130
def to_s
3231
'true'
3332
end
34-
35-
def inspect
36-
# Call #to_s rather than alias it so that people can change #to_s if they
37-
# wish.
38-
to_s
39-
end
33+
alias_method :inspect, :to_s
4034

4135
alias_method :===, :===
4236

0 commit comments

Comments
 (0)