www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 16203] New: std.signals connect() error


          Issue ID: 16203
           Summary: std.signals connect() error
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P1
         Component: phobos
          Assignee: nobody puremagic.com
          Reporter: nmtigor.wang googlemail.com


my test codes are as follows:

module dtest;

import std.signals;

struct SIG {}

class C1
  void watch( SIG ) {}
  void delegate(T1) createWatcher( T1 )() 
      return delegate void( T1 sig ) { watch( sig ); };

class C2
  mixin Signal!SIG;

  auto c1 = new C1;
  auto c2 = new C2;  
  auto slot = c1.createWatcher!SIG;
  c2.connect( slot );

When I run "rdmd -main -unittest dtest", it outputs following messages:

段错误 (核心已转储)

These messages are too vague. The source code of connect() also looks magic. I
have no idea of what's wrong.

Jun 24 2016