Never Type in compiler

Would it be a reasonable strategy to:

  1. add a ThrowsDecl : Decl class to Decl.h, with variables (and getters/setters etc):
    1. SourceLoc throwsLoc
    2. Optional<Type> throwsType.
    3. Optional<SourceLoc> throwsTypeLocation
  2. Add the createX factory methods for serialization and stuff to ThrowsDecl.
  3. Add an optional ThrowsDecl to AbstractFunctionDecl with serialization support.

Then we'd have a serializable component inside AbstractFunctionDecl that we could type-check without having to push the Never type around. The type-checking rule is that the ThrowsType has to conform to Error which might be a little problematic when the standard library is not available, so we would have to work through that.

Does that make sense or am I missing something in the numbered list above?