Bug 15906 – [REG2.068.1] GIT HEAD undefined references

Status
RESOLVED
Resolution
WORKSFORME
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2016-04-09T21:49:00Z
Last change time
2016-07-30T01:46:29Z
Keywords
link-failure
Assigned to
nobody
Creator
temtaime

Comments

Comment #0 by temtaime — 2016-04-09T21:49:41Z
import std.algorithm, std.file, std.string; void main() { [ `` ].map!(a => dirEntries(a, `*.d`, SpanMode.depth).map!(a => a.name).join).join; } error LNK2019: unresolved external symbol _D173TypeInfo_xS3std9algorithm9iteration121__T12FilterResultS76_D3std4file10dirEntriesFAyaAyaE3std4file8SpanModebZ1fMFS3std4file8DirEntryZbTS3std4file11DirIteratorZ12FilterResult6__initZ referenced in function _D3std9algorithm9iteration239__T9MapResultS584main4mainFZ18__T9__lambda1TAyaZ9__lambda1MFAyaZ9__lambda2TS3std9algorithm9iteration121__T12FilterResultS76_D3std4file10dirEntriesFAyaAyaE3std4file8SpanModebZ1fMFS3std4file8DirEntryZbTS3std4file11DirIteratorZ12FilterResultZ9MapResult9__xtoHashFNbNeKxS3std9algorithm9iteration239__T9MapResultS584main4mainFZ18__T9__lambda1TAyaZ9__lambda1MFAyaZ9__lambda2TS3std9algorithm9iteration121__T12FilterResultS76_D3std4file10dirEntriesFAyaAyaE3std4file8SpanModebZ1fMFS3std4file8DirEntryZbTS3std4file11DirIteratorZ12FilterResultZ9MapResultZm
Comment #1 by temtaime — 2016-04-09T21:59:09Z
Adding .array before second map fixes the issue
Comment #2 by k.hara.pg — 2016-04-14T11:38:38Z
Dustmited test case: //////////////////////////////////////// // test.d import algo; import file; void main() { [ `` ].map!(a => dirEntries(a).map!(a => a)); } //////////////////////////////////////// // file.d struct RefCounted(T) { struct RefCountedStore { struct Impl { T _payload; } Impl* _store; } RefCountedStore _refCounted; inout(T) refCountedPayload() inout { return _refCounted._store._payload; } alias refCountedPayload this; } struct DirEntry {} struct DirIteratorImpl {} struct DirIterator { RefCounted!(DirIteratorImpl) impl; } auto dirEntries(string) { import algo; bool f(DirEntry de) { return true; } return filter!f(DirIterator()); } //////////////////////////////////////// // algo.d template unaryFun(alias fun) { alias unaryFun = fun; } template ElementType(R) { static if (is(typeof(R.init.front) T)) alias ElementType = T; } T front(T)(T[] ) { return []; } template map(fun...) { auto map(Range)(Range r) { alias RE = ElementType!Range; alias _fun = unaryFun!fun; assert(!is(typeof(_fun(RE.init)))); return MapResult!(_fun, Range)(r); } } struct MapResult(alias fun, R) { R _input; @property front() { fun(_input.front); } } template filter(alias pred) { auto filter(R)(R ) { return FilterResult!(pred, R)(); } } struct FilterResult(alias pred, R) { R _input; @property front() { return _input; } } Introduced in: https://github.com/D-Programming-Language/dmd/pull/5001
Comment #3 by bugzilla — 2016-07-30T01:46:29Z
With HEAD, The test case in the first comment compiles, links and runs successfully. The second test case compiles and links, and asserts when fails. Since the report is a link failure, marking this as working.