Skip to content

Erroneous error of goto skipping declaration when tuple-like struct from function call fails to match template function. #21141

Open
@drpriver

Description

@drpriver
alias AliasSeq(TList...) = TList;
struct Foo {
    AliasSeq!(float) fields;
    alias this = fields;
}

Foo foo(){ return Foo();}
struct Bar { }

void func(Foo b){ }
// This must be a template for the error.
void func()(Bar b){ }

void call(){
    goto L1;
    func(foo());
    L1:
}
// a.d(15): Error: `goto` skips declaration of variable `a.call.__tup2`
//     goto L1;
//     ^
// a.d(16):        declared here
//     func(foo());
//             ^

There has to be a template function overload it fails to match and the struct must be the result of a function call.

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