D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 10477 - Allow bit shift in array operation
Summary: Allow bit shift in array operation
Status: NEW
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P4 enhancement
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-06-26 09:15 UTC by Ryuichi OHORI
Modified: 2024-12-13 18:08 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Ryuichi OHORI 2013-06-26 09:15:07 UTC
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.
Comment 1 yebblies 2013-11-21 03:26:39 UTC
It's not listed in the spec, seems like a valid enhancement.

http://dlang.org/arrays.html
Comment 2 dlangBugzillaToGithub 2024-12-13 18:08:36 UTC
THIS ISSUE HAS BEEN MOVED TO GITHUB

https://github.com/dlang/dmd/issues/18617

DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB