After updating to TypeScript 2.1, I am receiving an error when compiling a project that compiled under TS 2.0.
Below is the snippet of code that produces the error.
var id1 = true, id2 = true;
$(selector, $(question)).each((i, iteminput) => {
$id = $(iteminput);
id = $id.attr("id");
if (!$id.is(":checked") && $id.is(":visible") && $id.data("val-required") == "Required") {
if (i == 0)
id1 = false;
else if (i == 1)
id2 = false;
}
});
if (id1 == false && id2 == false) {
valid = false;
this.showValidationPrompt({
message: "* This question is required.",
elementid: id,
placement: 0,
promptType: 1,
containerSelector: ".cq-wrapper .cq-input"
});
}
Expected behavior: That this snippet will compile without errors.
Actual behavior: I receive the following error message:
error TS2365: Build:Operator '==' cannot be applied to types 'true' and 'false'.
due to this condition evaluation:
if (id1 == false && id2 == false) {
After updating to TypeScript 2.1, I am receiving an error when compiling a project that compiled under TS 2.0.
Below is the snippet of code that produces the error.
Expected behavior: That this snippet will compile without errors.
Actual behavior: I receive the following error message:
error TS2365: Build:Operator '==' cannot be applied to types 'true' and 'false'.due to this condition evaluation:
if (id1 == false && id2 == false) {