Commit 09665a7e authored by Ben Gamari's avatar Ben Gamari Committed by Ben Gamari
Browse files

Ensure Typeable declarations end up in boot interface files

Previously we neglected to emit Typeable TyCon and Module declarations
when typechecking boot interface files. This resulted in #11824.

Ultimately we'll likely want to do a bit of cleaning in this area but in
the interest of getting some sort of fix in I'm merging this. Further
clean-ups to come.

Test Plan: Validate

Reviewers: simonpj, austin

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D2108

GHC Trac Issues: #11824

(cherry picked from commit 048d6187b5892502e9bc75abfb21f9bd848a29cb)
parent d4980e51
......@@ -653,7 +653,6 @@ tcRnHsBootDecls hsc_src decls
-- See Note [Extra dependencies from .hs-boot files] in RnSource
; (gbl_env, lie) <- captureConstraints $ setGblEnv tcg_env $ do {
-- Check for illegal declarations
; case group_tail of
Just (SpliceDecl d _, _) -> badBootDecl hsc_src "splice" d
......@@ -669,6 +668,10 @@ tcRnHsBootDecls hsc_src decls
<- tcTyClsInstDecls tycl_decls inst_decls deriv_decls val_binds
; setGblEnv tcg_env $ do {
-- Emit Typeable declarations
; tcg_env <- setGblEnv tcg_env mkTypeableBinds
; setGblEnv tcg_env $ do {
-- Typecheck value declarations
; traceTc "Tc5" empty
; val_ids <- tcHsBootSigs val_binds val_sigs
......@@ -691,7 +694,7 @@ tcRnHsBootDecls hsc_src decls
}
; setGlobalTypeEnv gbl_env type_env2
}}
}}}
; traceTc "boot" (ppr lie); return gbl_env }
badBootDecl :: HscSource -> String -> Located decl -> TcM ()
......
test('T11824', expect_broken(11824), compile_and_run, [''])
\ No newline at end of file
test('T11824', normal, compile_and_run, [''])
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment