Browse Source

fix regression in test_issue_2395

Laytan Laats 1 year ago
parent
commit
29250f2657
3 changed files with 3 additions and 6 deletions
  1. 1 1
      src/check_type.cpp
  2. 2 3
      tests/issues/run.sh
  3. 0 2
      tests/issues/test_issue_2395.odin

+ 1 - 1
src/check_type.cpp

@@ -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;
 	}

+ 2 - 3
tests/issues/run.sh

@@ -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

+ 0 - 2
tests/issues/test_issue_2395.odin

@@ -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,