Would it be a reasonable strategy to:
- add a
ThrowsDecl : Declclass toDecl.h, with variables (and getters/setters etc):SourceLoc throwsLoc-
Optional<Type> throwsType. Optional<SourceLoc> throwsTypeLocation
- Add the
createXfactory methods for serialization and stuff toThrowsDecl. - Add an optional
ThrowsDecltoAbstractFunctionDeclwith 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?