Files
codeql/ruby/ql/test/library-tests/modules/element_reference.rb
2024-06-21 12:04:55 +02:00

14 lines
150 B
Ruby

class ClassWithElementRef
def [](x)
yield x + 1
end
end
c = ClassWithElementRef.new
c[1] { |x| puts x }
c[1] do |x|
puts x
end