compatible?(var, with_annotation:)
click to toggle source
def compatible?(var, with_annotation))
variance = result[var]
case
when variance == :unused
true
when with_annotation == :invariant
true
when variance == with_annotation
true
else
false
end
end
contravariant(x)
click to toggle source
def contravariant(x)
case result[x]
when :unused
result[x] = :contravariant
when :covariant
result[x] = :invariant
end
end
covariant(x)
click to toggle source
def covariant(x)
case result[x]
when :unused
result[x] = :covariant
when :contravariant
result[x] = :invariant
end
end
each(&block)
click to toggle source
def each(&block)
result.each(&block)
end
include?(name)
click to toggle source
def include?(name)
result.key?(name)
end
invariant(x)
click to toggle source
def invariant(x)
result[x] = :invariant
end