We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
package main import "core:fmt" main :: proc() { return_union() } Union :: union { Distinct_String } Distinct_String :: distinct string return_union :: proc() -> Union { return Distinct_String(fmt.ctprint("")) }
No error
Odin\src\llvm_backend_expr.cpp(2494): Panic: Invalid type conversion: 'string' to 'Union' for procedure 'main::return_union'
Distinct_String
distinct
distinct cstring
distinct string
cstring()
fmt.tprint/f/ln()
fmt.ctprint/f/ln()
Odin: dev-2025-02:ebda946d6 OS: Windows 11 Professional (version: 23H2), build 22631.4890 CPU: AMD Ryzen 7 7700 8-Core Processor RAM: 64617 MiB Backend: LLVM 18.1.8
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Context
Expected Behavior
No error
Current Behavior
Odin\src\llvm_backend_expr.cpp(2494): Panic: Invalid type conversion: 'string' to 'Union' for procedure 'main::return_union'
Notes
Distinct_String
must bedistinct
distinct cstring
instead ofdistinct string
workscstring()
orfmt.tprint/f/ln()
instead offmt.ctprint/f/ln()
Odin: dev-2025-02:ebda946d6
OS: Windows 11 Professional (version: 23H2), build 22631.4890
CPU: AMD Ryzen 7 7700 8-Core Processor
RAM: 64617 MiB
Backend: LLVM 18.1.8
The text was updated successfully, but these errors were encountered: