# BUG: Compiler favors "root classpath" definition over import statements

**URL:** <https://forum.kirupa.com/t/bug-compiler-favors-root-classpath-definition-over-import-statements/303899>\
**Category:** flash\
**Created:** [January 28, 2010, 7:59pm UTC](https://forum.kirupa.com/t/bug-compiler-favors-root-classpath-definition-over-import-statements/303899 "2010-01-28T19:59:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![IQAndreas](https://avatars.discourse-cdn.com/v4/letter/i/f08c70/32.png) [@IQAndreas](https://forum.kirupa.com/u/IQAndreas)\
**Post date:** [January 28, 2010, 7:59pm UTC](https://forum.kirupa.com/t/bug-compiler-favors-root-classpath-definition-over-import-statements/303899/1 "2010-01-28T19:59:28Z")

</div>

**I’m wondering if I’m the only one with this error. Is it a quirk or a feature? Should it be reported to Adobe as a bug?**

I found this out (after a while of frustration) that whenever I have a class in the root folder of the global classpath (or even in the same folder as the FLA, just not arranged into a package), even if I use an “import” statement for a “packaged” class with the same name, the compiler will still fetch and use the “global” class definition.

Here is a quick example of how to reproduce it.

Place the following class alongside the FLA:

```auto
package
{
   public class ClassOne
   {
      public function ClassOne()
      {
         trace("Make me an unpackaged class, matey!");
      }
   
      public static function tester()
      {
         trace("Hello, sweet, unpackaged world!");
      }
   }
}

```

And put this one in the folder “com/test/”

```auto
package com.test
{
   public class ClassOne
   {
      public function ClassOne()
      {
         trace("I feel so trapped, and so lonely in my class...");
      }
   
      public static function tester()
      {
         trace("Goodbye cruel, packaged world!");
      }
   }
}

```

And put this code on the timeline:

```auto
import com.test.ClassOne;

var c = new ClassOne(); //Test instance
ClassOne.tester(); //Test static

```
