Bug 10786 – non-trivial RTInfo generation causes link error

Status
RESOLVED
Resolution
WORKSFORME
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-08-09T01:19:55Z
Last change time
2017-12-24T09:10:10Z
Keywords
wrong-code
Assigned to
No Owner
Creator
Rainer Schuetze

Comments

Comment #0 by r.sagitario — 2013-08-09T01:19:55Z
Change the RTInfo declaration in object.di and object_.d to //////////////////////////////////////////////////////// template RTInfo(T) { enum RTInfo = cast(void*)RTInfoImpl!T; } template RTInfoImpl(T) { enum RTInfoImpl = &RTInfoImpl2!T; } template RTInfoImpl2(T) { immutable RTInfoImpl2 = 1234; } //////////////////////////////////////////////////////// and then compile these 2 files: ///////////////////////////////////// module ut; void main() {} ///////////////////////////////////// module ut2; unittest { // Original test case (revised, original assert was wrong) int[string] a; a["foo"] = 0; a.remove("foo"); assert(a == null); // should not crash } ///////////////////////////////////// with dmd -unittest ut.d ut2.d results in: OPTLINK (R) for Win32 Release 8.00.12 Copyright (C) Digital Mars 1989-2010 All rights reserved. http://www.digitalmars.com/ctg/optlink.html ut.obj(ut) Error 42: Symbol Undefined _D6object74__T11RTInfoImpl2TS6object28__T16Associati veArrayTAyaTiZ16AssociativeArrayZ11RTInfoImpl2yi --- errorlevel 1
Comment #1 by r.sagitario — 2017-12-24T09:10:10Z
cannot reproduce anymore