Skip to content

Undefined reference to static function in unused mixin lambda #22848

@dkorpel

Description

@dkorpel

Looks like dmd skips codegen for pred, but not for accept which takes pred as a template parameter, leading to a linker error.

mixin template Main(alias mainFunction) {}

mixin Main!(() 
{
	static bool pred(char c) => false;
	accept!pred;
});

char accept(alias pred)() => pred(0);
./onlineapp.d:9: error: undefined reference to '_D9onlineapp15__lambda_L3_C13FZ4predFNaNbNiNfaZb'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions