diff --git a/plugins/ets/tests/ets-templates/17.experimental_features/14.packages/07.shadowing_of_function_names/shadow_function_alias.ets b/plugins/ets/tests/ets-templates/17.experimental_features/14.packages/07.shadowing_of_function_names/shadow_function_alias.ets new file mode 100644 index 0000000000000000000000000000000000000000..b1ef412653df7620f4930aef3e0e2e72543e149b --- /dev/null +++ b/plugins/ets/tests/ets-templates/17.experimental_features/14.packages/07.shadowing_of_function_names/shadow_function_alias.ets @@ -0,0 +1,17 @@ +/*--- +desc: >- + Shadowing is the compile-time error that occurs if an imported function is identical to the function declared in the + current compilation unit (the same names and override-equivalent signatures), i.e., the declarations are duplicated. +tags: [compile-only, negative] +---*/ + +import {max as mymax} from "std/math"; + +function mymax(v: double, u: double): double { + assert false + return v > u ? v : u; +} + +function main(): void { + mymax(1.0, 1.0) +} diff --git a/plugins/ets/tests/ets-templates/17.experimental_features/14.packages/07.shadowing_of_function_names/shadow_function_explicit_name.ets b/plugins/ets/tests/ets-templates/17.experimental_features/14.packages/07.shadowing_of_function_names/shadow_function_explicit_name.ets new file mode 100644 index 0000000000000000000000000000000000000000..6c6b04e88ffc4a4d85bf3e8beeb361127aeb519d --- /dev/null +++ b/plugins/ets/tests/ets-templates/17.experimental_features/14.packages/07.shadowing_of_function_names/shadow_function_explicit_name.ets @@ -0,0 +1,17 @@ +/*--- +desc: >- + Shadowing is the compile-time error that occurs if an imported function is identical to the function declared in the + current compilation unit (the same names and override-equivalent signatures), i.e., the declarations are duplicated. +tags: [compile-only, negative] +---*/ + +import {max} from "std/math"; + +function max(v: double, u: double): double { + assert false + return v > u ? v : u; +} + +function main(): void { + max(1.0, 1.0) +} diff --git a/plugins/ets/tests/ets-templates/17.experimental_features/14.packages/07.shadowing_of_function_names/shadow_function_name.ets b/plugins/ets/tests/ets-templates/17.experimental_features/14.packages/07.shadowing_of_function_names/shadow_function_name.ets new file mode 100644 index 0000000000000000000000000000000000000000..c44fbbc7f7f1e742dc752fd908cd7eadaf9fd21e --- /dev/null +++ b/plugins/ets/tests/ets-templates/17.experimental_features/14.packages/07.shadowing_of_function_names/shadow_function_name.ets @@ -0,0 +1,17 @@ +/*--- +desc: >- + Shadowing is the compile-time error that occurs if an imported function is identical to the function declared in the + current compilation unit (the same names and override-equivalent signatures), i.e., the declarations are duplicated. +tags: [compile-only, negative] +---*/ + +import * from "std/math"; + +function min(v: double, u: double): double { + assert false + return v < u ? v : u; +} + +function main(): void { + min(1.0, 1.0) +} diff --git a/tests/tests-u-runner/runner/plugins/ets/ets-cts-ignored.txt b/tests/tests-u-runner/runner/plugins/ets/ets-cts-ignored.txt index 63e4c0c49232734230940012901102777cc5a7f5..c97340bf5fc4600aeced549f4b91f3baaed8f27d 100644 --- a/tests/tests-u-runner/runner/plugins/ets/ets-cts-ignored.txt +++ b/tests/tests-u-runner/runner/plugins/ets/ets-cts-ignored.txt @@ -1935,3 +1935,6 @@ 04.names_declarations_and_scopes/08.function_declarations/03.optional_parameters/opt_param_n_10.ets # end of es2panda fails +17.experimental_features/14.packages/07.shadowing_of_function_names/shadow_function_name.ets +17.experimental_features/14.packages/07.shadowing_of_function_names/shadow_function_explicit_name.ets +17.experimental_features/14.packages/07.shadowing_of_function_names/shadow_function_alias.ets