aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaytan <laytanlaats@hotmail.com>2025-04-30 20:20:43 +0200
committerGitHub <noreply@github.com>2025-04-30 20:20:43 +0200
commitdd0b8d5757750c394c1bbdecf99e8f220800dc90 (patch)
treecbc71afc733c3698c1b11c9e32c84029ed4fc0ce
parentc74f777b1ba94bf5e3cec20dd41f4ca753d4aba1 (diff)
parentd2f8cb1306360b85f49c6ed24242b2096ab6d02d (diff)
Merge pull request #5099 from laytan/add-alias-issue-tests-to-ci
adds the cases of #5043 and #5097 to the CI
-rw-r--r--tests/issues/run.bat2
-rwxr-xr-xtests/issues/run.sh2
-rw-r--r--tests/issues/test_issue_5043.odin23
-rw-r--r--tests/issues/test_issue_5097.odin15
4 files changed, 42 insertions, 0 deletions
diff --git a/tests/issues/run.bat b/tests/issues/run.bat
index 7ed43205d..267a2e030 100644
--- a/tests/issues/run.bat
+++ b/tests/issues/run.bat
@@ -17,6 +17,8 @@ set COMMON=-define:ODIN_TEST_FANCY=false -file -vet -strict-style
..\..\..\odin test ..\test_issue_2666.odin %COMMON% || exit /b
..\..\..\odin test ..\test_issue_4210.odin %COMMON% || exit /b
..\..\..\odin test ..\test_issue_4584.odin %COMMON% || exit /b
+..\..\..\odin build ..\test_issue_5043.odin %COMMON% || exit /b
+..\..\..\odin build ..\test_issue_5097.odin %COMMON% || exit /b
@echo off
diff --git a/tests/issues/run.sh b/tests/issues/run.sh
index 54543980e..5102ee307 100755
--- a/tests/issues/run.sh
+++ b/tests/issues/run.sh
@@ -24,6 +24,8 @@ else
echo "SUCCESSFUL 0/1"
exit 1
fi
+$ODIN build ../test_issue_5043.odin $COMMON
+$ODIN build ../test_issue_5097.odin $COMMON
set +x
diff --git a/tests/issues/test_issue_5043.odin b/tests/issues/test_issue_5043.odin
new file mode 100644
index 000000000..ce36bf674
--- /dev/null
+++ b/tests/issues/test_issue_5043.odin
@@ -0,0 +1,23 @@
+// Tests issue #5043 https://github.com/odin-lang/Odin/issues/5043
+package test_issues
+
+Table :: map [string] Type
+List :: [dynamic] Type
+
+Type :: union {
+ ^Table,
+ ^List,
+ i64,
+}
+
+
+main :: proc() {
+ v: Type = 5
+
+ switch t in v {
+ case ^Table: // or case ^map [string] Type:
+ case ^List:
+ case i64:
+
+ }
+}
diff --git a/tests/issues/test_issue_5097.odin b/tests/issues/test_issue_5097.odin
new file mode 100644
index 000000000..57ef60b8d
--- /dev/null
+++ b/tests/issues/test_issue_5097.odin
@@ -0,0 +1,15 @@
+// Tests issue #5097 https://github.com/odin-lang/Odin/issues/5097
+package test_issues
+
+Node_Ptr :: ^Node // the typedef...
+
+Node :: struct {
+ prev, next: Node_Ptr, // replacing the type with ^Node also fixes it
+}
+
+// ...if placed here, it works just fine
+
+main :: proc() {
+ node: Node_Ptr
+ _ = node
+}