core: allow an included file to use extends/overrules within the scope of the included file.
(cherry picked from commit bbcc9d89a14a3a582e1c214effb18aad33fd7620)