fix regression in test_issue_2395

This commit is contained in:
Laytan Laats
2024-06-07 16:33:38 +02:00
parent 9122c20d4b
commit 29250f2657
3 changed files with 3 additions and 6 deletions

View File

@@ -776,7 +776,7 @@ gb_internal void check_union_type(CheckerContext *ctx, Type *union_type, Ast *no
}
}
if (variants.count < 2) {
error(ut->align, "A union with #no_nil must have at least 2 variants");
error(node, "A union with #no_nil must have at least 2 variants");
}
break;
}

View File

@@ -6,8 +6,6 @@ pushd build
ODIN=../../../odin
COMMON="-define:ODIN_TEST_FANCY=false -file -vet -strict-style"
NO_NIL_ERR="Error: "
set -x
$ODIN test ../test_issue_829.odin $COMMON
@@ -18,10 +16,11 @@ $ODIN test ../test_issue_2466.odin $COMMON
$ODIN test ../test_issue_2615.odin $COMMON
$ODIN test ../test_issue_2637.odin $COMMON
$ODIN test ../test_issue_2666.odin $COMMON
if [[ $($ODIN build ../test_issue_2395.odin $COMMON 2>&1 >/dev/null | grep -c "$NO_NIL_ERR") -eq 2 ]] ; then
if [[ $($ODIN build ../test_issue_2395.odin $COMMON 2>&1 >/dev/null | grep -c "must have at least 2 variants") -eq 2 ]] ; then
echo "SUCCESSFUL 1/1"
else
echo "SUCCESSFUL 0/1"
exit 1
fi
set +x

View File

@@ -5,8 +5,6 @@
// exactly 2 errors from the invalid unions
package test_issues
import "core:testing"
ValidUnion :: union($T: typeid) #no_nil {
T,
f32,