From b01bf491d1d9fdf2c2f684be0843abbebbbc7b4b Mon Sep 17 00:00:00 2001 From: Anand Thakker Date: Mon, 11 Dec 2017 10:51:02 -0500 Subject: [PATCH] Simplify comparability check --- src/style-spec/expression/definitions/equals.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/style-spec/expression/definitions/equals.js b/src/style-spec/expression/definitions/equals.js index 05be7369444..7503489dfd0 100644 --- a/src/style-spec/expression/definitions/equals.js +++ b/src/style-spec/expression/definitions/equals.js @@ -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)}.`); }