ryan.gl.scott at gmail.com
Thu Apr 19 12:45:03 UTC 2018
> What does exactly happen if an extension is needed for a certain language element, but it is not present?
Generally, these manifest as runtime checks of the form (xopt
LangExt.TheLanguageExtensionName dflags). For an example, see ,
where GHC checks if the TypeFamilyDependencies extension is enabled,
and if not, subsequently throws an error.
> Does the type checker still continue its business after encountering such an error; or does it stop, and dump its the error messages?
It depends. Sometimes, GHC uses the addErrTc function to add an error
but not cause an outright failure, continuing until there is a fatal
error. The failWithTc function, on the other hand, adds an error and
causes GHC to exit, reporting all errors it's collected up to that
point. (The example in  does this.)
More information about the ghc-devs