Skip to content
  • Alex Vandiver's avatar
    Move RT::Record dependencies to runtime, not compile-time · e0921ff1
    Alex Vandiver authored
    Some of the "use RT::Foo" modules listed in RT::Record are themselves
    subclasses of RT::Record.  This means that RT::Record's methods are not
    necessarily initialized before the subclasses are loaded.  In tern, this
    causes the methods of RT::Record itself to be invisible to Role::Basic's
    "with" -- though methods of its superclass (DBIx::SearchBuilder::Record)
    are, as hey are pulled in earlier by the compile-time "use base" above.
    
    Move the import of RT::Foo classes to runtime, not compile-time.  This
    simplifies load order during compile-time, ensuring that a class loads
    all of its parent classes and roles without possibly creating load-order
    loops.  This also requires that any roles also declare their module
    dependencies using "require" as well.  As there are no notable "import"
    methods to RT's object classes, and (save for Role::Basic method
    resolution) compile-time checking is necessary, this is safe.
    e0921ff1