Stewart Gordon Wrote: > On 10/01/2011 13:02, Mitja wrote: > > I would like to have a template which returns > > appropriate delegate, something like this: > > For what purpose? All you seem to have is a long-winded identity function. > > <snip> > > and compiled it like this: dmd mod2.d mod1.d, the program would produce > > segmentation fault. > > I can't reproduce (DMD 2.051, Windows). In what setup are you > experiencing the problem? The problem appears in the following setup: Debian GNU/Linux 5.0, kernel 2.6.26-2-686 #1 SMP i686. dmd is D 2.051. As well as on Windows XP as guest OS in VirtualBox. XP prints out: "object.Error: Access Violation"
> > > It works fine when packages in mod2 are omitted. > > When which packages in mod2 are omitted? > > I can only make out that this is a compiler bug that needs to be > investigated. > > > What would be the correct way for templated delegate? > > It depends on what you're trying to do. > > Stewart.