Odin icon indicating copy to clipboard operation
Odin copied to clipboard

Parapoly with `typeid` does not recognize default values

Open ftphikari opened this issue 2 years ago • 0 comments

Context

    Odin: dev-2023-06:
    OS:   Windows 11 Professional (version: 22H2), build 22621.1702
    CPU:  Intel(R) Core(TM) i5-2400 CPU @ 3.10GHz
    RAM:  9938 MiB

Example

package main

Type :: struct($T: typeid = typeid_of(int)) {
	a: [2]T,
}

t: Type()
t2: Type(uint)

main :: proc() {}

Compiler output

random.odin(7:4) Too few polymorphic type arguments, expected 1, got 0
	t: Type()
	   ^~~~~^

Expected

The program either works, or default values are not possible for typeid type.

ftphikari avatar Jun 17 '23 16:06 ftphikari