Let's consider this code snippet:
ApplicationWindow
{
    /**/
    states: State {}
    /**/
}
When running the application, I get
Cannot assign to non-existent property "states"
When using
ApplicationWindow
{
    /**/
    Item { states: State {} }
    /**/
}
There is no error. Why can't I use states inside an ApplicationWindow?
 
     
    