Custom class importing weird issue

A very weird problem is happening in my AS3 code.
I made a custom class called test, and in the main document class I imported it using “import test”. Also, I set the class path correctly so it should work fine. Now, the problem is, when I instantiate this class to an object, it works fine as long as it is outside the document class constructor, it i try to use it inside the constructor method, it doesnt work!

Example:

package{
     import flash.display.MovieClip;
     import test;

     public class document extends MovieClip {

           var test_obj:test = new test(); // works fine, no problem here

           public function document(){

                    var test_obj:test = new test(); // error:  1046: Type was not found or was not a compile-time constant: test.


            }

     }
}