mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-05 23:28:48 +00:00
Fix #2666 by checking for disabled when generating parapoly procs
This commit is contained in:
@@ -349,6 +349,10 @@ gb_internal bool find_or_generate_polymorphic_procedure(CheckerContext *old_c, E
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (base_entity->flags & EntityFlag_Disabled) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
String name = base_entity->token.string;
|
String name = base_entity->token.string;
|
||||||
|
|
||||||
Type *src = base_type(base_entity->type);
|
Type *src = base_type(base_entity->type);
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ set COMMON=-collection:tests=..\..
|
|||||||
..\..\..\odin test ..\test_issue_2466.odin %COMMON% -file || exit /b
|
..\..\..\odin test ..\test_issue_2466.odin %COMMON% -file || exit /b
|
||||||
..\..\..\odin test ..\test_issue_2615.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_2637.odin %COMMON% -file || exit /b
|
||||||
|
..\..\..\odin test ..\test_issue_2666.odin %COMMON% -file || exit /b
|
||||||
|
|
||||||
@echo off
|
@echo off
|
||||||
|
|
||||||
|
|||||||
@@ -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_2466.odin $COMMON -file
|
||||||
$ODIN test ../test_issue_2615.odin $COMMON -file
|
$ODIN test ../test_issue_2615.odin $COMMON -file
|
||||||
$ODIN test ../test_issue_2637.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
|
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"
|
echo "SUCCESSFUL 1/1"
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -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")
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user