mirror of
https://github.com/odin-lang/Odin.git
synced 2026-05-02 19:14:42 +00:00
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
23
tests/issues/test_issue_5043.odin
Normal file
23
tests/issues/test_issue_5043.odin
Normal file
@@ -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:
|
||||
|
||||
}
|
||||
}
|
||||
15
tests/issues/test_issue_5097.odin
Normal file
15
tests/issues/test_issue_5097.odin
Normal file
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user