AS3, error 1119 - when class is same name as last folder in package

I have this strange error, I have a class defined like so:


package net.guttershark.model 
{
  public class Model 
  {
    private static var instance:Model;
    public var test:Boolean;
    public static function gi():Model
    {
      if(instance == null) instance = new Model();
      return instance;
    }
  }
}

It throws error 1119 any time I try to use it like so: trace(Model.gi().test);

The error:
"1119: Access of possibly undefined property test through a reference with static type Model.

Now when I simply rename the class to this:


package net.guttershark.model
{
 public class Model2
 {
 private static var instance:Model2;
 public var test:Boolean;
 public static function gi():Model2
 {
 if(instance == null) instance = new Model2();
 return instance;
 }
}
}

I get no errors, and it works fine. Whey does the class name conflict
with the last folder in the package structure? And is there a way
around this?

That doesn’t make a load of sense since there are classes such as flash.accessibility.Accessibility

The code that you posted works for me.

Control > Delete ASO Files ? (Or equivalent if you’re compiling with something else)