From 0f2f97e3e568add51300d4859e3f4534123a9791 Mon Sep 17 00:00:00 2001 From: Enzo Baldisserri Date: Sun, 26 Apr 2020 12:34:42 +0200 Subject: [PATCH] checker: reorganize tests to match fmt tests --- vlib/v/checker/checker.v | 11 ++++ .../checker_error_test.v => checker_test.v} | 2 +- .../tests/add_op_wrong_left_type_err_a.out | 6 +++ ...rr_a.vv => add_op_wrong_left_type_err_a.v} | 0 .../tests/add_op_wrong_left_type_err_a.vv | 4 ++ .../tests/add_op_wrong_left_type_err_b.out | 5 ++ ...rr_b.vv => add_op_wrong_left_type_err_b.v} | 0 .../tests/add_op_wrong_left_type_err_b.vv | 3 ++ .../tests/add_op_wrong_left_type_err_c.out | 6 +++ ...rr_c.vv => add_op_wrong_left_type_err_c.v} | 0 .../tests/add_op_wrong_left_type_err_c.vv | 4 ++ .../tests/add_op_wrong_right_type_err_a.out | 6 +++ ...r_a.vv => add_op_wrong_right_type_err_a.v} | 0 .../tests/add_op_wrong_right_type_err_a.vv | 4 ++ .../tests/add_op_wrong_right_type_err_b.out | 5 ++ ...r_b.vv => add_op_wrong_right_type_err_b.v} | 0 .../tests/add_op_wrong_right_type_err_b.vv | 3 ++ .../tests/add_op_wrong_right_type_err_c.out | 6 +++ ...r_c.vv => add_op_wrong_right_type_err_c.v} | 0 .../tests/add_op_wrong_right_type_err_c.vv | 4 ++ vlib/v/checker/tests/alias_type_exists.out | 5 ++ ...ias_type_exists.vv => alias_type_exists.v} | 0 vlib/v/checker/tests/alias_type_exists.vv | 5 ++ .../checker/tests/assign_expr_type_err_a.out | 6 +++ vlib/v/checker/tests/assign_expr_type_err_a.v | 4 ++ .../{inout => }/assign_expr_type_err_a.vv | 6 +-- .../checker/tests/assign_expr_type_err_b.out | 6 +++ vlib/v/checker/tests/assign_expr_type_err_b.v | 4 ++ .../{inout => }/assign_expr_type_err_b.vv | 6 +-- .../checker/tests/assign_expr_type_err_c.out | 6 +++ vlib/v/checker/tests/assign_expr_type_err_c.v | 4 ++ .../{inout => }/assign_expr_type_err_c.vv | 6 +-- .../checker/tests/assign_expr_type_err_d.out | 6 +++ vlib/v/checker/tests/assign_expr_type_err_d.v | 4 ++ .../{inout => }/assign_expr_type_err_d.vv | 6 +-- .../checker/tests/assign_expr_type_err_e.out | 6 +++ vlib/v/checker/tests/assign_expr_type_err_e.v | 4 ++ .../{inout => }/assign_expr_type_err_e.vv | 6 +-- .../checker/tests/assign_expr_type_err_f.out | 6 +++ vlib/v/checker/tests/assign_expr_type_err_f.v | 4 ++ .../{inout => }/assign_expr_type_err_f.vv | 6 +-- .../checker/tests/assign_expr_type_err_g.out | 6 +++ vlib/v/checker/tests/assign_expr_type_err_g.v | 4 ++ .../{inout => }/assign_expr_type_err_g.vv | 6 +-- .../checker/tests/assign_expr_type_err_h.out | 6 +++ vlib/v/checker/tests/assign_expr_type_err_h.v | 4 ++ .../{inout => }/assign_expr_type_err_h.vv | 6 +-- .../checker/tests/assign_expr_type_err_i.out | 6 +++ vlib/v/checker/tests/assign_expr_type_err_i.v | 4 ++ .../{inout => }/assign_expr_type_err_i.vv | 6 +-- .../tests/bit_op_wrong_left_type_err.out | 5 ++ .../tests/bit_op_wrong_left_type_err.v | 3 ++ .../{inout => }/bit_op_wrong_left_type_err.vv | 4 +- .../tests/bit_op_wrong_right_type_err.out | 5 ++ ...e_err.vv => bit_op_wrong_right_type_err.v} | 0 .../tests/bit_op_wrong_right_type_err.vv | 3 ++ .../tests/{inout => }/cannot_assign_array.out | 2 +- ..._assign_array.vv => cannot_assign_array.v} | 0 vlib/v/checker/tests/cannot_assign_array.vv | 10 ++++ vlib/v/checker/tests/decl_underscore.out | 5 ++ .../decl_underscore.vv => decl_underscore.v} | 0 vlib/v/checker/tests/decl_underscore.vv | 3 ++ .../tests/div_op_wrong_left_type_err_a.out | 6 +++ ...rr_a.vv => div_op_wrong_left_type_err_a.v} | 0 .../tests/div_op_wrong_left_type_err_a.vv | 4 ++ .../tests/div_op_wrong_left_type_err_b.out | 5 ++ ...rr_b.vv => div_op_wrong_left_type_err_b.v} | 0 .../tests/div_op_wrong_left_type_err_b.vv | 3 ++ .../tests/div_op_wrong_left_type_err_c.out | 6 +++ ...rr_c.vv => div_op_wrong_left_type_err_c.v} | 0 .../tests/div_op_wrong_left_type_err_c.vv | 4 ++ .../tests/div_op_wrong_right_type_err_a.out | 6 +++ ...r_a.vv => div_op_wrong_right_type_err_a.v} | 0 .../tests/div_op_wrong_right_type_err_a.vv | 4 ++ .../tests/div_op_wrong_right_type_err_b.out | 5 ++ ...r_b.vv => div_op_wrong_right_type_err_b.v} | 0 .../tests/div_op_wrong_right_type_err_b.vv | 3 ++ .../tests/div_op_wrong_right_type_err_c.out | 6 +++ ...r_c.vv => div_op_wrong_right_type_err_c.v} | 0 .../tests/div_op_wrong_right_type_err_c.vv | 4 ++ vlib/v/checker/tests/{inout => }/enum_err.out | 6 +-- .../tests/{inout/enum_err.vv => enum_err.v} | 0 vlib/v/checker/tests/enum_err.vv | 11 ++++ .../tests/{inout => }/fn_type_exists.out | 4 +- .../fn_type_exists.vv => fn_type_exists.v} | 0 vlib/v/checker/tests/fn_type_exists.vv | 7 +++ .../tests/{inout => }/for-in-index-type.out | 2 +- ...r-in-index-type.vv => for-in-index-type.v} | 0 vlib/v/checker/tests/for-in-index-type.vv | 5 ++ .../for_in_range_not_match_type.out | 2 +- ..._type.vv => for_in_range_not_match_type.v} | 0 .../tests/for_in_range_not_match_type.vv | 5 ++ .../{inout => }/for_in_range_string_type.out | 2 +- ...ing_type.vv => for_in_range_string_type.v} | 0 .../checker/tests/for_in_range_string_type.vv | 5 ++ vlib/v/checker/tests/go_expr.out | 5 ++ .../tests/{inout/go_expr.vv => go_expr.v} | 0 vlib/v/checker/tests/go_expr.vv | 3 ++ .../tests/{inout => }/in_mismatch_type.out | 16 +++--- ...in_mismatch_type.vv => in_mismatch_type.v} | 0 vlib/v/checker/tests/in_mismatch_type.vv | 37 +++++++++++++ .../inout/add_op_wrong_left_type_err_a.out | 6 --- .../inout/add_op_wrong_left_type_err_b.out | 5 -- .../inout/add_op_wrong_left_type_err_c.out | 6 --- .../inout/add_op_wrong_right_type_err_a.out | 6 --- .../inout/add_op_wrong_right_type_err_b.out | 5 -- .../inout/add_op_wrong_right_type_err_c.out | 6 --- .../checker/tests/inout/alias_type_exists.out | 5 -- .../tests/inout/assign_expr_type_err_a.out | 6 --- .../tests/inout/assign_expr_type_err_b.out | 6 --- .../tests/inout/assign_expr_type_err_c.out | 6 --- .../tests/inout/assign_expr_type_err_d.out | 6 --- .../tests/inout/assign_expr_type_err_e.out | 6 --- .../tests/inout/assign_expr_type_err_f.out | 6 --- .../tests/inout/assign_expr_type_err_g.out | 6 --- .../tests/inout/assign_expr_type_err_h.out | 6 --- .../tests/inout/assign_expr_type_err_i.out | 6 --- .../inout/bit_op_wrong_left_type_err.out | 5 -- .../inout/bit_op_wrong_right_type_err.out | 5 -- .../v/checker/tests/inout/decl_underscore.out | 5 -- .../inout/div_op_wrong_left_type_err_a.out | 6 --- .../inout/div_op_wrong_left_type_err_b.out | 5 -- .../inout/div_op_wrong_left_type_err_c.out | 6 --- .../inout/div_op_wrong_right_type_err_a.out | 6 --- .../inout/div_op_wrong_right_type_err_b.out | 5 -- .../inout/div_op_wrong_right_type_err_c.out | 6 --- vlib/v/checker/tests/inout/go_expr.out | 5 -- .../inout/minus_op_wrong_left_type_err_a.out | 6 --- .../inout/minus_op_wrong_left_type_err_b.out | 5 -- .../inout/minus_op_wrong_left_type_err_c.out | 6 --- .../inout/minus_op_wrong_right_type_err_a.out | 6 --- .../inout/minus_op_wrong_right_type_err_b.out | 5 -- .../inout/minus_op_wrong_right_type_err_c.out | 6 --- .../inout/mod_op_wrong_left_type_err_a.out | 5 -- .../inout/mod_op_wrong_left_type_err_b.out | 5 -- .../inout/mod_op_wrong_left_type_err_c.out | 6 --- .../inout/mod_op_wrong_left_type_err_d.out | 6 --- .../inout/mod_op_wrong_right_type_err_a.out | 5 -- .../inout/mod_op_wrong_right_type_err_b.out | 5 -- .../inout/mod_op_wrong_right_type_err_c.out | 6 --- .../inout/mod_op_wrong_right_type_err_d.out | 6 --- .../inout/mul_op_wrong_left_type_err_a.out | 6 --- .../inout/mul_op_wrong_left_type_err_b.out | 5 -- .../inout/mul_op_wrong_left_type_err_c.out | 6 --- .../inout/mul_op_wrong_right_type_err_a.out | 6 --- .../inout/mul_op_wrong_right_type_err_b.out | 5 -- .../inout/mul_op_wrong_right_type_err_c.out | 6 --- vlib/v/checker/tests/inout/no_fn_main.out | 5 -- vlib/v/checker/tests/inout/no_pub_in_main.out | 49 ----------------- vlib/v/checker/tests/inout/return_type.out | 6 --- .../inout/shift_op_wrong_left_type_err.out | 5 -- .../inout/shift_op_wrong_right_type_err.out | 5 -- vlib/v/checker/tests/inout/struct_name.out | 5 -- .../tests/{inout => }/is_type_not_exist.out | 2 +- ..._type_not_exist.vv => is_type_not_exist.v} | 0 vlib/v/checker/tests/is_type_not_exist.vv | 11 ++++ .../tests/{inout => }/left_shift_err.out | 2 +- .../left_shift_err.vv => left_shift_err.v} | 0 vlib/v/checker/tests/left_shift_err.vv | 4 ++ .../{inout => }/match_duplicate_branch.out | 10 ++-- ...ate_branch.vv => match_duplicate_branch.v} | 0 .../v/checker/tests/match_duplicate_branch.vv | 52 +++++++++++++++++++ .../{inout => }/match_else_last_expr.out | 2 +- ...se_last_expr.vv => match_else_last_expr.v} | 0 vlib/v/checker/tests/match_else_last_expr.vv | 7 +++ .../tests/{inout => }/match_expr_else.out | 6 +-- .../match_expr_else.vv => match_expr_else.v} | 0 vlib/v/checker/tests/match_expr_else.vv | 41 +++++++++++++++ .../{inout => }/match_undefined_cond.out | 2 +- ...defined_cond.vv => match_undefined_cond.v} | 0 vlib/v/checker/tests/match_undefined_cond.vv | 10 ++++ .../tests/minus_op_wrong_left_type_err_a.out | 6 +++ ..._a.vv => minus_op_wrong_left_type_err_a.v} | 0 .../tests/minus_op_wrong_left_type_err_a.vv | 4 ++ .../tests/minus_op_wrong_left_type_err_b.out | 5 ++ ..._b.vv => minus_op_wrong_left_type_err_b.v} | 0 .../tests/minus_op_wrong_left_type_err_b.vv | 3 ++ .../tests/minus_op_wrong_left_type_err_c.out | 6 +++ ..._c.vv => minus_op_wrong_left_type_err_c.v} | 0 .../tests/minus_op_wrong_left_type_err_c.vv | 4 ++ .../tests/minus_op_wrong_right_type_err_a.out | 6 +++ ...a.vv => minus_op_wrong_right_type_err_a.v} | 0 .../tests/minus_op_wrong_right_type_err_a.vv | 4 ++ .../tests/minus_op_wrong_right_type_err_b.out | 5 ++ ...b.vv => minus_op_wrong_right_type_err_b.v} | 0 .../tests/minus_op_wrong_right_type_err_b.vv | 3 ++ .../tests/minus_op_wrong_right_type_err_c.out | 6 +++ ...c.vv => minus_op_wrong_right_type_err_c.v} | 0 .../tests/minus_op_wrong_right_type_err_c.vv | 4 ++ ..._err_a.vv => mod_op_wrong_left_type_err.v} | 0 .../tests/mod_op_wrong_left_type_err_a.out | 5 ++ .../tests/mod_op_wrong_left_type_err_a.v | 3 ++ .../tests/mod_op_wrong_left_type_err_a.vv | 3 ++ .../tests/mod_op_wrong_left_type_err_b.out | 5 ++ ...rr_b.vv => mod_op_wrong_left_type_err_b.v} | 0 .../tests/mod_op_wrong_left_type_err_b.vv | 3 ++ .../tests/mod_op_wrong_left_type_err_c.out | 6 +++ ...rr_c.vv => mod_op_wrong_left_type_err_c.v} | 0 .../tests/mod_op_wrong_left_type_err_c.vv | 5 ++ .../tests/mod_op_wrong_left_type_err_d.out | 6 +++ ...rr_d.vv => mod_op_wrong_left_type_err_d.v} | 0 .../tests/mod_op_wrong_left_type_err_d.vv | 4 ++ ...err_a.vv => mod_op_wrong_right_type_err.v} | 0 .../tests/mod_op_wrong_right_type_err_a.out | 5 ++ .../tests/mod_op_wrong_right_type_err_a.v | 3 ++ .../tests/mod_op_wrong_right_type_err_a.vv | 3 ++ .../tests/mod_op_wrong_right_type_err_b.out | 5 ++ ...r_b.vv => mod_op_wrong_right_type_err_b.v} | 0 .../tests/mod_op_wrong_right_type_err_b.vv | 3 ++ .../tests/mod_op_wrong_right_type_err_c.out | 6 +++ ...r_c.vv => mod_op_wrong_right_type_err_c.v} | 0 .../tests/mod_op_wrong_right_type_err_c.vv | 5 ++ .../tests/mod_op_wrong_right_type_err_d.out | 6 +++ ...r_d.vv => mod_op_wrong_right_type_err_d.v} | 0 .../tests/mod_op_wrong_right_type_err_d.vv | 4 ++ .../tests/mul_op_wrong_left_type_err_a.out | 6 +++ ...rr_a.vv => mul_op_wrong_left_type_err_a.v} | 0 .../tests/mul_op_wrong_left_type_err_a.vv | 4 ++ .../tests/mul_op_wrong_left_type_err_b.out | 5 ++ ...rr_b.vv => mul_op_wrong_left_type_err_b.v} | 0 .../tests/mul_op_wrong_left_type_err_b.vv | 3 ++ .../tests/mul_op_wrong_left_type_err_c.out | 6 +++ ...rr_c.vv => mul_op_wrong_left_type_err_c.v} | 0 .../tests/mul_op_wrong_left_type_err_c.vv | 4 ++ .../tests/mul_op_wrong_right_type_err_a.out | 6 +++ ...r_a.vv => mul_op_wrong_right_type_err_a.v} | 0 .../tests/mul_op_wrong_right_type_err_a.vv | 4 ++ .../tests/mul_op_wrong_right_type_err_b.out | 5 ++ ...r_b.vv => mul_op_wrong_right_type_err_b.v} | 0 .../tests/mul_op_wrong_right_type_err_b.vv | 3 ++ .../tests/mul_op_wrong_right_type_err_c.out | 6 +++ ...r_c.vv => mul_op_wrong_right_type_err_c.v} | 0 .../tests/mul_op_wrong_right_type_err_c.vv | 4 ++ vlib/v/checker/tests/no_fn_main.out | 5 ++ .../{inout/no_fn_main.vv => no_fn_main.v} | 0 vlib/v/checker/tests/no_fn_main.vv | 3 ++ vlib/v/checker/tests/no_pub_in_main.out | 49 +++++++++++++++++ .../no_pub_in_main.vv => no_pub_in_main.v} | 0 vlib/v/checker/tests/no_pub_in_main.vv | 30 +++++++++++ vlib/v/checker/tests/return_type.out | 6 +++ .../{inout/return_type.vv => return_type.v} | 0 vlib/v/checker/tests/return_type.vv | 5 ++ .../tests/shift_op_wrong_left_type_err.out | 5 ++ ..._err.vv => shift_op_wrong_left_type_err.v} | 0 .../tests/shift_op_wrong_left_type_err.vv | 3 ++ .../tests/shift_op_wrong_right_type_err.out | 5 ++ ...err.vv => shift_op_wrong_right_type_err.v} | 0 .../tests/shift_op_wrong_right_type_err.vv | 3 ++ .../{inout => }/short_struct_too_many.out | 2 +- ...ct_too_many.vv => short_struct_too_many.v} | 0 vlib/v/checker/tests/short_struct_too_many.vv | 8 +++ vlib/v/checker/tests/struct_name.out | 5 ++ .../{inout/struct_name.vv => struct_name.v} | 0 vlib/v/checker/tests/struct_name.vv | 5 ++ .../{inout => }/struct_unknown_field.out | 2 +- ...nknown_field.vv => struct_unknown_field.v} | 0 vlib/v/checker/tests/struct_unknown_field.vv | 11 ++++ .../tests/{inout => }/sum_type_exists.out | 2 +- .../sum_type_exists.vv => sum_type_exists.v} | 0 vlib/v/checker/tests/sum_type_exists.vv | 5 ++ .../tests/{inout => }/unknown_field.out | 2 +- .../unknown_field.vv => unknown_field.v} | 0 vlib/v/checker/tests/unknown_field.vv | 8 +++ .../tests/{inout => }/unknown_method.out | 2 +- .../unknown_method.vv => unknown_method.v} | 0 vlib/v/checker/tests/unknown_method.vv | 8 +++ .../{inout => }/unnecessary_parenthesis.out | 6 +-- ...renthesis.vv => unnecessary_parenthesis.v} | 0 .../checker/tests/unnecessary_parenthesis.vv | 9 ++++ .../tests/{inout => }/void_fn_as_value.out | 2 +- ...void_fn_as_value.vv => void_fn_as_value.v} | 0 vlib/v/checker/tests/void_fn_as_value.vv | 8 +++ .../void_function_assign_to_string.out | 2 +- ...ng.vv => void_function_assign_to_string.v} | 0 .../tests/void_function_assign_to_string.vv | 8 +++ 275 files changed, 910 insertions(+), 403 deletions(-) rename vlib/v/checker/{tests/inout/checker_error_test.v => checker_test.v} (96%) create mode 100644 vlib/v/checker/tests/add_op_wrong_left_type_err_a.out rename vlib/v/checker/tests/{inout/add_op_wrong_left_type_err_a.vv => add_op_wrong_left_type_err_a.v} (100%) create mode 100644 vlib/v/checker/tests/add_op_wrong_left_type_err_a.vv create mode 100644 vlib/v/checker/tests/add_op_wrong_left_type_err_b.out rename vlib/v/checker/tests/{inout/add_op_wrong_left_type_err_b.vv => add_op_wrong_left_type_err_b.v} (100%) create mode 100644 vlib/v/checker/tests/add_op_wrong_left_type_err_b.vv create mode 100644 vlib/v/checker/tests/add_op_wrong_left_type_err_c.out rename vlib/v/checker/tests/{inout/add_op_wrong_left_type_err_c.vv => add_op_wrong_left_type_err_c.v} (100%) create mode 100644 vlib/v/checker/tests/add_op_wrong_left_type_err_c.vv create mode 100644 vlib/v/checker/tests/add_op_wrong_right_type_err_a.out rename vlib/v/checker/tests/{inout/add_op_wrong_right_type_err_a.vv => add_op_wrong_right_type_err_a.v} (100%) create mode 100644 vlib/v/checker/tests/add_op_wrong_right_type_err_a.vv create mode 100644 vlib/v/checker/tests/add_op_wrong_right_type_err_b.out rename vlib/v/checker/tests/{inout/add_op_wrong_right_type_err_b.vv => add_op_wrong_right_type_err_b.v} (100%) create mode 100644 vlib/v/checker/tests/add_op_wrong_right_type_err_b.vv create mode 100644 vlib/v/checker/tests/add_op_wrong_right_type_err_c.out rename vlib/v/checker/tests/{inout/add_op_wrong_right_type_err_c.vv => add_op_wrong_right_type_err_c.v} (100%) create mode 100644 vlib/v/checker/tests/add_op_wrong_right_type_err_c.vv create mode 100644 vlib/v/checker/tests/alias_type_exists.out rename vlib/v/checker/tests/{inout/alias_type_exists.vv => alias_type_exists.v} (100%) create mode 100644 vlib/v/checker/tests/alias_type_exists.vv create mode 100644 vlib/v/checker/tests/assign_expr_type_err_a.out create mode 100644 vlib/v/checker/tests/assign_expr_type_err_a.v rename vlib/v/checker/tests/{inout => }/assign_expr_type_err_a.vv (93%) create mode 100644 vlib/v/checker/tests/assign_expr_type_err_b.out create mode 100644 vlib/v/checker/tests/assign_expr_type_err_b.v rename vlib/v/checker/tests/{inout => }/assign_expr_type_err_b.vv (93%) create mode 100644 vlib/v/checker/tests/assign_expr_type_err_c.out create mode 100644 vlib/v/checker/tests/assign_expr_type_err_c.v rename vlib/v/checker/tests/{inout => }/assign_expr_type_err_c.vv (93%) create mode 100644 vlib/v/checker/tests/assign_expr_type_err_d.out create mode 100644 vlib/v/checker/tests/assign_expr_type_err_d.v rename vlib/v/checker/tests/{inout => }/assign_expr_type_err_d.vv (93%) create mode 100644 vlib/v/checker/tests/assign_expr_type_err_e.out create mode 100644 vlib/v/checker/tests/assign_expr_type_err_e.v rename vlib/v/checker/tests/{inout => }/assign_expr_type_err_e.vv (93%) create mode 100644 vlib/v/checker/tests/assign_expr_type_err_f.out create mode 100644 vlib/v/checker/tests/assign_expr_type_err_f.v rename vlib/v/checker/tests/{inout => }/assign_expr_type_err_f.vv (93%) create mode 100644 vlib/v/checker/tests/assign_expr_type_err_g.out create mode 100644 vlib/v/checker/tests/assign_expr_type_err_g.v rename vlib/v/checker/tests/{inout => }/assign_expr_type_err_g.vv (93%) create mode 100644 vlib/v/checker/tests/assign_expr_type_err_h.out create mode 100644 vlib/v/checker/tests/assign_expr_type_err_h.v rename vlib/v/checker/tests/{inout => }/assign_expr_type_err_h.vv (94%) create mode 100644 vlib/v/checker/tests/assign_expr_type_err_i.out create mode 100644 vlib/v/checker/tests/assign_expr_type_err_i.v rename vlib/v/checker/tests/{inout => }/assign_expr_type_err_i.vv (93%) create mode 100644 vlib/v/checker/tests/bit_op_wrong_left_type_err.out create mode 100644 vlib/v/checker/tests/bit_op_wrong_left_type_err.v rename vlib/v/checker/tests/{inout => }/bit_op_wrong_left_type_err.vv (91%) create mode 100644 vlib/v/checker/tests/bit_op_wrong_right_type_err.out rename vlib/v/checker/tests/{inout/bit_op_wrong_right_type_err.vv => bit_op_wrong_right_type_err.v} (100%) create mode 100644 vlib/v/checker/tests/bit_op_wrong_right_type_err.vv rename vlib/v/checker/tests/{inout => }/cannot_assign_array.out (57%) rename vlib/v/checker/tests/{inout/cannot_assign_array.vv => cannot_assign_array.v} (100%) create mode 100644 vlib/v/checker/tests/cannot_assign_array.vv create mode 100644 vlib/v/checker/tests/decl_underscore.out rename vlib/v/checker/tests/{inout/decl_underscore.vv => decl_underscore.v} (100%) create mode 100644 vlib/v/checker/tests/decl_underscore.vv create mode 100644 vlib/v/checker/tests/div_op_wrong_left_type_err_a.out rename vlib/v/checker/tests/{inout/div_op_wrong_left_type_err_a.vv => div_op_wrong_left_type_err_a.v} (100%) create mode 100644 vlib/v/checker/tests/div_op_wrong_left_type_err_a.vv create mode 100644 vlib/v/checker/tests/div_op_wrong_left_type_err_b.out rename vlib/v/checker/tests/{inout/div_op_wrong_left_type_err_b.vv => div_op_wrong_left_type_err_b.v} (100%) create mode 100644 vlib/v/checker/tests/div_op_wrong_left_type_err_b.vv create mode 100644 vlib/v/checker/tests/div_op_wrong_left_type_err_c.out rename vlib/v/checker/tests/{inout/div_op_wrong_left_type_err_c.vv => div_op_wrong_left_type_err_c.v} (100%) create mode 100644 vlib/v/checker/tests/div_op_wrong_left_type_err_c.vv create mode 100644 vlib/v/checker/tests/div_op_wrong_right_type_err_a.out rename vlib/v/checker/tests/{inout/div_op_wrong_right_type_err_a.vv => div_op_wrong_right_type_err_a.v} (100%) create mode 100644 vlib/v/checker/tests/div_op_wrong_right_type_err_a.vv create mode 100644 vlib/v/checker/tests/div_op_wrong_right_type_err_b.out rename vlib/v/checker/tests/{inout/div_op_wrong_right_type_err_b.vv => div_op_wrong_right_type_err_b.v} (100%) create mode 100644 vlib/v/checker/tests/div_op_wrong_right_type_err_b.vv create mode 100644 vlib/v/checker/tests/div_op_wrong_right_type_err_c.out rename vlib/v/checker/tests/{inout/div_op_wrong_right_type_err_c.vv => div_op_wrong_right_type_err_c.v} (100%) create mode 100644 vlib/v/checker/tests/div_op_wrong_right_type_err_c.vv rename vlib/v/checker/tests/{inout => }/enum_err.out (54%) rename vlib/v/checker/tests/{inout/enum_err.vv => enum_err.v} (100%) create mode 100644 vlib/v/checker/tests/enum_err.vv rename vlib/v/checker/tests/{inout => }/fn_type_exists.out (61%) rename vlib/v/checker/tests/{inout/fn_type_exists.vv => fn_type_exists.v} (100%) create mode 100644 vlib/v/checker/tests/fn_type_exists.vv rename vlib/v/checker/tests/{inout => }/for-in-index-type.out (54%) rename vlib/v/checker/tests/{inout/for-in-index-type.vv => for-in-index-type.v} (100%) create mode 100644 vlib/v/checker/tests/for-in-index-type.vv rename vlib/v/checker/tests/{inout => }/for_in_range_not_match_type.out (53%) rename vlib/v/checker/tests/{inout/for_in_range_not_match_type.vv => for_in_range_not_match_type.v} (100%) create mode 100644 vlib/v/checker/tests/for_in_range_not_match_type.vv rename vlib/v/checker/tests/{inout => }/for_in_range_string_type.out (53%) rename vlib/v/checker/tests/{inout/for_in_range_string_type.vv => for_in_range_string_type.v} (100%) create mode 100644 vlib/v/checker/tests/for_in_range_string_type.vv create mode 100644 vlib/v/checker/tests/go_expr.out rename vlib/v/checker/tests/{inout/go_expr.vv => go_expr.v} (100%) create mode 100644 vlib/v/checker/tests/go_expr.vv rename vlib/v/checker/tests/{inout => }/in_mismatch_type.out (53%) rename vlib/v/checker/tests/{inout/in_mismatch_type.vv => in_mismatch_type.v} (100%) create mode 100644 vlib/v/checker/tests/in_mismatch_type.vv delete mode 100644 vlib/v/checker/tests/inout/add_op_wrong_left_type_err_a.out delete mode 100644 vlib/v/checker/tests/inout/add_op_wrong_left_type_err_b.out delete mode 100644 vlib/v/checker/tests/inout/add_op_wrong_left_type_err_c.out delete mode 100644 vlib/v/checker/tests/inout/add_op_wrong_right_type_err_a.out delete mode 100644 vlib/v/checker/tests/inout/add_op_wrong_right_type_err_b.out delete mode 100644 vlib/v/checker/tests/inout/add_op_wrong_right_type_err_c.out delete mode 100644 vlib/v/checker/tests/inout/alias_type_exists.out delete mode 100644 vlib/v/checker/tests/inout/assign_expr_type_err_a.out delete mode 100644 vlib/v/checker/tests/inout/assign_expr_type_err_b.out delete mode 100644 vlib/v/checker/tests/inout/assign_expr_type_err_c.out delete mode 100644 vlib/v/checker/tests/inout/assign_expr_type_err_d.out delete mode 100644 vlib/v/checker/tests/inout/assign_expr_type_err_e.out delete mode 100644 vlib/v/checker/tests/inout/assign_expr_type_err_f.out delete mode 100644 vlib/v/checker/tests/inout/assign_expr_type_err_g.out delete mode 100644 vlib/v/checker/tests/inout/assign_expr_type_err_h.out delete mode 100644 vlib/v/checker/tests/inout/assign_expr_type_err_i.out delete mode 100644 vlib/v/checker/tests/inout/bit_op_wrong_left_type_err.out delete mode 100644 vlib/v/checker/tests/inout/bit_op_wrong_right_type_err.out delete mode 100644 vlib/v/checker/tests/inout/decl_underscore.out delete mode 100644 vlib/v/checker/tests/inout/div_op_wrong_left_type_err_a.out delete mode 100644 vlib/v/checker/tests/inout/div_op_wrong_left_type_err_b.out delete mode 100644 vlib/v/checker/tests/inout/div_op_wrong_left_type_err_c.out delete mode 100644 vlib/v/checker/tests/inout/div_op_wrong_right_type_err_a.out delete mode 100644 vlib/v/checker/tests/inout/div_op_wrong_right_type_err_b.out delete mode 100644 vlib/v/checker/tests/inout/div_op_wrong_right_type_err_c.out delete mode 100644 vlib/v/checker/tests/inout/go_expr.out delete mode 100644 vlib/v/checker/tests/inout/minus_op_wrong_left_type_err_a.out delete mode 100644 vlib/v/checker/tests/inout/minus_op_wrong_left_type_err_b.out delete mode 100644 vlib/v/checker/tests/inout/minus_op_wrong_left_type_err_c.out delete mode 100644 vlib/v/checker/tests/inout/minus_op_wrong_right_type_err_a.out delete mode 100644 vlib/v/checker/tests/inout/minus_op_wrong_right_type_err_b.out delete mode 100644 vlib/v/checker/tests/inout/minus_op_wrong_right_type_err_c.out delete mode 100644 vlib/v/checker/tests/inout/mod_op_wrong_left_type_err_a.out delete mode 100644 vlib/v/checker/tests/inout/mod_op_wrong_left_type_err_b.out delete mode 100644 vlib/v/checker/tests/inout/mod_op_wrong_left_type_err_c.out delete mode 100644 vlib/v/checker/tests/inout/mod_op_wrong_left_type_err_d.out delete mode 100644 vlib/v/checker/tests/inout/mod_op_wrong_right_type_err_a.out delete mode 100644 vlib/v/checker/tests/inout/mod_op_wrong_right_type_err_b.out delete mode 100644 vlib/v/checker/tests/inout/mod_op_wrong_right_type_err_c.out delete mode 100644 vlib/v/checker/tests/inout/mod_op_wrong_right_type_err_d.out delete mode 100644 vlib/v/checker/tests/inout/mul_op_wrong_left_type_err_a.out delete mode 100644 vlib/v/checker/tests/inout/mul_op_wrong_left_type_err_b.out delete mode 100644 vlib/v/checker/tests/inout/mul_op_wrong_left_type_err_c.out delete mode 100644 vlib/v/checker/tests/inout/mul_op_wrong_right_type_err_a.out delete mode 100644 vlib/v/checker/tests/inout/mul_op_wrong_right_type_err_b.out delete mode 100644 vlib/v/checker/tests/inout/mul_op_wrong_right_type_err_c.out delete mode 100644 vlib/v/checker/tests/inout/no_fn_main.out delete mode 100644 vlib/v/checker/tests/inout/no_pub_in_main.out delete mode 100644 vlib/v/checker/tests/inout/return_type.out delete mode 100644 vlib/v/checker/tests/inout/shift_op_wrong_left_type_err.out delete mode 100644 vlib/v/checker/tests/inout/shift_op_wrong_right_type_err.out delete mode 100644 vlib/v/checker/tests/inout/struct_name.out rename vlib/v/checker/tests/{inout => }/is_type_not_exist.out (64%) rename vlib/v/checker/tests/{inout/is_type_not_exist.vv => is_type_not_exist.v} (100%) create mode 100644 vlib/v/checker/tests/is_type_not_exist.vv rename vlib/v/checker/tests/{inout => }/left_shift_err.out (50%) rename vlib/v/checker/tests/{inout/left_shift_err.vv => left_shift_err.v} (100%) create mode 100644 vlib/v/checker/tests/left_shift_err.vv rename vlib/v/checker/tests/{inout => }/match_duplicate_branch.out (62%) rename vlib/v/checker/tests/{inout/match_duplicate_branch.vv => match_duplicate_branch.v} (100%) create mode 100644 vlib/v/checker/tests/match_duplicate_branch.vv rename vlib/v/checker/tests/{inout => }/match_else_last_expr.out (61%) rename vlib/v/checker/tests/{inout/match_else_last_expr.vv => match_else_last_expr.v} (100%) create mode 100644 vlib/v/checker/tests/match_else_last_expr.vv rename vlib/v/checker/tests/{inout => }/match_expr_else.out (53%) rename vlib/v/checker/tests/{inout/match_expr_else.vv => match_expr_else.v} (100%) create mode 100644 vlib/v/checker/tests/match_expr_else.vv rename vlib/v/checker/tests/{inout => }/match_undefined_cond.out (63%) rename vlib/v/checker/tests/{inout/match_undefined_cond.vv => match_undefined_cond.v} (100%) create mode 100644 vlib/v/checker/tests/match_undefined_cond.vv create mode 100644 vlib/v/checker/tests/minus_op_wrong_left_type_err_a.out rename vlib/v/checker/tests/{inout/minus_op_wrong_left_type_err_a.vv => minus_op_wrong_left_type_err_a.v} (100%) create mode 100644 vlib/v/checker/tests/minus_op_wrong_left_type_err_a.vv create mode 100644 vlib/v/checker/tests/minus_op_wrong_left_type_err_b.out rename vlib/v/checker/tests/{inout/minus_op_wrong_left_type_err_b.vv => minus_op_wrong_left_type_err_b.v} (100%) create mode 100644 vlib/v/checker/tests/minus_op_wrong_left_type_err_b.vv create mode 100644 vlib/v/checker/tests/minus_op_wrong_left_type_err_c.out rename vlib/v/checker/tests/{inout/minus_op_wrong_left_type_err_c.vv => minus_op_wrong_left_type_err_c.v} (100%) create mode 100644 vlib/v/checker/tests/minus_op_wrong_left_type_err_c.vv create mode 100644 vlib/v/checker/tests/minus_op_wrong_right_type_err_a.out rename vlib/v/checker/tests/{inout/minus_op_wrong_right_type_err_a.vv => minus_op_wrong_right_type_err_a.v} (100%) create mode 100644 vlib/v/checker/tests/minus_op_wrong_right_type_err_a.vv create mode 100644 vlib/v/checker/tests/minus_op_wrong_right_type_err_b.out rename vlib/v/checker/tests/{inout/minus_op_wrong_right_type_err_b.vv => minus_op_wrong_right_type_err_b.v} (100%) create mode 100644 vlib/v/checker/tests/minus_op_wrong_right_type_err_b.vv create mode 100644 vlib/v/checker/tests/minus_op_wrong_right_type_err_c.out rename vlib/v/checker/tests/{inout/minus_op_wrong_right_type_err_c.vv => minus_op_wrong_right_type_err_c.v} (100%) create mode 100644 vlib/v/checker/tests/minus_op_wrong_right_type_err_c.vv rename vlib/v/checker/tests/{inout/mod_op_wrong_left_type_err_a.vv => mod_op_wrong_left_type_err.v} (100%) create mode 100644 vlib/v/checker/tests/mod_op_wrong_left_type_err_a.out create mode 100644 vlib/v/checker/tests/mod_op_wrong_left_type_err_a.v create mode 100644 vlib/v/checker/tests/mod_op_wrong_left_type_err_a.vv create mode 100644 vlib/v/checker/tests/mod_op_wrong_left_type_err_b.out rename vlib/v/checker/tests/{inout/mod_op_wrong_left_type_err_b.vv => mod_op_wrong_left_type_err_b.v} (100%) create mode 100644 vlib/v/checker/tests/mod_op_wrong_left_type_err_b.vv create mode 100644 vlib/v/checker/tests/mod_op_wrong_left_type_err_c.out rename vlib/v/checker/tests/{inout/mod_op_wrong_left_type_err_c.vv => mod_op_wrong_left_type_err_c.v} (100%) create mode 100644 vlib/v/checker/tests/mod_op_wrong_left_type_err_c.vv create mode 100644 vlib/v/checker/tests/mod_op_wrong_left_type_err_d.out rename vlib/v/checker/tests/{inout/mod_op_wrong_left_type_err_d.vv => mod_op_wrong_left_type_err_d.v} (100%) create mode 100644 vlib/v/checker/tests/mod_op_wrong_left_type_err_d.vv rename vlib/v/checker/tests/{inout/mod_op_wrong_right_type_err_a.vv => mod_op_wrong_right_type_err.v} (100%) create mode 100644 vlib/v/checker/tests/mod_op_wrong_right_type_err_a.out create mode 100644 vlib/v/checker/tests/mod_op_wrong_right_type_err_a.v create mode 100644 vlib/v/checker/tests/mod_op_wrong_right_type_err_a.vv create mode 100644 vlib/v/checker/tests/mod_op_wrong_right_type_err_b.out rename vlib/v/checker/tests/{inout/mod_op_wrong_right_type_err_b.vv => mod_op_wrong_right_type_err_b.v} (100%) create mode 100644 vlib/v/checker/tests/mod_op_wrong_right_type_err_b.vv create mode 100644 vlib/v/checker/tests/mod_op_wrong_right_type_err_c.out rename vlib/v/checker/tests/{inout/mod_op_wrong_right_type_err_c.vv => mod_op_wrong_right_type_err_c.v} (100%) create mode 100644 vlib/v/checker/tests/mod_op_wrong_right_type_err_c.vv create mode 100644 vlib/v/checker/tests/mod_op_wrong_right_type_err_d.out rename vlib/v/checker/tests/{inout/mod_op_wrong_right_type_err_d.vv => mod_op_wrong_right_type_err_d.v} (100%) create mode 100644 vlib/v/checker/tests/mod_op_wrong_right_type_err_d.vv create mode 100644 vlib/v/checker/tests/mul_op_wrong_left_type_err_a.out rename vlib/v/checker/tests/{inout/mul_op_wrong_left_type_err_a.vv => mul_op_wrong_left_type_err_a.v} (100%) create mode 100644 vlib/v/checker/tests/mul_op_wrong_left_type_err_a.vv create mode 100644 vlib/v/checker/tests/mul_op_wrong_left_type_err_b.out rename vlib/v/checker/tests/{inout/mul_op_wrong_left_type_err_b.vv => mul_op_wrong_left_type_err_b.v} (100%) create mode 100644 vlib/v/checker/tests/mul_op_wrong_left_type_err_b.vv create mode 100644 vlib/v/checker/tests/mul_op_wrong_left_type_err_c.out rename vlib/v/checker/tests/{inout/mul_op_wrong_left_type_err_c.vv => mul_op_wrong_left_type_err_c.v} (100%) create mode 100644 vlib/v/checker/tests/mul_op_wrong_left_type_err_c.vv create mode 100644 vlib/v/checker/tests/mul_op_wrong_right_type_err_a.out rename vlib/v/checker/tests/{inout/mul_op_wrong_right_type_err_a.vv => mul_op_wrong_right_type_err_a.v} (100%) create mode 100644 vlib/v/checker/tests/mul_op_wrong_right_type_err_a.vv create mode 100644 vlib/v/checker/tests/mul_op_wrong_right_type_err_b.out rename vlib/v/checker/tests/{inout/mul_op_wrong_right_type_err_b.vv => mul_op_wrong_right_type_err_b.v} (100%) create mode 100644 vlib/v/checker/tests/mul_op_wrong_right_type_err_b.vv create mode 100644 vlib/v/checker/tests/mul_op_wrong_right_type_err_c.out rename vlib/v/checker/tests/{inout/mul_op_wrong_right_type_err_c.vv => mul_op_wrong_right_type_err_c.v} (100%) create mode 100644 vlib/v/checker/tests/mul_op_wrong_right_type_err_c.vv create mode 100644 vlib/v/checker/tests/no_fn_main.out rename vlib/v/checker/tests/{inout/no_fn_main.vv => no_fn_main.v} (100%) create mode 100644 vlib/v/checker/tests/no_fn_main.vv create mode 100644 vlib/v/checker/tests/no_pub_in_main.out rename vlib/v/checker/tests/{inout/no_pub_in_main.vv => no_pub_in_main.v} (100%) create mode 100644 vlib/v/checker/tests/no_pub_in_main.vv create mode 100644 vlib/v/checker/tests/return_type.out rename vlib/v/checker/tests/{inout/return_type.vv => return_type.v} (100%) create mode 100644 vlib/v/checker/tests/return_type.vv create mode 100644 vlib/v/checker/tests/shift_op_wrong_left_type_err.out rename vlib/v/checker/tests/{inout/shift_op_wrong_left_type_err.vv => shift_op_wrong_left_type_err.v} (100%) create mode 100644 vlib/v/checker/tests/shift_op_wrong_left_type_err.vv create mode 100644 vlib/v/checker/tests/shift_op_wrong_right_type_err.out rename vlib/v/checker/tests/{inout/shift_op_wrong_right_type_err.vv => shift_op_wrong_right_type_err.v} (100%) create mode 100644 vlib/v/checker/tests/shift_op_wrong_right_type_err.vv rename vlib/v/checker/tests/{inout => }/short_struct_too_many.out (60%) rename vlib/v/checker/tests/{inout/short_struct_too_many.vv => short_struct_too_many.v} (100%) create mode 100644 vlib/v/checker/tests/short_struct_too_many.vv create mode 100644 vlib/v/checker/tests/struct_name.out rename vlib/v/checker/tests/{inout/struct_name.vv => struct_name.v} (100%) create mode 100644 vlib/v/checker/tests/struct_name.vv rename vlib/v/checker/tests/{inout => }/struct_unknown_field.out (53%) rename vlib/v/checker/tests/{inout/struct_unknown_field.vv => struct_unknown_field.v} (100%) create mode 100644 vlib/v/checker/tests/struct_unknown_field.vv rename vlib/v/checker/tests/{inout => }/sum_type_exists.out (55%) rename vlib/v/checker/tests/{inout/sum_type_exists.vv => sum_type_exists.v} (100%) create mode 100644 vlib/v/checker/tests/sum_type_exists.vv rename vlib/v/checker/tests/{inout => }/unknown_field.out (55%) rename vlib/v/checker/tests/{inout/unknown_field.vv => unknown_field.v} (100%) create mode 100644 vlib/v/checker/tests/unknown_field.vv rename vlib/v/checker/tests/{inout => }/unknown_method.out (55%) rename vlib/v/checker/tests/{inout/unknown_method.vv => unknown_method.v} (100%) create mode 100644 vlib/v/checker/tests/unknown_method.vv rename vlib/v/checker/tests/{inout => }/unnecessary_parenthesis.out (54%) rename vlib/v/checker/tests/{inout/unnecessary_parenthesis.vv => unnecessary_parenthesis.v} (100%) create mode 100644 vlib/v/checker/tests/unnecessary_parenthesis.vv rename vlib/v/checker/tests/{inout => }/void_fn_as_value.out (63%) rename vlib/v/checker/tests/{inout/void_fn_as_value.vv => void_fn_as_value.v} (100%) create mode 100644 vlib/v/checker/tests/void_fn_as_value.vv rename vlib/v/checker/tests/{inout => }/void_function_assign_to_string.out (50%) rename vlib/v/checker/tests/{inout/void_function_assign_to_string.vv => void_function_assign_to_string.v} (100%) create mode 100644 vlib/v/checker/tests/void_function_assign_to_string.vv diff --git a/vlib/v/checker/checker.v b/vlib/v/checker/checker.v index 7ecc276b8b..40e3add85b 100644 --- a/vlib/v/checker/checker.v +++ b/vlib/v/checker/checker.v @@ -360,6 +360,17 @@ pub fn (mut c Checker) infix_expr(infix_expr mut ast.InfixExpr) table.Type { .left_shift { if left.kind == .array { // `array << elm` + match infix_expr.left { + ast.Ident { + + } + ast.SelectorExpr { + + } + else { + println('typeof: ${typeof(infix_expr.left)}') + } + } // the expressions have different types (array_x and x) if c.table.check(c.table.value_type(left_type), right_type) { // []T << T diff --git a/vlib/v/checker/tests/inout/checker_error_test.v b/vlib/v/checker/checker_test.v similarity index 96% rename from vlib/v/checker/tests/inout/checker_error_test.v rename to vlib/v/checker/checker_test.v index a7c015937f..4a4cfad238 100644 --- a/vlib/v/checker/tests/inout/checker_error_test.v +++ b/vlib/v/checker/checker_test.v @@ -5,7 +5,7 @@ fn test_all() { mut total_errors := 0 vexe := os.getenv('VEXE') // vroot := os.dir(vexe) - dir := 'vlib/v/checker/tests/inout' + dir := 'vlib/v/checker/tests' files := os.ls(dir) or { panic(err) } diff --git a/vlib/v/checker/tests/add_op_wrong_left_type_err_a.out b/vlib/v/checker/tests/add_op_wrong_left_type_err_a.out new file mode 100644 index 0000000000..db680c811c --- /dev/null +++ b/vlib/v/checker/tests/add_op_wrong_left_type_err_a.out @@ -0,0 +1,6 @@ +vlib/v/checker/tests/add_op_wrong_left_type_err_a.v:3:5: error: mismatched types `A` and `int` + 1| struct A{} + 2| fn main() { + 3| A{} + 10 + ~~~ + 4| } diff --git a/vlib/v/checker/tests/inout/add_op_wrong_left_type_err_a.vv b/vlib/v/checker/tests/add_op_wrong_left_type_err_a.v similarity index 100% rename from vlib/v/checker/tests/inout/add_op_wrong_left_type_err_a.vv rename to vlib/v/checker/tests/add_op_wrong_left_type_err_a.v diff --git a/vlib/v/checker/tests/add_op_wrong_left_type_err_a.vv b/vlib/v/checker/tests/add_op_wrong_left_type_err_a.vv new file mode 100644 index 0000000000..5a3069eb14 --- /dev/null +++ b/vlib/v/checker/tests/add_op_wrong_left_type_err_a.vv @@ -0,0 +1,4 @@ +struct A{} +fn main() { + A{} + 10 +} diff --git a/vlib/v/checker/tests/add_op_wrong_left_type_err_b.out b/vlib/v/checker/tests/add_op_wrong_left_type_err_b.out new file mode 100644 index 0000000000..0f434d3a49 --- /dev/null +++ b/vlib/v/checker/tests/add_op_wrong_left_type_err_b.out @@ -0,0 +1,5 @@ +vlib/v/checker/tests/add_op_wrong_left_type_err_b.v:2:5: error: mismatched types `array_int` and `int` + 1| fn main() { + 2| [1,2,3] + 10 + ~~~~~~~ + 3| } diff --git a/vlib/v/checker/tests/inout/add_op_wrong_left_type_err_b.vv b/vlib/v/checker/tests/add_op_wrong_left_type_err_b.v similarity index 100% rename from vlib/v/checker/tests/inout/add_op_wrong_left_type_err_b.vv rename to vlib/v/checker/tests/add_op_wrong_left_type_err_b.v diff --git a/vlib/v/checker/tests/add_op_wrong_left_type_err_b.vv b/vlib/v/checker/tests/add_op_wrong_left_type_err_b.vv new file mode 100644 index 0000000000..f75bfb8c6a --- /dev/null +++ b/vlib/v/checker/tests/add_op_wrong_left_type_err_b.vv @@ -0,0 +1,3 @@ +fn main() { + [1,2,3] + 10 +} diff --git a/vlib/v/checker/tests/add_op_wrong_left_type_err_c.out b/vlib/v/checker/tests/add_op_wrong_left_type_err_c.out new file mode 100644 index 0000000000..fa71a58bb5 --- /dev/null +++ b/vlib/v/checker/tests/add_op_wrong_left_type_err_c.out @@ -0,0 +1,6 @@ +vlib/v/checker/tests/add_op_wrong_left_type_err_c.v:3:5: error: mismatched types `map_string_int` and `int` + 1| fn main() { + 2| a := map[string]int + 3| a + 10 + ^ + 4| } diff --git a/vlib/v/checker/tests/inout/add_op_wrong_left_type_err_c.vv b/vlib/v/checker/tests/add_op_wrong_left_type_err_c.v similarity index 100% rename from vlib/v/checker/tests/inout/add_op_wrong_left_type_err_c.vv rename to vlib/v/checker/tests/add_op_wrong_left_type_err_c.v diff --git a/vlib/v/checker/tests/add_op_wrong_left_type_err_c.vv b/vlib/v/checker/tests/add_op_wrong_left_type_err_c.vv new file mode 100644 index 0000000000..497b3f95aa --- /dev/null +++ b/vlib/v/checker/tests/add_op_wrong_left_type_err_c.vv @@ -0,0 +1,4 @@ +fn main() { + a := map[string]int + a + 10 +} diff --git a/vlib/v/checker/tests/add_op_wrong_right_type_err_a.out b/vlib/v/checker/tests/add_op_wrong_right_type_err_a.out new file mode 100644 index 0000000000..7a22cfd13d --- /dev/null +++ b/vlib/v/checker/tests/add_op_wrong_right_type_err_a.out @@ -0,0 +1,6 @@ +vlib/v/checker/tests/add_op_wrong_right_type_err_a.v:3:10: error: mismatched types `int` and `A` + 1| struct A{} + 2| fn main() { + 3| 10 + A{} + ~~~ + 4| } diff --git a/vlib/v/checker/tests/inout/add_op_wrong_right_type_err_a.vv b/vlib/v/checker/tests/add_op_wrong_right_type_err_a.v similarity index 100% rename from vlib/v/checker/tests/inout/add_op_wrong_right_type_err_a.vv rename to vlib/v/checker/tests/add_op_wrong_right_type_err_a.v diff --git a/vlib/v/checker/tests/add_op_wrong_right_type_err_a.vv b/vlib/v/checker/tests/add_op_wrong_right_type_err_a.vv new file mode 100644 index 0000000000..3a98920ac4 --- /dev/null +++ b/vlib/v/checker/tests/add_op_wrong_right_type_err_a.vv @@ -0,0 +1,4 @@ +struct A{} +fn main() { + 10 + A{} +} diff --git a/vlib/v/checker/tests/add_op_wrong_right_type_err_b.out b/vlib/v/checker/tests/add_op_wrong_right_type_err_b.out new file mode 100644 index 0000000000..a20dd38078 --- /dev/null +++ b/vlib/v/checker/tests/add_op_wrong_right_type_err_b.out @@ -0,0 +1,5 @@ +vlib/v/checker/tests/add_op_wrong_right_type_err_b.v:2:10: error: mismatched types `int` and `array_int` + 1| fn main() { + 2| 10 + [1,2,3] + ~~~~~~~ + 3| } diff --git a/vlib/v/checker/tests/inout/add_op_wrong_right_type_err_b.vv b/vlib/v/checker/tests/add_op_wrong_right_type_err_b.v similarity index 100% rename from vlib/v/checker/tests/inout/add_op_wrong_right_type_err_b.vv rename to vlib/v/checker/tests/add_op_wrong_right_type_err_b.v diff --git a/vlib/v/checker/tests/add_op_wrong_right_type_err_b.vv b/vlib/v/checker/tests/add_op_wrong_right_type_err_b.vv new file mode 100644 index 0000000000..ad55530f74 --- /dev/null +++ b/vlib/v/checker/tests/add_op_wrong_right_type_err_b.vv @@ -0,0 +1,3 @@ +fn main() { + 10 + [1,2,3] +} diff --git a/vlib/v/checker/tests/add_op_wrong_right_type_err_c.out b/vlib/v/checker/tests/add_op_wrong_right_type_err_c.out new file mode 100644 index 0000000000..1414ce0fd9 --- /dev/null +++ b/vlib/v/checker/tests/add_op_wrong_right_type_err_c.out @@ -0,0 +1,6 @@ +vlib/v/checker/tests/add_op_wrong_right_type_err_c.v:3:10: error: mismatched types `int` and `map_string_int` + 1| fn main() { + 2| a := map[string]int + 3| 10 + a + ^ + 4| } diff --git a/vlib/v/checker/tests/inout/add_op_wrong_right_type_err_c.vv b/vlib/v/checker/tests/add_op_wrong_right_type_err_c.v similarity index 100% rename from vlib/v/checker/tests/inout/add_op_wrong_right_type_err_c.vv rename to vlib/v/checker/tests/add_op_wrong_right_type_err_c.v diff --git a/vlib/v/checker/tests/add_op_wrong_right_type_err_c.vv b/vlib/v/checker/tests/add_op_wrong_right_type_err_c.vv new file mode 100644 index 0000000000..1be1402479 --- /dev/null +++ b/vlib/v/checker/tests/add_op_wrong_right_type_err_c.vv @@ -0,0 +1,4 @@ +fn main() { + a := map[string]int + 10 + a +} diff --git a/vlib/v/checker/tests/alias_type_exists.out b/vlib/v/checker/tests/alias_type_exists.out new file mode 100644 index 0000000000..e871f2eea1 --- /dev/null +++ b/vlib/v/checker/tests/alias_type_exists.out @@ -0,0 +1,5 @@ +vlib/v/checker/tests/alias_type_exists.v:1:1: error: type `Bird` doesn't exist + 1| type Pigeon Bird + ~~~~~~~~~~~ + 2| + 3| fn main() { diff --git a/vlib/v/checker/tests/inout/alias_type_exists.vv b/vlib/v/checker/tests/alias_type_exists.v similarity index 100% rename from vlib/v/checker/tests/inout/alias_type_exists.vv rename to vlib/v/checker/tests/alias_type_exists.v diff --git a/vlib/v/checker/tests/alias_type_exists.vv b/vlib/v/checker/tests/alias_type_exists.vv new file mode 100644 index 0000000000..3cbeeeaa01 --- /dev/null +++ b/vlib/v/checker/tests/alias_type_exists.vv @@ -0,0 +1,5 @@ +type Pigeon Bird + +fn main() { + +} diff --git a/vlib/v/checker/tests/assign_expr_type_err_a.out b/vlib/v/checker/tests/assign_expr_type_err_a.out new file mode 100644 index 0000000000..375adfb6a9 --- /dev/null +++ b/vlib/v/checker/tests/assign_expr_type_err_a.out @@ -0,0 +1,6 @@ +vlib/v/checker/tests/assign_expr_type_err_a.v:3:2: error: operator <<= not defined on left operand type `f64` + 1| fn main() { + 2| mut foo := 0.5 + 3| foo <<= 1 + ~~~ + 4| } diff --git a/vlib/v/checker/tests/assign_expr_type_err_a.v b/vlib/v/checker/tests/assign_expr_type_err_a.v new file mode 100644 index 0000000000..7daa532fb9 --- /dev/null +++ b/vlib/v/checker/tests/assign_expr_type_err_a.v @@ -0,0 +1,4 @@ +fn main() { + mut foo := 0.5 + foo <<= 1 +} \ No newline at end of file diff --git a/vlib/v/checker/tests/inout/assign_expr_type_err_a.vv b/vlib/v/checker/tests/assign_expr_type_err_a.vv similarity index 93% rename from vlib/v/checker/tests/inout/assign_expr_type_err_a.vv rename to vlib/v/checker/tests/assign_expr_type_err_a.vv index 3e8816fa74..7daa532fb9 100644 --- a/vlib/v/checker/tests/inout/assign_expr_type_err_a.vv +++ b/vlib/v/checker/tests/assign_expr_type_err_a.vv @@ -1,4 +1,4 @@ -fn main() { - mut foo := 0.5 - foo <<= 1 +fn main() { + mut foo := 0.5 + foo <<= 1 } \ No newline at end of file diff --git a/vlib/v/checker/tests/assign_expr_type_err_b.out b/vlib/v/checker/tests/assign_expr_type_err_b.out new file mode 100644 index 0000000000..a85f8a3175 --- /dev/null +++ b/vlib/v/checker/tests/assign_expr_type_err_b.out @@ -0,0 +1,6 @@ +vlib/v/checker/tests/assign_expr_type_err_b.v:3:9: error: operator %= not defined on right operand type `string` + 1| fn main() { + 2| mut foo := 10 + 3| foo %= 'hello' + ~~~~~~~ + 4| } diff --git a/vlib/v/checker/tests/assign_expr_type_err_b.v b/vlib/v/checker/tests/assign_expr_type_err_b.v new file mode 100644 index 0000000000..1841f55b15 --- /dev/null +++ b/vlib/v/checker/tests/assign_expr_type_err_b.v @@ -0,0 +1,4 @@ +fn main() { + mut foo := 10 + foo %= 'hello' +} \ No newline at end of file diff --git a/vlib/v/checker/tests/inout/assign_expr_type_err_b.vv b/vlib/v/checker/tests/assign_expr_type_err_b.vv similarity index 93% rename from vlib/v/checker/tests/inout/assign_expr_type_err_b.vv rename to vlib/v/checker/tests/assign_expr_type_err_b.vv index 0fe4d81dda..1841f55b15 100644 --- a/vlib/v/checker/tests/inout/assign_expr_type_err_b.vv +++ b/vlib/v/checker/tests/assign_expr_type_err_b.vv @@ -1,4 +1,4 @@ -fn main() { - mut foo := 10 - foo %= 'hello' +fn main() { + mut foo := 10 + foo %= 'hello' } \ No newline at end of file diff --git a/vlib/v/checker/tests/assign_expr_type_err_c.out b/vlib/v/checker/tests/assign_expr_type_err_c.out new file mode 100644 index 0000000000..079ce9195d --- /dev/null +++ b/vlib/v/checker/tests/assign_expr_type_err_c.out @@ -0,0 +1,6 @@ +vlib/v/checker/tests/assign_expr_type_err_c.v:3:2: error: operator *= not defined on left operand type `string` + 1| fn main() { + 2| mut foo := 'hello' + 3| foo *= 10 + ~~~ + 4| } diff --git a/vlib/v/checker/tests/assign_expr_type_err_c.v b/vlib/v/checker/tests/assign_expr_type_err_c.v new file mode 100644 index 0000000000..e0cec96943 --- /dev/null +++ b/vlib/v/checker/tests/assign_expr_type_err_c.v @@ -0,0 +1,4 @@ +fn main() { + mut foo := 'hello' + foo *= 10 +} \ No newline at end of file diff --git a/vlib/v/checker/tests/inout/assign_expr_type_err_c.vv b/vlib/v/checker/tests/assign_expr_type_err_c.vv similarity index 93% rename from vlib/v/checker/tests/inout/assign_expr_type_err_c.vv rename to vlib/v/checker/tests/assign_expr_type_err_c.vv index 51be8d748f..e0cec96943 100644 --- a/vlib/v/checker/tests/inout/assign_expr_type_err_c.vv +++ b/vlib/v/checker/tests/assign_expr_type_err_c.vv @@ -1,4 +1,4 @@ -fn main() { - mut foo := 'hello' - foo *= 10 +fn main() { + mut foo := 'hello' + foo *= 10 } \ No newline at end of file diff --git a/vlib/v/checker/tests/assign_expr_type_err_d.out b/vlib/v/checker/tests/assign_expr_type_err_d.out new file mode 100644 index 0000000000..031420db2a --- /dev/null +++ b/vlib/v/checker/tests/assign_expr_type_err_d.out @@ -0,0 +1,6 @@ +vlib/v/checker/tests/assign_expr_type_err_d.v:3:9: error: operator /= not defined on right operand type `bool` + 1| fn main() { + 2| mut foo := 1.5 + 3| foo /= true + ~~~~ + 4| } diff --git a/vlib/v/checker/tests/assign_expr_type_err_d.v b/vlib/v/checker/tests/assign_expr_type_err_d.v new file mode 100644 index 0000000000..58857d39c9 --- /dev/null +++ b/vlib/v/checker/tests/assign_expr_type_err_d.v @@ -0,0 +1,4 @@ +fn main() { + mut foo := 1.5 + foo /= true +} \ No newline at end of file diff --git a/vlib/v/checker/tests/inout/assign_expr_type_err_d.vv b/vlib/v/checker/tests/assign_expr_type_err_d.vv similarity index 93% rename from vlib/v/checker/tests/inout/assign_expr_type_err_d.vv rename to vlib/v/checker/tests/assign_expr_type_err_d.vv index ce3c670298..58857d39c9 100644 --- a/vlib/v/checker/tests/inout/assign_expr_type_err_d.vv +++ b/vlib/v/checker/tests/assign_expr_type_err_d.vv @@ -1,4 +1,4 @@ -fn main() { - mut foo := 1.5 - foo /= true +fn main() { + mut foo := 1.5 + foo /= true } \ No newline at end of file diff --git a/vlib/v/checker/tests/assign_expr_type_err_e.out b/vlib/v/checker/tests/assign_expr_type_err_e.out new file mode 100644 index 0000000000..9db42b6354 --- /dev/null +++ b/vlib/v/checker/tests/assign_expr_type_err_e.out @@ -0,0 +1,6 @@ +vlib/v/checker/tests/assign_expr_type_err_e.v:3:2: error: operator -= not defined on left operand type `string` + 1| fn main() { + 2| mut foo := 'hello' + 3| foo -= `a` + ~~~ + 4| } diff --git a/vlib/v/checker/tests/assign_expr_type_err_e.v b/vlib/v/checker/tests/assign_expr_type_err_e.v new file mode 100644 index 0000000000..c3c7e230e1 --- /dev/null +++ b/vlib/v/checker/tests/assign_expr_type_err_e.v @@ -0,0 +1,4 @@ +fn main() { + mut foo := 'hello' + foo -= `a` +} \ No newline at end of file diff --git a/vlib/v/checker/tests/inout/assign_expr_type_err_e.vv b/vlib/v/checker/tests/assign_expr_type_err_e.vv similarity index 93% rename from vlib/v/checker/tests/inout/assign_expr_type_err_e.vv rename to vlib/v/checker/tests/assign_expr_type_err_e.vv index e2eeba8ee3..c3c7e230e1 100644 --- a/vlib/v/checker/tests/inout/assign_expr_type_err_e.vv +++ b/vlib/v/checker/tests/assign_expr_type_err_e.vv @@ -1,4 +1,4 @@ -fn main() { - mut foo := 'hello' - foo -= `a` +fn main() { + mut foo := 'hello' + foo -= `a` } \ No newline at end of file diff --git a/vlib/v/checker/tests/assign_expr_type_err_f.out b/vlib/v/checker/tests/assign_expr_type_err_f.out new file mode 100644 index 0000000000..8a2f0b86e7 --- /dev/null +++ b/vlib/v/checker/tests/assign_expr_type_err_f.out @@ -0,0 +1,6 @@ +vlib/v/checker/tests/assign_expr_type_err_f.v:3:9: error: operator -= not defined on right operand type `bool` + 1| fn main() { + 2| mut foo := 10 + 3| foo -= false + ~~~~~ + 4| } diff --git a/vlib/v/checker/tests/assign_expr_type_err_f.v b/vlib/v/checker/tests/assign_expr_type_err_f.v new file mode 100644 index 0000000000..a6b378bdd9 --- /dev/null +++ b/vlib/v/checker/tests/assign_expr_type_err_f.v @@ -0,0 +1,4 @@ +fn main() { + mut foo := 10 + foo -= false +} \ No newline at end of file diff --git a/vlib/v/checker/tests/inout/assign_expr_type_err_f.vv b/vlib/v/checker/tests/assign_expr_type_err_f.vv similarity index 93% rename from vlib/v/checker/tests/inout/assign_expr_type_err_f.vv rename to vlib/v/checker/tests/assign_expr_type_err_f.vv index 7b4ab43de9..a6b378bdd9 100644 --- a/vlib/v/checker/tests/inout/assign_expr_type_err_f.vv +++ b/vlib/v/checker/tests/assign_expr_type_err_f.vv @@ -1,4 +1,4 @@ -fn main() { - mut foo := 10 - foo -= false +fn main() { + mut foo := 10 + foo -= false } \ No newline at end of file diff --git a/vlib/v/checker/tests/assign_expr_type_err_g.out b/vlib/v/checker/tests/assign_expr_type_err_g.out new file mode 100644 index 0000000000..8e3faff54f --- /dev/null +++ b/vlib/v/checker/tests/assign_expr_type_err_g.out @@ -0,0 +1,6 @@ +vlib/v/checker/tests/assign_expr_type_err_g.v:3:2: error: operator += not defined on left operand type `bool` + 1| fn main() { + 2| mut foo := true + 3| foo += false + ~~~ + 4| } diff --git a/vlib/v/checker/tests/assign_expr_type_err_g.v b/vlib/v/checker/tests/assign_expr_type_err_g.v new file mode 100644 index 0000000000..621c5ce40b --- /dev/null +++ b/vlib/v/checker/tests/assign_expr_type_err_g.v @@ -0,0 +1,4 @@ +fn main() { + mut foo := true + foo += false +} \ No newline at end of file diff --git a/vlib/v/checker/tests/inout/assign_expr_type_err_g.vv b/vlib/v/checker/tests/assign_expr_type_err_g.vv similarity index 93% rename from vlib/v/checker/tests/inout/assign_expr_type_err_g.vv rename to vlib/v/checker/tests/assign_expr_type_err_g.vv index 018a651364..621c5ce40b 100644 --- a/vlib/v/checker/tests/inout/assign_expr_type_err_g.vv +++ b/vlib/v/checker/tests/assign_expr_type_err_g.vv @@ -1,4 +1,4 @@ -fn main() { - mut foo := true - foo += false +fn main() { + mut foo := true + foo += false } \ No newline at end of file diff --git a/vlib/v/checker/tests/assign_expr_type_err_h.out b/vlib/v/checker/tests/assign_expr_type_err_h.out new file mode 100644 index 0000000000..8d6cee805d --- /dev/null +++ b/vlib/v/checker/tests/assign_expr_type_err_h.out @@ -0,0 +1,6 @@ +vlib/v/checker/tests/assign_expr_type_err_h.v:3:9: error: operator += not defined on right operand type `bool` + 1| fn main() { + 2| mut foo := 'hello' + 3| foo += false + ~~~~~ + 4| } diff --git a/vlib/v/checker/tests/assign_expr_type_err_h.v b/vlib/v/checker/tests/assign_expr_type_err_h.v new file mode 100644 index 0000000000..ea1c7c4ecc --- /dev/null +++ b/vlib/v/checker/tests/assign_expr_type_err_h.v @@ -0,0 +1,4 @@ +fn main() { + mut foo := 'hello' + foo += false +} \ No newline at end of file diff --git a/vlib/v/checker/tests/inout/assign_expr_type_err_h.vv b/vlib/v/checker/tests/assign_expr_type_err_h.vv similarity index 94% rename from vlib/v/checker/tests/inout/assign_expr_type_err_h.vv rename to vlib/v/checker/tests/assign_expr_type_err_h.vv index 565c13cbff..ea1c7c4ecc 100644 --- a/vlib/v/checker/tests/inout/assign_expr_type_err_h.vv +++ b/vlib/v/checker/tests/assign_expr_type_err_h.vv @@ -1,4 +1,4 @@ -fn main() { - mut foo := 'hello' - foo += false +fn main() { + mut foo := 'hello' + foo += false } \ No newline at end of file diff --git a/vlib/v/checker/tests/assign_expr_type_err_i.out b/vlib/v/checker/tests/assign_expr_type_err_i.out new file mode 100644 index 0000000000..372970d4cc --- /dev/null +++ b/vlib/v/checker/tests/assign_expr_type_err_i.out @@ -0,0 +1,6 @@ +vlib/v/checker/tests/assign_expr_type_err_i.v:3:9: error: cannot assign `string` to variable `foo` of type `f64` + 1| fn main() { + 2| mut foo := 1.5 + 3| foo += 'hello' + ~~~~~~~ + 4| } diff --git a/vlib/v/checker/tests/assign_expr_type_err_i.v b/vlib/v/checker/tests/assign_expr_type_err_i.v new file mode 100644 index 0000000000..8b58aea97d --- /dev/null +++ b/vlib/v/checker/tests/assign_expr_type_err_i.v @@ -0,0 +1,4 @@ +fn main() { + mut foo := 1.5 + foo += 'hello' +} \ No newline at end of file diff --git a/vlib/v/checker/tests/inout/assign_expr_type_err_i.vv b/vlib/v/checker/tests/assign_expr_type_err_i.vv similarity index 93% rename from vlib/v/checker/tests/inout/assign_expr_type_err_i.vv rename to vlib/v/checker/tests/assign_expr_type_err_i.vv index da50d07c0f..8b58aea97d 100644 --- a/vlib/v/checker/tests/inout/assign_expr_type_err_i.vv +++ b/vlib/v/checker/tests/assign_expr_type_err_i.vv @@ -1,4 +1,4 @@ -fn main() { - mut foo := 1.5 - foo += 'hello' +fn main() { + mut foo := 1.5 + foo += 'hello' } \ No newline at end of file diff --git a/vlib/v/checker/tests/bit_op_wrong_left_type_err.out b/vlib/v/checker/tests/bit_op_wrong_left_type_err.out new file mode 100644 index 0000000000..3538aabf8c --- /dev/null +++ b/vlib/v/checker/tests/bit_op_wrong_left_type_err.out @@ -0,0 +1,5 @@ +vlib/v/checker/tests/bit_op_wrong_left_type_err.v:2:2: error: left type of `&` cannot be non-integer type f64 + 1| fn main() { + 2| 0.5 & 1 + ~~~ + 3| } diff --git a/vlib/v/checker/tests/bit_op_wrong_left_type_err.v b/vlib/v/checker/tests/bit_op_wrong_left_type_err.v new file mode 100644 index 0000000000..362cba79bc --- /dev/null +++ b/vlib/v/checker/tests/bit_op_wrong_left_type_err.v @@ -0,0 +1,3 @@ +fn main() { + 0.5 & 1 +} \ No newline at end of file diff --git a/vlib/v/checker/tests/inout/bit_op_wrong_left_type_err.vv b/vlib/v/checker/tests/bit_op_wrong_left_type_err.vv similarity index 91% rename from vlib/v/checker/tests/inout/bit_op_wrong_left_type_err.vv rename to vlib/v/checker/tests/bit_op_wrong_left_type_err.vv index 604c8485f3..362cba79bc 100644 --- a/vlib/v/checker/tests/inout/bit_op_wrong_left_type_err.vv +++ b/vlib/v/checker/tests/bit_op_wrong_left_type_err.vv @@ -1,3 +1,3 @@ -fn main() { - 0.5 & 1 +fn main() { + 0.5 & 1 } \ No newline at end of file diff --git a/vlib/v/checker/tests/bit_op_wrong_right_type_err.out b/vlib/v/checker/tests/bit_op_wrong_right_type_err.out new file mode 100644 index 0000000000..d14246125d --- /dev/null +++ b/vlib/v/checker/tests/bit_op_wrong_right_type_err.out @@ -0,0 +1,5 @@ +vlib/v/checker/tests/bit_op_wrong_right_type_err.v:2:6: error: right type of `|` cannot be non-integer type f64 + 1| fn main() { + 2| 1 | 0.5 + ~~~ + 3| } diff --git a/vlib/v/checker/tests/inout/bit_op_wrong_right_type_err.vv b/vlib/v/checker/tests/bit_op_wrong_right_type_err.v similarity index 100% rename from vlib/v/checker/tests/inout/bit_op_wrong_right_type_err.vv rename to vlib/v/checker/tests/bit_op_wrong_right_type_err.v diff --git a/vlib/v/checker/tests/bit_op_wrong_right_type_err.vv b/vlib/v/checker/tests/bit_op_wrong_right_type_err.vv new file mode 100644 index 0000000000..8bdcbc593f --- /dev/null +++ b/vlib/v/checker/tests/bit_op_wrong_right_type_err.vv @@ -0,0 +1,3 @@ +fn main() { + 1 | 0.5 +} \ No newline at end of file diff --git a/vlib/v/checker/tests/inout/cannot_assign_array.out b/vlib/v/checker/tests/cannot_assign_array.out similarity index 57% rename from vlib/v/checker/tests/inout/cannot_assign_array.out rename to vlib/v/checker/tests/cannot_assign_array.out index 76ac8d3327..6bc6815864 100644 --- a/vlib/v/checker/tests/inout/cannot_assign_array.out +++ b/vlib/v/checker/tests/cannot_assign_array.out @@ -1,4 +1,4 @@ -vlib/v/checker/tests/inout/cannot_assign_array.v:9:11: error: cannot assign `array_fixed_f64_8` to variable `ctx.vb` of type `string` +vlib/v/checker/tests/cannot_assign_array.v:9:11: error: cannot assign `array_fixed_f64_8` to variable `ctx.vb` of type `string` 7| mut ctx := Context{} 8| x := 2.32 9| ctx.vb = [1.1, x, 3.3, 4.4, 5.0, 6.0, 7.0, 8.9]!! diff --git a/vlib/v/checker/tests/inout/cannot_assign_array.vv b/vlib/v/checker/tests/cannot_assign_array.v similarity index 100% rename from vlib/v/checker/tests/inout/cannot_assign_array.vv rename to vlib/v/checker/tests/cannot_assign_array.v diff --git a/vlib/v/checker/tests/cannot_assign_array.vv b/vlib/v/checker/tests/cannot_assign_array.vv new file mode 100644 index 0000000000..790d34237c --- /dev/null +++ b/vlib/v/checker/tests/cannot_assign_array.vv @@ -0,0 +1,10 @@ +struct Context { + pub mut: + vb string +} + +fn main() { + mut ctx := Context{} + x := 2.32 + ctx.vb = [1.1, x, 3.3, 4.4, 5.0, 6.0, 7.0, 8.9]!! +} diff --git a/vlib/v/checker/tests/decl_underscore.out b/vlib/v/checker/tests/decl_underscore.out new file mode 100644 index 0000000000..3a59151217 --- /dev/null +++ b/vlib/v/checker/tests/decl_underscore.out @@ -0,0 +1,5 @@ +vlib/v/checker/tests/decl_underscore.v:2:2: error: variable names cannot start with `__` + 1| fn main() { + 2| __abc := 1 + ~~~~~ + 3| } \ No newline at end of file diff --git a/vlib/v/checker/tests/inout/decl_underscore.vv b/vlib/v/checker/tests/decl_underscore.v similarity index 100% rename from vlib/v/checker/tests/inout/decl_underscore.vv rename to vlib/v/checker/tests/decl_underscore.v diff --git a/vlib/v/checker/tests/decl_underscore.vv b/vlib/v/checker/tests/decl_underscore.vv new file mode 100644 index 0000000000..6ef91ce0dc --- /dev/null +++ b/vlib/v/checker/tests/decl_underscore.vv @@ -0,0 +1,3 @@ +fn main() { + __abc := 1 +} diff --git a/vlib/v/checker/tests/div_op_wrong_left_type_err_a.out b/vlib/v/checker/tests/div_op_wrong_left_type_err_a.out new file mode 100644 index 0000000000..61bf0d9bcd --- /dev/null +++ b/vlib/v/checker/tests/div_op_wrong_left_type_err_a.out @@ -0,0 +1,6 @@ +vlib/v/checker/tests/div_op_wrong_left_type_err_a.v:3:5: error: mismatched types `A` and `int` + 1| struct A{} + 2| fn main() { + 3| A{} / 10 + ~~~ + 4| } diff --git a/vlib/v/checker/tests/inout/div_op_wrong_left_type_err_a.vv b/vlib/v/checker/tests/div_op_wrong_left_type_err_a.v similarity index 100% rename from vlib/v/checker/tests/inout/div_op_wrong_left_type_err_a.vv rename to vlib/v/checker/tests/div_op_wrong_left_type_err_a.v diff --git a/vlib/v/checker/tests/div_op_wrong_left_type_err_a.vv b/vlib/v/checker/tests/div_op_wrong_left_type_err_a.vv new file mode 100644 index 0000000000..d52d510b99 --- /dev/null +++ b/vlib/v/checker/tests/div_op_wrong_left_type_err_a.vv @@ -0,0 +1,4 @@ +struct A{} +fn main() { + A{} / 10 +} diff --git a/vlib/v/checker/tests/div_op_wrong_left_type_err_b.out b/vlib/v/checker/tests/div_op_wrong_left_type_err_b.out new file mode 100644 index 0000000000..dadea506e6 --- /dev/null +++ b/vlib/v/checker/tests/div_op_wrong_left_type_err_b.out @@ -0,0 +1,5 @@ +vlib/v/checker/tests/div_op_wrong_left_type_err_b.v:2:5: error: mismatched types `array_int` and `int` + 1| fn main() { + 2| [1,2,3] / 10 + ~~~~~~~ + 3| } diff --git a/vlib/v/checker/tests/inout/div_op_wrong_left_type_err_b.vv b/vlib/v/checker/tests/div_op_wrong_left_type_err_b.v similarity index 100% rename from vlib/v/checker/tests/inout/div_op_wrong_left_type_err_b.vv rename to vlib/v/checker/tests/div_op_wrong_left_type_err_b.v diff --git a/vlib/v/checker/tests/div_op_wrong_left_type_err_b.vv b/vlib/v/checker/tests/div_op_wrong_left_type_err_b.vv new file mode 100644 index 0000000000..4dc9bc6ac6 --- /dev/null +++ b/vlib/v/checker/tests/div_op_wrong_left_type_err_b.vv @@ -0,0 +1,3 @@ +fn main() { + [1,2,3] / 10 +} diff --git a/vlib/v/checker/tests/div_op_wrong_left_type_err_c.out b/vlib/v/checker/tests/div_op_wrong_left_type_err_c.out new file mode 100644 index 0000000000..df6a9f6f9a --- /dev/null +++ b/vlib/v/checker/tests/div_op_wrong_left_type_err_c.out @@ -0,0 +1,6 @@ +vlib/v/checker/tests/div_op_wrong_left_type_err_c.v:3:5: error: mismatched types `map_string_int` and `int` + 1| fn main() { + 2| a := map[string]int + 3| a / 10 + ^ + 4| } diff --git a/vlib/v/checker/tests/inout/div_op_wrong_left_type_err_c.vv b/vlib/v/checker/tests/div_op_wrong_left_type_err_c.v similarity index 100% rename from vlib/v/checker/tests/inout/div_op_wrong_left_type_err_c.vv rename to vlib/v/checker/tests/div_op_wrong_left_type_err_c.v diff --git a/vlib/v/checker/tests/div_op_wrong_left_type_err_c.vv b/vlib/v/checker/tests/div_op_wrong_left_type_err_c.vv new file mode 100644 index 0000000000..b326b68729 --- /dev/null +++ b/vlib/v/checker/tests/div_op_wrong_left_type_err_c.vv @@ -0,0 +1,4 @@ +fn main() { + a := map[string]int + a / 10 +} diff --git a/vlib/v/checker/tests/div_op_wrong_right_type_err_a.out b/vlib/v/checker/tests/div_op_wrong_right_type_err_a.out new file mode 100644 index 0000000000..53480385ff --- /dev/null +++ b/vlib/v/checker/tests/div_op_wrong_right_type_err_a.out @@ -0,0 +1,6 @@ +vlib/v/checker/tests/div_op_wrong_right_type_err_a.v:3:10: error: mismatched types `int` and `A` + 1| struct A{} + 2| fn main() { + 3| 10 / A{} + ~~~ + 4| } diff --git a/vlib/v/checker/tests/inout/div_op_wrong_right_type_err_a.vv b/vlib/v/checker/tests/div_op_wrong_right_type_err_a.v similarity index 100% rename from vlib/v/checker/tests/inout/div_op_wrong_right_type_err_a.vv rename to vlib/v/checker/tests/div_op_wrong_right_type_err_a.v diff --git a/vlib/v/checker/tests/div_op_wrong_right_type_err_a.vv b/vlib/v/checker/tests/div_op_wrong_right_type_err_a.vv new file mode 100644 index 0000000000..ae12960e94 --- /dev/null +++ b/vlib/v/checker/tests/div_op_wrong_right_type_err_a.vv @@ -0,0 +1,4 @@ +struct A{} +fn main() { + 10 / A{} +} diff --git a/vlib/v/checker/tests/div_op_wrong_right_type_err_b.out b/vlib/v/checker/tests/div_op_wrong_right_type_err_b.out new file mode 100644 index 0000000000..26710c74a7 --- /dev/null +++ b/vlib/v/checker/tests/div_op_wrong_right_type_err_b.out @@ -0,0 +1,5 @@ +vlib/v/checker/tests/div_op_wrong_right_type_err_b.v:2:10: error: mismatched types `int` and `array_int` + 1| fn main() { + 2| 10 / [1,2,3] + ~~~~~~~ + 3| } diff --git a/vlib/v/checker/tests/inout/div_op_wrong_right_type_err_b.vv b/vlib/v/checker/tests/div_op_wrong_right_type_err_b.v similarity index 100% rename from vlib/v/checker/tests/inout/div_op_wrong_right_type_err_b.vv rename to vlib/v/checker/tests/div_op_wrong_right_type_err_b.v diff --git a/vlib/v/checker/tests/div_op_wrong_right_type_err_b.vv b/vlib/v/checker/tests/div_op_wrong_right_type_err_b.vv new file mode 100644 index 0000000000..0870d80a3d --- /dev/null +++ b/vlib/v/checker/tests/div_op_wrong_right_type_err_b.vv @@ -0,0 +1,3 @@ +fn main() { + 10 / [1,2,3] +} diff --git a/vlib/v/checker/tests/div_op_wrong_right_type_err_c.out b/vlib/v/checker/tests/div_op_wrong_right_type_err_c.out new file mode 100644 index 0000000000..13f4bc7c3c --- /dev/null +++ b/vlib/v/checker/tests/div_op_wrong_right_type_err_c.out @@ -0,0 +1,6 @@ +vlib/v/checker/tests/div_op_wrong_right_type_err_c.v:3:10: error: mismatched types `int` and `map_string_int` + 1| fn main() { + 2| a := map[string]int + 3| 10 / a + ^ + 4| } diff --git a/vlib/v/checker/tests/inout/div_op_wrong_right_type_err_c.vv b/vlib/v/checker/tests/div_op_wrong_right_type_err_c.v similarity index 100% rename from vlib/v/checker/tests/inout/div_op_wrong_right_type_err_c.vv rename to vlib/v/checker/tests/div_op_wrong_right_type_err_c.v diff --git a/vlib/v/checker/tests/div_op_wrong_right_type_err_c.vv b/vlib/v/checker/tests/div_op_wrong_right_type_err_c.vv new file mode 100644 index 0000000000..f784c8c0e3 --- /dev/null +++ b/vlib/v/checker/tests/div_op_wrong_right_type_err_c.vv @@ -0,0 +1,4 @@ +fn main() { + a := map[string]int + 10 / a +} diff --git a/vlib/v/checker/tests/inout/enum_err.out b/vlib/v/checker/tests/enum_err.out similarity index 54% rename from vlib/v/checker/tests/inout/enum_err.out rename to vlib/v/checker/tests/enum_err.out index ec4c36f31e..cca5e6305c 100644 --- a/vlib/v/checker/tests/inout/enum_err.out +++ b/vlib/v/checker/tests/enum_err.out @@ -1,11 +1,11 @@ -vlib/v/checker/tests/inout/enum_err.v:4:13: error: default value for enum has to be an integer - 2| +vlib/v/checker/tests/enum_err.v:4:13: error: default value for enum has to be an integer + 2| 3| enum Color { 4| green = 'green', ~~~~~~~ 5| yellow = 1+1, 6| blue, -vlib/v/checker/tests/inout/enum_err.v:5:14: error: default value for enum has to be an integer +vlib/v/checker/tests/enum_err.v:5:14: error: default value for enum has to be an integer 3| enum Color { 4| green = 'green', 5| yellow = 1+1, diff --git a/vlib/v/checker/tests/inout/enum_err.vv b/vlib/v/checker/tests/enum_err.v similarity index 100% rename from vlib/v/checker/tests/inout/enum_err.vv rename to vlib/v/checker/tests/enum_err.v diff --git a/vlib/v/checker/tests/enum_err.vv b/vlib/v/checker/tests/enum_err.vv new file mode 100644 index 0000000000..17ee4e7366 --- /dev/null +++ b/vlib/v/checker/tests/enum_err.vv @@ -0,0 +1,11 @@ +module main + +enum Color { + green = 'green', + yellow = 1+1, + blue, +} + +fn main(){ + println('hello') +} diff --git a/vlib/v/checker/tests/inout/fn_type_exists.out b/vlib/v/checker/tests/fn_type_exists.out similarity index 61% rename from vlib/v/checker/tests/inout/fn_type_exists.out rename to vlib/v/checker/tests/fn_type_exists.out index c800caff70..c94902e98b 100644 --- a/vlib/v/checker/tests/inout/fn_type_exists.out +++ b/vlib/v/checker/tests/fn_type_exists.out @@ -1,9 +1,9 @@ -vlib/v/checker/tests/inout/fn_type_exists.v:1:1: error: type `Pants` doesn't exist +vlib/v/checker/tests/fn_type_exists.v:1:1: error: type `Pants` doesn't exist 1| type PantsCreator = fn (a Shirt) Pants ~~~~~~~~~~~~~~~~~ 2| 3| type PantsConsumer = fn (p Pants) -vlib/v/checker/tests/inout/fn_type_exists.v:3:1: error: type `Pants` doesn't exist +vlib/v/checker/tests/fn_type_exists.v:3:1: error: type `Pants` doesn't exist 1| type PantsCreator = fn (a Shirt) Pants 2| 3| type PantsConsumer = fn (p Pants) diff --git a/vlib/v/checker/tests/inout/fn_type_exists.vv b/vlib/v/checker/tests/fn_type_exists.v similarity index 100% rename from vlib/v/checker/tests/inout/fn_type_exists.vv rename to vlib/v/checker/tests/fn_type_exists.v diff --git a/vlib/v/checker/tests/fn_type_exists.vv b/vlib/v/checker/tests/fn_type_exists.vv new file mode 100644 index 0000000000..a61c83c170 --- /dev/null +++ b/vlib/v/checker/tests/fn_type_exists.vv @@ -0,0 +1,7 @@ +type PantsCreator = fn (a Shirt) Pants + +type PantsConsumer = fn (p Pants) + +fn main() { + +} diff --git a/vlib/v/checker/tests/inout/for-in-index-type.out b/vlib/v/checker/tests/for-in-index-type.out similarity index 54% rename from vlib/v/checker/tests/inout/for-in-index-type.out rename to vlib/v/checker/tests/for-in-index-type.out index 34e2d31fb5..15f89cae7c 100644 --- a/vlib/v/checker/tests/inout/for-in-index-type.out +++ b/vlib/v/checker/tests/for-in-index-type.out @@ -1,4 +1,4 @@ -vlib/v/checker/tests/inout/for-in-index-type.v:2:11: error: for in: cannot index `int` +vlib/v/checker/tests/for-in-index-type.v:2:11: error: for in: cannot index `int` 1| fn main() { 2| for a in 52 { ~~ diff --git a/vlib/v/checker/tests/inout/for-in-index-type.vv b/vlib/v/checker/tests/for-in-index-type.v similarity index 100% rename from vlib/v/checker/tests/inout/for-in-index-type.vv rename to vlib/v/checker/tests/for-in-index-type.v diff --git a/vlib/v/checker/tests/for-in-index-type.vv b/vlib/v/checker/tests/for-in-index-type.vv new file mode 100644 index 0000000000..cbc26ae11b --- /dev/null +++ b/vlib/v/checker/tests/for-in-index-type.vv @@ -0,0 +1,5 @@ +fn main() { + for a in 52 { + println(a) + } +} \ No newline at end of file diff --git a/vlib/v/checker/tests/inout/for_in_range_not_match_type.out b/vlib/v/checker/tests/for_in_range_not_match_type.out similarity index 53% rename from vlib/v/checker/tests/inout/for_in_range_not_match_type.out rename to vlib/v/checker/tests/for_in_range_not_match_type.out index ea364b372f..a06754ac3d 100644 --- a/vlib/v/checker/tests/inout/for_in_range_not_match_type.out +++ b/vlib/v/checker/tests/for_in_range_not_match_type.out @@ -1,4 +1,4 @@ -vlib/v/checker/tests/inout/for_in_range_not_match_type.v:2:11: error: range types do not match +vlib/v/checker/tests/for_in_range_not_match_type.v:2:11: error: range types do not match 1| fn main() { 2| for i in 10..10.5 { ~~ diff --git a/vlib/v/checker/tests/inout/for_in_range_not_match_type.vv b/vlib/v/checker/tests/for_in_range_not_match_type.v similarity index 100% rename from vlib/v/checker/tests/inout/for_in_range_not_match_type.vv rename to vlib/v/checker/tests/for_in_range_not_match_type.v diff --git a/vlib/v/checker/tests/for_in_range_not_match_type.vv b/vlib/v/checker/tests/for_in_range_not_match_type.vv new file mode 100644 index 0000000000..8b158639f9 --- /dev/null +++ b/vlib/v/checker/tests/for_in_range_not_match_type.vv @@ -0,0 +1,5 @@ +fn main() { + for i in 10..10.5 { + println(i) + } +} diff --git a/vlib/v/checker/tests/inout/for_in_range_string_type.out b/vlib/v/checker/tests/for_in_range_string_type.out similarity index 53% rename from vlib/v/checker/tests/inout/for_in_range_string_type.out rename to vlib/v/checker/tests/for_in_range_string_type.out index f00ce32b10..a4f58afe2e 100644 --- a/vlib/v/checker/tests/inout/for_in_range_string_type.out +++ b/vlib/v/checker/tests/for_in_range_string_type.out @@ -1,4 +1,4 @@ -vlib/v/checker/tests/inout/for_in_range_string_type.v:2:11: error: range type can not be string +vlib/v/checker/tests/for_in_range_string_type.v:2:11: error: range type can not be string 1| fn main() { 2| for i in 'a'..'b' { ~~~ diff --git a/vlib/v/checker/tests/inout/for_in_range_string_type.vv b/vlib/v/checker/tests/for_in_range_string_type.v similarity index 100% rename from vlib/v/checker/tests/inout/for_in_range_string_type.vv rename to vlib/v/checker/tests/for_in_range_string_type.v diff --git a/vlib/v/checker/tests/for_in_range_string_type.vv b/vlib/v/checker/tests/for_in_range_string_type.vv new file mode 100644 index 0000000000..a459398c1d --- /dev/null +++ b/vlib/v/checker/tests/for_in_range_string_type.vv @@ -0,0 +1,5 @@ +fn main() { + for i in 'a'..'b' { + println(i) + } +} diff --git a/vlib/v/checker/tests/go_expr.out b/vlib/v/checker/tests/go_expr.out new file mode 100644 index 0000000000..17dcfaade3 --- /dev/null +++ b/vlib/v/checker/tests/go_expr.out @@ -0,0 +1,5 @@ +vlib/v/checker/tests/go_expr.v:2:5: error: expression in `go` must be a function call + 1| fn main() { + 2| go 1 + ^ + 3| } \ No newline at end of file diff --git a/vlib/v/checker/tests/inout/go_expr.vv b/vlib/v/checker/tests/go_expr.v similarity index 100% rename from vlib/v/checker/tests/inout/go_expr.vv rename to vlib/v/checker/tests/go_expr.v diff --git a/vlib/v/checker/tests/go_expr.vv b/vlib/v/checker/tests/go_expr.vv new file mode 100644 index 0000000000..969b29dc5e --- /dev/null +++ b/vlib/v/checker/tests/go_expr.vv @@ -0,0 +1,3 @@ +fn main() { + go 1 +} diff --git a/vlib/v/checker/tests/inout/in_mismatch_type.out b/vlib/v/checker/tests/in_mismatch_type.out similarity index 53% rename from vlib/v/checker/tests/inout/in_mismatch_type.out rename to vlib/v/checker/tests/in_mismatch_type.out index dc1c88a79d..0ee76c7f90 100644 --- a/vlib/v/checker/tests/inout/in_mismatch_type.out +++ b/vlib/v/checker/tests/in_mismatch_type.out @@ -1,53 +1,53 @@ -vlib/v/checker/tests/inout/in_mismatch_type.v:13:7: error: the data type on the left of `in` does not match the array item type +vlib/v/checker/tests/in_mismatch_type.v:13:7: error: the data type on the left of `in` does not match the array item type 11| } 12| s := 'abcd' 13| if 1 in a_s { ~~ 14| println('ok') 15| } -vlib/v/checker/tests/inout/in_mismatch_type.v:16:7: error: the data type on the left of `in` does not match the map key type +vlib/v/checker/tests/in_mismatch_type.v:16:7: error: the data type on the left of `in` does not match the map key type 14| println('ok') 15| } 16| if 2 in m { ~~ 17| println('yeah') 18| } -vlib/v/checker/tests/inout/in_mismatch_type.v:19:7: error: the data type on the left of `in` must be a string +vlib/v/checker/tests/in_mismatch_type.v:19:7: error: the data type on the left of `in` must be a string 17| println('yeah') 18| } 19| if 3 in s { ~~ 20| println('dope') 21| } -vlib/v/checker/tests/inout/in_mismatch_type.v:22:9: error: the data type on the left of `in` must be a string +vlib/v/checker/tests/in_mismatch_type.v:22:9: error: the data type on the left of `in` must be a string 20| println('dope') 21| } 22| if `a` in s { ~~ 23| println("oh no :'(") 24| } -vlib/v/checker/tests/inout/in_mismatch_type.v:25:7: error: `in` can only be used with an array/map/string +vlib/v/checker/tests/in_mismatch_type.v:25:7: error: `in` can only be used with an array/map/string 23| println("oh no :'(") 24| } 25| if 1 in 12 { ~~ 26| println('right') 27| } -vlib/v/checker/tests/inout/in_mismatch_type.v:28:12: error: the data type on the left of `in` does not match the map key type +vlib/v/checker/tests/in_mismatch_type.v:28:12: error: the data type on the left of `in` does not match the map key type 26| println('right') 27| } 28| if Int(2) in m { ~~ 29| println('yeah') 30| } -vlib/v/checker/tests/inout/in_mismatch_type.v:31:15: error: the data type on the left of `in` does not match the array item type +vlib/v/checker/tests/in_mismatch_type.v:31:15: error: the data type on the left of `in` does not match the array item type 29| println('yeah') 30| } 31| if Str2('3') in a_i { ~~ 32| println('sure') 33| } -vlib/v/checker/tests/inout/in_mismatch_type.v:34:15: error: the data type on the left of `in` does not match the array item type +vlib/v/checker/tests/in_mismatch_type.v:34:15: error: the data type on the left of `in` does not match the array item type 32| println('sure') 33| } 34| if Str3('2') in a_i { diff --git a/vlib/v/checker/tests/inout/in_mismatch_type.vv b/vlib/v/checker/tests/in_mismatch_type.v similarity index 100% rename from vlib/v/checker/tests/inout/in_mismatch_type.vv rename to vlib/v/checker/tests/in_mismatch_type.v diff --git a/vlib/v/checker/tests/in_mismatch_type.vv b/vlib/v/checker/tests/in_mismatch_type.vv new file mode 100644 index 0000000000..0754815d00 --- /dev/null +++ b/vlib/v/checker/tests/in_mismatch_type.vv @@ -0,0 +1,37 @@ +type Int = int + +type Str2 = string +type Str3 = Str2 + +fn main() { + a_i := [1, 2, 3] + a_s := ['1', '2', '3'] + m := { + 'test': 1 + } + s := 'abcd' + if 1 in a_s { + println('ok') + } + if 2 in m { + println('yeah') + } + if 3 in s { + println('dope') + } + if `a` in s { + println("oh no :'(") + } + if 1 in 12 { + println('right') + } + if Int(2) in m { + println('yeah') + } + if Str2('3') in a_i { + println('sure') + } + if Str3('2') in a_i { + println('all right') + } +} diff --git a/vlib/v/checker/tests/inout/add_op_wrong_left_type_err_a.out b/vlib/v/checker/tests/inout/add_op_wrong_left_type_err_a.out deleted file mode 100644 index 14543dbe80..0000000000 --- a/vlib/v/checker/tests/inout/add_op_wrong_left_type_err_a.out +++ /dev/null @@ -1,6 +0,0 @@ -vlib/v/checker/tests/inout/add_op_wrong_left_type_err_a.v:3:5: error: mismatched types `A` and `int` - 1| struct A{} - 2| fn main() { - 3| A{} + 10 - ~~~ - 4| } diff --git a/vlib/v/checker/tests/inout/add_op_wrong_left_type_err_b.out b/vlib/v/checker/tests/inout/add_op_wrong_left_type_err_b.out deleted file mode 100644 index 8d63042b98..0000000000 --- a/vlib/v/checker/tests/inout/add_op_wrong_left_type_err_b.out +++ /dev/null @@ -1,5 +0,0 @@ -vlib/v/checker/tests/inout/add_op_wrong_left_type_err_b.v:2:5: error: mismatched types `array_int` and `int` - 1| fn main() { - 2| [1,2,3] + 10 - ~~~~~~~ - 3| } diff --git a/vlib/v/checker/tests/inout/add_op_wrong_left_type_err_c.out b/vlib/v/checker/tests/inout/add_op_wrong_left_type_err_c.out deleted file mode 100644 index 7dfc066c43..0000000000 --- a/vlib/v/checker/tests/inout/add_op_wrong_left_type_err_c.out +++ /dev/null @@ -1,6 +0,0 @@ -vlib/v/checker/tests/inout/add_op_wrong_left_type_err_c.v:3:5: error: mismatched types `map_string_int` and `int` - 1| fn main() { - 2| a := map[string]int - 3| a + 10 - ^ - 4| } diff --git a/vlib/v/checker/tests/inout/add_op_wrong_right_type_err_a.out b/vlib/v/checker/tests/inout/add_op_wrong_right_type_err_a.out deleted file mode 100644 index 8f9cb31f8d..0000000000 --- a/vlib/v/checker/tests/inout/add_op_wrong_right_type_err_a.out +++ /dev/null @@ -1,6 +0,0 @@ -vlib/v/checker/tests/inout/add_op_wrong_right_type_err_a.v:3:10: error: mismatched types `int` and `A` - 1| struct A{} - 2| fn main() { - 3| 10 + A{} - ~~~ - 4| } diff --git a/vlib/v/checker/tests/inout/add_op_wrong_right_type_err_b.out b/vlib/v/checker/tests/inout/add_op_wrong_right_type_err_b.out deleted file mode 100644 index a55f7a8fe0..0000000000 --- a/vlib/v/checker/tests/inout/add_op_wrong_right_type_err_b.out +++ /dev/null @@ -1,5 +0,0 @@ -vlib/v/checker/tests/inout/add_op_wrong_right_type_err_b.v:2:10: error: mismatched types `int` and `array_int` - 1| fn main() { - 2| 10 + [1,2,3] - ~~~~~~~ - 3| } diff --git a/vlib/v/checker/tests/inout/add_op_wrong_right_type_err_c.out b/vlib/v/checker/tests/inout/add_op_wrong_right_type_err_c.out deleted file mode 100644 index 051e86c9d4..0000000000 --- a/vlib/v/checker/tests/inout/add_op_wrong_right_type_err_c.out +++ /dev/null @@ -1,6 +0,0 @@ -vlib/v/checker/tests/inout/add_op_wrong_right_type_err_c.v:3:10: error: mismatched types `int` and `map_string_int` - 1| fn main() { - 2| a := map[string]int - 3| 10 + a - ^ - 4| } diff --git a/vlib/v/checker/tests/inout/alias_type_exists.out b/vlib/v/checker/tests/inout/alias_type_exists.out deleted file mode 100644 index cdbee7fb04..0000000000 --- a/vlib/v/checker/tests/inout/alias_type_exists.out +++ /dev/null @@ -1,5 +0,0 @@ -vlib/v/checker/tests/inout/alias_type_exists.v:1:1: error: type `Bird` doesn't exist - 1| type Pigeon Bird - ~~~~~~~~~~~ - 2| - 3| fn main() { diff --git a/vlib/v/checker/tests/inout/assign_expr_type_err_a.out b/vlib/v/checker/tests/inout/assign_expr_type_err_a.out deleted file mode 100644 index 8e03a9c366..0000000000 --- a/vlib/v/checker/tests/inout/assign_expr_type_err_a.out +++ /dev/null @@ -1,6 +0,0 @@ -vlib/v/checker/tests/inout/assign_expr_type_err_a.v:3:2: error: operator <<= not defined on left operand type `f64` - 1| fn main() { - 2| mut foo := 0.5 - 3| foo <<= 1 - ~~~ - 4| } diff --git a/vlib/v/checker/tests/inout/assign_expr_type_err_b.out b/vlib/v/checker/tests/inout/assign_expr_type_err_b.out deleted file mode 100644 index 03f55bf78d..0000000000 --- a/vlib/v/checker/tests/inout/assign_expr_type_err_b.out +++ /dev/null @@ -1,6 +0,0 @@ -vlib/v/checker/tests/inout/assign_expr_type_err_b.v:3:9: error: operator %= not defined on right operand type `string` - 1| fn main() { - 2| mut foo := 10 - 3| foo %= 'hello' - ~~~~~~~ - 4| } diff --git a/vlib/v/checker/tests/inout/assign_expr_type_err_c.out b/vlib/v/checker/tests/inout/assign_expr_type_err_c.out deleted file mode 100644 index 72fb961c5b..0000000000 --- a/vlib/v/checker/tests/inout/assign_expr_type_err_c.out +++ /dev/null @@ -1,6 +0,0 @@ -vlib/v/checker/tests/inout/assign_expr_type_err_c.v:3:2: error: operator *= not defined on left operand type `string` - 1| fn main() { - 2| mut foo := 'hello' - 3| foo *= 10 - ~~~ - 4| } diff --git a/vlib/v/checker/tests/inout/assign_expr_type_err_d.out b/vlib/v/checker/tests/inout/assign_expr_type_err_d.out deleted file mode 100644 index bb3dfc85a0..0000000000 --- a/vlib/v/checker/tests/inout/assign_expr_type_err_d.out +++ /dev/null @@ -1,6 +0,0 @@ -vlib/v/checker/tests/inout/assign_expr_type_err_d.v:3:9: error: operator /= not defined on right operand type `bool` - 1| fn main() { - 2| mut foo := 1.5 - 3| foo /= true - ~~~~ - 4| } diff --git a/vlib/v/checker/tests/inout/assign_expr_type_err_e.out b/vlib/v/checker/tests/inout/assign_expr_type_err_e.out deleted file mode 100644 index ae6a0441b1..0000000000 --- a/vlib/v/checker/tests/inout/assign_expr_type_err_e.out +++ /dev/null @@ -1,6 +0,0 @@ -vlib/v/checker/tests/inout/assign_expr_type_err_e.v:3:2: error: operator -= not defined on left operand type `string` - 1| fn main() { - 2| mut foo := 'hello' - 3| foo -= `a` - ~~~ - 4| } diff --git a/vlib/v/checker/tests/inout/assign_expr_type_err_f.out b/vlib/v/checker/tests/inout/assign_expr_type_err_f.out deleted file mode 100644 index 960a87a532..0000000000 --- a/vlib/v/checker/tests/inout/assign_expr_type_err_f.out +++ /dev/null @@ -1,6 +0,0 @@ -vlib/v/checker/tests/inout/assign_expr_type_err_f.v:3:9: error: operator -= not defined on right operand type `bool` - 1| fn main() { - 2| mut foo := 10 - 3| foo -= false - ~~~~~ - 4| } diff --git a/vlib/v/checker/tests/inout/assign_expr_type_err_g.out b/vlib/v/checker/tests/inout/assign_expr_type_err_g.out deleted file mode 100644 index 4d17aa0c58..0000000000 --- a/vlib/v/checker/tests/inout/assign_expr_type_err_g.out +++ /dev/null @@ -1,6 +0,0 @@ -vlib/v/checker/tests/inout/assign_expr_type_err_g.v:3:2: error: operator += not defined on left operand type `bool` - 1| fn main() { - 2| mut foo := true - 3| foo += false - ~~~ - 4| } diff --git a/vlib/v/checker/tests/inout/assign_expr_type_err_h.out b/vlib/v/checker/tests/inout/assign_expr_type_err_h.out deleted file mode 100644 index 9e639b5285..0000000000 --- a/vlib/v/checker/tests/inout/assign_expr_type_err_h.out +++ /dev/null @@ -1,6 +0,0 @@ -vlib/v/checker/tests/inout/assign_expr_type_err_h.v:3:9: error: operator += not defined on right operand type `bool` - 1| fn main() { - 2| mut foo := 'hello' - 3| foo += false - ~~~~~ - 4| } diff --git a/vlib/v/checker/tests/inout/assign_expr_type_err_i.out b/vlib/v/checker/tests/inout/assign_expr_type_err_i.out deleted file mode 100644 index 3a056beb08..0000000000 --- a/vlib/v/checker/tests/inout/assign_expr_type_err_i.out +++ /dev/null @@ -1,6 +0,0 @@ -vlib/v/checker/tests/inout/assign_expr_type_err_i.v:3:9: error: cannot assign `string` to variable `foo` of type `f64` - 1| fn main() { - 2| mut foo := 1.5 - 3| foo += 'hello' - ~~~~~~~ - 4| } diff --git a/vlib/v/checker/tests/inout/bit_op_wrong_left_type_err.out b/vlib/v/checker/tests/inout/bit_op_wrong_left_type_err.out deleted file mode 100644 index 11c8992b64..0000000000 --- a/vlib/v/checker/tests/inout/bit_op_wrong_left_type_err.out +++ /dev/null @@ -1,5 +0,0 @@ -vlib/v/checker/tests/inout/bit_op_wrong_left_type_err.v:2:2: error: left type of `&` cannot be non-integer type f64 - 1| fn main() { - 2| 0.5 & 1 - ~~~ - 3| } diff --git a/vlib/v/checker/tests/inout/bit_op_wrong_right_type_err.out b/vlib/v/checker/tests/inout/bit_op_wrong_right_type_err.out deleted file mode 100644 index 668548cf69..0000000000 --- a/vlib/v/checker/tests/inout/bit_op_wrong_right_type_err.out +++ /dev/null @@ -1,5 +0,0 @@ -vlib/v/checker/tests/inout/bit_op_wrong_right_type_err.v:2:6: error: right type of `|` cannot be non-integer type f64 - 1| fn main() { - 2| 1 | 0.5 - ~~~ - 3| } diff --git a/vlib/v/checker/tests/inout/decl_underscore.out b/vlib/v/checker/tests/inout/decl_underscore.out deleted file mode 100644 index 2ae7fd09fd..0000000000 --- a/vlib/v/checker/tests/inout/decl_underscore.out +++ /dev/null @@ -1,5 +0,0 @@ -vlib/v/checker/tests/inout/decl_underscore.v:2:2: error: variable names cannot start with `__` - 1| fn main() { - 2| __abc := 1 - ~~~~~ - 3| } \ No newline at end of file diff --git a/vlib/v/checker/tests/inout/div_op_wrong_left_type_err_a.out b/vlib/v/checker/tests/inout/div_op_wrong_left_type_err_a.out deleted file mode 100644 index 0a472f66cb..0000000000 --- a/vlib/v/checker/tests/inout/div_op_wrong_left_type_err_a.out +++ /dev/null @@ -1,6 +0,0 @@ -vlib/v/checker/tests/inout/div_op_wrong_left_type_err_a.v:3:5: error: mismatched types `A` and `int` - 1| struct A{} - 2| fn main() { - 3| A{} / 10 - ~~~ - 4| } diff --git a/vlib/v/checker/tests/inout/div_op_wrong_left_type_err_b.out b/vlib/v/checker/tests/inout/div_op_wrong_left_type_err_b.out deleted file mode 100644 index 720ebecdf0..0000000000 --- a/vlib/v/checker/tests/inout/div_op_wrong_left_type_err_b.out +++ /dev/null @@ -1,5 +0,0 @@ -vlib/v/checker/tests/inout/div_op_wrong_left_type_err_b.v:2:5: error: mismatched types `array_int` and `int` - 1| fn main() { - 2| [1,2,3] / 10 - ~~~~~~~ - 3| } diff --git a/vlib/v/checker/tests/inout/div_op_wrong_left_type_err_c.out b/vlib/v/checker/tests/inout/div_op_wrong_left_type_err_c.out deleted file mode 100644 index 8cc5cf2e86..0000000000 --- a/vlib/v/checker/tests/inout/div_op_wrong_left_type_err_c.out +++ /dev/null @@ -1,6 +0,0 @@ -vlib/v/checker/tests/inout/div_op_wrong_left_type_err_c.v:3:5: error: mismatched types `map_string_int` and `int` - 1| fn main() { - 2| a := map[string]int - 3| a / 10 - ^ - 4| } diff --git a/vlib/v/checker/tests/inout/div_op_wrong_right_type_err_a.out b/vlib/v/checker/tests/inout/div_op_wrong_right_type_err_a.out deleted file mode 100644 index 5fbdf8d206..0000000000 --- a/vlib/v/checker/tests/inout/div_op_wrong_right_type_err_a.out +++ /dev/null @@ -1,6 +0,0 @@ -vlib/v/checker/tests/inout/div_op_wrong_right_type_err_a.v:3:10: error: mismatched types `int` and `A` - 1| struct A{} - 2| fn main() { - 3| 10 / A{} - ~~~ - 4| } diff --git a/vlib/v/checker/tests/inout/div_op_wrong_right_type_err_b.out b/vlib/v/checker/tests/inout/div_op_wrong_right_type_err_b.out deleted file mode 100644 index d4515b0bd7..0000000000 --- a/vlib/v/checker/tests/inout/div_op_wrong_right_type_err_b.out +++ /dev/null @@ -1,5 +0,0 @@ -vlib/v/checker/tests/inout/div_op_wrong_right_type_err_b.v:2:10: error: mismatched types `int` and `array_int` - 1| fn main() { - 2| 10 / [1,2,3] - ~~~~~~~ - 3| } diff --git a/vlib/v/checker/tests/inout/div_op_wrong_right_type_err_c.out b/vlib/v/checker/tests/inout/div_op_wrong_right_type_err_c.out deleted file mode 100644 index 3df975ccb3..0000000000 --- a/vlib/v/checker/tests/inout/div_op_wrong_right_type_err_c.out +++ /dev/null @@ -1,6 +0,0 @@ -vlib/v/checker/tests/inout/div_op_wrong_right_type_err_c.v:3:10: error: mismatched types `int` and `map_string_int` - 1| fn main() { - 2| a := map[string]int - 3| 10 / a - ^ - 4| } diff --git a/vlib/v/checker/tests/inout/go_expr.out b/vlib/v/checker/tests/inout/go_expr.out deleted file mode 100644 index 4430db9a06..0000000000 --- a/vlib/v/checker/tests/inout/go_expr.out +++ /dev/null @@ -1,5 +0,0 @@ -vlib/v/checker/tests/inout/go_expr.v:2:5: error: expression in `go` must be a function call - 1| fn main() { - 2| go 1 - ^ - 3| } \ No newline at end of file diff --git a/vlib/v/checker/tests/inout/minus_op_wrong_left_type_err_a.out b/vlib/v/checker/tests/inout/minus_op_wrong_left_type_err_a.out deleted file mode 100644 index 29b8a0ca9e..0000000000 --- a/vlib/v/checker/tests/inout/minus_op_wrong_left_type_err_a.out +++ /dev/null @@ -1,6 +0,0 @@ -vlib/v/checker/tests/inout/minus_op_wrong_left_type_err_a.v:3:5: error: mismatched types `A` and `int` - 1| struct A{} - 2| fn main() { - 3| A{} - 10 - ~~~ - 4| } diff --git a/vlib/v/checker/tests/inout/minus_op_wrong_left_type_err_b.out b/vlib/v/checker/tests/inout/minus_op_wrong_left_type_err_b.out deleted file mode 100644 index 10d3b9e4ed..0000000000 --- a/vlib/v/checker/tests/inout/minus_op_wrong_left_type_err_b.out +++ /dev/null @@ -1,5 +0,0 @@ -vlib/v/checker/tests/inout/minus_op_wrong_left_type_err_b.v:2:5: error: mismatched types `array_int` and `int` - 1| fn main() { - 2| [1,2,3] - 10 - ~~~~~~~ - 3| } diff --git a/vlib/v/checker/tests/inout/minus_op_wrong_left_type_err_c.out b/vlib/v/checker/tests/inout/minus_op_wrong_left_type_err_c.out deleted file mode 100644 index feb50e82b4..0000000000 --- a/vlib/v/checker/tests/inout/minus_op_wrong_left_type_err_c.out +++ /dev/null @@ -1,6 +0,0 @@ -vlib/v/checker/tests/inout/minus_op_wrong_left_type_err_c.v:3:5: error: mismatched types `map_string_int` and `int` - 1| fn main() { - 2| a := map[string]int - 3| a - 10 - ^ - 4| } diff --git a/vlib/v/checker/tests/inout/minus_op_wrong_right_type_err_a.out b/vlib/v/checker/tests/inout/minus_op_wrong_right_type_err_a.out deleted file mode 100644 index c47bfd697c..0000000000 --- a/vlib/v/checker/tests/inout/minus_op_wrong_right_type_err_a.out +++ /dev/null @@ -1,6 +0,0 @@ -vlib/v/checker/tests/inout/minus_op_wrong_right_type_err_a.v:3:10: error: mismatched types `int` and `A` - 1| struct A{} - 2| fn main() { - 3| 10 - A{} - ~~~ - 4| } diff --git a/vlib/v/checker/tests/inout/minus_op_wrong_right_type_err_b.out b/vlib/v/checker/tests/inout/minus_op_wrong_right_type_err_b.out deleted file mode 100644 index d24d801ff9..0000000000 --- a/vlib/v/checker/tests/inout/minus_op_wrong_right_type_err_b.out +++ /dev/null @@ -1,5 +0,0 @@ -vlib/v/checker/tests/inout/minus_op_wrong_right_type_err_b.v:2:10: error: mismatched types `int` and `array_int` - 1| fn main() { - 2| 10 - [1,2,3] - ~~~~~~~ - 3| } diff --git a/vlib/v/checker/tests/inout/minus_op_wrong_right_type_err_c.out b/vlib/v/checker/tests/inout/minus_op_wrong_right_type_err_c.out deleted file mode 100644 index 2523a80052..0000000000 --- a/vlib/v/checker/tests/inout/minus_op_wrong_right_type_err_c.out +++ /dev/null @@ -1,6 +0,0 @@ -vlib/v/checker/tests/inout/minus_op_wrong_right_type_err_c.v:3:10: error: mismatched types `int` and `map_string_int` - 1| fn main() { - 2| a := map[string]int - 3| 10 - a - ^ - 4| } diff --git a/vlib/v/checker/tests/inout/mod_op_wrong_left_type_err_a.out b/vlib/v/checker/tests/inout/mod_op_wrong_left_type_err_a.out deleted file mode 100644 index 67e242b595..0000000000 --- a/vlib/v/checker/tests/inout/mod_op_wrong_left_type_err_a.out +++ /dev/null @@ -1,5 +0,0 @@ -vlib/v/checker/tests/inout/mod_op_wrong_left_type_err_a.v:2:2: error: mismatched types `f64` and `int` - 1| fn main() { - 2| 0.5 % 1 - ~~~ - 3| } diff --git a/vlib/v/checker/tests/inout/mod_op_wrong_left_type_err_b.out b/vlib/v/checker/tests/inout/mod_op_wrong_left_type_err_b.out deleted file mode 100644 index 8753aa9e3d..0000000000 --- a/vlib/v/checker/tests/inout/mod_op_wrong_left_type_err_b.out +++ /dev/null @@ -1,5 +0,0 @@ -vlib/v/checker/tests/inout/mod_op_wrong_left_type_err_b.v:2:2: error: mismatched types `array_int` and `int` - 1| fn main() { - 2| [1,2,3] % 1 - ~~~~~~~ - 3| } diff --git a/vlib/v/checker/tests/inout/mod_op_wrong_left_type_err_c.out b/vlib/v/checker/tests/inout/mod_op_wrong_left_type_err_c.out deleted file mode 100644 index 3fd24c0b36..0000000000 --- a/vlib/v/checker/tests/inout/mod_op_wrong_left_type_err_c.out +++ /dev/null @@ -1,6 +0,0 @@ -vlib/v/checker/tests/inout/mod_op_wrong_left_type_err_c.v:4:2: error: mismatched types `A` and `int` - 2| fn main() { - 3| a := A{} - 4| a % 1 - ^ - 5| } diff --git a/vlib/v/checker/tests/inout/mod_op_wrong_left_type_err_d.out b/vlib/v/checker/tests/inout/mod_op_wrong_left_type_err_d.out deleted file mode 100644 index a8ec677e3b..0000000000 --- a/vlib/v/checker/tests/inout/mod_op_wrong_left_type_err_d.out +++ /dev/null @@ -1,6 +0,0 @@ -vlib/v/checker/tests/inout/mod_op_wrong_left_type_err_d.v:3:2: error: mismatched types `map_string_int` and `int` - 1| fn main() { - 2| a := map[string]int - 3| a % 1 - ^ - 4| } diff --git a/vlib/v/checker/tests/inout/mod_op_wrong_right_type_err_a.out b/vlib/v/checker/tests/inout/mod_op_wrong_right_type_err_a.out deleted file mode 100644 index b6cdbf5501..0000000000 --- a/vlib/v/checker/tests/inout/mod_op_wrong_right_type_err_a.out +++ /dev/null @@ -1,5 +0,0 @@ -vlib/v/checker/tests/inout/mod_op_wrong_right_type_err_a.v:2:6: error: mismatched types `int` and `f64` - 1| fn main() { - 2| 1 % 0.5 - ~~~ - 3| } diff --git a/vlib/v/checker/tests/inout/mod_op_wrong_right_type_err_b.out b/vlib/v/checker/tests/inout/mod_op_wrong_right_type_err_b.out deleted file mode 100644 index ebd4bded5d..0000000000 --- a/vlib/v/checker/tests/inout/mod_op_wrong_right_type_err_b.out +++ /dev/null @@ -1,5 +0,0 @@ -vlib/v/checker/tests/inout/mod_op_wrong_right_type_err_b.v:2:6: error: mismatched types `int` and `array_int` - 1| fn main() { - 2| 1 % [1,2,3] - ~~~~~~~ - 3| } diff --git a/vlib/v/checker/tests/inout/mod_op_wrong_right_type_err_c.out b/vlib/v/checker/tests/inout/mod_op_wrong_right_type_err_c.out deleted file mode 100644 index 60c7fbb0f6..0000000000 --- a/vlib/v/checker/tests/inout/mod_op_wrong_right_type_err_c.out +++ /dev/null @@ -1,6 +0,0 @@ -vlib/v/checker/tests/inout/mod_op_wrong_right_type_err_c.v:4:6: error: mismatched types `int` and `A` - 2| fn main() { - 3| a := A{} - 4| 1 % a - ^ - 5| } diff --git a/vlib/v/checker/tests/inout/mod_op_wrong_right_type_err_d.out b/vlib/v/checker/tests/inout/mod_op_wrong_right_type_err_d.out deleted file mode 100644 index 9dc25c38b9..0000000000 --- a/vlib/v/checker/tests/inout/mod_op_wrong_right_type_err_d.out +++ /dev/null @@ -1,6 +0,0 @@ -vlib/v/checker/tests/inout/mod_op_wrong_right_type_err_d.v:3:6: error: mismatched types `int` and `map_string_int` - 1| fn main() { - 2| a := map[string]int - 3| 1 % a - ^ - 4| } diff --git a/vlib/v/checker/tests/inout/mul_op_wrong_left_type_err_a.out b/vlib/v/checker/tests/inout/mul_op_wrong_left_type_err_a.out deleted file mode 100644 index fa9b8298c5..0000000000 --- a/vlib/v/checker/tests/inout/mul_op_wrong_left_type_err_a.out +++ /dev/null @@ -1,6 +0,0 @@ -vlib/v/checker/tests/inout/mul_op_wrong_left_type_err_a.v:3:5: error: mismatched types `A` and `int` - 1| struct A{} - 2| fn main() { - 3| A{} * 10 - ~~~ - 4| } diff --git a/vlib/v/checker/tests/inout/mul_op_wrong_left_type_err_b.out b/vlib/v/checker/tests/inout/mul_op_wrong_left_type_err_b.out deleted file mode 100644 index 9872130bde..0000000000 --- a/vlib/v/checker/tests/inout/mul_op_wrong_left_type_err_b.out +++ /dev/null @@ -1,5 +0,0 @@ -vlib/v/checker/tests/inout/mul_op_wrong_left_type_err_b.v:2:5: error: mismatched types `array_int` and `int` - 1| fn main() { - 2| [1,2,3] * 10 - ~~~~~~~ - 3| } diff --git a/vlib/v/checker/tests/inout/mul_op_wrong_left_type_err_c.out b/vlib/v/checker/tests/inout/mul_op_wrong_left_type_err_c.out deleted file mode 100644 index 4cf9da0fb7..0000000000 --- a/vlib/v/checker/tests/inout/mul_op_wrong_left_type_err_c.out +++ /dev/null @@ -1,6 +0,0 @@ -vlib/v/checker/tests/inout/mul_op_wrong_left_type_err_c.v:3:5: error: mismatched types `map_string_int` and `int` - 1| fn main() { - 2| a := map[string]int - 3| a * 10 - ^ - 4| } diff --git a/vlib/v/checker/tests/inout/mul_op_wrong_right_type_err_a.out b/vlib/v/checker/tests/inout/mul_op_wrong_right_type_err_a.out deleted file mode 100644 index f5031c40c3..0000000000 --- a/vlib/v/checker/tests/inout/mul_op_wrong_right_type_err_a.out +++ /dev/null @@ -1,6 +0,0 @@ -vlib/v/checker/tests/inout/mul_op_wrong_right_type_err_a.v:3:10: error: mismatched types `int` and `A` - 1| struct A{} - 2| fn main() { - 3| 10 * A{} - ~~~ - 4| } diff --git a/vlib/v/checker/tests/inout/mul_op_wrong_right_type_err_b.out b/vlib/v/checker/tests/inout/mul_op_wrong_right_type_err_b.out deleted file mode 100644 index e084e90a86..0000000000 --- a/vlib/v/checker/tests/inout/mul_op_wrong_right_type_err_b.out +++ /dev/null @@ -1,5 +0,0 @@ -vlib/v/checker/tests/inout/mul_op_wrong_right_type_err_b.v:2:10: error: mismatched types `int` and `array_int` - 1| fn main() { - 2| 10 * [1,2,3] - ~~~~~~~ - 3| } diff --git a/vlib/v/checker/tests/inout/mul_op_wrong_right_type_err_c.out b/vlib/v/checker/tests/inout/mul_op_wrong_right_type_err_c.out deleted file mode 100644 index 1d4fc41407..0000000000 --- a/vlib/v/checker/tests/inout/mul_op_wrong_right_type_err_c.out +++ /dev/null @@ -1,6 +0,0 @@ -vlib/v/checker/tests/inout/mul_op_wrong_right_type_err_c.v:3:10: error: mismatched types `int` and `map_string_int` - 1| fn main() { - 2| a := map[string]int - 3| 10 * a - ^ - 4| } diff --git a/vlib/v/checker/tests/inout/no_fn_main.out b/vlib/v/checker/tests/inout/no_fn_main.out deleted file mode 100644 index efaa176f82..0000000000 --- a/vlib/v/checker/tests/inout/no_fn_main.out +++ /dev/null @@ -1,5 +0,0 @@ -vlib/v/checker/tests/inout/no_fn_main.v:1:1: error: function `main` must be declared in the main module - 1| fn no_main() { - ^ - 2| println('Hello world !') - 3| } diff --git a/vlib/v/checker/tests/inout/no_pub_in_main.out b/vlib/v/checker/tests/inout/no_pub_in_main.out deleted file mode 100644 index bba28e48db..0000000000 --- a/vlib/v/checker/tests/inout/no_pub_in_main.out +++ /dev/null @@ -1,49 +0,0 @@ -vlib/v/checker/tests/inout/no_pub_in_main.v:3:1: error: type alias `Integer` in module main cannot be declared public - 1| module main - 2| - 3| pub type Integer = int - ~~~~~~~~~~~~~~~~ - 4| - 5| pub type Float = f32 | f64 -vlib/v/checker/tests/inout/no_pub_in_main.v:5:1: error: sum type `Float` in module main cannot be declared public - 3| pub type Integer = int - 4| - 5| pub type Float = f32 | f64 - ~~~~~~~~~~~~~~ - 6| - 7| // Buggy ATM -vlib/v/checker/tests/inout/no_pub_in_main.v:10:1: error: enum `Color` in module main cannot be declared public - 8| // pub type Fn = fn () int - 9| - 10| pub enum Color { - ~~~~~~~~~~~~~~ - 11| red - 12| green -vlib/v/checker/tests/inout/no_pub_in_main.v:16:1: error: const in module main cannot be declared public - 14| } - 15| - 16| pub const ( - ~~~~~~~~~ - 17| w = 'world' - 18| ) -vlib/v/checker/tests/inout/no_pub_in_main.v:20:1: error: function `my_fn` in module main cannot be declared public - 18| ) - 19| - 20| pub fn my_fn() int { - ~~~~~~~~~~~~~~~~~~ - 21| return 1 - 22| } -vlib/v/checker/tests/inout/no_pub_in_main.v:24:1: error: function `main` cannot be declared public - 22| } - 23| - 24| pub fn main() { - ~~~~~~~~~~~~~ - 25| println('main') - 26| } -vlib/v/checker/tests/inout/no_pub_in_main.v:28:1: error: struct `MyStruct` in module main cannot be declared public - 26| } - 27| - 28| pub struct MyStruct { - ~~~~~~~~~~~~~~~~~~~ - 29| field int - 30| } diff --git a/vlib/v/checker/tests/inout/return_type.out b/vlib/v/checker/tests/inout/return_type.out deleted file mode 100644 index 2d41747047..0000000000 --- a/vlib/v/checker/tests/inout/return_type.out +++ /dev/null @@ -1,6 +0,0 @@ -vlib/v/checker/tests/inout/return_type.v:2:9: error: cannot use `int` as type `bool` in return argument - 1| fn test() bool { - 2| return 100 - ~~~ - 3| } - 4| \ No newline at end of file diff --git a/vlib/v/checker/tests/inout/shift_op_wrong_left_type_err.out b/vlib/v/checker/tests/inout/shift_op_wrong_left_type_err.out deleted file mode 100644 index d4948c7920..0000000000 --- a/vlib/v/checker/tests/inout/shift_op_wrong_left_type_err.out +++ /dev/null @@ -1,5 +0,0 @@ -vlib/v/checker/tests/inout/shift_op_wrong_left_type_err.v:2:2: error: cannot shift type int into non-integer type f64 - 1| fn main() { - 2| 0.5 << 1 - ~~~ - 3| } diff --git a/vlib/v/checker/tests/inout/shift_op_wrong_right_type_err.out b/vlib/v/checker/tests/inout/shift_op_wrong_right_type_err.out deleted file mode 100644 index 35af639b74..0000000000 --- a/vlib/v/checker/tests/inout/shift_op_wrong_right_type_err.out +++ /dev/null @@ -1,5 +0,0 @@ -vlib/v/checker/tests/inout/shift_op_wrong_right_type_err.v:2:7: error: cannot shift non-integer type f64 into type int - 1| fn main() { - 2| 1 << 0.5 - ~~~ - 3| } diff --git a/vlib/v/checker/tests/inout/struct_name.out b/vlib/v/checker/tests/inout/struct_name.out deleted file mode 100644 index 9f14566f07..0000000000 --- a/vlib/v/checker/tests/inout/struct_name.out +++ /dev/null @@ -1,5 +0,0 @@ -vlib/v/checker/tests/inout/struct_name.v:1:8: error: struct name must begin with capital letter - 1| struct abc { - ~~~ - 2| - 3| } \ No newline at end of file diff --git a/vlib/v/checker/tests/inout/is_type_not_exist.out b/vlib/v/checker/tests/is_type_not_exist.out similarity index 64% rename from vlib/v/checker/tests/inout/is_type_not_exist.out rename to vlib/v/checker/tests/is_type_not_exist.out index b24533cbe4..2957294de3 100644 --- a/vlib/v/checker/tests/inout/is_type_not_exist.out +++ b/vlib/v/checker/tests/is_type_not_exist.out @@ -1,4 +1,4 @@ -vlib/v/checker/tests/inout/is_type_not_exist.v:8:10: error: is: type `SomethingThatDontExist` does not exist +vlib/v/checker/tests/is_type_not_exist.v:8:10: error: is: type `SomethingThatDontExist` does not exist 6| 7| fn fn_with_sum_type_param(i Integer) { 8| if i is SomethingThatDontExist { diff --git a/vlib/v/checker/tests/inout/is_type_not_exist.vv b/vlib/v/checker/tests/is_type_not_exist.v similarity index 100% rename from vlib/v/checker/tests/inout/is_type_not_exist.vv rename to vlib/v/checker/tests/is_type_not_exist.v diff --git a/vlib/v/checker/tests/is_type_not_exist.vv b/vlib/v/checker/tests/is_type_not_exist.vv new file mode 100644 index 0000000000..e50859b348 --- /dev/null +++ b/vlib/v/checker/tests/is_type_not_exist.vv @@ -0,0 +1,11 @@ +type Integer = i8 | i16 | int | i64 + +fn main() { + fn_with_sum_type_param(1) +} + +fn fn_with_sum_type_param(i Integer) { + if i is SomethingThatDontExist { + println('It should fail !') + } +} diff --git a/vlib/v/checker/tests/inout/left_shift_err.out b/vlib/v/checker/tests/left_shift_err.out similarity index 50% rename from vlib/v/checker/tests/inout/left_shift_err.out rename to vlib/v/checker/tests/left_shift_err.out index d28a20d59d..1c01098b02 100644 --- a/vlib/v/checker/tests/inout/left_shift_err.out +++ b/vlib/v/checker/tests/left_shift_err.out @@ -1,4 +1,4 @@ -vlib/v/checker/tests/inout/left_shift_err.v:3:7: error: cannot shift type string into array_int +vlib/v/checker/tests/left_shift_err.v:3:7: error: cannot shift type string into array_int 1| fn main() { 2| l := []int{} 3| l << 'test' diff --git a/vlib/v/checker/tests/inout/left_shift_err.vv b/vlib/v/checker/tests/left_shift_err.v similarity index 100% rename from vlib/v/checker/tests/inout/left_shift_err.vv rename to vlib/v/checker/tests/left_shift_err.v diff --git a/vlib/v/checker/tests/left_shift_err.vv b/vlib/v/checker/tests/left_shift_err.vv new file mode 100644 index 0000000000..df62f079be --- /dev/null +++ b/vlib/v/checker/tests/left_shift_err.vv @@ -0,0 +1,4 @@ +fn main() { + l := []int{} + l << 'test' +} diff --git a/vlib/v/checker/tests/inout/match_duplicate_branch.out b/vlib/v/checker/tests/match_duplicate_branch.out similarity index 62% rename from vlib/v/checker/tests/inout/match_duplicate_branch.out rename to vlib/v/checker/tests/match_duplicate_branch.out index c5aeac6289..0aa85aec85 100644 --- a/vlib/v/checker/tests/inout/match_duplicate_branch.out +++ b/vlib/v/checker/tests/match_duplicate_branch.out @@ -1,32 +1,32 @@ -vlib/v/checker/tests/inout/match_duplicate_branch.v:15:3: error: match case `St1` is handled more than once +vlib/v/checker/tests/match_duplicate_branch.v:15:3: error: match case `St1` is handled more than once 13| match i { 14| St1 { println('St1') } 15| St1 { println('St1') } ~~~~~ 16| St2 { println('St2') } 17| } -vlib/v/checker/tests/inout/match_duplicate_branch.v:20:3: error: match case `St1` is handled more than once +vlib/v/checker/tests/match_duplicate_branch.v:20:3: error: match case `St1` is handled more than once 18| match i { 19| St1 { println('St1') } 20| St1 { println('St1') } ~~~~~ 21| else { println('else') } 22| } -vlib/v/checker/tests/inout/match_duplicate_branch.v:29:3: error: match case `green` is handled more than once +vlib/v/checker/tests/match_duplicate_branch.v:29:3: error: match case `green` is handled more than once 27| .red { println('red') } 28| .green { println('green') } 29| .green { println('green') } ~~~~~~~~ 30| .blue { println('blue') } 31| } -vlib/v/checker/tests/inout/match_duplicate_branch.v:34:3: error: match case `green` is handled more than once +vlib/v/checker/tests/match_duplicate_branch.v:34:3: error: match case `green` is handled more than once 32| match c { 33| .red, .green { println('red green') } 34| .green { println('green') } ~~~~~~~~ 35| else { println('else') } 36| } -vlib/v/checker/tests/inout/match_duplicate_branch.v:43:3: error: match case `2` is handled more than once +vlib/v/checker/tests/match_duplicate_branch.v:43:3: error: match case `2` is handled more than once 41| 1 { println('1') } 42| 2 { println('2') } 43| 2 { println('3') } diff --git a/vlib/v/checker/tests/inout/match_duplicate_branch.vv b/vlib/v/checker/tests/match_duplicate_branch.v similarity index 100% rename from vlib/v/checker/tests/inout/match_duplicate_branch.vv rename to vlib/v/checker/tests/match_duplicate_branch.v diff --git a/vlib/v/checker/tests/match_duplicate_branch.vv b/vlib/v/checker/tests/match_duplicate_branch.vv new file mode 100644 index 0000000000..7ea3265bad --- /dev/null +++ b/vlib/v/checker/tests/match_duplicate_branch.vv @@ -0,0 +1,52 @@ +enum Color { + red + green + blue +} + +struct St1 {} +struct St2 {} + +type St = St1 | St2 + +fn test_sum_type(i St) { + match i { + St1 { println('St1') } + St1 { println('St1') } + St2 { println('St2') } + } + match i { + St1 { println('St1') } + St1 { println('St1') } + else { println('else') } + } +} + +fn test_enum(c Color) { + match c { + .red { println('red') } + .green { println('green') } + .green { println('green') } + .blue { println('blue') } + } + match c { + .red, .green { println('red green') } + .green { println('green') } + else { println('else') } + } +} + +fn test_int(i int) { + match i { + 1 { println('1') } + 2 { println('2') } + 2 { println('3') } + else { println('else') } + } +} + +fn main() { + test_sum_type(St1{}) + test_enum(.red) + test_int(2) +} diff --git a/vlib/v/checker/tests/inout/match_else_last_expr.out b/vlib/v/checker/tests/match_else_last_expr.out similarity index 61% rename from vlib/v/checker/tests/inout/match_else_last_expr.out rename to vlib/v/checker/tests/match_else_last_expr.out index 03f72e7893..85e4515104 100644 --- a/vlib/v/checker/tests/inout/match_else_last_expr.out +++ b/vlib/v/checker/tests/match_else_last_expr.out @@ -1,4 +1,4 @@ -vlib/v/checker/tests/inout/match_else_last_expr.v:4:3: error: `else` must be the last branch of `match` +vlib/v/checker/tests/match_else_last_expr.v:4:3: error: `else` must be the last branch of `match` 2| match 1 { 3| 1 { println('1') } 4| else { println('else') } diff --git a/vlib/v/checker/tests/inout/match_else_last_expr.vv b/vlib/v/checker/tests/match_else_last_expr.v similarity index 100% rename from vlib/v/checker/tests/inout/match_else_last_expr.vv rename to vlib/v/checker/tests/match_else_last_expr.v diff --git a/vlib/v/checker/tests/match_else_last_expr.vv b/vlib/v/checker/tests/match_else_last_expr.vv new file mode 100644 index 0000000000..3aa5cc5944 --- /dev/null +++ b/vlib/v/checker/tests/match_else_last_expr.vv @@ -0,0 +1,7 @@ +fn main() { + match 1 { + 1 { println('1') } + else { println('else') } + 4 { println('4') } + } +} diff --git a/vlib/v/checker/tests/inout/match_expr_else.out b/vlib/v/checker/tests/match_expr_else.out similarity index 53% rename from vlib/v/checker/tests/inout/match_expr_else.out rename to vlib/v/checker/tests/match_expr_else.out index d269437812..3558f27a4c 100644 --- a/vlib/v/checker/tests/inout/match_expr_else.out +++ b/vlib/v/checker/tests/match_expr_else.out @@ -1,18 +1,18 @@ -vlib/v/checker/tests/inout/match_expr_else.v:5:6: error: match must be exhaustive (add match branches for: `f64` or `else {}` at the end) +vlib/v/checker/tests/match_expr_else.v:5:6: error: match must be exhaustive (add match branches for: `f64` or `else {}` at the end) 3| fn main() { 4| x := A('test') 5| _ = match x { ~~~~~~~~~ 6| int { 7| 'int' -vlib/v/checker/tests/inout/match_expr_else.v:23:3: error: match expression is exhaustive, `else` is unnecessary +vlib/v/checker/tests/match_expr_else.v:23:3: error: match expression is exhaustive, `else` is unnecessary 21| 'f64' 22| } 23| else { ~~~~~~ 24| 'else' 25| } -vlib/v/checker/tests/inout/match_expr_else.v:34:3: error: `else` must be the last branch of `match` +vlib/v/checker/tests/match_expr_else.v:34:3: error: `else` must be the last branch of `match` 32| 'string' 33| } 34| else { diff --git a/vlib/v/checker/tests/inout/match_expr_else.vv b/vlib/v/checker/tests/match_expr_else.v similarity index 100% rename from vlib/v/checker/tests/inout/match_expr_else.vv rename to vlib/v/checker/tests/match_expr_else.v diff --git a/vlib/v/checker/tests/match_expr_else.vv b/vlib/v/checker/tests/match_expr_else.vv new file mode 100644 index 0000000000..fff7be0253 --- /dev/null +++ b/vlib/v/checker/tests/match_expr_else.vv @@ -0,0 +1,41 @@ +type A = int | string | f64 + +fn main() { + x := A('test') + _ = match x { + int { + 'int' + } + string { + 'string' + } + } + _ := match x { + int { + 'int' + } + string { + 'string' + } + f64 { + 'f64' + } + else { + 'else' + } + } + _ := match x { + int { + 'int' + } + string { + 'string' + } + else { + 'else' + } + f64 { + 'f64' + } + } +} diff --git a/vlib/v/checker/tests/inout/match_undefined_cond.out b/vlib/v/checker/tests/match_undefined_cond.out similarity index 63% rename from vlib/v/checker/tests/inout/match_undefined_cond.out rename to vlib/v/checker/tests/match_undefined_cond.out index 7dff92aaab..0530f67afe 100644 --- a/vlib/v/checker/tests/inout/match_undefined_cond.out +++ b/vlib/v/checker/tests/match_undefined_cond.out @@ -1,4 +1,4 @@ -vlib/v/checker/tests/inout/match_undefined_cond.v:4:15: error: undefined: `Asd` +vlib/v/checker/tests/match_undefined_cond.v:4:15: error: undefined: `Asd` 2| 3| fn main() { 4| res := match Asd { diff --git a/vlib/v/checker/tests/inout/match_undefined_cond.vv b/vlib/v/checker/tests/match_undefined_cond.v similarity index 100% rename from vlib/v/checker/tests/inout/match_undefined_cond.vv rename to vlib/v/checker/tests/match_undefined_cond.v diff --git a/vlib/v/checker/tests/match_undefined_cond.vv b/vlib/v/checker/tests/match_undefined_cond.vv new file mode 100644 index 0000000000..952e4b768b --- /dev/null +++ b/vlib/v/checker/tests/match_undefined_cond.vv @@ -0,0 +1,10 @@ +type Asd = int + +fn main() { + res := match Asd { + 1 { 'foo' } + 2 { 'test' } + else { '' } + } + _ = res +} diff --git a/vlib/v/checker/tests/minus_op_wrong_left_type_err_a.out b/vlib/v/checker/tests/minus_op_wrong_left_type_err_a.out new file mode 100644 index 0000000000..90a5b273d3 --- /dev/null +++ b/vlib/v/checker/tests/minus_op_wrong_left_type_err_a.out @@ -0,0 +1,6 @@ +vlib/v/checker/tests/minus_op_wrong_left_type_err_a.v:3:5: error: mismatched types `A` and `int` + 1| struct A{} + 2| fn main() { + 3| A{} - 10 + ~~~ + 4| } diff --git a/vlib/v/checker/tests/inout/minus_op_wrong_left_type_err_a.vv b/vlib/v/checker/tests/minus_op_wrong_left_type_err_a.v similarity index 100% rename from vlib/v/checker/tests/inout/minus_op_wrong_left_type_err_a.vv rename to vlib/v/checker/tests/minus_op_wrong_left_type_err_a.v diff --git a/vlib/v/checker/tests/minus_op_wrong_left_type_err_a.vv b/vlib/v/checker/tests/minus_op_wrong_left_type_err_a.vv new file mode 100644 index 0000000000..3c1a5c0894 --- /dev/null +++ b/vlib/v/checker/tests/minus_op_wrong_left_type_err_a.vv @@ -0,0 +1,4 @@ +struct A{} +fn main() { + A{} - 10 +} diff --git a/vlib/v/checker/tests/minus_op_wrong_left_type_err_b.out b/vlib/v/checker/tests/minus_op_wrong_left_type_err_b.out new file mode 100644 index 0000000000..05140438bd --- /dev/null +++ b/vlib/v/checker/tests/minus_op_wrong_left_type_err_b.out @@ -0,0 +1,5 @@ +vlib/v/checker/tests/minus_op_wrong_left_type_err_b.v:2:5: error: mismatched types `array_int` and `int` + 1| fn main() { + 2| [1,2,3] - 10 + ~~~~~~~ + 3| } diff --git a/vlib/v/checker/tests/inout/minus_op_wrong_left_type_err_b.vv b/vlib/v/checker/tests/minus_op_wrong_left_type_err_b.v similarity index 100% rename from vlib/v/checker/tests/inout/minus_op_wrong_left_type_err_b.vv rename to vlib/v/checker/tests/minus_op_wrong_left_type_err_b.v diff --git a/vlib/v/checker/tests/minus_op_wrong_left_type_err_b.vv b/vlib/v/checker/tests/minus_op_wrong_left_type_err_b.vv new file mode 100644 index 0000000000..25a7ed323e --- /dev/null +++ b/vlib/v/checker/tests/minus_op_wrong_left_type_err_b.vv @@ -0,0 +1,3 @@ +fn main() { + [1,2,3] - 10 +} diff --git a/vlib/v/checker/tests/minus_op_wrong_left_type_err_c.out b/vlib/v/checker/tests/minus_op_wrong_left_type_err_c.out new file mode 100644 index 0000000000..82e45f59b0 --- /dev/null +++ b/vlib/v/checker/tests/minus_op_wrong_left_type_err_c.out @@ -0,0 +1,6 @@ +vlib/v/checker/tests/minus_op_wrong_left_type_err_c.v:3:5: error: mismatched types `map_string_int` and `int` + 1| fn main() { + 2| a := map[string]int + 3| a - 10 + ^ + 4| } diff --git a/vlib/v/checker/tests/inout/minus_op_wrong_left_type_err_c.vv b/vlib/v/checker/tests/minus_op_wrong_left_type_err_c.v similarity index 100% rename from vlib/v/checker/tests/inout/minus_op_wrong_left_type_err_c.vv rename to vlib/v/checker/tests/minus_op_wrong_left_type_err_c.v diff --git a/vlib/v/checker/tests/minus_op_wrong_left_type_err_c.vv b/vlib/v/checker/tests/minus_op_wrong_left_type_err_c.vv new file mode 100644 index 0000000000..083d54b3a9 --- /dev/null +++ b/vlib/v/checker/tests/minus_op_wrong_left_type_err_c.vv @@ -0,0 +1,4 @@ +fn main() { + a := map[string]int + a - 10 +} diff --git a/vlib/v/checker/tests/minus_op_wrong_right_type_err_a.out b/vlib/v/checker/tests/minus_op_wrong_right_type_err_a.out new file mode 100644 index 0000000000..896a7b5052 --- /dev/null +++ b/vlib/v/checker/tests/minus_op_wrong_right_type_err_a.out @@ -0,0 +1,6 @@ +vlib/v/checker/tests/minus_op_wrong_right_type_err_a.v:3:10: error: mismatched types `int` and `A` + 1| struct A{} + 2| fn main() { + 3| 10 - A{} + ~~~ + 4| } diff --git a/vlib/v/checker/tests/inout/minus_op_wrong_right_type_err_a.vv b/vlib/v/checker/tests/minus_op_wrong_right_type_err_a.v similarity index 100% rename from vlib/v/checker/tests/inout/minus_op_wrong_right_type_err_a.vv rename to vlib/v/checker/tests/minus_op_wrong_right_type_err_a.v diff --git a/vlib/v/checker/tests/minus_op_wrong_right_type_err_a.vv b/vlib/v/checker/tests/minus_op_wrong_right_type_err_a.vv new file mode 100644 index 0000000000..bce597e6d5 --- /dev/null +++ b/vlib/v/checker/tests/minus_op_wrong_right_type_err_a.vv @@ -0,0 +1,4 @@ +struct A{} +fn main() { + 10 - A{} +} diff --git a/vlib/v/checker/tests/minus_op_wrong_right_type_err_b.out b/vlib/v/checker/tests/minus_op_wrong_right_type_err_b.out new file mode 100644 index 0000000000..a91e3bfc38 --- /dev/null +++ b/vlib/v/checker/tests/minus_op_wrong_right_type_err_b.out @@ -0,0 +1,5 @@ +vlib/v/checker/tests/minus_op_wrong_right_type_err_b.v:2:10: error: mismatched types `int` and `array_int` + 1| fn main() { + 2| 10 - [1,2,3] + ~~~~~~~ + 3| } diff --git a/vlib/v/checker/tests/inout/minus_op_wrong_right_type_err_b.vv b/vlib/v/checker/tests/minus_op_wrong_right_type_err_b.v similarity index 100% rename from vlib/v/checker/tests/inout/minus_op_wrong_right_type_err_b.vv rename to vlib/v/checker/tests/minus_op_wrong_right_type_err_b.v diff --git a/vlib/v/checker/tests/minus_op_wrong_right_type_err_b.vv b/vlib/v/checker/tests/minus_op_wrong_right_type_err_b.vv new file mode 100644 index 0000000000..d001d9bd2b --- /dev/null +++ b/vlib/v/checker/tests/minus_op_wrong_right_type_err_b.vv @@ -0,0 +1,3 @@ +fn main() { + 10 - [1,2,3] +} diff --git a/vlib/v/checker/tests/minus_op_wrong_right_type_err_c.out b/vlib/v/checker/tests/minus_op_wrong_right_type_err_c.out new file mode 100644 index 0000000000..789d6e809f --- /dev/null +++ b/vlib/v/checker/tests/minus_op_wrong_right_type_err_c.out @@ -0,0 +1,6 @@ +vlib/v/checker/tests/minus_op_wrong_right_type_err_c.v:3:10: error: mismatched types `int` and `map_string_int` + 1| fn main() { + 2| a := map[string]int + 3| 10 - a + ^ + 4| } diff --git a/vlib/v/checker/tests/inout/minus_op_wrong_right_type_err_c.vv b/vlib/v/checker/tests/minus_op_wrong_right_type_err_c.v similarity index 100% rename from vlib/v/checker/tests/inout/minus_op_wrong_right_type_err_c.vv rename to vlib/v/checker/tests/minus_op_wrong_right_type_err_c.v diff --git a/vlib/v/checker/tests/minus_op_wrong_right_type_err_c.vv b/vlib/v/checker/tests/minus_op_wrong_right_type_err_c.vv new file mode 100644 index 0000000000..7c73df41f3 --- /dev/null +++ b/vlib/v/checker/tests/minus_op_wrong_right_type_err_c.vv @@ -0,0 +1,4 @@ +fn main() { + a := map[string]int + 10 - a +} diff --git a/vlib/v/checker/tests/inout/mod_op_wrong_left_type_err_a.vv b/vlib/v/checker/tests/mod_op_wrong_left_type_err.v similarity index 100% rename from vlib/v/checker/tests/inout/mod_op_wrong_left_type_err_a.vv rename to vlib/v/checker/tests/mod_op_wrong_left_type_err.v diff --git a/vlib/v/checker/tests/mod_op_wrong_left_type_err_a.out b/vlib/v/checker/tests/mod_op_wrong_left_type_err_a.out new file mode 100644 index 0000000000..38a43868c8 --- /dev/null +++ b/vlib/v/checker/tests/mod_op_wrong_left_type_err_a.out @@ -0,0 +1,5 @@ +vlib/v/checker/tests/mod_op_wrong_left_type_err_a.v:2:2: error: mismatched types `f64` and `int` + 1| fn main() { + 2| 0.5 % 1 + ~~~ + 3| } diff --git a/vlib/v/checker/tests/mod_op_wrong_left_type_err_a.v b/vlib/v/checker/tests/mod_op_wrong_left_type_err_a.v new file mode 100644 index 0000000000..175974c6a0 --- /dev/null +++ b/vlib/v/checker/tests/mod_op_wrong_left_type_err_a.v @@ -0,0 +1,3 @@ +fn main() { + 0.5 % 1 +} diff --git a/vlib/v/checker/tests/mod_op_wrong_left_type_err_a.vv b/vlib/v/checker/tests/mod_op_wrong_left_type_err_a.vv new file mode 100644 index 0000000000..175974c6a0 --- /dev/null +++ b/vlib/v/checker/tests/mod_op_wrong_left_type_err_a.vv @@ -0,0 +1,3 @@ +fn main() { + 0.5 % 1 +} diff --git a/vlib/v/checker/tests/mod_op_wrong_left_type_err_b.out b/vlib/v/checker/tests/mod_op_wrong_left_type_err_b.out new file mode 100644 index 0000000000..cb73d04fa5 --- /dev/null +++ b/vlib/v/checker/tests/mod_op_wrong_left_type_err_b.out @@ -0,0 +1,5 @@ +vlib/v/checker/tests/mod_op_wrong_left_type_err_b.v:2:2: error: mismatched types `array_int` and `int` + 1| fn main() { + 2| [1,2,3] % 1 + ~~~~~~~ + 3| } diff --git a/vlib/v/checker/tests/inout/mod_op_wrong_left_type_err_b.vv b/vlib/v/checker/tests/mod_op_wrong_left_type_err_b.v similarity index 100% rename from vlib/v/checker/tests/inout/mod_op_wrong_left_type_err_b.vv rename to vlib/v/checker/tests/mod_op_wrong_left_type_err_b.v diff --git a/vlib/v/checker/tests/mod_op_wrong_left_type_err_b.vv b/vlib/v/checker/tests/mod_op_wrong_left_type_err_b.vv new file mode 100644 index 0000000000..8e33fbbb6f --- /dev/null +++ b/vlib/v/checker/tests/mod_op_wrong_left_type_err_b.vv @@ -0,0 +1,3 @@ +fn main() { + [1,2,3] % 1 +} diff --git a/vlib/v/checker/tests/mod_op_wrong_left_type_err_c.out b/vlib/v/checker/tests/mod_op_wrong_left_type_err_c.out new file mode 100644 index 0000000000..54e32b6816 --- /dev/null +++ b/vlib/v/checker/tests/mod_op_wrong_left_type_err_c.out @@ -0,0 +1,6 @@ +vlib/v/checker/tests/mod_op_wrong_left_type_err_c.v:4:2: error: mismatched types `A` and `int` + 2| fn main() { + 3| a := A{} + 4| a % 1 + ^ + 5| } diff --git a/vlib/v/checker/tests/inout/mod_op_wrong_left_type_err_c.vv b/vlib/v/checker/tests/mod_op_wrong_left_type_err_c.v similarity index 100% rename from vlib/v/checker/tests/inout/mod_op_wrong_left_type_err_c.vv rename to vlib/v/checker/tests/mod_op_wrong_left_type_err_c.v diff --git a/vlib/v/checker/tests/mod_op_wrong_left_type_err_c.vv b/vlib/v/checker/tests/mod_op_wrong_left_type_err_c.vv new file mode 100644 index 0000000000..7f88eafd62 --- /dev/null +++ b/vlib/v/checker/tests/mod_op_wrong_left_type_err_c.vv @@ -0,0 +1,5 @@ +struct A{} +fn main() { + a := A{} + a % 1 +} diff --git a/vlib/v/checker/tests/mod_op_wrong_left_type_err_d.out b/vlib/v/checker/tests/mod_op_wrong_left_type_err_d.out new file mode 100644 index 0000000000..7d9f82de89 --- /dev/null +++ b/vlib/v/checker/tests/mod_op_wrong_left_type_err_d.out @@ -0,0 +1,6 @@ +vlib/v/checker/tests/mod_op_wrong_left_type_err_d.v:3:2: error: mismatched types `map_string_int` and `int` + 1| fn main() { + 2| a := map[string]int + 3| a % 1 + ^ + 4| } diff --git a/vlib/v/checker/tests/inout/mod_op_wrong_left_type_err_d.vv b/vlib/v/checker/tests/mod_op_wrong_left_type_err_d.v similarity index 100% rename from vlib/v/checker/tests/inout/mod_op_wrong_left_type_err_d.vv rename to vlib/v/checker/tests/mod_op_wrong_left_type_err_d.v diff --git a/vlib/v/checker/tests/mod_op_wrong_left_type_err_d.vv b/vlib/v/checker/tests/mod_op_wrong_left_type_err_d.vv new file mode 100644 index 0000000000..d4f76d671f --- /dev/null +++ b/vlib/v/checker/tests/mod_op_wrong_left_type_err_d.vv @@ -0,0 +1,4 @@ +fn main() { + a := map[string]int + a % 1 +} diff --git a/vlib/v/checker/tests/inout/mod_op_wrong_right_type_err_a.vv b/vlib/v/checker/tests/mod_op_wrong_right_type_err.v similarity index 100% rename from vlib/v/checker/tests/inout/mod_op_wrong_right_type_err_a.vv rename to vlib/v/checker/tests/mod_op_wrong_right_type_err.v diff --git a/vlib/v/checker/tests/mod_op_wrong_right_type_err_a.out b/vlib/v/checker/tests/mod_op_wrong_right_type_err_a.out new file mode 100644 index 0000000000..f4749a21fa --- /dev/null +++ b/vlib/v/checker/tests/mod_op_wrong_right_type_err_a.out @@ -0,0 +1,5 @@ +vlib/v/checker/tests/mod_op_wrong_right_type_err_a.v:2:6: error: mismatched types `int` and `f64` + 1| fn main() { + 2| 1 % 0.5 + ~~~ + 3| } diff --git a/vlib/v/checker/tests/mod_op_wrong_right_type_err_a.v b/vlib/v/checker/tests/mod_op_wrong_right_type_err_a.v new file mode 100644 index 0000000000..9db1022bca --- /dev/null +++ b/vlib/v/checker/tests/mod_op_wrong_right_type_err_a.v @@ -0,0 +1,3 @@ +fn main() { + 1 % 0.5 +} diff --git a/vlib/v/checker/tests/mod_op_wrong_right_type_err_a.vv b/vlib/v/checker/tests/mod_op_wrong_right_type_err_a.vv new file mode 100644 index 0000000000..9db1022bca --- /dev/null +++ b/vlib/v/checker/tests/mod_op_wrong_right_type_err_a.vv @@ -0,0 +1,3 @@ +fn main() { + 1 % 0.5 +} diff --git a/vlib/v/checker/tests/mod_op_wrong_right_type_err_b.out b/vlib/v/checker/tests/mod_op_wrong_right_type_err_b.out new file mode 100644 index 0000000000..c1c82e590c --- /dev/null +++ b/vlib/v/checker/tests/mod_op_wrong_right_type_err_b.out @@ -0,0 +1,5 @@ +vlib/v/checker/tests/mod_op_wrong_right_type_err_b.v:2:6: error: mismatched types `int` and `array_int` + 1| fn main() { + 2| 1 % [1,2,3] + ~~~~~~~ + 3| } diff --git a/vlib/v/checker/tests/inout/mod_op_wrong_right_type_err_b.vv b/vlib/v/checker/tests/mod_op_wrong_right_type_err_b.v similarity index 100% rename from vlib/v/checker/tests/inout/mod_op_wrong_right_type_err_b.vv rename to vlib/v/checker/tests/mod_op_wrong_right_type_err_b.v diff --git a/vlib/v/checker/tests/mod_op_wrong_right_type_err_b.vv b/vlib/v/checker/tests/mod_op_wrong_right_type_err_b.vv new file mode 100644 index 0000000000..2322fed1e3 --- /dev/null +++ b/vlib/v/checker/tests/mod_op_wrong_right_type_err_b.vv @@ -0,0 +1,3 @@ +fn main() { + 1 % [1,2,3] +} diff --git a/vlib/v/checker/tests/mod_op_wrong_right_type_err_c.out b/vlib/v/checker/tests/mod_op_wrong_right_type_err_c.out new file mode 100644 index 0000000000..323b951d76 --- /dev/null +++ b/vlib/v/checker/tests/mod_op_wrong_right_type_err_c.out @@ -0,0 +1,6 @@ +vlib/v/checker/tests/mod_op_wrong_right_type_err_c.v:4:6: error: mismatched types `int` and `A` + 2| fn main() { + 3| a := A{} + 4| 1 % a + ^ + 5| } diff --git a/vlib/v/checker/tests/inout/mod_op_wrong_right_type_err_c.vv b/vlib/v/checker/tests/mod_op_wrong_right_type_err_c.v similarity index 100% rename from vlib/v/checker/tests/inout/mod_op_wrong_right_type_err_c.vv rename to vlib/v/checker/tests/mod_op_wrong_right_type_err_c.v diff --git a/vlib/v/checker/tests/mod_op_wrong_right_type_err_c.vv b/vlib/v/checker/tests/mod_op_wrong_right_type_err_c.vv new file mode 100644 index 0000000000..15c4feddb8 --- /dev/null +++ b/vlib/v/checker/tests/mod_op_wrong_right_type_err_c.vv @@ -0,0 +1,5 @@ +struct A{} +fn main() { + a := A{} + 1 % a +} diff --git a/vlib/v/checker/tests/mod_op_wrong_right_type_err_d.out b/vlib/v/checker/tests/mod_op_wrong_right_type_err_d.out new file mode 100644 index 0000000000..e268e19776 --- /dev/null +++ b/vlib/v/checker/tests/mod_op_wrong_right_type_err_d.out @@ -0,0 +1,6 @@ +vlib/v/checker/tests/mod_op_wrong_right_type_err_d.v:3:6: error: mismatched types `int` and `map_string_int` + 1| fn main() { + 2| a := map[string]int + 3| 1 % a + ^ + 4| } diff --git a/vlib/v/checker/tests/inout/mod_op_wrong_right_type_err_d.vv b/vlib/v/checker/tests/mod_op_wrong_right_type_err_d.v similarity index 100% rename from vlib/v/checker/tests/inout/mod_op_wrong_right_type_err_d.vv rename to vlib/v/checker/tests/mod_op_wrong_right_type_err_d.v diff --git a/vlib/v/checker/tests/mod_op_wrong_right_type_err_d.vv b/vlib/v/checker/tests/mod_op_wrong_right_type_err_d.vv new file mode 100644 index 0000000000..ca3730dec0 --- /dev/null +++ b/vlib/v/checker/tests/mod_op_wrong_right_type_err_d.vv @@ -0,0 +1,4 @@ +fn main() { + a := map[string]int + 1 % a +} diff --git a/vlib/v/checker/tests/mul_op_wrong_left_type_err_a.out b/vlib/v/checker/tests/mul_op_wrong_left_type_err_a.out new file mode 100644 index 0000000000..3ebdf6b8bf --- /dev/null +++ b/vlib/v/checker/tests/mul_op_wrong_left_type_err_a.out @@ -0,0 +1,6 @@ +vlib/v/checker/tests/mul_op_wrong_left_type_err_a.v:3:5: error: mismatched types `A` and `int` + 1| struct A{} + 2| fn main() { + 3| A{} * 10 + ~~~ + 4| } diff --git a/vlib/v/checker/tests/inout/mul_op_wrong_left_type_err_a.vv b/vlib/v/checker/tests/mul_op_wrong_left_type_err_a.v similarity index 100% rename from vlib/v/checker/tests/inout/mul_op_wrong_left_type_err_a.vv rename to vlib/v/checker/tests/mul_op_wrong_left_type_err_a.v diff --git a/vlib/v/checker/tests/mul_op_wrong_left_type_err_a.vv b/vlib/v/checker/tests/mul_op_wrong_left_type_err_a.vv new file mode 100644 index 0000000000..a3afb73839 --- /dev/null +++ b/vlib/v/checker/tests/mul_op_wrong_left_type_err_a.vv @@ -0,0 +1,4 @@ +struct A{} +fn main() { + A{} * 10 +} diff --git a/vlib/v/checker/tests/mul_op_wrong_left_type_err_b.out b/vlib/v/checker/tests/mul_op_wrong_left_type_err_b.out new file mode 100644 index 0000000000..6b85071a6b --- /dev/null +++ b/vlib/v/checker/tests/mul_op_wrong_left_type_err_b.out @@ -0,0 +1,5 @@ +vlib/v/checker/tests/mul_op_wrong_left_type_err_b.v:2:5: error: mismatched types `array_int` and `int` + 1| fn main() { + 2| [1,2,3] * 10 + ~~~~~~~ + 3| } diff --git a/vlib/v/checker/tests/inout/mul_op_wrong_left_type_err_b.vv b/vlib/v/checker/tests/mul_op_wrong_left_type_err_b.v similarity index 100% rename from vlib/v/checker/tests/inout/mul_op_wrong_left_type_err_b.vv rename to vlib/v/checker/tests/mul_op_wrong_left_type_err_b.v diff --git a/vlib/v/checker/tests/mul_op_wrong_left_type_err_b.vv b/vlib/v/checker/tests/mul_op_wrong_left_type_err_b.vv new file mode 100644 index 0000000000..d3db01f01f --- /dev/null +++ b/vlib/v/checker/tests/mul_op_wrong_left_type_err_b.vv @@ -0,0 +1,3 @@ +fn main() { + [1,2,3] * 10 +} diff --git a/vlib/v/checker/tests/mul_op_wrong_left_type_err_c.out b/vlib/v/checker/tests/mul_op_wrong_left_type_err_c.out new file mode 100644 index 0000000000..dd0acc525f --- /dev/null +++ b/vlib/v/checker/tests/mul_op_wrong_left_type_err_c.out @@ -0,0 +1,6 @@ +vlib/v/checker/tests/mul_op_wrong_left_type_err_c.v:3:5: error: mismatched types `map_string_int` and `int` + 1| fn main() { + 2| a := map[string]int + 3| a * 10 + ^ + 4| } diff --git a/vlib/v/checker/tests/inout/mul_op_wrong_left_type_err_c.vv b/vlib/v/checker/tests/mul_op_wrong_left_type_err_c.v similarity index 100% rename from vlib/v/checker/tests/inout/mul_op_wrong_left_type_err_c.vv rename to vlib/v/checker/tests/mul_op_wrong_left_type_err_c.v diff --git a/vlib/v/checker/tests/mul_op_wrong_left_type_err_c.vv b/vlib/v/checker/tests/mul_op_wrong_left_type_err_c.vv new file mode 100644 index 0000000000..315f882862 --- /dev/null +++ b/vlib/v/checker/tests/mul_op_wrong_left_type_err_c.vv @@ -0,0 +1,4 @@ +fn main() { + a := map[string]int + a * 10 +} diff --git a/vlib/v/checker/tests/mul_op_wrong_right_type_err_a.out b/vlib/v/checker/tests/mul_op_wrong_right_type_err_a.out new file mode 100644 index 0000000000..ed37214f0d --- /dev/null +++ b/vlib/v/checker/tests/mul_op_wrong_right_type_err_a.out @@ -0,0 +1,6 @@ +vlib/v/checker/tests/mul_op_wrong_right_type_err_a.v:3:10: error: mismatched types `int` and `A` + 1| struct A{} + 2| fn main() { + 3| 10 * A{} + ~~~ + 4| } diff --git a/vlib/v/checker/tests/inout/mul_op_wrong_right_type_err_a.vv b/vlib/v/checker/tests/mul_op_wrong_right_type_err_a.v similarity index 100% rename from vlib/v/checker/tests/inout/mul_op_wrong_right_type_err_a.vv rename to vlib/v/checker/tests/mul_op_wrong_right_type_err_a.v diff --git a/vlib/v/checker/tests/mul_op_wrong_right_type_err_a.vv b/vlib/v/checker/tests/mul_op_wrong_right_type_err_a.vv new file mode 100644 index 0000000000..452d5b5cd2 --- /dev/null +++ b/vlib/v/checker/tests/mul_op_wrong_right_type_err_a.vv @@ -0,0 +1,4 @@ +struct A{} +fn main() { + 10 * A{} +} diff --git a/vlib/v/checker/tests/mul_op_wrong_right_type_err_b.out b/vlib/v/checker/tests/mul_op_wrong_right_type_err_b.out new file mode 100644 index 0000000000..5c13594c0f --- /dev/null +++ b/vlib/v/checker/tests/mul_op_wrong_right_type_err_b.out @@ -0,0 +1,5 @@ +vlib/v/checker/tests/mul_op_wrong_right_type_err_b.v:2:10: error: mismatched types `int` and `array_int` + 1| fn main() { + 2| 10 * [1,2,3] + ~~~~~~~ + 3| } diff --git a/vlib/v/checker/tests/inout/mul_op_wrong_right_type_err_b.vv b/vlib/v/checker/tests/mul_op_wrong_right_type_err_b.v similarity index 100% rename from vlib/v/checker/tests/inout/mul_op_wrong_right_type_err_b.vv rename to vlib/v/checker/tests/mul_op_wrong_right_type_err_b.v diff --git a/vlib/v/checker/tests/mul_op_wrong_right_type_err_b.vv b/vlib/v/checker/tests/mul_op_wrong_right_type_err_b.vv new file mode 100644 index 0000000000..29a136b9e5 --- /dev/null +++ b/vlib/v/checker/tests/mul_op_wrong_right_type_err_b.vv @@ -0,0 +1,3 @@ +fn main() { + 10 * [1,2,3] +} diff --git a/vlib/v/checker/tests/mul_op_wrong_right_type_err_c.out b/vlib/v/checker/tests/mul_op_wrong_right_type_err_c.out new file mode 100644 index 0000000000..f6618f0910 --- /dev/null +++ b/vlib/v/checker/tests/mul_op_wrong_right_type_err_c.out @@ -0,0 +1,6 @@ +vlib/v/checker/tests/mul_op_wrong_right_type_err_c.v:3:10: error: mismatched types `int` and `map_string_int` + 1| fn main() { + 2| a := map[string]int + 3| 10 * a + ^ + 4| } diff --git a/vlib/v/checker/tests/inout/mul_op_wrong_right_type_err_c.vv b/vlib/v/checker/tests/mul_op_wrong_right_type_err_c.v similarity index 100% rename from vlib/v/checker/tests/inout/mul_op_wrong_right_type_err_c.vv rename to vlib/v/checker/tests/mul_op_wrong_right_type_err_c.v diff --git a/vlib/v/checker/tests/mul_op_wrong_right_type_err_c.vv b/vlib/v/checker/tests/mul_op_wrong_right_type_err_c.vv new file mode 100644 index 0000000000..80ef961943 --- /dev/null +++ b/vlib/v/checker/tests/mul_op_wrong_right_type_err_c.vv @@ -0,0 +1,4 @@ +fn main() { + a := map[string]int + 10 * a +} diff --git a/vlib/v/checker/tests/no_fn_main.out b/vlib/v/checker/tests/no_fn_main.out new file mode 100644 index 0000000000..34d5c5daf9 --- /dev/null +++ b/vlib/v/checker/tests/no_fn_main.out @@ -0,0 +1,5 @@ +vlib/v/checker/tests/no_fn_main.v:1:1: error: function `main` must be declared in the main module + 1| fn no_main() { + ^ + 2| println('Hello world !') + 3| } diff --git a/vlib/v/checker/tests/inout/no_fn_main.vv b/vlib/v/checker/tests/no_fn_main.v similarity index 100% rename from vlib/v/checker/tests/inout/no_fn_main.vv rename to vlib/v/checker/tests/no_fn_main.v diff --git a/vlib/v/checker/tests/no_fn_main.vv b/vlib/v/checker/tests/no_fn_main.vv new file mode 100644 index 0000000000..d9a0b24dae --- /dev/null +++ b/vlib/v/checker/tests/no_fn_main.vv @@ -0,0 +1,3 @@ +fn no_main() { + println('Hello world !') +} diff --git a/vlib/v/checker/tests/no_pub_in_main.out b/vlib/v/checker/tests/no_pub_in_main.out new file mode 100644 index 0000000000..882bc8d69c --- /dev/null +++ b/vlib/v/checker/tests/no_pub_in_main.out @@ -0,0 +1,49 @@ +vlib/v/checker/tests/no_pub_in_main.v:3:1: error: type alias `Integer` in module main cannot be declared public + 1| module main + 2| + 3| pub type Integer = int + ~~~~~~~~~~~~~~~~ + 4| + 5| pub type Float = f32 | f64 +vlib/v/checker/tests/no_pub_in_main.v:5:1: error: sum type `Float` in module main cannot be declared public + 3| pub type Integer = int + 4| + 5| pub type Float = f32 | f64 + ~~~~~~~~~~~~~~ + 6| + 7| // Buggy ATM +vlib/v/checker/tests/no_pub_in_main.v:10:1: error: enum `Color` in module main cannot be declared public + 8| // pub type Fn = fn () int + 9| + 10| pub enum Color { + ~~~~~~~~~~~~~~ + 11| red + 12| green +vlib/v/checker/tests/no_pub_in_main.v:16:1: error: const in module main cannot be declared public + 14| } + 15| + 16| pub const ( + ~~~~~~~~~ + 17| w = 'world' + 18| ) +vlib/v/checker/tests/no_pub_in_main.v:20:1: error: function `my_fn` in module main cannot be declared public + 18| ) + 19| + 20| pub fn my_fn() int { + ~~~~~~~~~~~~~~~~~~ + 21| return 1 + 22| } +vlib/v/checker/tests/no_pub_in_main.v:24:1: error: function `main` cannot be declared public + 22| } + 23| + 24| pub fn main() { + ~~~~~~~~~~~~~ + 25| println('main') + 26| } +vlib/v/checker/tests/no_pub_in_main.v:28:1: error: struct `MyStruct` in module main cannot be declared public + 26| } + 27| + 28| pub struct MyStruct { + ~~~~~~~~~~~~~~~~~~~ + 29| field int + 30| } diff --git a/vlib/v/checker/tests/inout/no_pub_in_main.vv b/vlib/v/checker/tests/no_pub_in_main.v similarity index 100% rename from vlib/v/checker/tests/inout/no_pub_in_main.vv rename to vlib/v/checker/tests/no_pub_in_main.v diff --git a/vlib/v/checker/tests/no_pub_in_main.vv b/vlib/v/checker/tests/no_pub_in_main.vv new file mode 100644 index 0000000000..76d6ee0114 --- /dev/null +++ b/vlib/v/checker/tests/no_pub_in_main.vv @@ -0,0 +1,30 @@ +module main + +pub type Integer = int + +pub type Float = f32 | f64 + +// Buggy ATM +// pub type Fn = fn () int + +pub enum Color { + red + green + blue +} + +pub const ( + w = 'world' +) + +pub fn my_fn() int { + return 1 +} + +pub fn main() { + println('main') +} + +pub struct MyStruct { + field int +} diff --git a/vlib/v/checker/tests/return_type.out b/vlib/v/checker/tests/return_type.out new file mode 100644 index 0000000000..4c6f59f7ba --- /dev/null +++ b/vlib/v/checker/tests/return_type.out @@ -0,0 +1,6 @@ +vlib/v/checker/tests/return_type.v:2:9: error: cannot use `int` as type `bool` in return argument + 1| fn test() bool { + 2| return 100 + ~~~ + 3| } + 4| \ No newline at end of file diff --git a/vlib/v/checker/tests/inout/return_type.vv b/vlib/v/checker/tests/return_type.v similarity index 100% rename from vlib/v/checker/tests/inout/return_type.vv rename to vlib/v/checker/tests/return_type.v diff --git a/vlib/v/checker/tests/return_type.vv b/vlib/v/checker/tests/return_type.vv new file mode 100644 index 0000000000..333ec9f622 --- /dev/null +++ b/vlib/v/checker/tests/return_type.vv @@ -0,0 +1,5 @@ +fn test() bool { + return 100 +} + +fn main() {} diff --git a/vlib/v/checker/tests/shift_op_wrong_left_type_err.out b/vlib/v/checker/tests/shift_op_wrong_left_type_err.out new file mode 100644 index 0000000000..1a52b9f04c --- /dev/null +++ b/vlib/v/checker/tests/shift_op_wrong_left_type_err.out @@ -0,0 +1,5 @@ +vlib/v/checker/tests/shift_op_wrong_left_type_err.v:2:2: error: cannot shift type int into non-integer type f64 + 1| fn main() { + 2| 0.5 << 1 + ~~~ + 3| } diff --git a/vlib/v/checker/tests/inout/shift_op_wrong_left_type_err.vv b/vlib/v/checker/tests/shift_op_wrong_left_type_err.v similarity index 100% rename from vlib/v/checker/tests/inout/shift_op_wrong_left_type_err.vv rename to vlib/v/checker/tests/shift_op_wrong_left_type_err.v diff --git a/vlib/v/checker/tests/shift_op_wrong_left_type_err.vv b/vlib/v/checker/tests/shift_op_wrong_left_type_err.vv new file mode 100644 index 0000000000..5c0a8cb6fd --- /dev/null +++ b/vlib/v/checker/tests/shift_op_wrong_left_type_err.vv @@ -0,0 +1,3 @@ +fn main() { + 0.5 << 1 +} \ No newline at end of file diff --git a/vlib/v/checker/tests/shift_op_wrong_right_type_err.out b/vlib/v/checker/tests/shift_op_wrong_right_type_err.out new file mode 100644 index 0000000000..f8e7ff03ef --- /dev/null +++ b/vlib/v/checker/tests/shift_op_wrong_right_type_err.out @@ -0,0 +1,5 @@ +vlib/v/checker/tests/shift_op_wrong_right_type_err.v:2:7: error: cannot shift non-integer type f64 into type int + 1| fn main() { + 2| 1 << 0.5 + ~~~ + 3| } diff --git a/vlib/v/checker/tests/inout/shift_op_wrong_right_type_err.vv b/vlib/v/checker/tests/shift_op_wrong_right_type_err.v similarity index 100% rename from vlib/v/checker/tests/inout/shift_op_wrong_right_type_err.vv rename to vlib/v/checker/tests/shift_op_wrong_right_type_err.v diff --git a/vlib/v/checker/tests/shift_op_wrong_right_type_err.vv b/vlib/v/checker/tests/shift_op_wrong_right_type_err.vv new file mode 100644 index 0000000000..5e8a85d179 --- /dev/null +++ b/vlib/v/checker/tests/shift_op_wrong_right_type_err.vv @@ -0,0 +1,3 @@ +fn main() { + 1 << 0.5 +} \ No newline at end of file diff --git a/vlib/v/checker/tests/inout/short_struct_too_many.out b/vlib/v/checker/tests/short_struct_too_many.out similarity index 60% rename from vlib/v/checker/tests/inout/short_struct_too_many.out rename to vlib/v/checker/tests/short_struct_too_many.out index 7a0e28d331..7218a5d9be 100644 --- a/vlib/v/checker/tests/inout/short_struct_too_many.out +++ b/vlib/v/checker/tests/short_struct_too_many.out @@ -1,4 +1,4 @@ -vlib/v/checker/tests/inout/short_struct_too_many.v:6:7: error: too many fields +vlib/v/checker/tests/short_struct_too_many.v:6:7: error: too many fields 4| 5| fn main() { 6| t := Test{true, false} diff --git a/vlib/v/checker/tests/inout/short_struct_too_many.vv b/vlib/v/checker/tests/short_struct_too_many.v similarity index 100% rename from vlib/v/checker/tests/inout/short_struct_too_many.vv rename to vlib/v/checker/tests/short_struct_too_many.v diff --git a/vlib/v/checker/tests/short_struct_too_many.vv b/vlib/v/checker/tests/short_struct_too_many.vv new file mode 100644 index 0000000000..d33acc614d --- /dev/null +++ b/vlib/v/checker/tests/short_struct_too_many.vv @@ -0,0 +1,8 @@ +struct Test { + foo bool +} + +fn main() { + t := Test{true, false} + _ = t +} diff --git a/vlib/v/checker/tests/struct_name.out b/vlib/v/checker/tests/struct_name.out new file mode 100644 index 0000000000..b040c64915 --- /dev/null +++ b/vlib/v/checker/tests/struct_name.out @@ -0,0 +1,5 @@ +vlib/v/checker/tests/struct_name.v:1:8: error: struct name must begin with capital letter + 1| struct abc { + ~~~ + 2| + 3| } \ No newline at end of file diff --git a/vlib/v/checker/tests/inout/struct_name.vv b/vlib/v/checker/tests/struct_name.v similarity index 100% rename from vlib/v/checker/tests/inout/struct_name.vv rename to vlib/v/checker/tests/struct_name.v diff --git a/vlib/v/checker/tests/struct_name.vv b/vlib/v/checker/tests/struct_name.vv new file mode 100644 index 0000000000..4cd9b723b8 --- /dev/null +++ b/vlib/v/checker/tests/struct_name.vv @@ -0,0 +1,5 @@ +struct abc { + +} + +fn main(){} diff --git a/vlib/v/checker/tests/inout/struct_unknown_field.out b/vlib/v/checker/tests/struct_unknown_field.out similarity index 53% rename from vlib/v/checker/tests/inout/struct_unknown_field.out rename to vlib/v/checker/tests/struct_unknown_field.out index 9e01e772a3..5e532520c2 100644 --- a/vlib/v/checker/tests/inout/struct_unknown_field.out +++ b/vlib/v/checker/tests/struct_unknown_field.out @@ -1,4 +1,4 @@ -vlib/v/checker/tests/inout/struct_unknown_field.v:8:9: error: unknown field `bar` in struct literal of type `Test` +vlib/v/checker/tests/struct_unknown_field.v:8:9: error: unknown field `bar` in struct literal of type `Test` 6| t := Test{ 7| foo: true 8| bar: false diff --git a/vlib/v/checker/tests/inout/struct_unknown_field.vv b/vlib/v/checker/tests/struct_unknown_field.v similarity index 100% rename from vlib/v/checker/tests/inout/struct_unknown_field.vv rename to vlib/v/checker/tests/struct_unknown_field.v diff --git a/vlib/v/checker/tests/struct_unknown_field.vv b/vlib/v/checker/tests/struct_unknown_field.vv new file mode 100644 index 0000000000..e4ec496630 --- /dev/null +++ b/vlib/v/checker/tests/struct_unknown_field.vv @@ -0,0 +1,11 @@ +struct Test { + foo bool +} + +fn main() { + t := Test{ + foo: true + bar: false + } + _ = t +} diff --git a/vlib/v/checker/tests/inout/sum_type_exists.out b/vlib/v/checker/tests/sum_type_exists.out similarity index 55% rename from vlib/v/checker/tests/inout/sum_type_exists.out rename to vlib/v/checker/tests/sum_type_exists.out index f726c17b04..9d9487ca9a 100644 --- a/vlib/v/checker/tests/inout/sum_type_exists.out +++ b/vlib/v/checker/tests/sum_type_exists.out @@ -1,4 +1,4 @@ -vlib/v/checker/tests/inout/sum_type_exists.v:1:1: error: type `Nope` doesn't exist +vlib/v/checker/tests/sum_type_exists.v:1:1: error: type `Nope` doesn't exist 1| type Miscellaneous = Nope | Inexistant | int ~~~~~~~~~~~~~~~~~~ 2| diff --git a/vlib/v/checker/tests/inout/sum_type_exists.vv b/vlib/v/checker/tests/sum_type_exists.v similarity index 100% rename from vlib/v/checker/tests/inout/sum_type_exists.vv rename to vlib/v/checker/tests/sum_type_exists.v diff --git a/vlib/v/checker/tests/sum_type_exists.vv b/vlib/v/checker/tests/sum_type_exists.vv new file mode 100644 index 0000000000..f55fa0ae41 --- /dev/null +++ b/vlib/v/checker/tests/sum_type_exists.vv @@ -0,0 +1,5 @@ +type Miscellaneous = Nope | Inexistant | int + +fn main() { + +} diff --git a/vlib/v/checker/tests/inout/unknown_field.out b/vlib/v/checker/tests/unknown_field.out similarity index 55% rename from vlib/v/checker/tests/inout/unknown_field.out rename to vlib/v/checker/tests/unknown_field.out index 3b5100ea55..15caf1ec51 100644 --- a/vlib/v/checker/tests/inout/unknown_field.out +++ b/vlib/v/checker/tests/unknown_field.out @@ -1,4 +1,4 @@ -vlib/v/checker/tests/inout/unknown_field.v:7:12: error: unknown field `Test.sdd` +vlib/v/checker/tests/unknown_field.v:7:12: error: unknown field `Test.sdd` 5| fn main() { 6| t := Test{} 7| println(t.sdd) diff --git a/vlib/v/checker/tests/inout/unknown_field.vv b/vlib/v/checker/tests/unknown_field.v similarity index 100% rename from vlib/v/checker/tests/inout/unknown_field.vv rename to vlib/v/checker/tests/unknown_field.v diff --git a/vlib/v/checker/tests/unknown_field.vv b/vlib/v/checker/tests/unknown_field.vv new file mode 100644 index 0000000000..8cf14a98fa --- /dev/null +++ b/vlib/v/checker/tests/unknown_field.vv @@ -0,0 +1,8 @@ +module main + +struct Test {} + +fn main() { + t := Test{} + println(t.sdd) +} diff --git a/vlib/v/checker/tests/inout/unknown_method.out b/vlib/v/checker/tests/unknown_method.out similarity index 55% rename from vlib/v/checker/tests/inout/unknown_method.out rename to vlib/v/checker/tests/unknown_method.out index fc09c377fc..87d0ca2214 100644 --- a/vlib/v/checker/tests/inout/unknown_method.out +++ b/vlib/v/checker/tests/unknown_method.out @@ -1,4 +1,4 @@ -vlib/v/checker/tests/inout/unknown_method.v:7:12: error: unknown method: `Test.sdd` +vlib/v/checker/tests/unknown_method.v:7:12: error: unknown method: `Test.sdd` 5| fn main() { 6| t := Test{} 7| println(t.sdd()) diff --git a/vlib/v/checker/tests/inout/unknown_method.vv b/vlib/v/checker/tests/unknown_method.v similarity index 100% rename from vlib/v/checker/tests/inout/unknown_method.vv rename to vlib/v/checker/tests/unknown_method.v diff --git a/vlib/v/checker/tests/unknown_method.vv b/vlib/v/checker/tests/unknown_method.vv new file mode 100644 index 0000000000..879b372923 --- /dev/null +++ b/vlib/v/checker/tests/unknown_method.vv @@ -0,0 +1,8 @@ +module main + +struct Test {} + +fn main() { + t := Test{} + println(t.sdd()) +} diff --git a/vlib/v/checker/tests/inout/unnecessary_parenthesis.out b/vlib/v/checker/tests/unnecessary_parenthesis.out similarity index 54% rename from vlib/v/checker/tests/inout/unnecessary_parenthesis.out rename to vlib/v/checker/tests/unnecessary_parenthesis.out index 49510a8d11..3f64e0ae3b 100644 --- a/vlib/v/checker/tests/inout/unnecessary_parenthesis.out +++ b/vlib/v/checker/tests/unnecessary_parenthesis.out @@ -1,17 +1,17 @@ -vlib/v/checker/tests/inout/unnecessary_parenthesis.v:2:2: error: unnecessary `()` in an if condition. use `if expr {` instead of `if (expr) {`. +vlib/v/checker/tests/unnecessary_parenthesis.v:2:2: error: unnecessary `()` in an if condition. use `if expr {` instead of `if (expr) {`. 1| fn main() { 2| if (1 == 1) { ~~~~~~~~~~~ 3| println('yeay') 4| } else if (1 == 2) { -vlib/v/checker/tests/inout/unnecessary_parenthesis.v:4:4: error: unnecessary `()` in an if condition. use `if expr {` instead of `if (expr) {`. +vlib/v/checker/tests/unnecessary_parenthesis.v:4:4: error: unnecessary `()` in an if condition. use `if expr {` instead of `if (expr) {`. 2| if (1 == 1) { 3| println('yeay') 4| } else if (1 == 2) { ~~~~~~~~~~~~~~~~ 5| println("oh no :'(") 6| } else if (1 == 3) { -vlib/v/checker/tests/inout/unnecessary_parenthesis.v:6:4: error: unnecessary `()` in an if condition. use `if expr {` instead of `if (expr) {`. +vlib/v/checker/tests/unnecessary_parenthesis.v:6:4: error: unnecessary `()` in an if condition. use `if expr {` instead of `if (expr) {`. 4| } else if (1 == 2) { 5| println("oh no :'(") 6| } else if (1 == 3) { diff --git a/vlib/v/checker/tests/inout/unnecessary_parenthesis.vv b/vlib/v/checker/tests/unnecessary_parenthesis.v similarity index 100% rename from vlib/v/checker/tests/inout/unnecessary_parenthesis.vv rename to vlib/v/checker/tests/unnecessary_parenthesis.v diff --git a/vlib/v/checker/tests/unnecessary_parenthesis.vv b/vlib/v/checker/tests/unnecessary_parenthesis.vv new file mode 100644 index 0000000000..c1eb1ae2b6 --- /dev/null +++ b/vlib/v/checker/tests/unnecessary_parenthesis.vv @@ -0,0 +1,9 @@ +fn main() { + if (1 == 1) { + println('yeay') + } else if (1 == 2) { + println("oh no :'(") + } else if (1 == 3) { + println("what's wrong with physics ????") + } +} diff --git a/vlib/v/checker/tests/inout/void_fn_as_value.out b/vlib/v/checker/tests/void_fn_as_value.out similarity index 63% rename from vlib/v/checker/tests/inout/void_fn_as_value.out rename to vlib/v/checker/tests/void_fn_as_value.out index 94eb71e5d0..163b1f8b2b 100644 --- a/vlib/v/checker/tests/inout/void_fn_as_value.out +++ b/vlib/v/checker/tests/void_fn_as_value.out @@ -1,4 +1,4 @@ -vlib/v/checker/tests/inout/void_fn_as_value.v:5:8: error: unknown function: x +vlib/v/checker/tests/void_fn_as_value.v:5:8: error: unknown function: x 3| fn main() { 4| mut a := 'aa' 5| a += x('a','b') diff --git a/vlib/v/checker/tests/inout/void_fn_as_value.vv b/vlib/v/checker/tests/void_fn_as_value.v similarity index 100% rename from vlib/v/checker/tests/inout/void_fn_as_value.vv rename to vlib/v/checker/tests/void_fn_as_value.v diff --git a/vlib/v/checker/tests/void_fn_as_value.vv b/vlib/v/checker/tests/void_fn_as_value.vv new file mode 100644 index 0000000000..4d6f97dc39 --- /dev/null +++ b/vlib/v/checker/tests/void_fn_as_value.vv @@ -0,0 +1,8 @@ +module main + +fn main() { + mut a := 'aa' + a += x('a','b') + mut b := 'abcdef' + _ = b +} diff --git a/vlib/v/checker/tests/inout/void_function_assign_to_string.out b/vlib/v/checker/tests/void_function_assign_to_string.out similarity index 50% rename from vlib/v/checker/tests/inout/void_function_assign_to_string.out rename to vlib/v/checker/tests/void_function_assign_to_string.out index a30318c21a..127f3521f7 100644 --- a/vlib/v/checker/tests/inout/void_function_assign_to_string.out +++ b/vlib/v/checker/tests/void_function_assign_to_string.out @@ -1,4 +1,4 @@ -vlib/v/checker/tests/inout/void_function_assign_to_string.v:6:6: error: cannot assign `void` to variable `a` of type `string` +vlib/v/checker/tests/void_function_assign_to_string.v:6:6: error: cannot assign `void` to variable `a` of type `string` 4| fn main(){ 5| mut a := '' 6| a = x(1,2) // hello diff --git a/vlib/v/checker/tests/inout/void_function_assign_to_string.vv b/vlib/v/checker/tests/void_function_assign_to_string.v similarity index 100% rename from vlib/v/checker/tests/inout/void_function_assign_to_string.vv rename to vlib/v/checker/tests/void_function_assign_to_string.v diff --git a/vlib/v/checker/tests/void_function_assign_to_string.vv b/vlib/v/checker/tests/void_function_assign_to_string.vv new file mode 100644 index 0000000000..839d84d00c --- /dev/null +++ b/vlib/v/checker/tests/void_function_assign_to_string.vv @@ -0,0 +1,8 @@ +fn x(x,y int) { + +} +fn main(){ + mut a := '' + a = x(1,2) // hello + eprintln('a: $a') +}