October 05, 2011

Hello, I have this code:

import std.stdio;
class TTest
{
   public void Info(T)(string name)
   {
      writeln(typeid(T), "\t", name);
   }
}
void main()
{
   TTest test;
   test.Info!(uint)("one");
}

When compiling no errors. But when I try to run a program there is an error:
object.Error: Access Violation
----------------
426348
4261BF
402023
404C5B
404857
455789
----------------


October 05, 2011
On Wed, 05 Oct 2011 09:49:04 +0900, Мартыненко А.А. wrote:

> Hello, I have this code:
> 
> import std.stdio;
> class TTest
> {
>     public void Info(T)(string name)
>     {
>        writeln(typeid(T), "\t", name);
>     }
> }
> void main()
> {
>     TTest test;

test is null. This works:

    auto test = new TTest();

>     test.Info!(uint)("one");
> }
> 
> When compiling no errors. But when I try to run a program there is an error: object.Error: Access Violation
> ----------------
> 426348
> 4261BF
> 402023
> 404C5B
> 404857
> 455789
> ----------------

Ali