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

Allow bit shift in array operation #18617

Open
dlangBugzillaToGithub opened this issue Jun 26, 2013 · 1 comment
Open

Allow bit shift in array operation #18617

dlangBugzillaToGithub opened this issue Jun 26, 2013 · 1 comment

Comments

@dlangBugzillaToGithub
Copy link

Ryuichi OHORI reported this on 2013-06-26T09:15:07Z

Transferred from https://issues.dlang.org/show_bug.cgi?id=10477

CC List

  • yebblies

Description

import std.stdio;

void main()
{
    int[] a; a.length = 3;
    int[] b; b.length = 3;
    // both of the following cause same error.
    // Error: var has no effect in expression (c0)
    a[] <<= b[];
    a[] <<= 1;
    // another error message.
    // Error: 'a[]' is not of integral type, it is a int[]
    a[] = a[] << 1;
    a[] = a[] << b[];
}

I don't see why bit shift operation is not arrowed in array operations.
@dlangBugzillaToGithub
Copy link
Author

yebblies commented on 2013-11-21T03:26:39Z

It's not listed in the spec, seems like a valid enhancement.

http://dlang.org/arrays.html

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

No branches or pull requests

1 participant