Re: [Vala] Delegates in generic classes



Thanks Abderrahim,

public class GenericClass<T>
{     
      private Callback<T> cb;

      public GenericClass(Callback<T> cb)
      {
              this.cb = cb;
      }
}

this works so far, but I can't seem to add a method that actually calls
the callback, e.g. adding

public void callit()
{
        this.cb<T>( new T() );
}

leads to an assertion at compile time:

ERROR:valasemanticanalyzer.c:2737:vala_semantic_analyzer_get_actual_type: assertion failed: (instance_type != 
NULL)
Aborted

:M:





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]