class Molinillo::Resolver::Resolution::UnwindDetails(R, S)

Overview

Details of the state to unwind to when a conflict occurs, and the cause of the unwind @attr [Integer] state_index the index of the state to unwind to @attr [Object] state_requirement the requirement of the state we're unwinding to @attr [Array] requirement_tree for the requirement we're relaxing @attr [Array] conflicting_requirements the requirements that combined to cause the conflict @attr [Array] requirement_trees for the conflict @attr [Array] requirements_unwound_to_instead array of unwind requirements that were chosen over this unwind

Included Modules

Defined in:

molinillo/resolution.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(state_index : Int32, state_requirement : R | Nil, requirement_tree : Array(R), conflicting_requirements : Array(R), requirement_trees : Array(Array(R)), requirements_unwound_to_instead : Array(R | Nil)) #

[View source]

Instance Method Detail

def <=>(other) #

We compare UnwindDetails when choosing which state to unwind to. If two options have the same state_index we prefer the one most removed from a requirement that caused the conflict. Both options would unwind to the same state, but a grandparent option will filter out fewer of its possibilities after doing so - where a state is both a parent and a grandparent to requirements that have caused a conflict this is the correct behaviour. @param [UnwindDetail] other UnwindDetail to be compared @return [Integer] integer specifying ordering


[View source]
def all_requirements #

@return [Array] array of all the requirements that led to the need for this unwind


[View source]
def conflicting_requirements : Array(R) #

[View source]
def requirement_tree : Array(R) #

[View source]
def requirement_trees : Array(Array(R)) #

[View source]
def requirements_unwound_to_instead : Array(R | Nil) #

[View source]
def reversed_requirement_tree_index #

@return [Integer] index of state requirement in reversed requirement tree (the conflicting requirement itself will be at position 0)


[View source]
def state_index : Int32 #

[View source]
def state_requirement : R | Nil #

[View source]
def sub_dependencies_to_avoid #

@return [Array] array of sub-dependencies to avoid when choosing a new possibility for the state we've unwound to. Only relevant for non-primary unwinds


[View source]
def unwinding_to_primary_requirement? #

@return [Boolean] where the requirement of the state we're unwinding to directly caused the conflict. Note: in this case, it is impossible for the state we're unwinding to to be a parent of any of the other conflicting requirements (or we would have circularity)


[View source]