digitalmars.D - static import of std.signals
- Zbigniew Kostrzewa (43/43) Dec 10 2010 Hi
Hi When I try to compile following two modules: signal.d: 1 static import std.signals; 2 3 class Signal(T...) { 4 mixin std.signals.Signal!(T); 5 } task.di: 1 import signal; 2 3 interface ITask { 4 alias Signal!(int) OnCompleted; 5 6 void start(); 7 void stop(); 8 void connectOnCompleted(const OnCompleted.slot_t slot); 9 } I get errors like: /usr/include/d/dmd/phobos/std/signals.d(199): Error: undefined identifier _d_toObject /usr/include/d/dmd/phobos/std/signals.d(200): Error: undefined identifier rt_attachDisposeEvent /usr/include/d/dmd/phobos/std/signals.d(216): Error: undefined identifier _d_toObject /usr/include/d/dmd/phobos/std/signals.d(217): Error: undefined identifier rt_detachDisposeEvent /usr/include/d/dmd/phobos/std/signals.d(234): Error: undefined identifier _d_toObject /usr/include/d/dmd/phobos/std/signals.d(259): Error: undefined identifier _d_toObject /usr/include/d/dmd/phobos/std/signals.d(260): Error: undefined identifier rt_detachDisposeEvent But when I import std.signals not using 'static' or when I adjust std/signals.d module by prefixing calls to above methods with std.signals everything compiles just fine. Is it typical behavior when dealing with mixin templates or is it because those methods are declared as extern (C) ? Or I made some mistake in the code above ? Since I don't want to forward std.signals to other modules that will import my signal.d I thought about privately importing std.signals inside my Signal class but I'm not sure it's the most appropriate solution to this issue (?) Thanks in advance for any help with this.
Dec 10 2010