aboutsummaryrefslogtreecommitdiff
path: root/tests/issues/test_issue_2666.odin
diff options
context:
space:
mode:
authorgingerBill <gingerBill@users.noreply.github.com>2023-08-01 14:45:36 +0100
committerGitHub <noreply@github.com>2023-08-01 14:45:36 +0100
commit9453b2387b2cc7c473547997703c305e7982f5e4 (patch)
tree058e492f8b6e40b6d4db3ab0a719472aa06803c6 /tests/issues/test_issue_2666.odin
parenta4de59c8eebfcde06409e258ec18383f1a6e0da1 (diff)
parent74338733ba0f672124c413a6af103f2fa48049c2 (diff)
Merge pull request #2669 from laytan/check-disabled-when-generating-parapolydev-2023-08
Fix #2666 by checking for disabled when generating parapoly procs
Diffstat (limited to 'tests/issues/test_issue_2666.odin')
-rw-r--r--tests/issues/test_issue_2666.odin26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/issues/test_issue_2666.odin b/tests/issues/test_issue_2666.odin
new file mode 100644
index 000000000..dd77129ea
--- /dev/null
+++ b/tests/issues/test_issue_2666.odin
@@ -0,0 +1,26 @@
+// Tests issue https://github.com/odin-lang/Odin/issues/2666
+// @(disabled=<boolean>) does not work with polymorphic procs
+package test_issues
+
+import "core:testing"
+
+@(test)
+test_disabled_parapoly :: proc(t: ^testing.T) {
+ disabled_parapoly(t, 1)
+ disabled_parapoly_constant(t, 1)
+}
+
+@(private="file")
+@(disabled = true)
+disabled_parapoly :: proc(t: ^testing.T, num: $T) {
+ testing.error(t, "disabled_parapoly should be disabled")
+}
+
+@(private="file")
+DISABLE :: true
+
+@(disabled = DISABLE)
+@(private = "file")
+disabled_parapoly_constant :: proc(t: ^testing.T, num: $T) {
+ testing.error(t, "disabled_parapoly_constant should be disabled")
+}