1
1
mirror of https://github.com/github/semantic.git synced 2024-12-26 08:25:19 +03:00

Correct the categorization test.

This implies that uncategorized nodes can be compared with anything.
This commit is contained in:
Rob Rix 2015-10-14 17:51:01 -04:00
parent 2aef2114c3
commit 742fc0ea0f

View File

@ -112,7 +112,7 @@ extension Algorithm where B: FreeConvertible, B.RollType == Term.LeafType, B.Pur
public func evaluate<C>(equals: (Term, Term) -> Bool, categorize: Term -> Set<C>) -> B {
return evaluate(equals, recur: {
(categorize($0).isEmpty || categorize($1).isEmpty) && !categorize($0).intersect(categorize($1)).isEmpty
categorize($0).isEmpty || categorize($1).isEmpty || !categorize($0).intersect(categorize($1)).isEmpty
? Algorithm($0, $1).evaluate(equals).free
: nil
})