这是indexloc提供的服务,不要输入任何密码
Skip to content

Calling a proc on field of poly'd type crashes if that proc is overloaded on that type #146

@Tetralux

Description

@Tetralux
S :: struct(T: type)
{
	data:  T,
	// data2: []T,
	// data3: [dynamic]T,
	// data4: int,

	// Any of these fields crash it.

	// data:  T,
	// (Incidentally, it also crashes, after showing the redeclaration error message
	//  if you use the same name for more than one field.)
}

func :: proc(s: S($T))
{
}
// Change to `s: ^S($T)` and it doesn't crash, but it gives a weird error.

main :: proc() {
	s: S(int);
	func(s.data);
}

Edit: better repro.

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