diff --git a/static_core/plugins/ets/tests/ets-templates/07.expressions/11.function_call_expression/fcall.params.yaml b/static_core/plugins/ets/tests/ets-templates/07.expressions/11.function_call_expression/fcall.params.yaml index 50b3f1b6224549eb87a6bb7cc758c7cbc45ccdf6..d21323afc8c2f07ba6e6f4a8a53ba46f56b9bb57 100644 --- a/static_core/plugins/ets/tests/ets-templates/07.expressions/11.function_call_expression/fcall.params.yaml +++ b/static_core/plugins/ets/tests/ets-templates/07.expressions/11.function_call_expression/fcall.params.yaml @@ -216,7 +216,7 @@ cases: let r: Boolean | undefined = ll?.('Hello', 42, true) arktest.assertEQ(undefined, r) arktest.assertEQ(0, calls) - + ll = getLambdaOrNull(true) r = ll?.('Hello', 42, true) arktest.assertEQ(true, r) @@ -294,3 +294,10 @@ cases: let value = ((up: LP): User => { return up() }) () { return {name: 'Alice', age: 16 } } arktest.assertEQ('Alice', value.name) arktest.assertTrue(value instanceof User) + + - decl: |- + function bar(callee: (a: int) => void): void { + callee(1) + } + use: |- + bar((): void => {}) diff --git a/static_core/plugins/ets/tests/ets-templates/16.concurrency/03.asynchronous_api/05.promise/p.params.yaml b/static_core/plugins/ets/tests/ets-templates/16.concurrency/03.asynchronous_api/05.promise/p.params.yaml index 5ed304c6a0b6ef17d25b677d2ed27b67f2c79fec..1621d83e6fc1c8943ff909f0dcc398eb8383703e 100644 --- a/static_core/plugins/ets/tests/ets-templates/16.concurrency/03.asynchronous_api/05.promise/p.params.yaml +++ b/static_core/plugins/ets/tests/ets-templates/16.concurrency/03.asynchronous_api/05.promise/p.params.yaml @@ -14,12 +14,11 @@ --- cases: - decl: |- - type ON = Object|null let s = 'XYZ' use: |- // test resolving path let r: Promise = new Promise( - (resolve: (p: string) => void, reject: (p: ON) => void): void => { + (resolve: (p: string) => void, reject: (p: Error) => void): void => { if (s == 'XYZ') { resolve(s) } else { @@ -30,12 +29,11 @@ cases: arktest.assertTrue((await r) == 'XYZ') - decl: |- - type ON = Object|null let s = 'XYZ' use: |- // test rejection path let r: Promise = new Promise( - (resolve: (p: string) => void, reject: (p: ON) => void): void => { + (resolve: (p: string) => void, reject: (p: Error) => void): void => { if (s != 'XYZ') { resolve(s) } else { @@ -53,12 +51,11 @@ cases: arktest.assertTrue(false) - decl: |- - type ON = Object|null let s = 'XYZ' use: |- // test throw from resolving path let r: Promise = new Promise( - (resolve: (p: string) => void, reject: (p: ON) => void): void => { + (resolve: (p: string) => void, reject: (p: Error) => void): void => { if (s == 'XYZ') { throw new Error(s) } else { @@ -76,12 +73,11 @@ cases: arktest.assertTrue(false) - decl: |- - type ON = Object|null let initVal: number = 1.0 use: |- // test then chain, resolved let r = new Promise( - (resolve: (p: number) => void, reject: (p: ON) => void): void => { + (resolve: (p: number) => void, reject: (p: Error) => void): void => { if (initVal > 0) { resolve(initVal) } else { @@ -105,7 +101,7 @@ cases: use: |- // test catch chain let r: Promise = new Promise( - (resolve: (p: number) => void, reject: (p: ON) => void): void => { + (resolve: (p: number) => void, reject: (p: Error) => void): void => { if (initVal < 0) { resolve(initVal) } else { @@ -144,7 +140,7 @@ cases: use: |- // test mixed then and catch chain let r: Promise = new Promise( - (resolve: (p: string) => void, reject: (p: ON) => void): void => { + (resolve: (p: string) => void, reject: (p: Error) => void): void => { if (initVal > 0) { resolve('A') } else { diff --git a/static_core/plugins/ets/tests/interop_js/eacoro/eaworker_test.ets b/static_core/plugins/ets/tests/interop_js/eacoro/eaworker_test.ets index 0ce3e701d043e6f001f20c0be0c6c279155401fe..b1d748ab5a992eca8ef7350d8bff9df989b93679 100644 --- a/static_core/plugins/ets/tests/interop_js/eacoro/eaworker_test.ets +++ b/static_core/plugins/ets/tests/interop_js/eacoro/eaworker_test.ets @@ -68,7 +68,7 @@ function RunTasksWithJsAsyncCallTest(): void { let modified = false; let method = JSRuntime.getPropertyJSValue(module, 'asyncWithAwait'); let promise = (ESValue.wrap(JSRuntime.invoke(module, method))).toPromise(); - let promise1 = promise.then((x:Object): void => { + let promise1 = promise.then((x:Any): void => { modified = true; }); diff --git a/static_core/plugins/ets/tests/interop_js/tests/promise/promise_tests.ets b/static_core/plugins/ets/tests/interop_js/tests/promise/promise_tests.ets index 22bbdc25f8d7a91fd837c53167092b3304b3ad73..02a7fbf23293b4532d6cfeae2e42d9f8ee692a61 100644 --- a/static_core/plugins/ets/tests/interop_js/tests/promise/promise_tests.ets +++ b/static_core/plugins/ets/tests/interop_js/tests/promise/promise_tests.ets @@ -755,9 +755,11 @@ function testPromiseRaceRejected(): void { function testPromiseThenOnRejection(): void { globalTest = new Test(); - Promise.reject(new Error("test")).then( - (value: Object): void => { + Promise.reject(new Error("test")).then( + (value: Object): string => { globalTest!.fail(); + // String return type needed, until 'String|void' type is supported + return ""; }, (error: Error): string => { return "correct flow"; }).then((value): string => {