Actually, ``InteractiveCompilationUnit`` should have declare an additional abstract method ``def updateErrorAnnotations(errors: List[IProblem])`` so that you don't need to perform any casting. The type of ``scUnit`` would be ``InteractiveCompilationUnit``.