digitalmars.D.learn - typecons wrap error
What I do wrong? [code] import std.stdio, std.typecons; interface A { void foo(); void bar( int ); } class B { void foo() { writeln( "B.foo" ); } void bar( int i ) { writefln( "B.bar(%d)", i ); } } void call( A a ) { a.foo(); a.bar( 12 ); } void main() { auto b = new B; A a = wrap!A(b); call( a ); } [/code] then I run dmd, it fails with error $ dmd -run tcons.d tcons.o: In function `_D3std8typecons19__T4wrapTC5tcons1AZ19__T4wrapTC5tcons1BZ4Impl587__T8mixinAllVAyaa139_6f766572726964652052657475726e5479706521285461726765744d656d626572735b305d2e747970652920666f6f28506172616d65746572547970655475706c6521285461726765744d656d626572735b305d2e7479706529206172677329207b2072657475726e205f777261705f736f757263652e666f6f28666f72776172642161726773293b207dVAyaa139_6f766572726964652052657475726e5479706521285461726765744d656d626572735b315d2e74797065292062617228506172616d65746572547970655475706c6521285461726765744d656d626572735b315d2e7479706529206172677329207b2072657475726e205f777261705f736f757263652e62617228666f72776172642161726773293b207dZ300__T8mixinAllVAyaa139_6f766572726964652052657475726e5479706521285461726765744d656d626572735b315d2e74797065292062617228506172616d65746572547970655475706c6521285461726765744d656d626572735b315d2e7479706529206172677329207b2072657475726e205f777261705f736f757263652e62617228666f72776172642161726773293b207dZ3barMFiZv': tcons.d:(.text._D3std8typecons19__T4wrapTC5tcons1AZ19__T4wrapTC5tcons1BZ4Impl587__T8mixinAllVAyaa139_6f766572726964652052657475726e5479706521285461726765744d656d626572735b305d2e747970652920666f6f28506172616d65746572547970655475706c6521285461726765744d656d626572735b305d2e7479706529206172677329207b2072657475726e205f777261705f736f757263652e666f6f28666f72776172642161726773293b207dVAyaa139_6f766572726964652052657475726e5479706521285461726765744d656d626572735b315d2e74797065292062617228506172616d65746572547970655475706c6521285461726765744d656d626572735b315d2e7479706529206172677329207b2072657475726e205f777261705f736f757263652e62617228666f72776172642161726773293b207dZ300__T8mixinAllVAyaa139_6f766572726964652052657475726e5479706521285461726765744d656d626572735b315d2e74797065292062617228506172616d65746572547970655475706c6521285461726765744d656d626572735b315d2e7479706529206172677329207b2072657475726e205f777261705f736f757263652e62617228666f72776172642161726773293b2 7dZ3barMFiZv+0x54): undefined reference to `_D3std8typecons19__T4wrapTC5tcons1AZ19__T4wrapTC5tcons1BZ4Impl587__T8mixinAllVAyaa139_6f766572726964652052657475726e5479706521285461726765744d656d626572735b305d2e747970652920666f6f28506172616d65746572547970655475706c6521285461726765744d656d626572735b305d2e7479706529206172677329207b2072657475726e205f777261705f736f757263652e666f6f28666f72776172642161726773293b207dVAyaa139_6f766572726964652052657475726e5479706521285461726765744d656d626572735b315d2e74797065292062617228506172616d65746572547970655475706c6521285461726765744d656d626572735b315d2e7479706529206172677329207b2072657475726e205f777261705f736f757263652e62617228666f72776172642161726773293b207dZ300__T8mixinAllVAyaa139_6f766572726964652052657475726e5479706521285461726765744d656d626572735b315d2e74797065292062617228506172616d65746572547970655475706c6521285461726765744d656d626572735b315d2e7479706529206172677329207b2072657475726e205f777261705f736f757263652e62617228666f72776172642161726773293b207dZ3barMFiZv990__T7forwardS974_D3std8typecons19__T4wrapTC5tcons1AZ19__T4wrapTC5tcons1BZ4Impl587__T8mixinAllVAyaa139_6f766572726964652052657475726e5479706521285461726765744d656d626572735b305d2e747970652920666f6f28506172616d65746572547970655475706c6521285461726765744d656d626572735b305d2e7479706529206172677329207b2072657475726e205f777261705f736f757263652e666f6f28666f72776172642161726773293b207dVAyaa139_6f766572726964652052657475726e5479706521285461726765744d656d626572735b315d2e74797065292062617228506172616d65746572547970655475706c6521285461726765744d656d626572735b315d2e7479706529206172677329207b2072657475726e205f777261705f736f757263652e62617228666f72776172642161726773293b207dZ300__T8mixinAllVAyaa139_6f766572726964652052657475726e5479706521285461726765744d656d626572735b315d2e74797065292062617228506172616d65746572547970655475706c6521285461726765744d656d626572735b315d2e7479706529206172677329207b2072657475726e205f777261705f736f757263652e62617228666f72776172642161726773293b207dZ3barMFiZv8_param_0iZ8__T3fwdZ3fwdMFNbNdNfZi' collect2: error: ld returned 1 exit status --- errorlevel 1
Nov 21 2013
https://d.puremagic.com/issues/show_bug.cgi?id=11456 (use -allinst compiler switch as a workaround until proper fix)
Nov 21 2013