www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - object.Error: Access Violation

reply =?UTF-8?B?ItCc0LDRgNGC0YvQvdC10L3QutC+INCQLtCQLiI=?= writes:
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
----------------
Oct 04 2011
parent Ali =?iso-8859-1?q?=C7ehreli?= <acehreli yahoo.com> writes:
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
Oct 04 2011