Skip to content

Warning on undocumented public symbol falsely detects stack variables in functions in is(typeof(...)) #970

@thewilsonator

Description

@thewilsonator
enum isSeedable(Rng, SeedType) = isUniformRNG!(Rng) &&
	is(typeof(
    {
        Rng r = void;              // can define a Rng object
        SeedType s = void;
        r.seed(s); // can seed a Rng
    }));
}

Yields

std/random.d(311:13)[warn]: Public declaration 'r' is undocumented. 
std/random.d(312:18)[warn]: Public declaration 's' is undocumented.

But apparently not if written as

template  isSeedable(Rng, SeedType) 
{
     enum isSeedable = isUniformRNG!(Rng) &&
	is(typeof(
    {
        Rng r = void;              // can define a Rng object
        SeedType s = void;
        r.seed(s); // can seed a Rng
    }));
}

See dlang/phobos#10853

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