aboutsummaryrefslogtreecommitdiff
path: root/tests/issues/test_issue_2666.odin
blob: dd77129eaef9cd67009f53a146501fc449fb36c8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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")
}