title: Haxe Type not found : Client
body: <p>Hi am trying to create a ThreadServer in Haxe. I love this language, just got into it couple days ago it's a mix between C# and AS3 which I love both!</p>
  
  <p>So the problem is when I try to store the Clients in a List to access them later example to kick etc I need it but it tells me Type not found but it's in the same package it should be able to access it here is the code with the file names and the error.</p>
  
  <p>Error:</p>
  
  <pre><code>var cl:Client = { id: num, cSocket:s };
  var cData = new ClientData(cl);
  Main.clients.add(cData);
  </code></pre>
  
  <p>Server.hx:</p>
  
  <pre><code>package;
  
  import neko.Lib;
  import sys.net.Socket;
  import neko.net.ThreadServer;
  import haxe.io.Bytes;
  
  typedef Client =
  {
      var id : Int;
      var cSocket:Socket;
  }
  
  typedef Message =
  {
      var str : String;
  }
  
  class Server extends ThreadServer&lt;Client, Message&gt;
  {
      // create a Client
      override function clientConnected( s : Socket ) : Client
      {
          var num = Std.random(100);
          Lib.println("client " + num + " is " + s.peer());
  
          var cl:Client = { id: num, cSocket:s };
          var cData = new ClientData(cl);
          Main.clients.add(cData);
  
          return cl;
      }
  
      override function clientDisconnected( c : Client )
      {
          Lib.println("client " + Std.string(c.id) + " disconnected");
      }
  
      override function readClientMessage(c:Client, buf:Bytes, pos:Int, len:Int)
      {
          var complete = false;
          var cpos = pos;
          while (cpos &lt; (pos+len) &amp;&amp; !complete)
          {
              complete = (buf.get(cpos) == 0);
              cpos++;
          }
  
          if ( !complete ) return null;
  
          var msg:String = buf.getString(pos, cpos-pos);
          return {msg: {str: msg}, bytes: cpos-pos};
      }
  
      override function clientMessage( c : Client, msg : Message )
      {
          Lib.println(c.id + " got: " + msg.str);
      }
  }
  </code></pre>
  
  <p>ClientData.hx:</p>
  
  <pre><code>package;
  
  class ClientData
  {
      var client:Client;
  
      public function new(c:Client)
      {
          this.client = c;
      }
  }
  </code></pre>
  
  <p>Main.hx:</p>
  
  <pre><code>package;
  
  class Main 
  {
      public static var clients=new List&lt;ClientData&gt;();
  
      static function main() 
      {
        var server = new Server();
        server.run("localhost", 5588);
      }
  }
  </code></pre>
  
  <p>Thanks for the help!</p>