Sha256: 073c71b9cfd180838e644d6fd4560d6064db6815547a7df9614843a7fe40ecd0

Contents?: true

Size: 487 Bytes

Versions: 3

Compression:

Stored size: 487 Bytes

Contents

# ALLOW FAILURE

require "tsort"

# @type var g: Hash[Integer, Array[Integer]]
g = {1=>[2, 3], 2=>[4], 3=>[2, 4], 4=>[]}

# @type var each_node: ^() { (Integer) -> void } -> void
each_node = -> (&b) { g.each_key(&b) }
# @type var each_child: ^(Integer) { (Integer) -> void } -> void
each_child = -> (n, &b) { g[n].each(&b) }

# @type var xs: Array[String]
# !expects IncompatibleAssignment: lhs_type=::Array[::String], rhs_type=::Array[::Integer]
xs = TSort.tsort(each_node, each_child)

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
steep-0.39.0 smoke/tsort/a.rb
steep-0.38.0 smoke/tsort/a.rb
steep-0.37.0 smoke/tsort/a.rb