@@ -74,6 +74,49 @@ def foo(
7474 # Reference: https://github.com/vim-ruby/vim-ruby/issues/450
7575 def self.foo = puts(bar)
7676 def bar.foo = puts(baz)
77+
78+ def +(other) = to_r + other
79+ def -(other) = to_r - other
80+ def *(other) = to_r * other
81+ def **(other) = to_r ** other
82+ def /(other) = to_r / other
83+ def %(other) = to_i % other
84+ def &(other) = to_i & other
85+ def ^(other) = to_i ^ other
86+ def >>(other) = to_i >> other
87+ def <<(other) = to_i << other
88+ def ==(other) = to_r == other
89+ def !=(other) = to_r != other
90+
91+ def ===(other) = to_r === other
92+ def foo.===(other) = other
93+
94+ def =~(other) = to_s =~ other
95+ def foo.=~(other) = other
96+
97+ def !~(other) = to_s !~ other
98+ def foo.!~(other) = other
99+
100+ def <=>(other) = to_r <=> other
101+ def foo.<=>(other) = other
102+
103+ def <(other) = to_r < other
104+ def >(other) = to_r > other
105+
106+ def <=(other) = to_r <= other
107+ def foo.<=(other) = other
108+ def >=(other) = to_r >= other
109+ def foo.>=(other) = other
110+
111+ def ! = false
112+ def ~ = ~to_i
113+
114+ def -@ = -to_r
115+ def +@ = to_r
116+ def !@ = false
117+ def ~@ = ~to_i
118+
119+ def [](i) = @array[i]
77120 end
78121 EOF
79122 end
0 commit comments