Bug 12050 – in does not work as storage class where const scope does

Status
RESOLVED
Resolution
INVALID
Severity
minor
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-01-31T15:31:46Z
Last change time
2023-06-29T09:31:58Z
Keywords
bootcamp, diagnostic
Assigned to
No Owner
Creator
rswhite4

Comments

Comment #0 by rswhite4 — 2014-01-31T15:31:46Z
---- 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.
Comment #1 by rswhite4 — 2014-01-31T15:35:40Z
At least it should give a better error message like "only parameters can be marked with 'in'"
Comment #2 by k.hara.pg — 2014-02-01T09:02:09Z
(In reply to comment #1) > At least it should give a better error message like "only parameters can be > marked with 'in'" Marked as diagnostic issue.
Comment #3 by razvan.nitu1305 — 2023-06-29T09:31:58Z
In, according to the spec, can only be used on function parameters. Only in that context is "in" treated as const scope or just scope. Therefore, in cannot be used in all contexts `scope const` is. This bug report is invalid.