Code review comment: Do we have an issue to fix these, https://github.com/ballerina-platform/ballerina-spec/issues/724#issuecomment-771358941

Code under review:
public void testTypeGuardNegative() {
        CompileResult negativeResult = BCompileUtil.compile("test-src/statements/ifelse/type-guard-negative.bal");
        int i = 0;
        BAssertUtil.validateError(negativeResult, i++,
                "incompatible types: 'string' will not be matched to 'int'", 20, 27);
        BAssertUtil.validateError(negativeResult, i++,
                "unnecessary condition: expression will always evaluate to 'true'", 29, 13);
        BAssertUtil.validateError(negativeResult, i++,
                "incompatible types: 'string' will not be matched to 'int'", 33, 13);
        BAssertUtil.validateError(negativeResult, i++,
                                  "incompatible types: '(float|boolean)' will not be matched to 'string'", 53, 16);
        BAssertUtil.validateError(negativeResult, i++, "unreachable code", 84, 5);


        BAssertUtil.validateError(negativeResult, i++,
                                  "incompatible types: '(int|boolean)' will not be matched to 'float'", 99, 63);
        BAssertUtil.validateError(negativeResult, i++,
                                  "incompatible types: '(boolean|float)' will not be matched to 'int'", 108, 30);
        BAssertUtil.validateError(negativeResult, i++,
                                  "incompatible types: 'string' will not be matched to 'int'", 117, 25);
        BAssertUtil.validateError(negativeResult, i++,
                                  "incompatible types: 'string' will not be matched to 'float'", 117, 37);
        BAssertUtil.validateError(negativeResult, i++,
                                  "incompatible types: 'string' will not be matched to 'float'", 126, 25);
        BAssertUtil.validateError(negativeResult, i++,
                                  "incompatible types: '(Person|Student)' will not be matched to 'string'", 147, 10);
        BAssertUtil.validateError(negativeResult, i++,
                                  "unnecessary condition: expression will always evaluate to 'true'", 147, 25);
        BAssertUtil.validateError(negativeResult, i++,
                                  "incompatible types: '(Person|Student)' will not be matched to 'float'", 147, 40);
        BAssertUtil.validateError(negativeResult, i++,
                                  "incompatible types: '(Person|Student)' will not be matched to 'boolean'", 147, 56);


        BAssertUtil.validateError(negativeResult, i++,
                "incompatible types: '(Baz|int)' will not be matched to 'Bar'", 167, 15);
        BAssertUtil.validateError(negativeResult, i++,
                "incompatible types: '(Baz|int)' will not be matched to 'Qux'", 173, 15);

        Assert.assertEquals(negativeResult.getErrorCount(), i);
    }


Revised code:
public void testTypeGuardNegative() {
        CompileResult negativeResult = BCompileUtil.compile("test-src/statements/ifelse/type-guard-negative.bal");
        int i = 0;
        BAssertUtil.validateError(negativeResult, i++,
                "incompatible types: 'string' will not be matched to 'int'", 20, 27);
        BAssertUtil.validateError(negativeResult, i++,
                "unnecessary condition: expression will always evaluate to 'true'", 29, 13);
        BAssertUtil.validateError(negativeResult, i++,
                "incompatible types: 'string' will not be matched to 'int'", 33, 13);
        BAssertUtil.validateError(negativeResult, i++,
                                  "incompatible types: '(float|boolean)' will not be matched to 'string'", 53, 16);
        BAssertUtil.validateError(negativeResult, i++, "unreachable code", 84, 5);


        BAssertUtil.validateError(negativeResult, i++,
                                  "incompatible types: '(int|boolean)' will not be matched to 'float'", 99, 63);
        BAssertUtil.validateError(negativeResult, i++,
                                  "incompatible types: '(boolean|float)' will not be matched to 'int'", 108, 30);
        BAssertUtil.validateError(negativeResult, i++,
                                  "incompatible types: 'string' will not be matched to 'int'", 117, 25);
        BAssertUtil.validateError(negativeResult, i++,
                                  "incompatible types: 'string' will not be matched to 'float'", 117, 37);
        BAssertUtil.validateError(negativeResult, i++,
                                  "incompatible types: 'string' will not be matched to 'float'", 126, 25);
        BAssertUtil.validateError(negativeResult, i++,
                                  "incompatible types: '(Person|Student)' will not be matched to 'string'", 147, 10);
        BAssertUtil.validateError(negativeResult, i++,
                                  "unnecessary condition: expression will always evaluate to 'true'", 147, 25);
        BAssertUtil.validateError(negativeResult, i++,
                                  "incompatible types: '(Person|Student)' will not be matched to 'float'", 147, 40);
        BAssertUtil.validateError(negativeResult, i++,
                                  "incompatible types: '(Person|Student)' will not be matched to 'boolean'", 147, 56);


        BAssertUtil.validateError(negativeResult, i++,
                "incompatible types: '(Baz|int)' will not be matched to 'Bar'", 167, 15);
        BAssertUtil.validateError(negativeResult, i++,
                "incompatible types: '(Baz|int)' will not be matched to 'Qux'", 173, 15);

        Assert.assertEquals(negativeResult.getErrorCount(), i);
    }