Code review comment: I belive typeParam was not working here previously when we call `el2.iterator().next()`  ```Ballerina public isolated function iterator(xml<ItemType> x) returns object {     public isolated function next() returns record {| ItemType value; |}?; } = external; ``` From the iterator first argument, we resolve `ItemType` to be the type of `el2` s constraint via TypeParamAnalyzer. Then when returning we resolve `ItemType` to be the type of `el2`.

Code under review:
public void testNegative() {

        int index = 0;
        BAssertUtil.validateError(negative, index++,
                                  "invalid list binding pattern: attempted to infer a list type, but found 'xml'",
                                  13, 17);
        BAssertUtil.validateError(negative, index++, "incompatible types: expected " +
                "'function ((xml:Element|xml:Comment|xml:ProcessingInstruction|xml:Text)) returns ()'," +
                " found 'function ([int,xml,string]) returns ()'", 18, 19);
        BAssertUtil.validateError(negative, index++,
                "incompatible types: expected 'other', found 'xml:Element'",
                29, 13);
        BAssertUtil.validateError(negative, index++,
                "incompatible types: 'xml:Element' is not an iterable collection",
                29, 34);
        BAssertUtil.validateError(negative, index++,
                "incompatible types: expected 'other', found 'xml:Comment'",
                40, 13);
        BAssertUtil.validateError(negative, index++,
                "incompatible types: 'xml:Comment' is not an iterable collection",
                40, 34);
        BAssertUtil.validateError(negative, index++,
                "incompatible types: expected 'other', found 'xml:ProcessingInstruction'",
                51, 13);
        BAssertUtil.validateError(negative, index++,
                "incompatible types: 'xml:ProcessingInstruction' is not an iterable collection",
                51, 48);
        BAssertUtil.validateError(negative, index++,
                "incompatible types: expected '(xml:Element|xml:Text)', found 'xml'",
                59, 34);
        BAssertUtil.validateError(negative, index++,
                "incompatible types: expected 'other', found '(xml:Element|xml:Text)'",
                63, 13);
        BAssertUtil.validateError(negative, index++,
                "incompatible types: '(xml:Element|xml:Text)' is not an iterable collection",
                63, 44);
        BAssertUtil.validateError(negative, index++,
                "incompatible types: expected 'other', found '(xml:Element|xml:Text)'",
                68, 13);
        BAssertUtil.validateError(negative, index++,
                "incompatible types: '(xml<xml:Element>|xml<xml:Text>)' is not an iterable collection",
                68, 44);
        BAssertUtil.validateError(negative, index++,
                "incompatible types: expected 'record {| (xml:Element|xml:Text) value; |}?', found 'record " +
                        "{| (xml:Element|xml:Comment|xml:ProcessingInstruction|xml:Text) value; |}?'",
                72, 68);
        BAssertUtil.validateError(negative, index++,
                "xml langlib functions does not support union types as their arguments",
                72, 68);
        BAssertUtil.validateError(negative, index++,
                "incompatible types: expected 'record {| (xml:Element|xml:Text) value; |}?', found 'record " +
                        "{| (xml:Element|xml:Comment|xml:ProcessingInstruction|xml:Text) value; |}?'",
                73, 68);
        BAssertUtil.validateError(negative, index++,
                "xml langlib functions does not support union types as their arguments",
                73, 68);
        Assert.assertEquals(negative.getErrorCount(), index);
    }

Line commented on: BAssertUtil.validateError(negative, index++,

Revised code:
public void testNegative() {

        int index = 0;
        BAssertUtil.validateError(negative, index++,
                                  "invalid list binding pattern: attempted to infer a list type, but found 'xml'",
                                  13, 17);
        BAssertUtil.validateError(negative, index++, "incompatible types: expected " +
                "'function ((xml:Element|xml:Comment|xml:ProcessingInstruction|xml:Text)) returns ()'," +
                " found 'function ([int,xml,string]) returns ()'", 18, 19);
        BAssertUtil.validateError(negative, index++,
                "incompatible types: expected 'other', found 'xml:Element'",
                29, 13);
        BAssertUtil.validateError(negative, index++,
                "incompatible types: 'xml:Element' is not an iterable collection",
                29, 34);
        BAssertUtil.validateError(negative, index++,
                "incompatible types: expected 'record {| xml:Comment value; |}?', found " +
                        "'record {| xml:Element value; |}?'", 33, 54);
        BAssertUtil.validateError(negative, index++,
                "incompatible types: expected 'other', found 'xml:Comment'",
                40, 13);
        BAssertUtil.validateError(negative, index++,
                "incompatible types: 'xml:Comment' is not an iterable collection",
                40, 34);
        BAssertUtil.validateError(negative, index++,
                "incompatible types: expected 'record {| xml:Element value; |}?', found " +
                        "'record {| xml:Comment value; |}?'", 44, 54);
        BAssertUtil.validateError(negative, index++,
                "incompatible types: expected 'other', found 'xml:ProcessingInstruction'",
                51, 13);
        BAssertUtil.validateError(negative, index++,
                "incompatible types: 'xml:ProcessingInstruction' is not an iterable collection",
                51, 48);
        BAssertUtil.validateError(negative, index++,
                "incompatible types: expected 'record {| xml:Comment value; |}?', found " +
                        "'record {| xml:ProcessingInstruction value; |}?'", 55, 49);
        BAssertUtil.validateError(negative, index++,
                "incompatible types: expected '(xml:Element|xml:Text)', found 'xml'",
                59, 34);
        BAssertUtil.validateError(negative, index++,
                "incompatible types: expected 'other', found '(xml:Element|xml:Text)'",
                63, 13);
        BAssertUtil.validateError(negative, index++,
                "incompatible types: '(xml:Element|xml:Text)' is not an iterable collection",
                63, 44);
        BAssertUtil.validateError(negative, index++,
                "incompatible types: expected 'other', found '(xml:Element|xml:Text)'",
                68, 13);
        BAssertUtil.validateError(negative, index++,
                "incompatible types: '(xml<xml:Element>|xml<xml:Text>)' is not an iterable collection",
                68, 44);
        BAssertUtil.validateError(negative, index++,
                "incompatible types: expected 'record {| (xml:Element|xml:Text) value; |}?', found 'record " +
                        "{| (xml:Element|xml:Comment|xml:ProcessingInstruction|xml:Text) value; |}?'",
                72, 68);
        BAssertUtil.validateError(negative, index++,
                "xml langlib functions does not support union types as their arguments",
                72, 68);
        BAssertUtil.validateError(negative, index++,
                "incompatible types: expected 'record {| (xml:Element|xml:Text) value; |}?', found 'record " +
                        "{| (xml:Element|xml:Comment|xml:ProcessingInstruction|xml:Text) value; |}?'",
                73, 68);
        BAssertUtil.validateError(negative, index++,
                "xml langlib functions does not support union types as their arguments",
                73, 68);
    }