www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 12050] New: in does not work as storage class where const scope does

reply d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=12050

           Summary: in does not work as storage class where const scope
                    does
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: rswhite4 googlemail.com


--- Comment #0 from rswhite4 googlemail.com 2014-01-31 15:31:46 PST ---
----
void main() {
    scope const int[] arr = new int[100];
}
----

Compiles but:

----
void main() {
    in int[] arr = new int[100];
}
----

fails with: Error: found 'in' instead of statement

Since 'in' is the same as 'const scope' both should compile or fail.

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 31 2014
parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=12050



--- Comment #1 from rswhite4 googlemail.com 2014-01-31 15:35:40 PST ---
At least it should give a better error message like "only parameters can be
marked with 'in'"

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 31 2014