Object
# File rbs-2.1.0/lib/rbs/variance_calculator.rb, line 43 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
# File rbs-2.1.0/lib/rbs/variance_calculator.rb, line 22 def contravariant(x) case result[x] when :unused result[x] = :contravariant when :covariant result[x] = :invariant end end
# File rbs-2.1.0/lib/rbs/variance_calculator.rb, line 13 def covariant(x) case result[x] when :unused result[x] = :covariant when :contravariant result[x] = :invariant end end
# File rbs-2.1.0/lib/rbs/variance_calculator.rb, line 35 def each(&block) result.each(&block) end
# File rbs-2.1.0/lib/rbs/variance_calculator.rb, line 39 def include?(name) result.key?(name) end
# File rbs-2.1.0/lib/rbs/variance_calculator.rb, line 58 def incompatible?(params) # @type set: Hash[Symbol] set = Set[] params.each do |param| unless compatible?(param.name, with_annotation: param.variance) set << param.name end end unless set.empty? set end end