Sha256: 5252f1fc303ac458cca54a461b6d48ca23668d59c98603b2b649ddbccb5c1011

Contents?: true

Size: 1.02 KB

Versions: 11

Compression:

Stored size: 1.02 KB

Contents

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

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

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

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

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

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

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
typeprof-0.7.0 smoke/block-args1.rb
typeprof-0.6.1 smoke/block-args1.rb
typeprof-0.6.0 smoke/block-args1.rb
typeprof-0.5.4 smoke/block-args1.rb
typeprof-0.5.3 smoke/block-args1.rb
typeprof-0.5.2 smoke/block-args1.rb
typeprof-0.5.1 smoke/block-args1.rb
typeprof-0.5.0 smoke/block-args1.rb
typeprof-0.4.2 smoke/block-args1.rb
typeprof-0.4.1 smoke/block-args1.rb
typeprof-0.4.0 smoke/block-args1.rb