| /arkcompiler/runtime_core/static_core/plugins/ets/tests/ets-templates/07.expressions/11.function_call_expression/step_1_selection_of_function/ |
| D | step1.params.yaml | 18 function foo(p: Number): string { 21 function foo(p: Number|null): string { 24 function foo(p: UT): string { 29 assert foo(new Number()) == "N" 34 function foo(p: Number|null): string { 37 function foo(p: UT): string { 42 assert foo(new Number()) == "UT" 47 function foo(p: Number|null): string { 50 function foo(p: UT): string { 53 function foo(p: number): string { [all …]
|
| D | step1n.params.yaml | 17 function foo(p: number): string { 20 function foo(...p: number[]): string { 23 function foo(p: number, q: number = 0.0): string { 28 assert foo(0.0) == "n" 31 function foo(p: number): string { 34 function foo(...p: number[]): string { 37 function foo(p: number, q?: Number): string { 42 assert foo(0.0) == "n" 45 function foo(...p: number[]): string { 48 function foo(p: number, q: number = 0.0): string { [all …]
|
| /arkcompiler/runtime_core/static_core/plugins/ets/tests/ets-templates/07.expressions/01.evaluation_of_expressions/ |
| D | typ.sts | 24 function foo(a: byte): int { 27 function foo(a: short): int { 30 function foo(a: char): int { 33 function foo(a: int): int { 36 function foo(a: long): int { 39 function foo(a: float): int { 42 function foo(a: double): int { 45 function foo(a: boolean): int { 48 function foo(a: Byte): int { 51 function foo(a: Short): int { [all …]
|
| /arkcompiler/runtime_core/static_core/plugins/ets/tests/ets-templates/17.experimental_features/07.function_and_method_overloading/01.function_overloading/ |
| D | fn_overloading.sts | 25 function foo(a: byte): int { 28 function foo(a: short): int { 31 function foo(a: char): int { 34 function foo(a: int): int { 37 function foo(a: long): int { 40 function foo(a: float): int { 43 function foo(a: double): int { 46 function foo(a: boolean): int { 49 function foo(a: Byte): int { 52 function foo(a: Short): int { [all …]
|
| D | fn_overloading_n.params.yaml | 17 function foo() {} 18 function foo(): void {} 21 function foo(): void throws {} 22 function foo(): void {} 25 function foo(): int { 28 native function foo(): void; 31 function foo(): int { 34 function foo(): short { 39 function foo(... a: byte): void {} 40 native function foo(... b: byte): long; [all …]
|
| /arkcompiler/runtime_core/static_core/plugins/ets/tests/ets-templates/15.semantic_rules/07.overloading_and_overriding/02.override-compatible_signatures/ |
| D | override_with_object.params.yaml | 19 foo(i: Base): void { 23 override foo(i: Object): void { 26 call: new Derived().foo(new Base()); 31 foo(i: Base): void { 35 override foo(i: Object): void { 38 call: new Derived().foo(new Object()); 44 foo(i: Object): void { 48 override foo(i: Base): void { 51 call: new Derived().foo(new Base()); 56 foo(): Object { [all …]
|
| D | override_variance.params.yaml | 19 foo(i: Derived): void { 23 override foo(i: Base): void { 26 call: new Derived().foo(new Base()); 31 foo(i: Derived): void { 35 override foo(i: Base): void { 38 call: new Derived().foo(new Derived()); 44 foo(i: Base): void { 48 override foo(i: Derived): void { 51 call: new Derived().foo(new Base()); 56 foo(): Base { [all …]
|
| D | override_compatible_signature.params.yaml | 17 foo(): void { 21 override foo(): void { 24 call: new Derived().foo() 30 foo(): int { 35 override foo(): void { 38 call: new Derived().foo() 44 foo(): void { 48 override foo(i: int): void { 51 call: new Derived().foo(1) 57 foo(i: int, j: string): void { [all …]
|
| /arkcompiler/runtime_core/static_core/plugins/ets/tests/ets-templates/15.semantic_rules/07.overloading_and_overriding/04.overloading_and_overriding_in_classes/ |
| D | single_class_overload_n.params.yaml | 96 foo() { res = 1;} 97 foo() { res = 2;} 103 foo() { res = 1;} 104 foo(): int { res = 2; return 1;} 110 foo(i: number) { res = 1;} 111 foo(j: number) { res = 2;} 117 foo(i: Number) { res = 1;} 118 foo(j: Double) { res = 2;} 124 foo(i: Number|undefined|null) { res = 1;} 125 foo(j: undefined|null|Number) { res = 2;} [all …]
|
| D | class_method_over_n3.params.yaml | 23 foo(i: T, j: S) { 27 static foo(i: T, j: S) { 32 foo(i: T, j: S) { 36 static foo(i: T, j: S) { 41 new Derived<A, B>().foo(new A(), new B()); 43 new Derived<B, I>().foo(new B(), new C()); 45 Derived.foo(new Number(), new String()); 53 foo(i: B) { 57 static foo(i: B) { 62 foo(i: B) { [all …]
|
| /arkcompiler/runtime_core/static_core/plugins/ets/tests/ets-templates/04.names_declarations_and_scopes/08.function_declarations/04.optional_parameters/ |
| D | opt_param.params.yaml | 28 …function foo(a: byte = 1, b: short = 2, c: int = 3, d: long = 4, e: float = 5.0, f: double = 6.0, … 38 call: foo() 42 function foo(a: int = 1, b: int = 2, c: int = 3): int { 46 assert foo(11, 12, 13) == 36 47 assert foo(11) == 16 48 assert foo(, 11) == 15 49 assert foo(,, 11) == 14 50 assert foo(11,, 11) == 24 51 assert foo(,,) == 6 52 assert foo() == 6 [all …]
|
| /arkcompiler/runtime_core/static_core/plugins/ets/tests/ets-templates/04.names_declarations_and_scopes/08.function_declarations/07.return_type/ |
| D | ret_type.params.yaml | 18 function foo() { // infer void 22 foo() 26 let s = "foo" 27 function foo() { // infer string 31 let v: string = foo(); 32 assert foo() == "foo" 36 function foo() { // infer int 40 let v: int = foo(); 41 assert foo() == 42 45 function foo() { // infer number [all …]
|
| /arkcompiler/runtime_core/static_core/plugins/ets/tests/ets-templates/17.experimental_features/12.trailing_lambda/ |
| D | trlambda_func.params.yaml | 19 function foo(n: number, f: () => void) { 25 foo(10.0, () => { 33 function foo(n: number, f?: FF) { // optional 39 foo(10.0, () => { 44 foo(10.0) 51 function foo(n: number, f: FF) { 56 foo(10.0) // trailing lambda 64 function foo(n: number, f?: () => void) { // optional 69 foo(10.0) // trailing lambda 75 foo(10.0) [all …]
|
| /arkcompiler/ets_frontend/ets2panda/linter/docs/rules/ |
| D | recipe52.md | 21 foo() { 22 console.log("foo") 32 c2.foo = bar 34 c1.foo() // foo 35 c2.foo() // bar 45 foo() { 46 console.log("foo") 51 foo() { 53 super.foo() 63 c1.foo() // foo [all …]
|
| D | recipe96.md | 17 class Foo { 18 foo: number = 0 27 function isFoo(arg: any): arg is Foo { 28 return arg.foo !== undefined 31 function doStuff(arg: Foo | Bar) { 33 console.log(arg.foo) // OK 36 console.log(arg.foo) // Compile-time error 41 doStuff({ foo: 123, common: '123' }) 51 class Foo { 52 foo: number = 0 [all …]
|
| /arkcompiler/runtime_core/static_core/libpandabase/ |
| D | task_runner.h | 28 * runner.AddFinalize(foo); 42 * | call foo; 51 * call foo; 110 template <typename Foo> 111 void AddOnSuccess(Foo foo) in AddOnSuccess() argument 114 callbackOnSuccess_ = NextCallback(std::move(callbackOnSuccess_), std::move(foo)); in AddOnSuccess() 116 callbackOnSuccess_ = std::move(foo); in AddOnSuccess() 121 template <typename Foo> 122 void AddOnFail(Foo foo) in AddOnFail() argument 125 callbackOnFail_ = NextCallback(std::move(callbackOnFail_), std::move(foo)); in AddOnFail() [all …]
|
| /arkcompiler/runtime_core/static_core/plugins/ets/tests/ets-templates/15.semantic_rules/07.overloading_and_overriding/03.overloading_for_functions/modules/ |
| D | function_export_all.sts | 25 export function foo(): int { 29 export function foo(i: boolean): int { 33 export function foo(i: Boolean): int { 37 export function foo(i: char): int { 41 export function foo(i: Char): int { 45 export function foo(i: short): int { 49 export function foo(i: Short): int { 53 export function foo(i: int): int { 57 export function foo(i: Int): int { 61 export function foo(i: long): int { [all …]
|
| /arkcompiler/runtime_core/static_core/plugins/ets/tests/ets-templates/15.semantic_rules/07.overloading_and_overriding/03.overloading_for_functions/ |
| D | function_import_from_same_cu_2.sts | 27 import {foo} from "./modules/function_export_all.sts" 33 assert(foo(true) == 2); 34 assert(foo(new Boolean()) == 3); 35 assert(foo(c'A') == 4); 36 assert(foo(new Char()) == 5); 37 assert(foo(1 as short) == 6); 38 assert(foo(new Short()) == 7); 39 assert(foo(1 as int) == 8); 40 assert(foo(new Int()) == 9); 41 assert(foo(1 as long) == 10); [all …]
|
| /arkcompiler/ets_frontend/ets2panda/test/runtime/ets/ |
| D | conditionalExpressionGenericLUB.sts | 34 function foo(p: Object): int { 38 function foo(p: GenA<A>): int { 42 function foo(p: GenA<B>): int { 46 function foo(p: GenB<A>): int { 50 function foo(p: GenB<B>): int { 54 function foo(p: GenB<C>): int { 58 function foo(p: GenB<F>): int { 62 function foo(p: GenC<A, A>): int { 66 function foo(p: GenC<B, B>): int { 70 function foo(p: GenC<C, F>): int { [all …]
|
| D | Override-3.sts | 17 foo(a: int, op?: int): int { return a } 20 override foo(a: int, op?: int): int { return a } 24 foo(a: T, op?: T): T { return a } 27 override foo(a: T, op?: T): T { return a } 36 assert(b.foo(5) == a.foo(5)); 37 assert(b.foo(6) != a.foo(5)); 38 assert(b.foo(5) != a.foo(6)); 39 assert(c.foo("x") == d.foo("x")); 40 assert(c.foo("x") != d.foo("y")); 41 assert(c.foo("y") != d.foo("x"));
|
| /arkcompiler/ets_frontend/ets2panda/test/compiler/ts/ |
| D | memberExpTests.ts | 22 foo: number, property 26 foo: number, property 32 a1.foo = 2; 34 b1.foo = a1.foo; 37 a1.foobar.foo = 3; 38 a1.foobar.bar = "foo"; 43 foo: number[] property 46 a2.foo[2] = 5; 51 foo : {bar: number} property 54 a3.foo.bar = 3; [all …]
|
| /arkcompiler/ets_frontend/es2panda/test/parser/ts/type_checker/ |
| D | memberExpTests.ts | 22 foo: number, property 26 foo: number, property 32 a1.foo = 2; 34 b1.foo = a1.foo; 37 a1.foobar.foo = 3; 38 a1.foobar.bar = "foo"; 43 foo: number[] property 46 a2.foo[2] = 5; 51 foo : {bar: number} property 54 a3.foo.bar = 3; [all …]
|
| /arkcompiler/runtime_core/static_core/plugins/ets/tests/ets-templates/06.contexts_and_conversions/03.numeric_operator_contexts/unary_numeric_promotion/ |
| D | shift.sts | 24 function foo(p: byte): int { 28 function foo(p: short): int { 32 function foo(p: int): int { 36 function foo(p: long): int { 40 function foo(p: char): int { 44 function foo(p: boolean): int { 48 function foo(p: float): int { 52 function foo(p: double): int { 56 function foo(p: Byte): int { 60 function foo(p: Short): int { [all …]
|
| /arkcompiler/runtime_core/static_core/plugins/ets/tests/ets-templates/04.names_declarations_and_scopes/08.function_declarations/02.parameter_list/ |
| D | param_list.params.yaml | 18 function foo(a: long, b: double, c: char): void {} 20 foo(42, 1.5, c'A'); 24 function foo(a: long[], b: double[], c: char[]): void {} 29 foo(a, b, c); 34 function foo(a: () => void): void {} 36 foo(bar); 42 function foo(a: BarType[]) {} 46 foo(arr); 50 function foo(a: Long) {} 52 foo(new Long()) [all …]
|
| /arkcompiler/runtime_core/static_core/plugins/ets/tests/ets-templates/04.names_declarations_and_scopes/08.function_declarations/09.function_overload_signatures/ |
| D | overload_neg.params.yaml | 18 function foo(): string; 19 function foo(a: string): string; 20 function foo(a: string, b: string): string; 22 foo(); 26 function foo(): string; 27 function foo(a: string, b: string): string; 31 function foo(a?: string, b?:string): string { 35 foo() 39 function foo(): string; 40 function foo(a: string, b: string): string; [all …]
|