diff --git a/tests/jballerina-unit-test/src/test/java/org/ballerinalang/test/types/finaltypes/FinalAccessTest.java b/tests/jballerina-unit-test/src/test/java/org/ballerinalang/test/types/finaltypes/FinalAccessTest.java index a4f7bae7c03e..6e2c009e072f 100644 --- a/tests/jballerina-unit-test/src/test/java/org/ballerinalang/test/types/finaltypes/FinalAccessTest.java +++ b/tests/jballerina-unit-test/src/test/java/org/ballerinalang/test/types/finaltypes/FinalAccessTest.java @@ -60,6 +60,7 @@ public void testFinalFailCase() { BAssertUtil.validateError(compileResultNegative, i++, "cannot assign a value to function argument 'p2'", 49, 5); BAssertUtil.validateError(compileResultNegative, i++, "cannot assign a value to function argument 'b'", 53, 9); BAssertUtil.validateError(compileResultNegative, i++, "cannot assign a value to function argument 'b'", 59, 9); + BAssertUtil.validateError(compileResultNegative, i++, "cannot assign a value to function argument 'b'", 66, 9); Assert.assertEquals(compileResultNegative.getErrorCount(), i); } diff --git a/tests/jballerina-unit-test/src/test/resources/test-src/types/finaltypes/test_implicitly_final_negative.bal b/tests/jballerina-unit-test/src/test/resources/test-src/types/finaltypes/test_implicitly_final_negative.bal index 66621e0a1a5d..d7de92a7a443 100644 --- a/tests/jballerina-unit-test/src/test/resources/test-src/types/finaltypes/test_implicitly_final_negative.bal +++ b/tests/jballerina-unit-test/src/test/resources/test-src/types/finaltypes/test_implicitly_final_negative.bal @@ -59,3 +59,10 @@ public function testLocalLevelRestParamFinal() { b = arr; }; } + +public function testLocalLevelRestParamFinalWithVar() { + int[] arr = []; + var func = function (int i, int... b) { + b = arr; + }; +}