Skip to content
New issue

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

[CPP Panic] Invalid Type Conversion #4866

Open
dozn opened this issue Feb 23, 2025 · 0 comments
Open

[CPP Panic] Invalid Type Conversion #4866

dozn opened this issue Feb 23, 2025 · 0 comments

Comments

@dozn
Copy link
Contributor

dozn commented Feb 23, 2025

Context

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(""))
}

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


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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant