diff --git a/src/check_expr.cpp b/src/check_expr.cpp index 98154f33d59..91422addd8b 100644 --- a/src/check_expr.cpp +++ b/src/check_expr.cpp @@ -349,6 +349,10 @@ gb_internal bool find_or_generate_polymorphic_procedure(CheckerContext *old_c, E return false; } + if (base_entity->flags & EntityFlag_Disabled) { + return false; + } + String name = base_entity->token.string; Type *src = base_type(base_entity->type); diff --git a/tests/issues/run.bat b/tests/issues/run.bat index 63d722e093b..41c52c02f2e 100644 --- a/tests/issues/run.bat +++ b/tests/issues/run.bat @@ -15,6 +15,7 @@ set COMMON=-collection:tests=..\.. ..\..\..\odin test ..\test_issue_2466.odin %COMMON% -file || exit /b ..\..\..\odin test ..\test_issue_2615.odin %COMMON% -file || exit /b ..\..\..\odin test ..\test_issue_2637.odin %COMMON% -file || exit /b +..\..\..\odin test ..\test_issue_2666.odin %COMMON% -file || exit /b @echo off diff --git a/tests/issues/run.sh b/tests/issues/run.sh index 7d2101dc62d..6d53388a7d0 100755 --- a/tests/issues/run.sh +++ b/tests/issues/run.sh @@ -18,6 +18,7 @@ $ODIN build ../test_issue_2113.odin $COMMON -file -debug $ODIN test ../test_issue_2466.odin $COMMON -file $ODIN test ../test_issue_2615.odin $COMMON -file $ODIN test ../test_issue_2637.odin $COMMON -file +$ODIN test ../test_issue_2666.odin $COMMON -file if [[ $($ODIN build ../test_issue_2395.odin $COMMON -file 2>&1 >/dev/null | grep -c "$NO_NIL_ERR") -eq 2 ]] ; then echo "SUCCESSFUL 1/1" else diff --git a/tests/issues/test_issue_2666.odin b/tests/issues/test_issue_2666.odin new file mode 100644 index 00000000000..dd77129eaef --- /dev/null +++ b/tests/issues/test_issue_2666.odin @@ -0,0 +1,26 @@ +// Tests issue https://github.com/odin-lang/Odin/issues/2666 +// @(disabled=) 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") +}