Skip to content

Initialization of a struct-typed template parameter from a different type fails. #20994

@maxsamukha

Description

@maxsamukha
struct S
{
    this(int x) {}
}

void foo(S a = 0)
{
}

template Foo(S a = 0)
{
}

void main(){
    S a = 0; // ok
    foo(); // ok
    alias F = Foo!(); // fails, should compile
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions