When recently changing some of the AST syntax in the specs, I ran into various errors from the backends. They mostly just consisted of uncaught exceptions.
A dual problem was that some restrictions/assumptions were not checked, but simply lead to less than useful output, with no indication of why.
Since the backends are naturally more specialised and hence more restrictive than the frontend or IL validation, this is a user-facing issue. Consequently, backends need to
-
check all assumptions they make about the input, and fail visibly for cases they cannot handle correctly,
-
produce useful error messages for cases they cannot handle, including line information, ideally using the Source.error infrastructure.
When recently changing some of the AST syntax in the specs, I ran into various errors from the backends. They mostly just consisted of uncaught exceptions.
A dual problem was that some restrictions/assumptions were not checked, but simply lead to less than useful output, with no indication of why.
Since the backends are naturally more specialised and hence more restrictive than the frontend or IL validation, this is a user-facing issue. Consequently, backends need to
check all assumptions they make about the input, and fail visibly for cases they cannot handle correctly,
produce useful error messages for cases they cannot handle, including line information, ideally using the Source.error infrastructure.