Bug 16129 – Linker error when using zero length array

Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2016-06-05T21:39:00Z
Last change time
2017-10-25T03:35:28Z
Keywords
Optlink
Assigned to
No Owner
Creator
fooleryt70

Comments

Comment #0 by fooleryt70 — 2016-06-05T21:39:00Z
struct Note { string topic; string content; } class NoteStore { Note[][string] store; static Note[0] empty; Note[] getNotes(string id) { return (id in store) ? store[id] : empty; } } void main() {} dmd ns.d OPTLINK (R) for Win32 Release 8.00.17 Copyright (C) Digital Mars 1989-2013 All rights reserved. http://www.digitalmars.com/ctg/optlink.html ns.obj(ns) Offset 00678H Record Type 009D Error 16: Index Range --- errorlevel 1 dmd --version DMD32 D Compiler v2.071.0 Copyright (c) 1999-2015 by Digital Mars written by Walter Bright
Comment #1 by bugzilla — 2017-10-25T03:32:51Z
*** Issue 16855 has been marked as a duplicate of this issue. ***
Comment #2 by bugzilla — 2017-10-25T03:35:28Z
*** This issue has been marked as a duplicate of issue 7997 ***