Sha256: 915618aa6027a84f94deb883575c2604e8654f13304653febeb188d8be04eb94

Contents?: true

Size: 1.41 KB

Versions: 4

Compression:

Stored size: 1.41 KB

Contents

def f1(&blk)
  yield
  blk
end
def log1(a, o, r, c); end
f1 do |a, o=:opt, *r, c|
  log1(a, o, r, c)
end

def f2(&blk)
  yield :a
  blk
end
def log2(a, o, r, c); end
f2 do |a, o=:opt, *r, c|
  log2(a, o, r, c)
end

def f3(&blk)
  yield :a, :b
  blk
end
def log3(a, o, r, c); end
f3 do |a, o=:opt, *r, c|
  log3(a, o, r, c)
end

def f4(&blk)
  yield :a, :b, :c
  blk
end
def log4(a, o, r, c); end
f4 do |a, o=:opt, *r, c|
  log4(a, o, r, c)
end

def f5(&blk)
  yield :a, :b, :c, :d
  blk
end
def log5(a, o, r, c); end
f5 do |a, o=:opt, *r, c|
  log5(a, o, r, c)
end

def f6(&blk)
  yield :a, :b, :c, :d, :e
  blk
end
def log6(a, o, r, c); end
f6 do |a, o=:opt, *r, c|
  log6(a, o, r, c)
end

__END__
# Classes
class Object
  def f1 : { -> nil } -> ^(nil, ?:opt, *bot, nil) -> nil
  def log1 : (nil, :opt, Array[bot], nil) -> nil
  def f2 : { (:a) -> nil } -> ^(:a, ?:opt, *bot, nil) -> nil
  def log2 : (:a, :opt, Array[bot], nil) -> nil
  def f3 : { (:a, :b) -> nil } -> ^(:a, ?:opt, *bot, :b) -> nil
  def log3 : (:a, :opt, Array[bot], :b) -> nil
  def f4 : { (:a, :b, :c) -> nil } -> (^(:a, ?:b | :opt, *bot, :c) -> nil)
  def log4 : (:a, :b | :opt, Array[bot], :c) -> nil
  def f5 : { (:a, :b, :c, :d) -> nil } -> (^(:a, ?:b | :opt, *:c, :d) -> nil)
  def log5 : (:a, :b | :opt, [:c], :d) -> nil
  def f6 : { (:a, :b, :c, :d, :e) -> nil } -> (^(:a, ?:b | :opt, *:c | :d, :e) -> nil)
  def log6 : (:a, :b | :opt, [:c, :d], :e) -> nil
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
typeprof-0.7.0 smoke/block-args3.rb
typeprof-0.6.1 smoke/block-args3.rb
typeprof-0.6.0 smoke/block-args3.rb
typeprof-0.5.4 smoke/block-args3.rb