D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 16129 - Linker error when using zero length array
Summary: Linker error when using zero length array
Status: RESOLVED DUPLICATE of issue 7997
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86 Windows
: P1 normal
Assignee: No Owner
URL:
Keywords: Optlink
: 16855 (view as issue list)
Depends on:
Blocks:
 
Reported: 2016-06-05 21:39 UTC by fooleryt70
Modified: 2017-10-25 03:35 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 fooleryt70 2016-06-05 21:39:00 UTC
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 Walter Bright 2017-10-25 03:32:51 UTC
*** Issue 16855 has been marked as a duplicate of this issue. ***
Comment 2 Walter Bright 2017-10-25 03:35:28 UTC

*** This issue has been marked as a duplicate of issue 7997 ***