Skip to content

Namespace scope doesn't apply to variables #140

@BobSmun

Description

@BobSmun

When a variable is defined inside a namespace, the namespace scope needs to be dropped to be able to access the variable

namespace test {
    bool something = true;
    bool setting in;
}

//way to access
something = false;
setting = true;

//expected way to access
test::something = false;
test::setting = true;

It also means that it is impossible to use namespaces to separate different instances of variables. In the below example, all three instances of 'something' collide with each other

bool something = true;

namespace test {
    bool something = true;
}

namespace test2 {
    bool something = true;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions