mirror of
https://github.com/odin-lang/Odin.git
synced 2026-06-05 02:04:06 +00:00
fix regression in test_issue_2395
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user