AST: More error-proof getContextSubstitutions()
The loop at the end is meant to fill in substitutions from the local
context with corresponding context archetypes, but we can end up
here if the getSuperclassForDecl() class failed above. In this case,
fill in the replacement types with ErrorType instead to avoid
surfacing archetypes from the wrong environment.