aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDaniel Gavin <danielgavin5@hotmail.com>2021-11-10 18:48:25 +0100
committerDaniel Gavin <danielgavin5@hotmail.com>2021-11-10 18:48:25 +0100
commit077cddfffeb8576d98bd79e6f2dbaab0fdfc7d82 (patch)
tree2fe40d415a2168235aa8da5aca287ac6a83a79cb /tests
parentdf9b402a31f0e65ca232f9d08ad86d1f62862913 (diff)
Add Any_Int attribute support - make function now infers correctly again.
Diffstat (limited to 'tests')
-rw-r--r--tests/completions_test.odin56
1 files changed, 56 insertions, 0 deletions
diff --git a/tests/completions_test.odin b/tests/completions_test.odin
index 4d6e3cf..ba43268 100644
--- a/tests/completions_test.odin
+++ b/tests/completions_test.odin
@@ -618,6 +618,62 @@ ast_struct_for_in_switch_stmt_completion :: proc(t: ^testing.T) {
test.expect_completion_details(t, &source, ".", {"Window.height: int"});
}
+@(test)
+ast_overload_with_autocast_completion :: proc(t: ^testing.T) {
+
+ source := test.Source {
+ main = `package test
+
+ my_group :: proc{
+ with_autocast,
+ with_bool,
+ };
+ with_autocast :: proc(auto_cast a: int) -> bool {
+ }
+ with_bool :: proc(a: bool) -> int {
+ }
+
+ main :: proc() {
+ my_uint: uint = 0;
+ my_value := my_group(my_uint);
+ my_val*
+ }
+ `,
+ packages = {},
+ };
+
+ test.expect_completion_details(t, &source, "", {"test.my_value: bool"});
+}
+
+
+@(test)
+ast_overload_with_any_int_completion :: proc(t: ^testing.T) {
+
+ source := test.Source {
+ main = `package test
+
+ my_group :: proc{
+ with_any_int,
+ with_bool,
+ };
+ with_any_int :: proc(#any_int a: int) -> bool {
+ }
+ with_bool :: proc(a: bool) -> int {
+ }
+
+ main :: proc() {
+ my_uint: uint = 0;
+ my_value := my_group(my_uint);
+ my_val*
+ }
+ `,
+ packages = {},
+ };
+
+ test.expect_completion_details(t, &source, "", {"test.my_value: bool"});
+}
+
+
/*
Looks like a bug in for each on w.*