Casting a descendant class to an interface implemented by the base

I use delphi at work and don't have a copy at home and of course forgot to
write down the exact error number, none the less:

I've got a class heirarchy beginning with Base1 which = class(TObject,
IXMLDOMDocument).  This class has a property xmlDoc: IXMLDOMDocument read
FxmlDoc implements IXMLDOMDocument.

3 levels down the chain I have descendant3 = class(descendant2).
Descendant3 is actually instantiated and used by a form.  The problem arizes
when I case descendant3 as an IXMLDOMDocument and do a Project | Compile I
get an internal compiler error (1382C I think) but if I do a Project | Build
everything works fine.  From this point forward anytime I change any part of
the file that does the typecast I get the internal compiler error unless I
explicitly build the entire project again.  This is Delphi4 Pro update 3,
thought I'd test the waters here before calling Borland directly on Monday.
Has anyone seen this behavior before?