Skip to content

Fatal error of compilation generic structs. #26438

@iperov

Description

@iperov

Describe the bug

Fatal error of compilation generic structs.

struct Foo[T] {
    bar &Bar[T]
}

struct Bar[T] {
    foo &Foo[T]
}

fn Foo.new[T]() &Foo[T] { 
	return &Foo[T]{} 
}

fn main() {
    Foo.new[int]()
}

Reproduction Steps

https://play.vlang.io/p/7f3751a1af

Expected Behavior

ok

Current Behavior

fail

Possible Solution

No response

Additional Information/Context

No response

V version

playground

Environment details (OS name and version, etc.)

playground

Note

You can use the 👍 reaction to increase the issue's priority for developers.

Please note that only the 👍 reaction to the issue itself counts as a vote.
Other reactions and those to comments will not be taken into account.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugThis tag is applied to issues which reports bugs.Status: ConfirmedThis bug has been confirmed to be valid by a contributor.Unit: CheckerBugs/feature requests, that are related to the type checker.Unit: CompilerBugs/feature requests, that are related to the V compiler in general.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions