Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Space after cast is inconsistent #573

Open
zyedidia opened this issue Nov 21, 2022 · 0 comments
Open

Space after cast is inconsistent #573

zyedidia opened this issue Nov 21, 2022 · 0 comments

Comments

@zyedidia
Copy link

When the space_after_cast option is enabled (which is the default), spaces are only sometimes added after casts, and sometimes they are removed. For example

void main()
{
    uint foo = cast(uint) x;
    uint foo = cast(uint) (1 + 1);
    uint* foo = cast(uint*) &x;
    uint foo = cast(uint) 1;
}

is formatted to

void main()
{
    uint foo = cast(uint) x;
    uint foo = cast(uint)(1 + 1);
    uint* foo = cast(uint*)&x;
    uint foo = cast(uint) 1;
}

It seems like spaces after casts are removed when the expression starts with & or (. Is this intentional? The docs say:

Insert space after the closing paren of a cast expression.

which doesn't seem to necessarily be the case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant