Skip to content

Commit

Permalink
Simplify comparability check
Browse files Browse the repository at this point in the history
  • Loading branch information
Anand Thakker committed Dec 11, 2017
1 parent 980ccee commit b01bf49
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/style-spec/expression/definitions/equals.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class Equals implements Expression {
return context.error(`Expected at least one argument to be a string, number, boolean, or null, but found (${toString(lhs.type)}, ${toString(rhs.type)}) instead.`);
}

if (checkSubtype(lhs.type, rhs.type) && checkSubtype(rhs.type, lhs.type)) {
if (lhs.type.kind !== rhs.type.kind && lhs.type.kind !== 'value' && rhs.type.kind !== 'value') {
return context.error(`Cannot compare ${toString(lhs.type)} and ${toString(rhs.type)}.`);
}

Expand Down

0 comments on commit b01bf49

Please sign in to comment.