From d86cb67eda0cfd7eb912e2a64ca0d3e4e89ac015 Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Thu, 28 Jan 2021 11:13:51 +0100 Subject: [PATCH] checker: add a test for the single letter receiver --- cmd/tools/vtest-self.v | 2 +- vlib/v/checker/tests/receiver_unknown_type_single_letter.out | 3 +++ vlib/v/checker/tests/receiver_unknown_type_single_letter.vv | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 vlib/v/checker/tests/receiver_unknown_type_single_letter.out create mode 100644 vlib/v/checker/tests/receiver_unknown_type_single_letter.vv diff --git a/cmd/tools/vtest-self.v b/cmd/tools/vtest-self.v index 1fd8ccaec4..c7b06f0071 100644 --- a/cmd/tools/vtest-self.v +++ b/cmd/tools/vtest-self.v @@ -95,7 +95,7 @@ fn main() { args := os.args.clone() args_string := args[1..].join(' ') cmd_prefix := args_string.all_before('test-self') - title := 'testing all fixed tests' + title := 'testing all tests' all_test_files := os.walk_ext(os.join_path(vroot, 'vlib'), '_test.v') testing.eheader(title) mut tsession := testing.new_test_session(cmd_prefix) diff --git a/vlib/v/checker/tests/receiver_unknown_type_single_letter.out b/vlib/v/checker/tests/receiver_unknown_type_single_letter.out new file mode 100644 index 0000000000..bd78937087 --- /dev/null +++ b/vlib/v/checker/tests/receiver_unknown_type_single_letter.out @@ -0,0 +1,3 @@ +vlib/v/checker/tests/receiver_unknown_type_single_letter.vv:1:5: error: unknown type `A` + 1 | fn (p A) foo() {} + | ~~~ diff --git a/vlib/v/checker/tests/receiver_unknown_type_single_letter.vv b/vlib/v/checker/tests/receiver_unknown_type_single_letter.vv new file mode 100644 index 0000000000..4c00043e35 --- /dev/null +++ b/vlib/v/checker/tests/receiver_unknown_type_single_letter.vv @@ -0,0 +1,2 @@ +fn (p A) foo() {} +