aboutsummaryrefslogtreecommitdiff
path: root/tests/inlay_hints_test.odin
diff options
context:
space:
mode:
authorBradley Lewis <22850972+BradLewis@users.noreply.github.com>2025-09-27 13:54:34 -0400
committerGitHub <noreply@github.com>2025-09-27 13:54:34 -0400
commit4a2a71e12d61be1cd8ca486d96de8dd47dd49df2 (patch)
tree68d0da9ad2a1b5e167497ac8264d7e8c0294ea5d /tests/inlay_hints_test.odin
parentd9e6c6aa6988e880448c1418c4a904c66f157fc3 (diff)
parent2d585d7ec2c1e47b1f48f6be7ae2e7da37aeafcc (diff)
Merge pull request #1060 from thetarnav/inlay_hints_implicit_return_values
Add inlay hints for implicit return values (closes #1058)
Diffstat (limited to 'tests/inlay_hints_test.odin')
-rw-r--r--tests/inlay_hints_test.odin23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/inlay_hints_test.odin b/tests/inlay_hints_test.odin
index c5600cc..c1c078b 100644
--- a/tests/inlay_hints_test.odin
+++ b/tests/inlay_hints_test.odin
@@ -205,3 +205,26 @@ ast_inlay_hints_disabled :: proc(t: ^testing.T) {
test.expect_inlay_hints(t, &source)
}
+
+@(test)
+ast_inlay_hints_implicit_return_values :: proc(t: ^testing.T) {
+ source := test.Source {
+ main = `package test
+
+ foo :: proc () -> (res: int, ok: bool) {
+
+ if !condition() do return[[ res, ok]]
+
+ condition() or_return[[ res, _]]
+
+ return value, true
+ }
+ `,
+ packages = {},
+ config = {
+ enable_inlay_hints_implicit_return = true,
+ },
+ }
+
+ test.expect_inlay_hints(t, &source)
+} \ No newline at end of file