diff --git a/tests/jballerina-unit-test/src/test/java/org/ballerinalang/test/isolation/IsolationWarningTest.java b/tests/jballerina-unit-test/src/test/java/org/ballerinalang/test/isolation/IsolationWarningTest.java index 45313c669723..2c5479d5259c 100644 --- a/tests/jballerina-unit-test/src/test/java/org/ballerinalang/test/isolation/IsolationWarningTest.java +++ b/tests/jballerina-unit-test/src/test/java/org/ballerinalang/test/isolation/IsolationWarningTest.java @@ -46,28 +46,136 @@ public void testIsolationWarnings() { int i = 0; validateHint(result, i++, NON_ISOLATED_SERVICE_HINT, 26, 5); validateHint(result, i++, NON_ISOLATED_SERVICE_HINT, 30, 5); - validateHint(result, i++, NON_ISOLATED_METHOD_HINT, 43, 5); - validateHint(result, i++, NON_ISOLATED_METHOD_HINT, 47, 5); - validateHint(result, i++, NON_ISOLATED_METHOD_HINT, 62, 5); - validateHint(result, i++, NON_ISOLATED_METHOD_HINT, 66, 5); - validateHint(result, i++, NON_ISOLATED_SERVICE_AND_METHOD_HINT, 79, 5); - validateHint(result, i++, NON_ISOLATED_SERVICE_AND_METHOD_HINT, 83, 5); - validateHint(result, i++, NON_ISOLATED_SERVICE_HINT, 101, 5); - validateHint(result, i++, NON_ISOLATED_SERVICE_HINT, 105, 5); - validateHint(result, i++, NON_ISOLATED_METHOD_HINT, 118, 5); - validateHint(result, i++, NON_ISOLATED_METHOD_HINT, 122, 5); - validateHint(result, i++, NON_ISOLATED_METHOD_HINT, 137, 5); - validateHint(result, i++, NON_ISOLATED_METHOD_HINT, 141, 5); - validateHint(result, i++, NON_ISOLATED_SERVICE_AND_METHOD_HINT, 154, 5); - validateHint(result, i++, NON_ISOLATED_SERVICE_AND_METHOD_HINT, 158, 5); - validateHint(result, i++, NON_ISOLATED_SERVICE_HINT, 176, 5); - validateHint(result, i++, NON_ISOLATED_SERVICE_HINT, 180, 5); - validateHint(result, i++, NON_ISOLATED_METHOD_HINT, 193, 5); - validateHint(result, i++, NON_ISOLATED_METHOD_HINT, 197, 5); - validateHint(result, i++, NON_ISOLATED_METHOD_HINT, 211, 5); - validateHint(result, i++, NON_ISOLATED_METHOD_HINT, 215, 5); - validateHint(result, i++, NON_ISOLATED_SERVICE_AND_METHOD_HINT, 228, 5); - validateHint(result, i++, NON_ISOLATED_SERVICE_AND_METHOD_HINT, 232, 5); + validateHint(result, i++, NON_ISOLATED_SERVICE_AND_METHOD_HINT, 39, 5); + validateHint(result, i++, NON_ISOLATED_SERVICE_AND_METHOD_HINT, 43, 5); + validateHint(result, i++, NON_ISOLATED_SERVICE_AND_METHOD_HINT, 47, 5); + validateHint(result, i++, NON_ISOLATED_SERVICE_AND_METHOD_HINT, 51, 5); + validateHint(result, i++, NON_ISOLATED_SERVICE_AND_METHOD_HINT, 55, 5); + validateHint(result, i++, NON_ISOLATED_SERVICE_AND_METHOD_HINT, 59, 5); + validateHint(result, i++, NON_ISOLATED_SERVICE_AND_METHOD_HINT, 63, 5); + validateHint(result, i++, NON_ISOLATED_SERVICE_AND_METHOD_HINT, 67, 5); + validateHint(result, i++, NON_ISOLATED_SERVICE_AND_METHOD_HINT, 71, 5); + validateHint(result, i++, NON_ISOLATED_METHOD_HINT, 79, 5); + validateHint(result, i++, NON_ISOLATED_METHOD_HINT, 83, 5); + validateHint(result, i++, NON_ISOLATED_METHOD_HINT, 93, 5); + validateHint(result, i++, NON_ISOLATED_METHOD_HINT, 97, 5); + validateHint(result, i++, NON_ISOLATED_METHOD_HINT, 101, 5); + validateHint(result, i++, NON_ISOLATED_METHOD_HINT, 105, 5); + validateHint(result, i++, NON_ISOLATED_METHOD_HINT, 109, 5); + validateHint(result, i++, NON_ISOLATED_METHOD_HINT, 113, 5); + validateHint(result, i++, NON_ISOLATED_METHOD_HINT, 117, 5); + validateHint(result, i++, NON_ISOLATED_METHOD_HINT, 121, 5); + validateHint(result, i++, NON_ISOLATED_METHOD_HINT, 125, 5); + validateHint(result, i++, NON_ISOLATED_METHOD_HINT, 134, 5); + validateHint(result, i++, NON_ISOLATED_METHOD_HINT, 138, 5); + validateHint(result, i++, NON_ISOLATED_METHOD_HINT, 146, 5); + validateHint(result, i++, NON_ISOLATED_METHOD_HINT, 150, 5); + validateHint(result, i++, NON_ISOLATED_METHOD_HINT, 154, 5); + validateHint(result, i++, NON_ISOLATED_METHOD_HINT, 158, 5); + validateHint(result, i++, NON_ISOLATED_METHOD_HINT, 162, 5); + validateHint(result, i++, NON_ISOLATED_METHOD_HINT, 166, 5); + validateHint(result, i++, NON_ISOLATED_METHOD_HINT, 170, 5); + validateHint(result, i++, NON_ISOLATED_METHOD_HINT, 174, 5); + validateHint(result, i++, NON_ISOLATED_METHOD_HINT, 178, 5); + validateHint(result, i++, NON_ISOLATED_SERVICE_AND_METHOD_HINT, 187, 5); + validateHint(result, i++, NON_ISOLATED_SERVICE_AND_METHOD_HINT, 191, 5); + validateHint(result, i++, NON_ISOLATED_SERVICE_AND_METHOD_HINT, 201, 5); + validateHint(result, i++, NON_ISOLATED_SERVICE_AND_METHOD_HINT, 205, 5); + validateHint(result, i++, NON_ISOLATED_SERVICE_AND_METHOD_HINT, 209, 5); + validateHint(result, i++, NON_ISOLATED_SERVICE_AND_METHOD_HINT, 213, 5); + validateHint(result, i++, NON_ISOLATED_SERVICE_AND_METHOD_HINT, 217, 5); + validateHint(result, i++, NON_ISOLATED_SERVICE_AND_METHOD_HINT, 221, 5); + validateHint(result, i++, NON_ISOLATED_SERVICE_AND_METHOD_HINT, 225, 5); + validateHint(result, i++, NON_ISOLATED_SERVICE_AND_METHOD_HINT, 229, 5); + validateHint(result, i++, NON_ISOLATED_SERVICE_AND_METHOD_HINT, 233, 5); + validateHint(result, i++, NON_ISOLATED_SERVICE_HINT, 245, 5); + validateHint(result, i++, NON_ISOLATED_SERVICE_HINT, 249, 5); + validateHint(result, i++, NON_ISOLATED_SERVICE_AND_METHOD_HINT, 258, 5); + validateHint(result, i++, NON_ISOLATED_SERVICE_AND_METHOD_HINT, 262, 5); + validateHint(result, i++, NON_ISOLATED_SERVICE_AND_METHOD_HINT, 266, 5); + validateHint(result, i++, NON_ISOLATED_SERVICE_AND_METHOD_HINT, 270, 5); + validateHint(result, i++, NON_ISOLATED_SERVICE_AND_METHOD_HINT, 274, 5); + validateHint(result, i++, NON_ISOLATED_SERVICE_AND_METHOD_HINT, 278, 5); + validateHint(result, i++, NON_ISOLATED_SERVICE_AND_METHOD_HINT, 282, 5); + validateHint(result, i++, NON_ISOLATED_SERVICE_AND_METHOD_HINT, 286, 5); + validateHint(result, i++, NON_ISOLATED_SERVICE_AND_METHOD_HINT, 290, 5); + validateHint(result, i++, NON_ISOLATED_METHOD_HINT, 298, 5); + validateHint(result, i++, NON_ISOLATED_METHOD_HINT, 302, 5); + validateHint(result, i++, NON_ISOLATED_METHOD_HINT, 312, 5); + validateHint(result, i++, NON_ISOLATED_METHOD_HINT, 316, 5); + validateHint(result, i++, NON_ISOLATED_METHOD_HINT, 320, 5); + validateHint(result, i++, NON_ISOLATED_METHOD_HINT, 324, 5); + validateHint(result, i++, NON_ISOLATED_METHOD_HINT, 328, 5); + validateHint(result, i++, NON_ISOLATED_METHOD_HINT, 332, 5); + validateHint(result, i++, NON_ISOLATED_METHOD_HINT, 336, 5); + validateHint(result, i++, NON_ISOLATED_METHOD_HINT, 340, 5); + validateHint(result, i++, NON_ISOLATED_METHOD_HINT, 344, 5); + validateHint(result, i++, NON_ISOLATED_METHOD_HINT, 353, 5); + validateHint(result, i++, NON_ISOLATED_METHOD_HINT, 357, 5); + validateHint(result, i++, NON_ISOLATED_METHOD_HINT, 365, 5); + validateHint(result, i++, NON_ISOLATED_METHOD_HINT, 369, 5); + validateHint(result, i++, NON_ISOLATED_METHOD_HINT, 373, 5); + validateHint(result, i++, NON_ISOLATED_METHOD_HINT, 377, 5); + validateHint(result, i++, NON_ISOLATED_METHOD_HINT, 381, 5); + validateHint(result, i++, NON_ISOLATED_METHOD_HINT, 385, 5); + validateHint(result, i++, NON_ISOLATED_METHOD_HINT, 389, 5); + validateHint(result, i++, NON_ISOLATED_METHOD_HINT, 393, 5); + validateHint(result, i++, NON_ISOLATED_METHOD_HINT, 397, 5); + validateHint(result, i++, NON_ISOLATED_SERVICE_AND_METHOD_HINT, 406, 5); + validateHint(result, i++, NON_ISOLATED_SERVICE_AND_METHOD_HINT, 410, 5); + validateHint(result, i++, NON_ISOLATED_SERVICE_AND_METHOD_HINT, 420, 5); + validateHint(result, i++, NON_ISOLATED_SERVICE_AND_METHOD_HINT, 424, 5); + validateHint(result, i++, NON_ISOLATED_SERVICE_AND_METHOD_HINT, 428, 5); + validateHint(result, i++, NON_ISOLATED_SERVICE_AND_METHOD_HINT, 432, 5); + validateHint(result, i++, NON_ISOLATED_SERVICE_AND_METHOD_HINT, 436, 5); + validateHint(result, i++, NON_ISOLATED_SERVICE_AND_METHOD_HINT, 440, 5); + validateHint(result, i++, NON_ISOLATED_SERVICE_AND_METHOD_HINT, 444, 5); + validateHint(result, i++, NON_ISOLATED_SERVICE_AND_METHOD_HINT, 448, 5); + validateHint(result, i++, NON_ISOLATED_SERVICE_AND_METHOD_HINT, 452, 5); + validateHint(result, i++, NON_ISOLATED_SERVICE_HINT, 464, 5); + validateHint(result, i++, NON_ISOLATED_SERVICE_HINT, 468, 5); + validateHint(result, i++, NON_ISOLATED_SERVICE_AND_METHOD_HINT, 477, 5); + validateHint(result, i++, NON_ISOLATED_SERVICE_AND_METHOD_HINT, 481, 5); + validateHint(result, i++, NON_ISOLATED_SERVICE_AND_METHOD_HINT, 485, 5); + validateHint(result, i++, NON_ISOLATED_SERVICE_AND_METHOD_HINT, 489, 5); + validateHint(result, i++, NON_ISOLATED_SERVICE_AND_METHOD_HINT, 493, 5); + validateHint(result, i++, NON_ISOLATED_SERVICE_AND_METHOD_HINT, 497, 5); + validateHint(result, i++, NON_ISOLATED_SERVICE_AND_METHOD_HINT, 501, 5); + validateHint(result, i++, NON_ISOLATED_SERVICE_AND_METHOD_HINT, 505, 5); + validateHint(result, i++, NON_ISOLATED_SERVICE_AND_METHOD_HINT, 509, 5); + validateHint(result, i++, NON_ISOLATED_METHOD_HINT, 517, 5); + validateHint(result, i++, NON_ISOLATED_METHOD_HINT, 521, 5); + validateHint(result, i++, NON_ISOLATED_METHOD_HINT, 531, 5); + validateHint(result, i++, NON_ISOLATED_METHOD_HINT, 535, 5); + validateHint(result, i++, NON_ISOLATED_METHOD_HINT, 539, 5); + validateHint(result, i++, NON_ISOLATED_METHOD_HINT, 543, 5); + validateHint(result, i++, NON_ISOLATED_METHOD_HINT, 547, 5); + validateHint(result, i++, NON_ISOLATED_METHOD_HINT, 551, 5); + validateHint(result, i++, NON_ISOLATED_METHOD_HINT, 555, 5); + validateHint(result, i++, NON_ISOLATED_METHOD_HINT, 559, 5); + validateHint(result, i++, NON_ISOLATED_METHOD_HINT, 563, 5); + validateHint(result, i++, NON_ISOLATED_METHOD_HINT, 571, 5); + validateHint(result, i++, NON_ISOLATED_METHOD_HINT, 575, 5); + validateHint(result, i++, NON_ISOLATED_METHOD_HINT, 583, 5); + validateHint(result, i++, NON_ISOLATED_METHOD_HINT, 587, 5); + validateHint(result, i++, NON_ISOLATED_METHOD_HINT, 591, 5); + validateHint(result, i++, NON_ISOLATED_METHOD_HINT, 595, 5); + validateHint(result, i++, NON_ISOLATED_METHOD_HINT, 599, 5); + validateHint(result, i++, NON_ISOLATED_METHOD_HINT, 603, 5); + validateHint(result, i++, NON_ISOLATED_METHOD_HINT, 607, 5); + validateHint(result, i++, NON_ISOLATED_METHOD_HINT, 611, 5); + validateHint(result, i++, NON_ISOLATED_METHOD_HINT, 615, 5); + validateHint(result, i++, NON_ISOLATED_SERVICE_AND_METHOD_HINT, 624, 5); + validateHint(result, i++, NON_ISOLATED_SERVICE_AND_METHOD_HINT, 628, 5); + validateHint(result, i++, NON_ISOLATED_SERVICE_AND_METHOD_HINT, 638, 5); + validateHint(result, i++, NON_ISOLATED_SERVICE_AND_METHOD_HINT, 642, 5); + validateHint(result, i++, NON_ISOLATED_SERVICE_AND_METHOD_HINT, 646, 5); + validateHint(result, i++, NON_ISOLATED_SERVICE_AND_METHOD_HINT, 650, 5); + validateHint(result, i++, NON_ISOLATED_SERVICE_AND_METHOD_HINT, 654, 5); + validateHint(result, i++, NON_ISOLATED_SERVICE_AND_METHOD_HINT, 658, 5); + validateHint(result, i++, NON_ISOLATED_SERVICE_AND_METHOD_HINT, 662, 5); + validateHint(result, i++, NON_ISOLATED_SERVICE_AND_METHOD_HINT, 666, 5); + validateHint(result, i++, NON_ISOLATED_SERVICE_AND_METHOD_HINT, 670, 5); assertEquals(result.getHintCount(), i); LineRange lineRange = result.getDiagnostics()[0].location().lineRange(); diff --git a/tests/jballerina-unit-test/src/test/resources/test-src/isolation-analysis/isolation_warnings_for_service_methods.bal b/tests/jballerina-unit-test/src/test/resources/test-src/isolation-analysis/isolation_warnings_for_service_methods.bal index d0918ade8590..bf3467ea7b5c 100644 --- a/tests/jballerina-unit-test/src/test/resources/test-src/isolation-analysis/isolation_warnings_for_service_methods.bal +++ b/tests/jballerina-unit-test/src/test/resources/test-src/isolation-analysis/isolation_warnings_for_service_methods.bal @@ -14,7 +14,7 @@ // specific language governing permissions and limitations // under the License. -int nonIsolatedVar = 0; +int nonIsolatedVar = 0; //////////////////// Service Declarations //////////////////// @@ -35,6 +35,42 @@ service on new Listener() { function func() { } + + resource function post bar(string[] mutableVal) { + _ = start mutableValueAccess(mutableVal); + } + + resource function post bas([string[], string[], string[]] args) { + _ = start passParamsAsRestArgs(...args); + } + + resource function post baz(string[] arg1, string[] arg2, string[] arg3) { + _ = start passParamsAsRestArgs(...[arg1, arg2, arg3]); + } + + resource function post qux(string[] arg1, string[] arg2, string[]... restArgs) { + _ = start passRequiredArgsAndRestArgs(...[arg1, arg2, ...restArgs]); + } + + resource function post quxx([string[], string[]] args, string[]... restArgs) { + _ = start passRequiredArgsAndRestArgs(...[...args, ...restArgs]); + } + + resource function post quxxx(string[] arg1, string[] arg2, string[] arg3) { + _ = start passRestArgsAsArgs(arg1, arg2, arg3); + } + + resource function post path(T1 t1) { + _ = start passParamsAsRestArgs(t1.arg1, [], []); + } + + resource function post path2(T1 t1, T2 t2) { + _ = start passParamsAsRestArgs(...{...t1, ...t2, arg3: []}); + } + + resource function post path3(T3 t3) { + _ = start passParamsAsRestArgs(...{...{...{...t3}}}); + } } isolated service "ser2" on new Listener() { @@ -53,6 +89,42 @@ isolated service "ser2" on new Listener() { function func() { nonIsolatedFunc(); } + + resource function post bar(string[] mutableVal) { + _ = start mutableValueAccess(mutableVal); + } + + resource function post bas([string[], string[], string[]] args) { + _ = start passParamsAsRestArgs(...args); + } + + resource function post baz(string[] arg1, string[] arg2, string[] arg3) { + _ = start passParamsAsRestArgs(...[arg1, arg2, arg3]); + } + + resource function post qux(string[] arg1, string[] arg2, string[]... restArgs) { + _ = start passRequiredArgsAndRestArgs(...[arg1, arg2, ...restArgs]); + } + + resource function post quxx([string[], string[]] args, string[]... restArgs) { + _ = start passRequiredArgsAndRestArgs(...[...args, ...restArgs]); + } + + resource function post quxxx(string[] arg1, string[] arg2, string[] arg3) { + _ = start passRestArgsAsArgs(arg1, arg2, arg3); + } + + resource function post path(T1 t1) { + _ = start passParamsAsRestArgs(t1.arg1, [], []); + } + + resource function post path2(T1 t1, T2 t2) { + _ = start passParamsAsRestArgs(...{...t1, ...t2, arg3: []}); + } + + resource function post path3(T3 t3) { + _ = start passParamsAsRestArgs(...{...{...{...t3}}}); + } } // Inferred isolated. @@ -70,6 +142,42 @@ service "ser3" on new Listener() { function func() { nonIsolatedFunc(); } + + resource function post bar(string[] mutableVal) { + _ = start mutableValueAccess(mutableVal); + } + + resource function post bas([string[], string[], string[]] args) { + _ = start passParamsAsRestArgs(...args); + } + + resource function post baz(string[] arg1, string[] arg2, string[] arg3) { + _ = start passParamsAsRestArgs(...[arg1, arg2, arg3]); + } + + resource function post qux(string[] arg1, string[] arg2, string[]... restArgs) { + _ = start passRequiredArgsAndRestArgs(...[arg1, arg2, ...restArgs]); + } + + resource function post quxx([string[], string[]] args, string[]... restArgs) { + _ = start passRequiredArgsAndRestArgs(...[...args, ...restArgs]); + } + + resource function post quxxx(string[] arg1, string[] arg2, string[] arg3) { + _ = start passRestArgsAsArgs(arg1, arg2, arg3); + } + + resource function post path(T1 t1) { + _ = start passParamsAsRestArgs(t1.arg1, [], []); + } + + resource function post path2(T1 t1, T2 t2) { + _ = start passParamsAsRestArgs(...{...t1, ...t2, arg3: []}); + } + + resource function post path3(T3 t3) { + _ = start passParamsAsRestArgs(...{...{...{...t3}}}); + } } service "ser4" on new Listener() { @@ -89,6 +197,42 @@ service "ser4" on new Listener() { function func() { nonIsolatedFunc(); } + + resource function post bar(string[] mutableVal) { + _ = start mutableValueAccess(mutableVal); + } + + resource function post bas([string[], string[], string[]] args) { + _ = start passParamsAsRestArgs(...args); + } + + resource function post baz(string[] arg1, string[] arg2, string[] arg3) { + _ = start passParamsAsRestArgs(...[arg1, arg2, arg3]); + } + + resource function post qux(string[] arg1, string[] arg2, string[]... restArgs) { + _ = start passRequiredArgsAndRestArgs(...[arg1, arg2, ...restArgs]); + } + + resource function post quxx([string[], string[]] args, string[]... restArgs) { + _ = start passRequiredArgsAndRestArgs(...[...args, ...restArgs]); + } + + resource function post quxxx(string[] arg1, string[] arg2, string[] arg3) { + _ = start passRestArgsAsArgs(arg1, arg2, arg3); + } + + resource function post path(T1 t1) { + _ = start passParamsAsRestArgs(t1.arg1, [], []); + } + + resource function post path2(T1 t1, T2 t2) { + _ = start passParamsAsRestArgs(...{...t1, ...t2, arg3: []}); + } + + resource function post path3(T3 t3) { + _ = start passParamsAsRestArgs(...{...{...{...t3}}}); + } } //////////////////// Service Classes //////////////////// @@ -110,6 +254,42 @@ service class Serv1 { function func() { } + + resource function post bar(string[] mutableVal) { + _ = start mutableValueAccess(mutableVal); + } + + resource function post bas([string[], string[], string[]] args) { + _ = start passParamsAsRestArgs(...args); + } + + resource function post baz(string[] arg1, string[] arg2, string[] arg3) { + _ = start passParamsAsRestArgs(...[arg1, arg2, arg3]); + } + + resource function post qux(string[] arg1, string[] arg2, string[]... restArgs) { + _ = start passRequiredArgsAndRestArgs(...[arg1, arg2, ...restArgs]); + } + + resource function post quxx([string[], string[]] args, string[]... restArgs) { + _ = start passRequiredArgsAndRestArgs(...[...args, ...restArgs]); + } + + resource function post quxxx(string[] arg1, string[] arg2, string[] arg3) { + _ = start passRestArgsAsArgs(arg1, arg2, arg3); + } + + resource function post path(T1 t1) { + _ = start passParamsAsRestArgs(t1.arg1, [], []); + } + + resource function post path2(T1 t1, T2 t2) { + _ = start passParamsAsRestArgs(...{...t1, ...t2, arg3: []}); + } + + resource function post path3(T3 t3) { + _ = start passParamsAsRestArgs(...{...{...{...t3}}}); + } } isolated service class Serv2 { @@ -128,6 +308,42 @@ isolated service class Serv2 { function func() { nonIsolatedFunc(); } + + resource function post bar(string[] mutableVal) { + _ = start mutableValueAccess(mutableVal); + } + + resource function post bas([string[], string[], string[]] args) { + _ = start passParamsAsRestArgs(...args); + } + + resource function post baz(string[] arg1, string[] arg2, string[] arg3) { + _ = start passParamsAsRestArgs(...[arg1, arg2, arg3]); + } + + resource function post qux(string[] arg1, string[] arg2, string[]... restArgs) { + _ = start passRequiredArgsAndRestArgs(...[arg1, arg2, ...restArgs]); + } + + resource function post quxx([string[], string[]] args, string[]... restArgs) { + _ = start passRequiredArgsAndRestArgs(...[...args, ...restArgs]); + } + + resource function post quxxx(string[] arg1, string[] arg2, string[] arg3) { + _ = start passRestArgsAsArgs(arg1, arg2, arg3); + } + + resource function post path(T1 t1) { + _ = start passParamsAsRestArgs(t1.arg1, [], []); + } + + resource function post path2(T1 t1, T2 t2) { + _ = start passParamsAsRestArgs(...{...t1, ...t2, arg3: []}); + } + + resource function post path3(T3 t3) { + _ = start passParamsAsRestArgs(...{...{...{...t3}}}); + } } // Inferred isolated. @@ -145,6 +361,42 @@ service class Serv3 { function func() { nonIsolatedFunc(); } + + resource function post bar(string[] mutableVal) { + _ = start mutableValueAccess(mutableVal); + } + + resource function post bas([string[], string[], string[]] args) { + _ = start passParamsAsRestArgs(...args); + } + + resource function post baz(string[] arg1, string[] arg2, string[] arg3) { + _ = start passParamsAsRestArgs(...[arg1, arg2, arg3]); + } + + resource function post qux(string[] arg1, string[] arg2, string[]... restArgs) { + _ = start passRequiredArgsAndRestArgs(...[arg1, arg2, ...restArgs]); + } + + resource function post quxx([string[], string[]] args, string[]... restArgs) { + _ = start passRequiredArgsAndRestArgs(...[...args, ...restArgs]); + } + + resource function post quxxx(string[] arg1, string[] arg2, string[] arg3) { + _ = start passRestArgsAsArgs(arg1, arg2, arg3); + } + + resource function post path(T1 t1) { + _ = start passParamsAsRestArgs(t1.arg1, [], []); + } + + resource function post path2(T1 t1, T2 t2) { + _ = start passParamsAsRestArgs(...{...t1, ...t2, arg3: []}); + } + + resource function post path3(T3 t3) { + _ = start passParamsAsRestArgs(...{...{...{...t3}}}); + } } service class Serv4 { @@ -164,6 +416,42 @@ service class Serv4 { function func() { nonIsolatedFunc(); } + + resource function post bar(string[] mutableVal) { + _ = start mutableValueAccess(mutableVal); + } + + resource function post bas([string[], string[], string[]] args) { + _ = start passParamsAsRestArgs(...args); + } + + resource function post baz(string[] arg1, string[] arg2, string[] arg3) { + _ = start passParamsAsRestArgs(...[arg1, arg2, arg3]); + } + + resource function post qux(string[] arg1, string[] arg2, string[]... restArgs) { + _ = start passRequiredArgsAndRestArgs(...[arg1, arg2, ...restArgs]); + } + + resource function post quxx([string[], string[]] args, string[]... restArgs) { + _ = start passRequiredArgsAndRestArgs(...[...args, ...restArgs]); + } + + resource function post quxxx(string[] arg1, string[] arg2, string[] arg3) { + _ = start passRestArgsAsArgs(arg1, arg2, arg3); + } + + resource function post path(T1 t1) { + _ = start passParamsAsRestArgs(t1.arg1, [], []); + } + + resource function post path2(T1 t1, T2 t2) { + _ = start passParamsAsRestArgs(...{...t1, ...t2, arg3: []}); + } + + resource function post path3(T3 t3) { + _ = start passParamsAsRestArgs(...{...{...{...t3}}}); + } } //////////////////// Service Object Constructors //////////////////// @@ -185,6 +473,42 @@ var s1 = service object { function func() { } + + resource function post bar(string[] mutableVal) { + _ = start mutableValueAccess(mutableVal); + } + + resource function post bas([string[], string[], string[]] args) { + _ = start passParamsAsRestArgs(...args); + } + + resource function post baz(string[] arg1, string[] arg2, string[] arg3) { + _ = start passParamsAsRestArgs(...[arg1, arg2, arg3]); + } + + resource function post qux(string[] arg1, string[] arg2, string[]... restArgs) { + _ = start passRequiredArgsAndRestArgs(...[arg1, arg2, ...restArgs]); + } + + resource function post quxx([string[], string[]] args, string[]... restArgs) { + _ = start passRequiredArgsAndRestArgs(...[...args, ...restArgs]); + } + + resource function post quxxx(string[] arg1, string[] arg2, string[] arg3) { + _ = start passRestArgsAsArgs(arg1, arg2, arg3); + } + + resource function post path(T1 t1) { + _ = start passParamsAsRestArgs(t1.arg1, [], []); + } + + resource function post path2(T1 t1, T2 t2) { + _ = start passParamsAsRestArgs(...{...t1, ...t2, arg3: []}); + } + + resource function post path3(T3 t3) { + _ = start passParamsAsRestArgs(...{...{...{...t3}}}); + } }; var s2 = isolated service object { @@ -203,6 +527,42 @@ var s2 = isolated service object { function func() { nonIsolatedFunc(); } + + resource function post bar(string[] mutableVal) { + _ = start mutableValueAccess(mutableVal); + } + + resource function post bas([string[], string[], string[]] args) { + _ = start passParamsAsRestArgs(...args); + } + + resource function post baz(string[] arg1, string[] arg2, string[] arg3) { + _ = start passParamsAsRestArgs(...[arg1, arg2, arg3]); + } + + resource function post qux(string[] arg1, string[] arg2, string[]... restArgs) { + _ = start passRequiredArgsAndRestArgs(...[arg1, arg2, ...restArgs]); + } + + resource function post quxx([string[], string[]] args, string[]... restArgs) { + _ = start passRequiredArgsAndRestArgs(...[...args, ...restArgs]); + } + + resource function post quxxx(string[] arg1, string[] arg2, string[] arg3) { + _ = start passRestArgsAsArgs(arg1, arg2, arg3); + } + + resource function post path(T1 t1) { + _ = start passParamsAsRestArgs(t1.arg1, [], []); + } + + resource function post path2(T1 t1, T2 t2) { + _ = start passParamsAsRestArgs(...{...t1, ...t2, arg3: []}); + } + + resource function post path3(T3 t3) { + _ = start passParamsAsRestArgs(...{...{...{...t3}}}); + } }; var s3 = service object { @@ -219,6 +579,42 @@ var s3 = service object { function func() { nonIsolatedFunc(); } + + resource function post bar(string[] mutableVal) { + _ = start mutableValueAccess(mutableVal); + } + + resource function post bas([string[], string[], string[]] args) { + _ = start passParamsAsRestArgs(...args); + } + + resource function post baz(string[] arg1, string[] arg2, string[] arg3) { + _ = start passParamsAsRestArgs(...[arg1, arg2, arg3]); + } + + resource function post qux(string[] arg1, string[] arg2, string[]... restArgs) { + _ = start passRequiredArgsAndRestArgs(...[arg1, arg2, ...restArgs]); + } + + resource function post quxx([string[], string[]] args, string[]... restArgs) { + _ = start passRequiredArgsAndRestArgs(...[...args, ...restArgs]); + } + + resource function post quxxx(string[] arg1, string[] arg2, string[] arg3) { + _ = start passRestArgsAsArgs(arg1, arg2, arg3); + } + + resource function post path(T1 t1) { + _ = start passParamsAsRestArgs(t1.arg1, [], []); + } + + resource function post path2(T1 t1, T2 t2) { + _ = start passParamsAsRestArgs(...{...t1, ...t2, arg3: []}); + } + + resource function post path3(T3 t3) { + _ = start passParamsAsRestArgs(...{...{...{...t3}}}); + } }; service object {} s4 = service object { @@ -238,6 +634,42 @@ service object {} s4 = service object { function func() { nonIsolatedFunc(); } + + resource function post bar(string[] mutableVal) { + _ = start mutableValueAccess(mutableVal); + } + + resource function post bas([string[], string[], string[]] args) { + _ = start passParamsAsRestArgs(...args); + } + + resource function post baz(string[] arg1, string[] arg2, string[] arg3) { + _ = start passParamsAsRestArgs(...[arg1, arg2, arg3]); + } + + resource function post qux(string[] arg1, string[] arg2, string[]... restArgs) { + _ = start passRequiredArgsAndRestArgs(...[arg1, arg2, ...restArgs]); + } + + resource function post quxx([string[], string[]] args, string[]... restArgs) { + _ = start passRequiredArgsAndRestArgs(...[...args, ...restArgs]); + } + + resource function post quxxx(string[] arg1, string[] arg2, string[] arg3) { + _ = start passRestArgsAsArgs(arg1, arg2, arg3); + } + + resource function post path(T1 t1) { + _ = start passParamsAsRestArgs(t1.arg1, [], []); + } + + resource function post path2(T1 t1, T2 t2) { + _ = start passParamsAsRestArgs(...{...t1, ...t2, arg3: []}); + } + + resource function post path3(T3 t3) { + _ = start passParamsAsRestArgs(...{...{...{...t3}}}); + } }; function nonIsolatedFunc() { @@ -315,6 +747,33 @@ var s6 = isolated service object { } }; +isolated function mutableValueAccess(string[] value) { +} + +isolated function passParamsAsRestArgs(string[] arg1, string[] arg2, string[] arg3) { +} + +isolated function passRequiredArgsAndRestArgs(string[] arg1, string[] arg2, string[]... restArg) { +} + +isolated function passRestArgsAsArgs(string[]... restArg) { +} + + +type T1 record {| + string[] arg1; +|}; + +type T2 record {| + string[] arg2; +|}; + +type T3 record {| + *T1; + *T2; + string[] arg3; +|}; + public class Listener { public isolated function 'start() returns error? { return;