diff --git a/CHANGELOG.md b/CHANGELOG.md index 9f12f9b13..bcaf0bcf3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,9 @@ # Change Log ## [Unreleased version] - 20XX-XX-XX +### Breaking changes +- Function arguments are now immutable by default and an argument attribute `mut` must be added: `(fun (a b c) (set b 5))` -> `(fun (a (mut b) c) (set b 5))` + ### Added - new builtin `disassemble` to print the bytecode of a function - new builtin `io:readFileLines` to read lines from a file as a list of strings diff --git a/include/Ark/Error/Exceptions.hpp b/include/Ark/Error/Exceptions.hpp index b17b60de3..898bbd5b8 100644 --- a/include/Ark/Error/Exceptions.hpp +++ b/include/Ark/Error/Exceptions.hpp @@ -22,6 +22,8 @@ namespace Ark { + class VM; + namespace internal { class Node; @@ -34,7 +36,7 @@ namespace Ark std::runtime_error(message) {} - [[nodiscard]] virtual std::string details(bool colorize [[maybe_unused]]) const + [[nodiscard]] virtual std::string details(bool colorize [[maybe_unused]], VM& vm [[maybe_unused]]) const { return what(); } @@ -67,9 +69,9 @@ namespace Ark class ARK_API NestedError final : public Error { public: - NestedError(const Error& e, const std::string& details) : + NestedError(const Error& e, const std::string& details, VM& vm) : Error("NestedError"), - m_details(e.details(/* colorize= */ false)) + m_details(e.details(/* colorize= */ false, vm)) { if (!m_details.empty() && m_details.back() != '\n') m_details += '\n'; diff --git a/include/Ark/TypeChecker.hpp b/include/Ark/TypeChecker.hpp index 7f45a88c8..601e2aaa0 100644 --- a/include/Ark/TypeChecker.hpp +++ b/include/Ark/TypeChecker.hpp @@ -19,6 +19,11 @@ #include #include +namespace Ark +{ + class VM; +} + namespace Ark::types { namespace details @@ -92,6 +97,7 @@ namespace Ark::types * @param funcname ArkScript name of the function * @param contracts types contracts the function can follow * @param args provided argument list + * @param vm reference to the VM used for pretty printing closures * @param os output stream, default to cout * @param colorize enable output colorizing */ @@ -99,6 +105,7 @@ namespace Ark::types const std::string_view& funcname, const std::vector& contracts, const std::vector& args, + VM& vm, std::ostream& os = std::cout, bool colorize = true); @@ -112,10 +119,10 @@ namespace Ark::types m_passed_args(args) {} - [[nodiscard]] std::string details(const bool colorize) const override + [[nodiscard]] std::string details(const bool colorize, VM& vm) const override { std::stringstream stream; - generateError(m_funcname, m_contracts, m_passed_args, stream, colorize); + generateError(m_funcname, m_contracts, m_passed_args, vm, stream, colorize); return stream.str(); } diff --git a/lib/std b/lib/std index 4860f9d4d..5caac41e9 160000 --- a/lib/std +++ b/lib/std @@ -1 +1 @@ -Subproject commit 4860f9d4d76fec2740acd51450bf56361b7c0049 +Subproject commit 5caac41e9dffca7d09a7cf5cc1f07abf672ce5da diff --git a/src/arkreactor/TypeChecker.cpp b/src/arkreactor/TypeChecker.cpp index d13b31994..45a6b1e21 100644 --- a/src/arkreactor/TypeChecker.cpp +++ b/src/arkreactor/TypeChecker.cpp @@ -7,6 +7,8 @@ #include #include +#include + namespace Ark::types { std::string typeListToString(const std::vector& types) @@ -20,13 +22,18 @@ namespace Ark::types { if (i > 0) acc += ", "; + if (i + 1 == end && types.size() > 1) + acc += "or "; acc += std::to_string(types[i]); } return acc; } - void displayContract(const Contract& contract, const std::vector& args, std::ostream& os, const bool colorize) + void displayContract(const std::string_view& funcname, const Contract& contract, const std::vector& args, VM& vm, std::ostream& os, const bool colorize) { + const std::string checkmark = "✓"; + const std::string crossmark = "×"; + auto displayArg = [colorize, &os](const Typedef& td, const bool correct) { const std::string arg_str = typeListToString(td.types); @@ -43,9 +50,14 @@ namespace Ark::types store.push_back(td.name); store.push_back(arg_str); - fmt::vprint(os, " -> {}{} ({})", store); + fmt::vprint(os, " → {}`{}' (expected {})", store); }; + fmt::print(os, "Signature\n ↳ ({}", funcname); + for (const Typedef& td : contract.arguments) + fmt::print(os, " {}", td.name); + fmt::print(os, ")\nArguments\n"); + for (std::size_t i = 0, end = contract.arguments.size(); i < end; ++i) { const Typedef& td = contract.arguments[i]; @@ -53,25 +65,36 @@ namespace Ark::types if (td.variadic && i < args.size()) { // variadic argument in contract and enough provided arguments - std::size_t bad_type = 0; + std::size_t bad_type_count = 0; + std::string formatted_varargs; for (std::size_t j = i, args_end = args.size(); j < args_end; ++j) { + bool type_ok = true; if (td.types[0] != ValueType::Any && std::ranges::find(td.types, args[j].valueType()) == td.types.end()) - bad_type++; + { + bad_type_count++; + type_ok = false; + } + formatted_varargs += fmt::format( + "\n {} ({}) {}", + args[j].toString(vm), + std::to_string(args[j].valueType()), + type_ok ? checkmark : crossmark); } - if (bad_type) + if (bad_type_count) { displayArg(td, /* correct= */ false); fmt::dynamic_format_arg_store store; if (colorize) - store.push_back(fmt::styled(bad_type, fmt::fg(fmt::color::red))); + store.push_back(fmt::styled(bad_type_count, fmt::fg(fmt::color::red))); else - store.push_back(bad_type); - store.push_back(bad_type > 1 ? "s" : ""); + store.push_back(bad_type_count); + store.push_back(bad_type_count > 1 ? "s" : ""); + store.push_back(formatted_varargs); - fmt::vprint(os, " {} argument{} do not match", store); + fmt::vprint(os, ": {} argument{} do not match:{}", store); } else displayArg(td, /* correct= */ true); @@ -85,11 +108,12 @@ namespace Ark::types const auto type = std::to_string(args[i].valueType()); fmt::dynamic_format_arg_store store; + store.push_back(args[i].toString(vm)); if (colorize) store.push_back(fmt::styled(type, fmt::fg(fmt::color::red))); else store.push_back(type); - fmt::vprint(os, " was of type {}", store); + fmt::vprint(os, ", got {} ({})", store); } // non-provided argument else if (i >= args.size()) @@ -101,13 +125,28 @@ namespace Ark::types fmt::print(os, " was not provided"); } else + { displayArg(td, /* correct= */ true); + fmt::print(os, " {}", checkmark); + } + } + fmt::print(os, "\n"); + } + + if (contract.arguments.size() < args.size()) + { + fmt::print(os, " → unexpected additional args: "); + for (std::size_t i = contract.arguments.size(), end = args.size(); i < end; ++i) + { + fmt::print(os, "{} ({})", args[i].toString(vm), std::to_string(args[i].valueType())); + if (i + 1 != end) + fmt::print(os, ", "); } fmt::print(os, "\n"); } } - void generateError(const std::string_view& funcname, const std::vector& contracts, const std::vector& args, std::ostream& os, bool colorize) + void generateError(const std::string_view& funcname, const std::vector& contracts, const std::vector& args, VM& vm, std::ostream& os, bool colorize) { { fmt::dynamic_format_arg_store store; @@ -183,13 +222,16 @@ namespace Ark::types fmt::print(os, " {} got {}", preposition, sanitizedArgs.size()); } - fmt::print(os, "\n"); + fmt::print(os, "\nCall\n ↳ ({}", funcname); + for (const Value& arg : args) + fmt::print(os, " {}", arg.toString(vm)); + fmt::print(os, ")\n"); - displayContract(contracts[0], sanitizedArgs, os, colorize); + displayContract(funcname, contracts[0], sanitizedArgs, vm, os, colorize); for (std::size_t i = 1, end = contracts.size(); i < end; ++i) { - fmt::print(os, "Alternative {}:\n", i + 1); - displayContract(contracts[i], sanitizedArgs, os, colorize); + fmt::print(os, "\nAlternative {}:\n", i + 1); + displayContract(funcname, contracts[i], sanitizedArgs, vm, os, colorize); } } } diff --git a/src/arkreactor/VM/VM.cpp b/src/arkreactor/VM/VM.cpp index 1f8f7d30d..91eb7eb05 100644 --- a/src/arkreactor/VM/VM.cpp +++ b/src/arkreactor/VM/VM.cpp @@ -1997,10 +1997,10 @@ namespace Ark backtrace(context, stream, /* colorize= */ false); // It's important we have an Ark::Error here, as the constructor for NestedError // does more than just aggregate error messages, hence the code duplication. - throw NestedError(e, stream.str()); + throw NestedError(e, stream.str(), *this); } else - showBacktraceWithException(Error(e.details(/* colorize= */ true)), context); + showBacktraceWithException(Error(e.details(/* colorize= */ true, *this)), context); } catch (const std::exception& e) { diff --git a/tests/unittests/Main.cpp b/tests/unittests/Main.cpp index 66f53e45f..e666fb872 100644 --- a/tests/unittests/Main.cpp +++ b/tests/unittests/Main.cpp @@ -2,6 +2,8 @@ #include #include +#include + #include #include @@ -9,8 +11,11 @@ int main(const int argc, char** argv) { using namespace boost; + if (argc == 2 && std::string(argv[1]) == "update") + shouldWriteNewDiffsTofile(true); + std::string filter = "*"; - if (argc >= 2) + if (argc >= 2 && std::string(argv[1]) != "update") filter = argv[1]; bool failed = false; diff --git a/tests/unittests/Suites/DiagnosticsSuite.cpp b/tests/unittests/Suites/DiagnosticsSuite.cpp index d4b04ebd5..1f6a54f43 100644 --- a/tests/unittests/Suites/DiagnosticsSuite.cpp +++ b/tests/unittests/Suites/DiagnosticsSuite.cpp @@ -28,6 +28,8 @@ ut::suite<"Diagnostics"> diagnostics_suite = [] { std::string diag = sanitizeCodeError(e, /* remove_in_file_line= */ true); Ark::Utils::rtrim(diag); expectOrDiff(data.expected, diag); + if (shouldWriteNewDiffsTofile() && data.expected != diag) + updateExpectedFile(data, diag); } }; }); @@ -52,6 +54,8 @@ ut::suite<"Diagnostics"> diagnostics_suite = [] { { std::string diag = sanitizeRuntimeError(e); expectOrDiff(data.expected, diag); + if (shouldWriteNewDiffsTofile() && data.expected != diag) + updateExpectedFile(data, diag); } }; }); @@ -76,6 +80,8 @@ ut::suite<"Diagnostics"> diagnostics_suite = [] { { std::string diag = sanitizeRuntimeError(e); expectOrDiff(data.expected, diag); + if (shouldWriteNewDiffsTofile() && data.expected != diag) + updateExpectedFile(data, diag); } }; }); diff --git a/tests/unittests/Suites/TypeCheckerSuite.cpp b/tests/unittests/Suites/TypeCheckerSuite.cpp index 4ad04339a..96330e850 100644 --- a/tests/unittests/Suites/TypeCheckerSuite.cpp +++ b/tests/unittests/Suites/TypeCheckerSuite.cpp @@ -5,6 +5,8 @@ #include #include +#include +#include #include #include #include @@ -207,17 +209,22 @@ ut::suite<"TypeChecker"> type_checker_suite = [] { } should("generate error message " + data.stem) = [inputs, contracts, data] { + Ark::State dummy_state; + Ark::VM dummy_VM(dummy_state); std::stringstream stream; Ark::types::generateError( inputs.front().func, contracts, inputs.front().given_args, + dummy_VM, stream, /* colorize= */ false); auto result = stream.str(); Ark::Utils::rtrim(Ark::Utils::ltrim(result)); expectOrDiff(data.expected, result); + if (shouldWriteNewDiffsTofile() && data.expected != result) + updateExpectedFile(data, result); }; }, { .skip_folders = false }); diff --git a/tests/unittests/TestsHelper.cpp b/tests/unittests/TestsHelper.cpp index b66a9f8be..2643fb9ba 100644 --- a/tests/unittests/TestsHelper.cpp +++ b/tests/unittests/TestsHelper.cpp @@ -6,6 +6,28 @@ #include #include +bool shouldWriteNewDiffsTofile(const std::optional should) +{ + static bool update = false; + if (should.has_value()) + update = should.value(); + + return update; +} + +void updateExpectedFile(const TestData& data, const std::string& actual) +{ + std::filesystem::path expected_path = data.path; + expected_path.replace_extension("expected"); + + std::ofstream f(expected_path.generic_string()); + if (f.is_open()) + { + f << actual; + f.close(); + } +} + void iterTestFiles(const std::string& folder, std::function&& test, IterTestFilesParam&& params) { boost::ut::test(folder) = [&] { diff --git a/tests/unittests/TestsHelper.hpp b/tests/unittests/TestsHelper.hpp index a69e211a6..541711c18 100644 --- a/tests/unittests/TestsHelper.hpp +++ b/tests/unittests/TestsHelper.hpp @@ -21,6 +21,13 @@ const auto lib_path = std::filesystem::path(ARK_TESTS_ROOT "/lib/"); const auto unittests_path = std::filesystem::path(ARK_TESTS_ROOT "/tests/unittests/"); +/** + * @brief Check if the tests should update their dataset + * @param should used by Main.cpp to toggle on/off the updating mechanism + * @return true if the tests should write the actual data to the 'expected' file + */ +bool shouldWriteNewDiffsTofile(std::optional should = std::nullopt); + struct TestData { std::string path; ///< The file we are testing, eg tests/unittests/resources/ASTSuite/testname.ark @@ -37,6 +44,8 @@ struct IterTestFilesParam bool ignore_expected = false; }; +void updateExpectedFile(const TestData& data, const std::string& actual); + /** * @brief Iterate over the files inside a folder, looking for "name.ark" & "name.expected" files to create a TestData structure * @param folder folder to list files in diff --git a/tests/unittests/resources/DiagnosticsSuite/runtime/async_number.expected b/tests/unittests/resources/DiagnosticsSuite/runtime/async_number.expected index acce557e7..147e8ddf0 100644 --- a/tests/unittests/resources/DiagnosticsSuite/runtime/async_number.expected +++ b/tests/unittests/resources/DiagnosticsSuite/runtime/async_number.expected @@ -1,10 +1,19 @@ Function async expected between 1 argument and 2 arguments and got 1 - -> function (Function, CProc, Closure) was of type Number - -> variadic args (any) was not provided +Call + ↳ (async 1) +Signature + ↳ (async function args) +Arguments + → `function' (expected Function, CProc, or Closure), got 1 (Number) + → variadic `args' (expected any) was not provided + Alternative 2: - -> function (Function, CProc, Closure) was of type Number +Signature + ↳ (async function) +Arguments + → `function' (expected Function, CProc, or Closure), got 1 (Number) In file tests/unittests/resources/DiagnosticsSuite/runtime/async_number.ark:1 1 | (async 1) | ^~~~~~~~ - 2 | + 2 | \ No newline at end of file diff --git a/tests/unittests/resources/DiagnosticsSuite/runtime/backtrace_builtin.expected b/tests/unittests/resources/DiagnosticsSuite/runtime/backtrace_builtin.expected index f011910db..b99a50a35 100644 --- a/tests/unittests/resources/DiagnosticsSuite/runtime/backtrace_builtin.expected +++ b/tests/unittests/resources/DiagnosticsSuite/runtime/backtrace_builtin.expected @@ -1,5 +1,10 @@ Function list:sort expected 1 argument - -> list (List) was of type String +Call + ↳ (list:sort live) +Signature + ↳ (list:sort list) +Arguments + → `list' (expected List), got live (String) In file /lib/std/List.ark:51 48 | # (list:sort [4 2 3]) # [1 2 4] @@ -13,4 +18,4 @@ In file /lib/std/List.ark:51 [ 2] In function `list:sort' (/lib/std/List.ark:51) [ 1] In global scope (tests/unittests/resources/DiagnosticsSuite/runtime/backtrace_builtin.ark:3) -Current scope variables values: +Current scope variables values: \ No newline at end of file diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/add_num_str.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/add_num_str.expected index d9afdf6bc..e0a56542d 100644 --- a/tests/unittests/resources/DiagnosticsSuite/typeChecking/add_num_str.expected +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/add_num_str.expected @@ -1,11 +1,20 @@ Function + expected 2 arguments - -> a (Number) - -> b (Number) was of type String +Call + ↳ (+ 1 2) +Signature + ↳ (+ a b) +Arguments + → `a' (expected Number) ✓ + → `b' (expected Number), got 2 (String) + Alternative 2: - -> a (String) was of type Number - -> b (String) +Signature + ↳ (+ a b) +Arguments + → `a' (expected String), got 1 (Number) + → `b' (expected String) ✓ In file tests/unittests/resources/DiagnosticsSuite/typeChecking/add_num_str.ark:1 1 | (+ 1 "2") | ^~~~~~~~ - 2 | + 2 | \ No newline at end of file diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/append_in_place_num_num.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/append_in_place_num_num.expected index edad9617b..90dbb84c9 100644 --- a/tests/unittests/resources/DiagnosticsSuite/typeChecking/append_in_place_num_num.expected +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/append_in_place_num_num.expected @@ -1,9 +1,14 @@ Function append! expected at least 2 arguments and got 2 - -> list (List) was of type Number - -> variadic value (any) +Call + ↳ (append! 1 5) +Signature + ↳ (append! list value) +Arguments + → `list' (expected List), got 1 (Number) + → variadic `value' (expected any) In file tests/unittests/resources/DiagnosticsSuite/typeChecking/append_in_place_num_num.ark:2 1 | (mut L 1) 2 | (append! L 5) | ^~~~~~~~~~~~ - 3 | + 3 | \ No newline at end of file diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/append_num_num.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/append_num_num.expected index 5ad4e3524..6fd8c8b6e 100644 --- a/tests/unittests/resources/DiagnosticsSuite/typeChecking/append_num_num.expected +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/append_num_num.expected @@ -1,8 +1,13 @@ Function append expected at least 2 arguments and got 2 - -> list (List) was of type Number - -> variadic value (any) +Call + ↳ (append 1 3) +Signature + ↳ (append list value) +Arguments + → `list' (expected List), got 1 (Number) + → variadic `value' (expected any) In file tests/unittests/resources/DiagnosticsSuite/typeChecking/append_num_num.ark:1 1 | (append 1 3) | ^~~~~~~~~~~ - 2 | + 2 | \ No newline at end of file diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/assert_num_num.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/assert_num_num.expected index 9e1c73961..80f297d9c 100644 --- a/tests/unittests/resources/DiagnosticsSuite/typeChecking/assert_num_num.expected +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/assert_num_num.expected @@ -1,8 +1,13 @@ Function assert expected 2 arguments - -> expr (any) - -> message (String) was of type Number +Call + ↳ (assert 1 2) +Signature + ↳ (assert expr message) +Arguments + → `expr' (expected any) ✓ + → `message' (expected String), got 2 (Number) In file tests/unittests/resources/DiagnosticsSuite/typeChecking/assert_num_num.ark:1 1 | (assert 1 2) | ^~~~~~~~~~~ - 2 | + 2 | \ No newline at end of file diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/at_at_eq_list_num_num_num.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/at_at_eq_list_num_num_num.expected index 2fb310358..66aa31f97 100644 --- a/tests/unittests/resources/DiagnosticsSuite/typeChecking/at_at_eq_list_num_num_num.expected +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/at_at_eq_list_num_num_num.expected @@ -1,15 +1,24 @@ Function @@= expected 4 arguments - -> list (List) - -> x (Number) - -> y (Number) - -> new_value (any) +Call + ↳ (@@= [1 2 3 4] 0 1 4) +Signature + ↳ (@@= list x y new_value) +Arguments + → `list' (expected List) ✓ + → `x' (expected Number) ✓ + → `y' (expected Number) ✓ + → `new_value' (expected any) ✓ + Alternative 2: - -> string (String) was of type List - -> x (Number) - -> y (Number) - -> char (String) was of type Number +Signature + ↳ (@@= string x y char) +Arguments + → `string' (expected String), got [1 2 3 4] (List) + → `x' (expected Number) ✓ + → `y' (expected Number) ✓ + → `char' (expected String), got 4 (Number) In file tests/unittests/resources/DiagnosticsSuite/typeChecking/at_at_eq_list_num_num_num.ark:1 1 | (@@= [1 2 3 4] 0 1 4) | ^~~~~~~~~~~~~~~~~~~~ - 2 | + 2 | \ No newline at end of file diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/at_at_eq_num_num_num_num.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/at_at_eq_num_num_num_num.expected index a30f1e133..689e9e1ff 100644 --- a/tests/unittests/resources/DiagnosticsSuite/typeChecking/at_at_eq_num_num_num_num.expected +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/at_at_eq_num_num_num_num.expected @@ -1,10 +1,15 @@ Function @@= expected 4 arguments - -> list (List) was of type Number - -> x (Number) - -> y (Number) - -> new_value (any) +Call + ↳ (@@= 1 2 3 4) +Signature + ↳ (@@= list x y new_value) +Arguments + → `list' (expected List), got 1 (Number) + → `x' (expected Number) ✓ + → `y' (expected Number) ✓ + → `new_value' (expected any) ✓ In file tests/unittests/resources/DiagnosticsSuite/typeChecking/at_at_eq_num_num_num_num.ark:1 1 | (@@= 1 2 3 4) | ^~~~~~~~~~~~ - 2 | + 2 | \ No newline at end of file diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/at_at_num_num_num.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/at_at_num_num_num.expected index 05cdf5b0d..8221a9440 100644 --- a/tests/unittests/resources/DiagnosticsSuite/typeChecking/at_at_num_num_num.expected +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/at_at_num_num_num.expected @@ -1,9 +1,14 @@ Function @@ expected 3 arguments - -> src (List) was of type Number - -> y (Number) - -> x (Number) +Call + ↳ (@@ 1 2 3) +Signature + ↳ (@@ src y x) +Arguments + → `src' (expected List), got 1 (Number) + → `y' (expected Number) ✓ + → `x' (expected Number) ✓ In file tests/unittests/resources/DiagnosticsSuite/typeChecking/at_at_num_num_num.ark:1 1 | (@@ 1 2 3) | ^~~~~~~~~ - 2 | + 2 | \ No newline at end of file diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/at_eq_num_num_num.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/at_eq_num_num_num.expected index 7b33c8519..eeefba288 100644 --- a/tests/unittests/resources/DiagnosticsSuite/typeChecking/at_eq_num_num_num.expected +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/at_eq_num_num_num.expected @@ -1,13 +1,22 @@ Function @= expected 3 arguments - -> list (List) was of type Number - -> index (Number) - -> new_value (any) +Call + ↳ (@= 1 2 3) +Signature + ↳ (@= list index new_value) +Arguments + → `list' (expected List), got 1 (Number) + → `index' (expected Number) ✓ + → `new_value' (expected any) ✓ + Alternative 2: - -> string (String) was of type Number - -> index (Number) - -> char (String) was of type Number +Signature + ↳ (@= string index char) +Arguments + → `string' (expected String), got 1 (Number) + → `index' (expected Number) ✓ + → `char' (expected String), got 3 (Number) In file tests/unittests/resources/DiagnosticsSuite/typeChecking/at_eq_num_num_num.ark:1 1 | (@= 1 2 3) | ^~~~~~~~~ - 2 | + 2 | \ No newline at end of file diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/at_list_str.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/at_list_str.expected index a0dd0f611..3694ef6f8 100644 --- a/tests/unittests/resources/DiagnosticsSuite/typeChecking/at_list_str.expected +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/at_list_str.expected @@ -1,11 +1,20 @@ Function @ expected 2 arguments - -> src (List) - -> idx (Number) was of type String +Call + ↳ (@ [] 1) +Signature + ↳ (@ src idx) +Arguments + → `src' (expected List) ✓ + → `idx' (expected Number), got 1 (String) + Alternative 2: - -> src (String) was of type List - -> idx (Number) was of type String +Signature + ↳ (@ src idx) +Arguments + → `src' (expected String), got [] (List) + → `idx' (expected Number), got 1 (String) In file tests/unittests/resources/DiagnosticsSuite/typeChecking/at_list_str.ark:1 1 | (@ [] "1") | ^~~~~~~~~ - 2 | + 2 | \ No newline at end of file diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/at_num_num.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/at_num_num.expected index 64c6e62fa..47efb37e0 100644 --- a/tests/unittests/resources/DiagnosticsSuite/typeChecking/at_num_num.expected +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/at_num_num.expected @@ -1,11 +1,20 @@ Function @ expected 2 arguments - -> src (List) was of type Number - -> idx (Number) +Call + ↳ (@ 1 2) +Signature + ↳ (@ src idx) +Arguments + → `src' (expected List), got 1 (Number) + → `idx' (expected Number) ✓ + Alternative 2: - -> src (String) was of type Number - -> idx (Number) +Signature + ↳ (@ src idx) +Arguments + → `src' (expected String), got 1 (Number) + → `idx' (expected Number) ✓ In file tests/unittests/resources/DiagnosticsSuite/typeChecking/at_num_num.ark:1 1 | (@ 1 2) | ^~~~~~ - 2 | + 2 | \ No newline at end of file diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/await_num.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/await_num.expected index dd7ad48cd..12908df31 100644 --- a/tests/unittests/resources/DiagnosticsSuite/typeChecking/await_num.expected +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/await_num.expected @@ -1,7 +1,12 @@ Function await expected 1 argument - -> future (UserType) was of type Number +Call + ↳ (await 1) +Signature + ↳ (await future) +Arguments + → `future' (expected UserType), got 1 (Number) In file tests/unittests/resources/DiagnosticsSuite/typeChecking/await_num.ark:1 1 | (await 1) | ^~~~~~~~ - 2 | + 2 | \ No newline at end of file diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/concat_in_place_list_num.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/concat_in_place_list_num.expected index c0a26d9ea..3715a5402 100644 --- a/tests/unittests/resources/DiagnosticsSuite/typeChecking/concat_in_place_list_num.expected +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/concat_in_place_list_num.expected @@ -1,9 +1,14 @@ Function concat! expected 2 arguments - -> dst (List) - -> src (List) was of type Number +Call + ↳ (concat! [] 5) +Signature + ↳ (concat! dst src) +Arguments + → `dst' (expected List) ✓ + → `src' (expected List), got 5 (Number) In file tests/unittests/resources/DiagnosticsSuite/typeChecking/concat_in_place_list_num.ark:2 1 | (mut L []) 2 | (concat! L 5) | ^~~~~~~~~~~~ - 3 | + 3 | \ No newline at end of file diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/concat_in_place_num_num.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/concat_in_place_num_num.expected index f6e239abf..88edfcdb0 100644 --- a/tests/unittests/resources/DiagnosticsSuite/typeChecking/concat_in_place_num_num.expected +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/concat_in_place_num_num.expected @@ -1,9 +1,14 @@ Function concat! expected 2 arguments - -> dst (List) was of type Number - -> src (List) was of type Number +Call + ↳ (concat! 1 5) +Signature + ↳ (concat! dst src) +Arguments + → `dst' (expected List), got 1 (Number) + → `src' (expected List), got 5 (Number) In file tests/unittests/resources/DiagnosticsSuite/typeChecking/concat_in_place_num_num.ark:2 1 | (mut L 1) 2 | (concat! L 5) | ^~~~~~~~~~~~ - 3 | + 3 | \ No newline at end of file diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/concat_list_num.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/concat_list_num.expected index 15822e372..17d54f405 100644 --- a/tests/unittests/resources/DiagnosticsSuite/typeChecking/concat_list_num.expected +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/concat_list_num.expected @@ -1,8 +1,13 @@ Function concat expected 2 arguments - -> dst (List) - -> src (List) was of type Number +Call + ↳ (concat [1] 3) +Signature + ↳ (concat dst src) +Arguments + → `dst' (expected List) ✓ + → `src' (expected List), got 3 (Number) In file tests/unittests/resources/DiagnosticsSuite/typeChecking/concat_list_num.ark:1 1 | (concat [1] 3) | ^~~~~~~~~~~~~ - 2 | + 2 | \ No newline at end of file diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/concat_num_num.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/concat_num_num.expected index aa2cc5515..e8eb6659a 100644 --- a/tests/unittests/resources/DiagnosticsSuite/typeChecking/concat_num_num.expected +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/concat_num_num.expected @@ -1,8 +1,13 @@ Function concat expected 2 arguments - -> dst (List) was of type Number - -> src (List) was of type Number +Call + ↳ (concat 1 3) +Signature + ↳ (concat dst src) +Arguments + → `dst' (expected List), got 1 (Number) + → `src' (expected List), got 3 (Number) In file tests/unittests/resources/DiagnosticsSuite/typeChecking/concat_num_num.ark:1 1 | (concat 1 3) | ^~~~~~~~~~~ - 2 | + 2 | \ No newline at end of file diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/decrement_index_str_num.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/decrement_index_str_num.expected index 814125b51..3f3722268 100644 --- a/tests/unittests/resources/DiagnosticsSuite/typeChecking/decrement_index_str_num.expected +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/decrement_index_str_num.expected @@ -1,6 +1,11 @@ Function - expected 2 arguments - -> a (Number) was of type String - -> b (Number) was of type Function +Call + ↳ (- 0 Function@1) +Signature + ↳ (- a b) +Arguments + → `a' (expected Number), got 0 (String) + → `b' (expected Number), got Function@1 (Function) In file tests/unittests/resources/DiagnosticsSuite/typeChecking/decrement_index_str_num.ark:2 1 | (mut i "0") @@ -11,4 +16,4 @@ In file tests/unittests/resources/DiagnosticsSuite/typeChecking/decrement_index_ [ 2] In function `???' (tests/unittests/resources/DiagnosticsSuite/typeChecking/decrement_index_str_num.ark:2) [ 1] In global scope (tests/unittests/resources/DiagnosticsSuite/typeChecking/decrement_index_str_num.ark:2) -Current scope variables values: +Current scope variables values: \ No newline at end of file diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/decrement_store_str_num.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/decrement_store_str_num.expected index 70cbdd919..6feba0584 100644 --- a/tests/unittests/resources/DiagnosticsSuite/typeChecking/decrement_store_str_num.expected +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/decrement_store_str_num.expected @@ -1,6 +1,11 @@ Function - expected 2 arguments - -> a (Number) was of type String - -> b (Number) was of type Function +Call + ↳ (- 0 Function@1) +Signature + ↳ (- a b) +Arguments + → `a' (expected Number), got 0 (String) + → `b' (expected Number), got Function@1 (Function) In file tests/unittests/resources/DiagnosticsSuite/typeChecking/decrement_store_str_num.ark:2 1 | (mut i "0") @@ -11,4 +16,4 @@ In file tests/unittests/resources/DiagnosticsSuite/typeChecking/decrement_store_ [ 2] In function `???' (tests/unittests/resources/DiagnosticsSuite/typeChecking/decrement_store_str_num.ark:2) [ 1] In global scope (tests/unittests/resources/DiagnosticsSuite/typeChecking/decrement_store_str_num.ark:2) -Current scope variables values: +Current scope variables values: \ No newline at end of file diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/decrement_str_num.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/decrement_str_num.expected index e312d805a..a73800d8c 100644 --- a/tests/unittests/resources/DiagnosticsSuite/typeChecking/decrement_str_num.expected +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/decrement_str_num.expected @@ -1,9 +1,14 @@ Function - expected 2 arguments - -> a (Number) was of type String - -> b (Number) was of type Function +Call + ↳ (- 1 Function@1) +Signature + ↳ (- a b) +Arguments + → `a' (expected Number), got 1 (String) + → `b' (expected Number), got Function@1 (Function) In file tests/unittests/resources/DiagnosticsSuite/typeChecking/decrement_str_num.ark:2 1 | (mut n "1") 2 | (set n (- n 1)) | ^~~~~~~~~~~~~~ - 3 | + 3 | \ No newline at end of file diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/dict_add_num.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/dict_add_num.expected index e125090dc..c6881c909 100644 --- a/tests/unittests/resources/DiagnosticsSuite/typeChecking/dict_add_num.expected +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/dict_add_num.expected @@ -1,9 +1,14 @@ Function dict:add expected 3 arguments but got 1 - -> dictionary (Dict) was of type Number - -> key (any) was not provided - -> value (any) was not provided +Call + ↳ (dict:add 1) +Signature + ↳ (dict:add dictionary key value) +Arguments + → `dictionary' (expected Dict), got 1 (Number) + → `key' (expected any) was not provided + → `value' (expected any) was not provided In file tests/unittests/resources/DiagnosticsSuite/typeChecking/dict_add_num.ark:1 1 | (builtin__dict:add 1) | ^~~~~~~~~~~~~~~~~~~~ - 2 | + 2 | \ No newline at end of file diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/dict_contains_num.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/dict_contains_num.expected index 9b2d4696f..5bf74e55c 100644 --- a/tests/unittests/resources/DiagnosticsSuite/typeChecking/dict_contains_num.expected +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/dict_contains_num.expected @@ -1,8 +1,13 @@ Function dict:contains? expected 2 arguments but got 1 - -> dictionary (Dict) was of type Number - -> key (any) was not provided +Call + ↳ (dict:contains? 1) +Signature + ↳ (dict:contains? dictionary key) +Arguments + → `dictionary' (expected Dict), got 1 (Number) + → `key' (expected any) was not provided In file tests/unittests/resources/DiagnosticsSuite/typeChecking/dict_contains_num.ark:1 1 | (builtin__dict:contains 1) | ^~~~~~~~~~~~~~~~~~~~~~~~~ - 2 | + 2 | \ No newline at end of file diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/dict_get_num.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/dict_get_num.expected index c7ae95cb4..01172108e 100644 --- a/tests/unittests/resources/DiagnosticsSuite/typeChecking/dict_get_num.expected +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/dict_get_num.expected @@ -1,8 +1,13 @@ Function dict:get expected 2 arguments but got 1 - -> dictionary (Dict) was of type Number - -> key (any) was not provided +Call + ↳ (dict:get 1) +Signature + ↳ (dict:get dictionary key) +Arguments + → `dictionary' (expected Dict), got 1 (Number) + → `key' (expected any) was not provided In file tests/unittests/resources/DiagnosticsSuite/typeChecking/dict_get_num.ark:1 1 | (builtin__dict:get 1) | ^~~~~~~~~~~~~~~~~~~~ - 2 | + 2 | \ No newline at end of file diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/dict_keys_num.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/dict_keys_num.expected index ecf7691c9..561774386 100644 --- a/tests/unittests/resources/DiagnosticsSuite/typeChecking/dict_keys_num.expected +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/dict_keys_num.expected @@ -1,7 +1,12 @@ Function dict:keys expected 1 argument - -> dictionary (Dict) was of type Number +Call + ↳ (dict:keys 1) +Signature + ↳ (dict:keys dictionary) +Arguments + → `dictionary' (expected Dict), got 1 (Number) In file tests/unittests/resources/DiagnosticsSuite/typeChecking/dict_keys_num.ark:1 1 | (builtin__dict:keys 1) | ^~~~~~~~~~~~~~~~~~~~~ - 2 | + 2 | \ No newline at end of file diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/dict_remove_num.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/dict_remove_num.expected index 1fa276033..fe6afae28 100644 --- a/tests/unittests/resources/DiagnosticsSuite/typeChecking/dict_remove_num.expected +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/dict_remove_num.expected @@ -1,8 +1,13 @@ Function dict:remove expected 2 arguments but got 1 - -> dictionary (Dict) was of type Number - -> key (any) was not provided +Call + ↳ (dict:remove 1) +Signature + ↳ (dict:remove dictionary key) +Arguments + → `dictionary' (expected Dict), got 1 (Number) + → `key' (expected any) was not provided In file tests/unittests/resources/DiagnosticsSuite/typeChecking/dict_remove_num.ark:1 1 | (builtin__dict:remove 1) | ^~~~~~~~~~~~~~~~~~~~~~~ - 2 | + 2 | \ No newline at end of file diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/dict_size_num.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/dict_size_num.expected index 131d1c23a..6dd36cc8a 100644 --- a/tests/unittests/resources/DiagnosticsSuite/typeChecking/dict_size_num.expected +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/dict_size_num.expected @@ -1,7 +1,12 @@ Function dict:size expected 1 argument - -> dictionary (Dict) was of type Number +Call + ↳ (dict:size 1) +Signature + ↳ (dict:size dictionary) +Arguments + → `dictionary' (expected Dict), got 1 (Number) In file tests/unittests/resources/DiagnosticsSuite/typeChecking/dict_size_num.ark:1 1 | (builtin__dict:size 1) | ^~~~~~~~~~~~~~~~~~~~~ - 2 | + 2 | \ No newline at end of file diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/disassemble_num.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/disassemble_num.expected index bb8fb3ff1..689dd2888 100644 --- a/tests/unittests/resources/DiagnosticsSuite/typeChecking/disassemble_num.expected +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/disassemble_num.expected @@ -1,7 +1,12 @@ Function disassemble expected 1 argument - -> f (Function) was of type Number +Call + ↳ (disassemble 1) +Signature + ↳ (disassemble f) +Arguments + → `f' (expected Function), got 1 (Number) In file tests/unittests/resources/DiagnosticsSuite/typeChecking/disassemble_num.ark:1 1 | (disassemble 1) | ^~~~~~~~~~~~~~ - 2 | + 2 | \ No newline at end of file diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/div_str_num.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/div_str_num.expected index f1e417e4d..eaa8df1f6 100644 --- a/tests/unittests/resources/DiagnosticsSuite/typeChecking/div_str_num.expected +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/div_str_num.expected @@ -1,8 +1,13 @@ Function / expected 2 arguments - -> a (Number) was of type String - -> b (Number) +Call + ↳ (/ 3 5) +Signature + ↳ (/ a b) +Arguments + → `a' (expected Number), got 3 (String) + → `b' (expected Number) ✓ In file tests/unittests/resources/DiagnosticsSuite/typeChecking/div_str_num.ark:1 1 | (/ "3" 5) | ^~~~~~~~ - 2 | + 2 | \ No newline at end of file diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/empty_num.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/empty_num.expected index 5e8d17fcb..a2679e231 100644 --- a/tests/unittests/resources/DiagnosticsSuite/typeChecking/empty_num.expected +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/empty_num.expected @@ -1,9 +1,18 @@ Function empty? expected 1 argument - -> value (List) was of type Number +Call + ↳ (empty? 1) +Signature + ↳ (empty? value) +Arguments + → `value' (expected List), got 1 (Number) + Alternative 2: - -> value (String) was of type Number +Signature + ↳ (empty? value) +Arguments + → `value' (expected String), got 1 (Number) In file tests/unittests/resources/DiagnosticsSuite/typeChecking/empty_num.ark:1 1 | (empty? 1) | ^~~~~~~~~ - 2 | + 2 | \ No newline at end of file diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/hasfield_num_str.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/hasfield_num_str.expected index 401faaee4..04fd3c2b7 100644 --- a/tests/unittests/resources/DiagnosticsSuite/typeChecking/hasfield_num_str.expected +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/hasfield_num_str.expected @@ -1,8 +1,13 @@ Function hasField expected 2 arguments - -> closure (Closure) was of type Number - -> field (String) +Call + ↳ (hasField 1 c) +Signature + ↳ (hasField closure field) +Arguments + → `closure' (expected Closure), got 1 (Number) + → `field' (expected String) ✓ In file tests/unittests/resources/DiagnosticsSuite/typeChecking/hasfield_num_str.ark:1 1 | (hasField 1 "c") | ^~~~~~~~~~~~~~~ - 2 | + 2 | \ No newline at end of file diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/head_num.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/head_num.expected index 0f7e9491a..b92170ac7 100644 --- a/tests/unittests/resources/DiagnosticsSuite/typeChecking/head_num.expected +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/head_num.expected @@ -1,9 +1,18 @@ Function head expected 1 argument - -> value (List) was of type Number +Call + ↳ (head 5) +Signature + ↳ (head value) +Arguments + → `value' (expected List), got 5 (Number) + Alternative 2: - -> value (String) was of type Number +Signature + ↳ (head value) +Arguments + → `value' (expected String), got 5 (Number) In file tests/unittests/resources/DiagnosticsSuite/typeChecking/head_num.ark:1 1 | (head 5) | ^~~~~~~ - 2 | + 2 | \ No newline at end of file diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/increment_index_str_num.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/increment_index_str_num.expected index dd489a66c..f94876ad6 100644 --- a/tests/unittests/resources/DiagnosticsSuite/typeChecking/increment_index_str_num.expected +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/increment_index_str_num.expected @@ -1,6 +1,11 @@ Function + expected 2 arguments - -> a (Number) was of type String - -> b (Number) was of type Function +Call + ↳ (+ 0 Function@1) +Signature + ↳ (+ a b) +Arguments + → `a' (expected Number), got 0 (String) + → `b' (expected Number), got Function@1 (Function) In file tests/unittests/resources/DiagnosticsSuite/typeChecking/increment_index_str_num.ark:2 1 | (mut i "0") @@ -11,4 +16,4 @@ In file tests/unittests/resources/DiagnosticsSuite/typeChecking/increment_index_ [ 2] In function `???' (tests/unittests/resources/DiagnosticsSuite/typeChecking/increment_index_str_num.ark:2) [ 1] In global scope (tests/unittests/resources/DiagnosticsSuite/typeChecking/increment_index_str_num.ark:2) -Current scope variables values: +Current scope variables values: \ No newline at end of file diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/increment_store_str_num.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/increment_store_str_num.expected index 878232eae..0e42592d9 100644 --- a/tests/unittests/resources/DiagnosticsSuite/typeChecking/increment_store_str_num.expected +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/increment_store_str_num.expected @@ -1,6 +1,11 @@ Function + expected 2 arguments - -> a (Number) was of type String - -> b (Number) was of type Function +Call + ↳ (+ 0 Function@1) +Signature + ↳ (+ a b) +Arguments + → `a' (expected Number), got 0 (String) + → `b' (expected Number), got Function@1 (Function) In file tests/unittests/resources/DiagnosticsSuite/typeChecking/increment_store_str_num.ark:2 1 | (mut i "0") @@ -11,4 +16,4 @@ In file tests/unittests/resources/DiagnosticsSuite/typeChecking/increment_store_ [ 2] In function `???' (tests/unittests/resources/DiagnosticsSuite/typeChecking/increment_store_str_num.ark:2) [ 1] In global scope (tests/unittests/resources/DiagnosticsSuite/typeChecking/increment_store_str_num.ark:2) -Current scope variables values: +Current scope variables values: \ No newline at end of file diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/increment_str_num.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/increment_str_num.expected index 1ab03a557..f6730be74 100644 --- a/tests/unittests/resources/DiagnosticsSuite/typeChecking/increment_str_num.expected +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/increment_str_num.expected @@ -1,9 +1,14 @@ Function + expected 2 arguments - -> a (Number) was of type String - -> b (Number) was of type Function +Call + ↳ (+ 1 Function@1) +Signature + ↳ (+ a b) +Arguments + → `a' (expected Number), got 1 (String) + → `b' (expected Number), got Function@1 (Function) In file tests/unittests/resources/DiagnosticsSuite/typeChecking/increment_str_num.ark:2 1 | (mut n "1") 2 | (set n (+ n 1)) | ^~~~~~~~~~~~~~ - 3 | + 3 | \ No newline at end of file diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/ioappendtofile_num_num.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/ioappendtofile_num_num.expected index f65476b28..68b2e5eae 100644 --- a/tests/unittests/resources/DiagnosticsSuite/typeChecking/ioappendtofile_num_num.expected +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/ioappendtofile_num_num.expected @@ -1,8 +1,13 @@ Function io:appendToFile expected 2 arguments - -> filename (String) was of type Number - -> content (any) +Call + ↳ (io:appendToFile 1 2) +Signature + ↳ (io:appendToFile filename content) +Arguments + → `filename' (expected String), got 1 (Number) + → `content' (expected any) ✓ In file tests/unittests/resources/DiagnosticsSuite/typeChecking/ioappendtofile_num_num.ark:1 1 | (builtin__io:appendToFile 1 2) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - 2 | + 2 | \ No newline at end of file diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/iodir_num.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/iodir_num.expected index 444e1ab03..03637bdcc 100644 --- a/tests/unittests/resources/DiagnosticsSuite/typeChecking/iodir_num.expected +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/iodir_num.expected @@ -1,7 +1,12 @@ Function io:dir? expected 1 argument - -> path (String) was of type Number +Call + ↳ (io:dir? 1) +Signature + ↳ (io:dir? path) +Arguments + → `path' (expected String), got 1 (Number) In file tests/unittests/resources/DiagnosticsSuite/typeChecking/iodir_num.ark:1 1 | (builtin__io:dir? 1) | ^~~~~~~~~~~~~~~~~~~ - 2 | + 2 | \ No newline at end of file diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/iofileexists_num.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/iofileexists_num.expected index 098dd5c34..6337e3584 100644 --- a/tests/unittests/resources/DiagnosticsSuite/typeChecking/iofileexists_num.expected +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/iofileexists_num.expected @@ -1,7 +1,12 @@ Function io:fileExists? expected 1 argument - -> filename (String) was of type Number +Call + ↳ (io:fileExists? 1) +Signature + ↳ (io:fileExists? filename) +Arguments + → `filename' (expected String), got 1 (Number) In file tests/unittests/resources/DiagnosticsSuite/typeChecking/iofileexists_num.ark:1 1 | (builtin__io:fileExists? 1) | ^~~~~~~~~~~~~~~~~~~~~~~~~~ - 2 | + 2 | \ No newline at end of file diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/iolistfiles_num.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/iolistfiles_num.expected index 0dfce92ed..f01bbe447 100644 --- a/tests/unittests/resources/DiagnosticsSuite/typeChecking/iolistfiles_num.expected +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/iolistfiles_num.expected @@ -1,7 +1,12 @@ Function io:listFiles expected 1 argument - -> path (String) was of type Number +Call + ↳ (io:listFiles 1) +Signature + ↳ (io:listFiles path) +Arguments + → `path' (expected String), got 1 (Number) In file tests/unittests/resources/DiagnosticsSuite/typeChecking/iolistfiles_num.ark:1 1 | (builtin__io:listFiles 1) | ^~~~~~~~~~~~~~~~~~~~~~~~ - 2 | + 2 | \ No newline at end of file diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/iomakedir_num.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/iomakedir_num.expected index 08be63ad4..c89e02112 100644 --- a/tests/unittests/resources/DiagnosticsSuite/typeChecking/iomakedir_num.expected +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/iomakedir_num.expected @@ -1,7 +1,12 @@ Function io:makeDir expected 1 argument - -> path (String) was of type Number +Call + ↳ (io:makeDir 1) +Signature + ↳ (io:makeDir path) +Arguments + → `path' (expected String), got 1 (Number) In file tests/unittests/resources/DiagnosticsSuite/typeChecking/iomakedir_num.ark:1 1 | (builtin__io:makeDir 1) | ^~~~~~~~~~~~~~~~~~~~~~ - 2 | + 2 | \ No newline at end of file diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/ioreadfile_num.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/ioreadfile_num.expected index 6fac5f06f..afb354ce4 100644 --- a/tests/unittests/resources/DiagnosticsSuite/typeChecking/ioreadfile_num.expected +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/ioreadfile_num.expected @@ -1,7 +1,12 @@ Function io:readFile expected 1 argument - -> filename (String) was of type Number +Call + ↳ (io:readFile 1) +Signature + ↳ (io:readFile filename) +Arguments + → `filename' (expected String), got 1 (Number) In file tests/unittests/resources/DiagnosticsSuite/typeChecking/ioreadfile_num.ark:1 1 | (builtin__io:readFile 1) | ^~~~~~~~~~~~~~~~~~~~~~~ - 2 | + 2 | \ No newline at end of file diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/ioreadlinesfile_num.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/ioreadlinesfile_num.expected index b9b9f2350..96c5ba8f0 100644 --- a/tests/unittests/resources/DiagnosticsSuite/typeChecking/ioreadlinesfile_num.expected +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/ioreadlinesfile_num.expected @@ -1,7 +1,12 @@ Function io:readLinesFile expected 1 argument - -> filename (String) was of type Number +Call + ↳ (io:readLinesFile 1) +Signature + ↳ (io:readLinesFile filename) +Arguments + → `filename' (expected String), got 1 (Number) In file tests/unittests/resources/DiagnosticsSuite/typeChecking/ioreadlinesfile_num.ark:1 1 | (builtin__io:readLinesFile 1) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ - 2 | + 2 | \ No newline at end of file diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/ioremovefile_num.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/ioremovefile_num.expected index a9792ecb2..b7fbe4971 100644 --- a/tests/unittests/resources/DiagnosticsSuite/typeChecking/ioremovefile_num.expected +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/ioremovefile_num.expected @@ -1,7 +1,12 @@ Function io:removeFile expected 1 argument - -> filename (String) was of type Number +Call + ↳ (io:removeFile 1) +Signature + ↳ (io:removeFile filename) +Arguments + → `filename' (expected String), got 1 (Number) In file tests/unittests/resources/DiagnosticsSuite/typeChecking/ioremovefile_num.ark:1 1 | (builtin__io:removeFile 1) | ^~~~~~~~~~~~~~~~~~~~~~~~~ - 2 | + 2 | \ No newline at end of file diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/iowritefile_num_num.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/iowritefile_num_num.expected index 2af81db4a..c4cee8ba0 100644 --- a/tests/unittests/resources/DiagnosticsSuite/typeChecking/iowritefile_num_num.expected +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/iowritefile_num_num.expected @@ -1,8 +1,13 @@ Function io:writeFile expected 2 arguments - -> filename (String) was of type Number - -> content (any) +Call + ↳ (io:writeFile 1 2) +Signature + ↳ (io:writeFile filename content) +Arguments + → `filename' (expected String), got 1 (Number) + → `content' (expected any) ✓ In file tests/unittests/resources/DiagnosticsSuite/typeChecking/iowritefile_num_num.ark:1 1 | (builtin__io:writeFile 1 2) | ^~~~~~~~~~~~~~~~~~~~~~~~~~ - 2 | + 2 | \ No newline at end of file diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/len_num.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/len_num.expected index e1b1e44ad..03713d9c7 100644 --- a/tests/unittests/resources/DiagnosticsSuite/typeChecking/len_num.expected +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/len_num.expected @@ -1,9 +1,18 @@ Function len expected 1 argument - -> value (List) was of type Number +Call + ↳ (len 1) +Signature + ↳ (len value) +Arguments + → `value' (expected List), got 1 (Number) + Alternative 2: - -> value (String) was of type Number +Signature + ↳ (len value) +Arguments + → `value' (expected String), got 1 (Number) In file tests/unittests/resources/DiagnosticsSuite/typeChecking/len_num.ark:1 1 | (len 1) | ^~~~~~ - 2 | + 2 | \ No newline at end of file diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/listfill_str.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/listfill_str.expected index c3f551540..ec4ee478b 100644 --- a/tests/unittests/resources/DiagnosticsSuite/typeChecking/listfill_str.expected +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/listfill_str.expected @@ -1,8 +1,13 @@ Function list:fill expected 2 arguments but got 1 - -> size (Number) was of type String - -> value (any) was not provided +Call + ↳ (list:fill hello) +Signature + ↳ (list:fill size value) +Arguments + → `size' (expected Number), got hello (String) + → `value' (expected any) was not provided In file tests/unittests/resources/DiagnosticsSuite/typeChecking/listfill_str.ark:1 1 | (builtin__list:fill "hello") | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ - 2 | + 2 | \ No newline at end of file diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/listfind_str_num.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/listfind_str_num.expected index b7f45a0d1..aed57c35e 100644 --- a/tests/unittests/resources/DiagnosticsSuite/typeChecking/listfind_str_num.expected +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/listfind_str_num.expected @@ -1,8 +1,13 @@ Function list:find expected 2 arguments - -> list (List) was of type String - -> value (any) +Call + ↳ (list:find hello 1) +Signature + ↳ (list:find list value) +Arguments + → `list' (expected List), got hello (String) + → `value' (expected any) ✓ In file tests/unittests/resources/DiagnosticsSuite/typeChecking/listfind_str_num.ark:1 1 | (builtin__list:find "hello" 1) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - 2 | + 2 | \ No newline at end of file diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/listreverse_str.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/listreverse_str.expected index 623126699..0cbc0ee7b 100644 --- a/tests/unittests/resources/DiagnosticsSuite/typeChecking/listreverse_str.expected +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/listreverse_str.expected @@ -1,7 +1,12 @@ Function list:reverse expected 1 argument - -> list (List) was of type String +Call + ↳ (list:reverse hello) +Signature + ↳ (list:reverse list) +Arguments + → `list' (expected List), got hello (String) In file tests/unittests/resources/DiagnosticsSuite/typeChecking/listreverse_str.ark:1 1 | (builtin__list:reverse "hello") | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - 2 | + 2 | \ No newline at end of file diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/listsetat_str.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/listsetat_str.expected index 2770c8f03..c510bcacc 100644 --- a/tests/unittests/resources/DiagnosticsSuite/typeChecking/listsetat_str.expected +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/listsetat_str.expected @@ -1,9 +1,14 @@ Function list:setAt expected 3 arguments but got 1 - -> list (List) was of type String - -> index (Number) was not provided - -> value (any) was not provided +Call + ↳ (list:setAt hello) +Signature + ↳ (list:setAt list index value) +Arguments + → `list' (expected List), got hello (String) + → `index' (expected Number) was not provided + → `value' (expected any) was not provided In file tests/unittests/resources/DiagnosticsSuite/typeChecking/listsetat_str.ark:1 1 | (builtin__list:setAt "hello") | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ - 2 | + 2 | \ No newline at end of file diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/listslice_str_num_bool_nil.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/listslice_str_num_bool_nil.expected index bb1dbce33..388947cee 100644 --- a/tests/unittests/resources/DiagnosticsSuite/typeChecking/listslice_str_num_bool_nil.expected +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/listslice_str_num_bool_nil.expected @@ -1,10 +1,15 @@ Function list:slice expected 4 arguments - -> list (List) was of type String - -> start (Number) - -> end (Number) was of type Bool - -> step (Number) was of type Nil +Call + ↳ (list:slice hello 1 true nil) +Signature + ↳ (list:slice list start end step) +Arguments + → `list' (expected List), got hello (String) + → `start' (expected Number) ✓ + → `end' (expected Number), got true (Bool) + → `step' (expected Number), got nil (Nil) In file tests/unittests/resources/DiagnosticsSuite/typeChecking/listslice_str_num_bool_nil.ark:1 1 | (builtin__list:slice "hello" 1 true nil) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - 2 | + 2 | \ No newline at end of file diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/listsort_str.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/listsort_str.expected index 27cd1ad93..11ffd30bb 100644 --- a/tests/unittests/resources/DiagnosticsSuite/typeChecking/listsort_str.expected +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/listsort_str.expected @@ -1,7 +1,12 @@ Function list:sort expected 1 argument - -> list (List) was of type String +Call + ↳ (list:sort hello) +Signature + ↳ (list:sort list) +Arguments + → `list' (expected List), got hello (String) In file tests/unittests/resources/DiagnosticsSuite/typeChecking/listsort_str.ark:1 1 | (builtin__list:sort "hello") | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ - 2 | + 2 | \ No newline at end of file diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/lt_len_sym_jump_if_false_num.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/lt_len_sym_jump_if_false_num.expected index 30878c466..74c47ff54 100644 --- a/tests/unittests/resources/DiagnosticsSuite/typeChecking/lt_len_sym_jump_if_false_num.expected +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/lt_len_sym_jump_if_false_num.expected @@ -1,7 +1,16 @@ Function len expected 1 argument - -> value (List) was of type Number +Call + ↳ (len 1) +Signature + ↳ (len value) +Arguments + → `value' (expected List), got 1 (Number) + Alternative 2: - -> value (String) was of type Number +Signature + ↳ (len value) +Arguments + → `value' (expected String), got 1 (Number) In file tests/unittests/resources/DiagnosticsSuite/typeChecking/lt_len_sym_jump_if_false_num.ark:3 1 | (let data 1) @@ -9,4 +18,4 @@ In file tests/unittests/resources/DiagnosticsSuite/typeChecking/lt_len_sym_jump_ 3 | (while (< i (len data)) { | ^~~~~~~~~~~~~~~~~~~~~~~~ 4 | (print i " " (@ data i)) - 5 | (set i (+ 1 i)) }) + 5 | (set i (+ 1 i)) }) \ No newline at end of file diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathacosh_str.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathacosh_str.expected index ab800e3bc..3ea8477c3 100644 --- a/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathacosh_str.expected +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathacosh_str.expected @@ -1,7 +1,12 @@ Function math:acosh expected 1 argument - -> value (Number) was of type String +Call + ↳ (math:acosh 1) +Signature + ↳ (math:acosh value) +Arguments + → `value' (expected Number), got 1 (String) In file tests/unittests/resources/DiagnosticsSuite/typeChecking/mathacosh_str.ark:1 1 | (builtin__math:acosh "1") | ^~~~~~~~~~~~~~~~~~~~~~~~ - 2 | + 2 | \ No newline at end of file diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/matharccos_str.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/matharccos_str.expected index 5b163be30..e77be97da 100644 --- a/tests/unittests/resources/DiagnosticsSuite/typeChecking/matharccos_str.expected +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/matharccos_str.expected @@ -1,7 +1,12 @@ Function math:arccos expected 1 argument - -> value (Number) was of type String +Call + ↳ (math:arccos 1) +Signature + ↳ (math:arccos value) +Arguments + → `value' (expected Number), got 1 (String) In file tests/unittests/resources/DiagnosticsSuite/typeChecking/matharccos_str.ark:1 1 | (builtin__math:arccos "1") | ^~~~~~~~~~~~~~~~~~~~~~~~~ - 2 | + 2 | \ No newline at end of file diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/matharcsin_str.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/matharcsin_str.expected index bb49e1204..81fc91a98 100644 --- a/tests/unittests/resources/DiagnosticsSuite/typeChecking/matharcsin_str.expected +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/matharcsin_str.expected @@ -1,7 +1,12 @@ Function math:arcsin expected 1 argument - -> value (Number) was of type String +Call + ↳ (math:arcsin 1) +Signature + ↳ (math:arcsin value) +Arguments + → `value' (expected Number), got 1 (String) In file tests/unittests/resources/DiagnosticsSuite/typeChecking/matharcsin_str.ark:1 1 | (builtin__math:arcsin "1") | ^~~~~~~~~~~~~~~~~~~~~~~~~ - 2 | + 2 | \ No newline at end of file diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/matharctan_str.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/matharctan_str.expected index 02b5d5f72..3800c3e8b 100644 --- a/tests/unittests/resources/DiagnosticsSuite/typeChecking/matharctan_str.expected +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/matharctan_str.expected @@ -1,7 +1,12 @@ Function math:arctan expected 1 argument - -> value (Number) was of type String +Call + ↳ (math:arctan 1) +Signature + ↳ (math:arctan value) +Arguments + → `value' (expected Number), got 1 (String) In file tests/unittests/resources/DiagnosticsSuite/typeChecking/matharctan_str.ark:1 1 | (builtin__math:arctan "1") | ^~~~~~~~~~~~~~~~~~~~~~~~~ - 2 | + 2 | \ No newline at end of file diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathasinh_str.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathasinh_str.expected index 37fd06f7a..4d08a30ab 100644 --- a/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathasinh_str.expected +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathasinh_str.expected @@ -1,7 +1,12 @@ Function math:asinh expected 1 argument - -> value (Number) was of type String +Call + ↳ (math:asinh 1) +Signature + ↳ (math:asinh value) +Arguments + → `value' (expected Number), got 1 (String) In file tests/unittests/resources/DiagnosticsSuite/typeChecking/mathasinh_str.ark:1 1 | (builtin__math:asinh "1") | ^~~~~~~~~~~~~~~~~~~~~~~~ - 2 | + 2 | \ No newline at end of file diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathatanh_str.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathatanh_str.expected index a424631c3..c7e9e10bd 100644 --- a/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathatanh_str.expected +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathatanh_str.expected @@ -1,7 +1,12 @@ Function math:atanh expected 1 argument - -> value (Number) was of type String +Call + ↳ (math:atanh 1) +Signature + ↳ (math:atanh value) +Arguments + → `value' (expected Number), got 1 (String) In file tests/unittests/resources/DiagnosticsSuite/typeChecking/mathatanh_str.ark:1 1 | (builtin__math:atanh "1") | ^~~~~~~~~~~~~~~~~~~~~~~~ - 2 | + 2 | \ No newline at end of file diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathceil_str.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathceil_str.expected index 6dfbc37db..1e17e8c85 100644 --- a/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathceil_str.expected +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathceil_str.expected @@ -1,7 +1,12 @@ Function math:ceil expected 1 argument - -> value (Number) was of type String +Call + ↳ (math:ceil 1) +Signature + ↳ (math:ceil value) +Arguments + → `value' (expected Number), got 1 (String) In file tests/unittests/resources/DiagnosticsSuite/typeChecking/mathceil_str.ark:1 1 | (builtin__math:ceil "1") | ^~~~~~~~~~~~~~~~~~~~~~~ - 2 | + 2 | \ No newline at end of file diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathcos_str.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathcos_str.expected index fef09b4b9..f253e3b85 100644 --- a/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathcos_str.expected +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathcos_str.expected @@ -1,7 +1,12 @@ Function math:cos expected 1 argument - -> value (Number) was of type String +Call + ↳ (math:cos 1) +Signature + ↳ (math:cos value) +Arguments + → `value' (expected Number), got 1 (String) In file tests/unittests/resources/DiagnosticsSuite/typeChecking/mathcos_str.ark:1 1 | (builtin__math:cos "1") | ^~~~~~~~~~~~~~~~~~~~~~ - 2 | + 2 | \ No newline at end of file diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathcosh_str.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathcosh_str.expected index 5fe63aec7..30f486beb 100644 --- a/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathcosh_str.expected +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathcosh_str.expected @@ -1,7 +1,12 @@ Function math:cosh expected 1 argument - -> value (Number) was of type String +Call + ↳ (math:cosh 1) +Signature + ↳ (math:cosh value) +Arguments + → `value' (expected Number), got 1 (String) In file tests/unittests/resources/DiagnosticsSuite/typeChecking/mathcosh_str.ark:1 1 | (builtin__math:cosh "1") | ^~~~~~~~~~~~~~~~~~~~~~~ - 2 | + 2 | \ No newline at end of file diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathexp_str.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathexp_str.expected index 79b083717..cd207f0cf 100644 --- a/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathexp_str.expected +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathexp_str.expected @@ -1,7 +1,12 @@ Function math:exp expected 1 argument - -> value (Number) was of type String +Call + ↳ (math:exp 1) +Signature + ↳ (math:exp value) +Arguments + → `value' (expected Number), got 1 (String) In file tests/unittests/resources/DiagnosticsSuite/typeChecking/mathexp_str.ark:1 1 | (builtin__math:exp "1") | ^~~~~~~~~~~~~~~~~~~~~~ - 2 | + 2 | \ No newline at end of file diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathfloor_str.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathfloor_str.expected index a7c0e3eea..27725159c 100644 --- a/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathfloor_str.expected +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathfloor_str.expected @@ -1,7 +1,12 @@ Function math:floor expected 1 argument - -> value (Number) was of type String +Call + ↳ (math:floor 1) +Signature + ↳ (math:floor value) +Arguments + → `value' (expected Number), got 1 (String) In file tests/unittests/resources/DiagnosticsSuite/typeChecking/mathfloor_str.ark:1 1 | (builtin__math:floor "1") | ^~~~~~~~~~~~~~~~~~~~~~~~ - 2 | + 2 | \ No newline at end of file diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathln_str.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathln_str.expected index da5a8da7c..6255606b7 100644 --- a/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathln_str.expected +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathln_str.expected @@ -1,7 +1,12 @@ Function math:ln expected 1 argument - -> value (Number) was of type String +Call + ↳ (math:ln 1) +Signature + ↳ (math:ln value) +Arguments + → `value' (expected Number), got 1 (String) In file tests/unittests/resources/DiagnosticsSuite/typeChecking/mathln_str.ark:1 1 | (builtin__math:ln "1") | ^~~~~~~~~~~~~~~~~~~~~ - 2 | + 2 | \ No newline at end of file diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathround_str.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathround_str.expected index ff3d0dc33..b55e073b0 100644 --- a/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathround_str.expected +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathround_str.expected @@ -1,7 +1,12 @@ Function math:round expected 1 argument - -> value (Number) was of type String +Call + ↳ (math:round 1) +Signature + ↳ (math:round value) +Arguments + → `value' (expected Number), got 1 (String) In file tests/unittests/resources/DiagnosticsSuite/typeChecking/mathround_str.ark:1 1 | (builtin__math:round "1") | ^~~~~~~~~~~~~~~~~~~~~~~~ - 2 | + 2 | \ No newline at end of file diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathsin_str.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathsin_str.expected index 62b1e5aac..312dcca13 100644 --- a/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathsin_str.expected +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathsin_str.expected @@ -1,7 +1,12 @@ Function math:sin expected 1 argument - -> value (Number) was of type String +Call + ↳ (math:sin 1) +Signature + ↳ (math:sin value) +Arguments + → `value' (expected Number), got 1 (String) In file tests/unittests/resources/DiagnosticsSuite/typeChecking/mathsin_str.ark:1 1 | (builtin__math:sin "1") | ^~~~~~~~~~~~~~~~~~~~~~ - 2 | + 2 | \ No newline at end of file diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathsinh_str.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathsinh_str.expected index e2755c489..d6dd56e75 100644 --- a/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathsinh_str.expected +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathsinh_str.expected @@ -1,7 +1,12 @@ Function math:sinh expected 1 argument - -> value (Number) was of type String +Call + ↳ (math:sinh 1) +Signature + ↳ (math:sinh value) +Arguments + → `value' (expected Number), got 1 (String) In file tests/unittests/resources/DiagnosticsSuite/typeChecking/mathsinh_str.ark:1 1 | (builtin__math:sinh "1") | ^~~~~~~~~~~~~~~~~~~~~~~ - 2 | + 2 | \ No newline at end of file diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathtan_str.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathtan_str.expected index b1d5d0179..a7efdc3fb 100644 --- a/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathtan_str.expected +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathtan_str.expected @@ -1,7 +1,12 @@ Function math:tan expected 1 argument - -> value (Number) was of type String +Call + ↳ (math:tan 1) +Signature + ↳ (math:tan value) +Arguments + → `value' (expected Number), got 1 (String) In file tests/unittests/resources/DiagnosticsSuite/typeChecking/mathtan_str.ark:1 1 | (builtin__math:tan "1") | ^~~~~~~~~~~~~~~~~~~~~~ - 2 | + 2 | \ No newline at end of file diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathtanh_str.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathtanh_str.expected index 5befdbca3..9f3dfc3ac 100644 --- a/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathtanh_str.expected +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/mathtanh_str.expected @@ -1,7 +1,12 @@ Function math:tanh expected 1 argument - -> value (Number) was of type String +Call + ↳ (math:tanh 1) +Signature + ↳ (math:tanh value) +Arguments + → `value' (expected Number), got 1 (String) In file tests/unittests/resources/DiagnosticsSuite/typeChecking/mathtanh_str.ark:1 1 | (builtin__math:tanh "1") | ^~~~~~~~~~~~~~~~~~~~~~~ - 2 | + 2 | \ No newline at end of file diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/mod_str_str.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/mod_str_str.expected index b2e26af85..b800560b6 100644 --- a/tests/unittests/resources/DiagnosticsSuite/typeChecking/mod_str_str.expected +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/mod_str_str.expected @@ -1,8 +1,13 @@ Function mod expected 2 arguments - -> a (Number) was of type String - -> b (Number) was of type String +Call + ↳ (mod 1 2) +Signature + ↳ (mod a b) +Arguments + → `a' (expected Number), got 1 (String) + → `b' (expected Number), got 2 (String) In file tests/unittests/resources/DiagnosticsSuite/typeChecking/mod_str_str.ark:1 1 | (mod "1" "2") | ^~~~~~~~~~~~ - 2 | + 2 | \ No newline at end of file diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/mul_str_num.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/mul_str_num.expected index 1a01146e7..ceaae80b5 100644 --- a/tests/unittests/resources/DiagnosticsSuite/typeChecking/mul_str_num.expected +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/mul_str_num.expected @@ -1,8 +1,13 @@ Function * expected 2 arguments - -> a (Number) was of type String - -> b (Number) +Call + ↳ (* 3 4) +Signature + ↳ (* a b) +Arguments + → `a' (expected Number), got 3 (String) + → `b' (expected Number) ✓ In file tests/unittests/resources/DiagnosticsSuite/typeChecking/mul_str_num.ark:1 1 | (* "3" 4) | ^~~~~~~~ - 2 | + 2 | \ No newline at end of file diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/pop_in_place_num_num.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/pop_in_place_num_num.expected index 51a3e0c1a..39262f746 100644 --- a/tests/unittests/resources/DiagnosticsSuite/typeChecking/pop_in_place_num_num.expected +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/pop_in_place_num_num.expected @@ -1,8 +1,13 @@ Function pop! expected 2 arguments - -> list (List) was of type Number - -> index (Number) +Call + ↳ (pop! 5 5) +Signature + ↳ (pop! list index) +Arguments + → `list' (expected List), got 5 (Number) + → `index' (expected Number) ✓ In file tests/unittests/resources/DiagnosticsSuite/typeChecking/pop_in_place_num_num.ark:1 1 | (pop! 5 5) | ^~~~~~~~~ - 2 | + 2 | \ No newline at end of file diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/pop_num_num.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/pop_num_num.expected index abd080ccf..58734d684 100644 --- a/tests/unittests/resources/DiagnosticsSuite/typeChecking/pop_num_num.expected +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/pop_num_num.expected @@ -1,8 +1,13 @@ Function pop expected 2 arguments - -> list (List) was of type Number - -> index (Number) +Call + ↳ (pop 5 5) +Signature + ↳ (pop list index) +Arguments + → `list' (expected List), got 5 (Number) + → `index' (expected Number) ✓ In file tests/unittests/resources/DiagnosticsSuite/typeChecking/pop_num_num.ark:1 1 | (pop 5 5) | ^~~~~~~~ - 2 | + 2 | \ No newline at end of file diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/random_str_str.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/random_str_str.expected index d4a8de091..2fd1934df 100644 --- a/tests/unittests/resources/DiagnosticsSuite/typeChecking/random_str_str.expected +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/random_str_str.expected @@ -1,8 +1,13 @@ Function random expected 2 arguments - -> min (Number) was of type String - -> max (Number) was of type String +Call + ↳ (random 1 2) +Signature + ↳ (random min max) +Arguments + → `min' (expected Number), got 1 (String) + → `max' (expected Number), got 2 (String) In file tests/unittests/resources/DiagnosticsSuite/typeChecking/random_str_str.ark:1 1 | (random "1" "2") | ^~~~~~~~~~~~~~~ - 2 | + 2 | \ No newline at end of file diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/store_len_num.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/store_len_num.expected index f16ad34d2..dde2bf7ee 100644 --- a/tests/unittests/resources/DiagnosticsSuite/typeChecking/store_len_num.expected +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/store_len_num.expected @@ -1,10 +1,19 @@ Function len expected 1 argument - -> value (List) was of type Number +Call + ↳ (len 1) +Signature + ↳ (len value) +Arguments + → `value' (expected List), got 1 (Number) + Alternative 2: - -> value (String) was of type Number +Signature + ↳ (len value) +Arguments + → `value' (expected String), got 1 (Number) In file tests/unittests/resources/DiagnosticsSuite/typeChecking/store_len_num.ark:2 1 | (let a 1) 2 | (let l (len a)) | ^~~~~~~~~~~~~~ - 3 | + 3 | \ No newline at end of file diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/stringchr_str.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/stringchr_str.expected index da5b214dc..325ccfe94 100644 --- a/tests/unittests/resources/DiagnosticsSuite/typeChecking/stringchr_str.expected +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/stringchr_str.expected @@ -1,7 +1,12 @@ Function string:chr expected 1 argument - -> codepoint (Number) was of type String +Call + ↳ (string:chr 1) +Signature + ↳ (string:chr codepoint) +Arguments + → `codepoint' (expected Number), got 1 (String) In file tests/unittests/resources/DiagnosticsSuite/typeChecking/stringchr_str.ark:1 1 | (builtin__string:chr "1") | ^~~~~~~~~~~~~~~~~~~~~~~~ - 2 | + 2 | \ No newline at end of file diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/stringfind_num.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/stringfind_num.expected index 1144faaf3..340d8fab0 100644 --- a/tests/unittests/resources/DiagnosticsSuite/typeChecking/stringfind_num.expected +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/stringfind_num.expected @@ -1,12 +1,21 @@ Function string:find expected between 2 arguments and 3 arguments but got 1 - -> string (String) was of type Number - -> substr (String) was not provided +Call + ↳ (string:find 1) +Signature + ↳ (string:find string substr) +Arguments + → `string' (expected String), got 1 (Number) + → `substr' (expected String) was not provided + Alternative 2: - -> string (String) was of type Number - -> substr (String) was not provided - -> startIndex (Number) was not provided +Signature + ↳ (string:find string substr startIndex) +Arguments + → `string' (expected String), got 1 (Number) + → `substr' (expected String) was not provided + → `startIndex' (expected Number) was not provided In file tests/unittests/resources/DiagnosticsSuite/typeChecking/stringfind_num.ark:1 1 | (builtin__string:find 1) | ^~~~~~~~~~~~~~~~~~~~~~~ - 2 | + 2 | \ No newline at end of file diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/stringformat_num.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/stringformat_num.expected index c0f1bd035..67a2a894e 100644 --- a/tests/unittests/resources/DiagnosticsSuite/typeChecking/stringformat_num.expected +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/stringformat_num.expected @@ -1,8 +1,13 @@ Function format expected at least 2 arguments but got 1 - -> string (String) was of type Number - -> variadic value (any) was not provided +Call + ↳ (format 1) +Signature + ↳ (format string value) +Arguments + → `string' (expected String), got 1 (Number) + → variadic `value' (expected any) was not provided In file tests/unittests/resources/DiagnosticsSuite/typeChecking/stringformat_num.ark:1 1 | (format 1) | ^~~~~~~~~ - 2 | + 2 | \ No newline at end of file diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/stringord_num.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/stringord_num.expected index 8ae9e053f..61bd1661a 100644 --- a/tests/unittests/resources/DiagnosticsSuite/typeChecking/stringord_num.expected +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/stringord_num.expected @@ -1,7 +1,12 @@ Function string:ord expected 1 argument - -> string (String) was of type Number +Call + ↳ (string:ord 1) +Signature + ↳ (string:ord string) +Arguments + → `string' (expected String), got 1 (Number) In file tests/unittests/resources/DiagnosticsSuite/typeChecking/stringord_num.ark:1 1 | (builtin__string:ord 1) | ^~~~~~~~~~~~~~~~~~~~~~ - 2 | + 2 | \ No newline at end of file diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/stringremoveat_num.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/stringremoveat_num.expected index f11cd916a..480000222 100644 --- a/tests/unittests/resources/DiagnosticsSuite/typeChecking/stringremoveat_num.expected +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/stringremoveat_num.expected @@ -1,8 +1,13 @@ Function string:removeAt expected 2 arguments but got 1 - -> string (String) was of type Number - -> index (Number) was not provided +Call + ↳ (string:removeAt 1) +Signature + ↳ (string:removeAt string index) +Arguments + → `string' (expected String), got 1 (Number) + → `index' (expected Number) was not provided In file tests/unittests/resources/DiagnosticsSuite/typeChecking/stringremoveat_num.ark:1 1 | (builtin__string:removeAt 1) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ - 2 | + 2 | \ No newline at end of file diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/stringsetat_str.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/stringsetat_str.expected index cda8203b5..600ae84e5 100644 --- a/tests/unittests/resources/DiagnosticsSuite/typeChecking/stringsetat_str.expected +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/stringsetat_str.expected @@ -1,9 +1,14 @@ Function string:setAt expected 3 arguments but got 1 - -> string (String) - -> index (Number) was not provided - -> value (String) was not provided +Call + ↳ (string:setAt 1) +Signature + ↳ (string:setAt string index value) +Arguments + → `string' (expected String) ✓ + → `index' (expected Number) was not provided + → `value' (expected String) was not provided In file tests/unittests/resources/DiagnosticsSuite/typeChecking/stringsetat_str.ark:1 1 | (builtin__string:setAt "1") | ^~~~~~~~~~~~~~~~~~~~~~~~~~ - 2 | + 2 | \ No newline at end of file diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/sub_str_str.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/sub_str_str.expected index 0fd006044..aeb30462d 100644 --- a/tests/unittests/resources/DiagnosticsSuite/typeChecking/sub_str_str.expected +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/sub_str_str.expected @@ -1,8 +1,13 @@ Function - expected 2 arguments - -> a (Number) was of type String - -> b (Number) was of type String +Call + ↳ (- 1 2) +Signature + ↳ (- a b) +Arguments + → `a' (expected Number), got 1 (String) + → `b' (expected Number), got 2 (String) In file tests/unittests/resources/DiagnosticsSuite/typeChecking/sub_str_str.ark:1 1 | (- "1" "2") | ^~~~~~~~~~ - 2 | + 2 | \ No newline at end of file diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/syssleep_str.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/syssleep_str.expected index 916b4140b..0a33da83f 100644 --- a/tests/unittests/resources/DiagnosticsSuite/typeChecking/syssleep_str.expected +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/syssleep_str.expected @@ -1,7 +1,12 @@ Function sys:sleep expected 1 argument - -> duration (Number) was of type String +Call + ↳ (sys:sleep 1) +Signature + ↳ (sys:sleep duration) +Arguments + → `duration' (expected Number), got 1 (String) In file tests/unittests/resources/DiagnosticsSuite/typeChecking/syssleep_str.ark:1 1 | (builtin__sys:sleep "1") | ^~~~~~~~~~~~~~~~~~~~~~~ - 2 | + 2 | \ No newline at end of file diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/tail_num.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/tail_num.expected index 6dd49822a..3142780b8 100644 --- a/tests/unittests/resources/DiagnosticsSuite/typeChecking/tail_num.expected +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/tail_num.expected @@ -1,9 +1,18 @@ Function tail expected 1 argument - -> value (List) was of type Number +Call + ↳ (tail 5) +Signature + ↳ (tail value) +Arguments + → `value' (expected List), got 5 (Number) + Alternative 2: - -> value (String) was of type Number +Signature + ↳ (tail value) +Arguments + → `value' (expected String), got 5 (Number) In file tests/unittests/resources/DiagnosticsSuite/typeChecking/tail_num.ark:1 1 | (tail 5) | ^~~~~~~ - 2 | + 2 | \ No newline at end of file diff --git a/tests/unittests/resources/DiagnosticsSuite/typeChecking/tonumber_num.expected b/tests/unittests/resources/DiagnosticsSuite/typeChecking/tonumber_num.expected index 4447832e3..889bf8b80 100644 --- a/tests/unittests/resources/DiagnosticsSuite/typeChecking/tonumber_num.expected +++ b/tests/unittests/resources/DiagnosticsSuite/typeChecking/tonumber_num.expected @@ -1,7 +1,12 @@ Function toNumber expected 1 argument - -> value (String) was of type Number +Call + ↳ (toNumber 5) +Signature + ↳ (toNumber value) +Arguments + → `value' (expected String), got 5 (Number) In file tests/unittests/resources/DiagnosticsSuite/typeChecking/tonumber_num.ark:1 1 | (toNumber 5) | ^~~~~~~~~~~ - 2 | + 2 | \ No newline at end of file diff --git a/tests/unittests/resources/TypeCheckerSuite/multi.expected b/tests/unittests/resources/TypeCheckerSuite/multi.expected index faf8d9513..af69aadbd 100644 --- a/tests/unittests/resources/TypeCheckerSuite/multi.expected +++ b/tests/unittests/resources/TypeCheckerSuite/multi.expected @@ -1,6 +1,15 @@ Function f expected 2 arguments but got 1 - -> n (Number) - -> m (Number) was not provided +Call + ↳ (f 1) +Signature + ↳ (f n m) +Arguments + → `n' (expected Number) ✓ + → `m' (expected Number) was not provided + Alternative 2: - -> n (Number) - -> m (String) was not provided +Signature + ↳ (f n m) +Arguments + → `n' (expected Number) ✓ + → `m' (expected String) was not provided \ No newline at end of file diff --git a/tests/unittests/resources/TypeCheckerSuite/multi_varying_arity.expected b/tests/unittests/resources/TypeCheckerSuite/multi_varying_arity.expected index 17409b2f9..607ef0d70 100644 --- a/tests/unittests/resources/TypeCheckerSuite/multi_varying_arity.expected +++ b/tests/unittests/resources/TypeCheckerSuite/multi_varying_arity.expected @@ -1,7 +1,16 @@ Function f expected between 2 arguments and 3 arguments but got 1 - -> n (Number) - -> m (Number) was not provided +Call + ↳ (f 1) +Signature + ↳ (f n m) +Arguments + → `n' (expected Number) ✓ + → `m' (expected Number) was not provided + Alternative 2: - -> n (Number) - -> m (String) was not provided - -> o (List) was not provided +Signature + ↳ (f n m o) +Arguments + → `n' (expected Number) ✓ + → `m' (expected String) was not provided + → `o' (expected List) was not provided \ No newline at end of file diff --git a/tests/unittests/resources/TypeCheckerSuite/not_enough_args.expected b/tests/unittests/resources/TypeCheckerSuite/not_enough_args.expected index c316ce412..912d132d3 100644 --- a/tests/unittests/resources/TypeCheckerSuite/not_enough_args.expected +++ b/tests/unittests/resources/TypeCheckerSuite/not_enough_args.expected @@ -1,3 +1,8 @@ Function f expected 2 arguments but got 1 - -> n (Number) - -> m (Number) was not provided +Call + ↳ (f 1) +Signature + ↳ (f n m) +Arguments + → `n' (expected Number) ✓ + → `m' (expected Number) was not provided \ No newline at end of file diff --git a/tests/unittests/resources/TypeCheckerSuite/num.expected b/tests/unittests/resources/TypeCheckerSuite/num.expected index a6bfe8c23..513364755 100644 --- a/tests/unittests/resources/TypeCheckerSuite/num.expected +++ b/tests/unittests/resources/TypeCheckerSuite/num.expected @@ -1,2 +1,7 @@ Function f expected 1 argument - -> n (Number) was of type String +Call + ↳ (f hello) +Signature + ↳ (f n) +Arguments + → `n' (expected Number), got hello (String) \ No newline at end of file diff --git a/tests/unittests/resources/TypeCheckerSuite/sum_type.expected b/tests/unittests/resources/TypeCheckerSuite/sum_type.expected index 14c76ac65..59794a16f 100644 --- a/tests/unittests/resources/TypeCheckerSuite/sum_type.expected +++ b/tests/unittests/resources/TypeCheckerSuite/sum_type.expected @@ -1,2 +1,7 @@ Function f expected 1 argument - -> n (Number, String) was of type Bool +Call + ↳ (f true) +Signature + ↳ (f n) +Arguments + → `n' (expected Number, or String), got true (Bool) \ No newline at end of file diff --git a/tests/unittests/resources/TypeCheckerSuite/too_many_args.expected b/tests/unittests/resources/TypeCheckerSuite/too_many_args.expected index 2fa2df844..f9dc0729e 100644 --- a/tests/unittests/resources/TypeCheckerSuite/too_many_args.expected +++ b/tests/unittests/resources/TypeCheckerSuite/too_many_args.expected @@ -1,2 +1,8 @@ Function f expected 1 argument but got 2 - -> n (Number) +Call + ↳ (f 1 hello) +Signature + ↳ (f n) +Arguments + → `n' (expected Number) ✓ + → unexpected additional args: hello (String) \ No newline at end of file diff --git a/tests/unittests/resources/TypeCheckerSuite/variadic.expected b/tests/unittests/resources/TypeCheckerSuite/variadic.expected index fdd9fab22..844fefad3 100644 --- a/tests/unittests/resources/TypeCheckerSuite/variadic.expected +++ b/tests/unittests/resources/TypeCheckerSuite/variadic.expected @@ -1,2 +1,10 @@ Function f expected at least 1 argument and got 2 - -> variadic vararg (Number) 1 argument do not match +Call + ↳ (f 1 hello) +Signature + ↳ (f vararg) +Arguments + → variadic `vararg' (expected Number): 1 argument do not match: + 1 (Number) ✓ + hello (String) × + → unexpected additional args: hello (String)