-
-
Notifications
You must be signed in to change notification settings - Fork 906
Open
Description
Context
Odin: dev-2026-02
OS: NixOS 25.11 (Xantusia), Linux 6.12.60
CPU: AMD Ryzen 7 8840HS w/ Radeon 780M Graphics
RAM: 15232 MiB
Backend: LLVM 18.1.8
Expected Behavior
The following code should compile:
package test
foo :: proc($T: typeid, v: T = {}) {}
bar :: proc() {foo(string)}Current Behavior
The code fails to compile:
Error: Cannot assign value '{}' of type 'typeid' to 'string' in a procedure argument
foo :: proc($T: typeid, v: T = {}) {}
The following snippet fails with a similar error:
package test
foo :: proc($T: typeid, v: T) {}
bar :: proc() {foo(string, {})}
Annotating {} does make this last snippet pass:
package test
foo :: proc($T: typeid, v: T) {}
bar :: proc() {foo(string, string{})}
This does not work in the previous scenario:
package test
foo :: proc($T: typeid, v: T = T{}) {}
bar :: proc() {foo(string)}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels