Skip to content

Segfault When Passing Type to struct Which Doesn't Have Type Parameter (Inner Field Does, Though) #4811

Open
@dozn

Description

@dozn

Context

package main
import "core:fmt"

S1 :: struct($T: typeid) { _: S2(T) }
S2 :: struct { _: proc($T: typeid) }

main :: proc() {
	s := S1(int){}
	fmt.println("SIGSEGV before we get here.")
}

Expected Behavior

Compiler error, as S2 does not accept a type, yet we're still able to pass one in.

Current Behavior

Segfault.


Odin: dev-2025-02:0683a3d67
OS: Windows 11 Professional (version: 23H2), build 22631.4751
CPU: AMD Ryzen 7 3700X 8-Core Processor
RAM: 65457 MiB
Backend: LLVM 18.1.8

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions