diff options
| author | Daniel Gavin <danielgavin5@hotmail.com> | 2022-01-09 02:45:42 +0100 |
|---|---|---|
| committer | Daniel Gavin <danielgavin5@hotmail.com> | 2022-01-09 02:45:42 +0100 |
| commit | 2e6c803dedce3c85c55a36a1bd8fb04edc65f65c (patch) | |
| tree | b01a93f074babb711a7b537ddb11d032787c57c8 /tests | |
| parent | 661f1afc57eca524a6d25ea533d43206e21be68d (diff) | |
Fix function overloading with function returns.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/completions_test.odin | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/tests/completions_test.odin b/tests/completions_test.odin index 472ace0..60b41c9 100644 --- a/tests/completions_test.odin +++ b/tests/completions_test.odin @@ -1195,7 +1195,6 @@ ast_maybe_index_completion :: proc(t: ^testing.T) { @(test) ast_distinct_u32_completion :: proc(t: ^testing.T) { - source := test.Source { main = `package main import "my_package" @@ -1211,6 +1210,33 @@ ast_distinct_u32_completion :: proc(t: ^testing.T) { test.expect_completion_details(t, &source, "", {"test.d: Distinct_Type"}); } +@(test) +ast_overload_with_procedure_return :: proc(t: ^testing.T) { + source := test.Source { + main = `package main + import "my_package" + + + my_group :: proc { + make_slice, + make_map, + } + + make_slice :: proc($T: typeid/[]$E, auto_cast len: int) -> (T, Allocator_Error) #optional_second {} + make_map :: proc(a: int) -> int {} + + + test_int :: proc() -> int {} + main :: proc() { + my_in := my_group([]int, test_int()) + my_in* + } + `, + }; + + test.expect_completion_details(t, &source, "", {"test.my_in: []int"}); +} + /* Looks like a bug in for each on w.* |