mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-05 23:28:48 +00:00
fix regression in test_issue_2395
This commit is contained in:
+1
-1
@@ -776,7 +776,7 @@ gb_internal void check_union_type(CheckerContext *ctx, Type *union_type, Ast *no
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (variants.count < 2) {
|
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;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-3
@@ -6,8 +6,6 @@ pushd build
|
|||||||
ODIN=../../../odin
|
ODIN=../../../odin
|
||||||
COMMON="-define:ODIN_TEST_FANCY=false -file -vet -strict-style"
|
COMMON="-define:ODIN_TEST_FANCY=false -file -vet -strict-style"
|
||||||
|
|
||||||
NO_NIL_ERR="Error: "
|
|
||||||
|
|
||||||
set -x
|
set -x
|
||||||
|
|
||||||
$ODIN test ../test_issue_829.odin $COMMON
|
$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_2615.odin $COMMON
|
||||||
$ODIN test ../test_issue_2637.odin $COMMON
|
$ODIN test ../test_issue_2637.odin $COMMON
|
||||||
$ODIN test ../test_issue_2666.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"
|
echo "SUCCESSFUL 1/1"
|
||||||
else
|
else
|
||||||
echo "SUCCESSFUL 0/1"
|
echo "SUCCESSFUL 0/1"
|
||||||
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
set +x
|
set +x
|
||||||
|
|||||||
@@ -5,8 +5,6 @@
|
|||||||
// exactly 2 errors from the invalid unions
|
// exactly 2 errors from the invalid unions
|
||||||
package test_issues
|
package test_issues
|
||||||
|
|
||||||
import "core:testing"
|
|
||||||
|
|
||||||
ValidUnion :: union($T: typeid) #no_nil {
|
ValidUnion :: union($T: typeid) #no_nil {
|
||||||
T,
|
T,
|
||||||
f32,
|
f32,
|
||||||
|
|||||||
Reference in New Issue
Block a user