-tcMonoExpr (HsSplice n expr) res_ty = tcSpliceExpr n expr res_ty
-
-tcMonoExpr (HsBracket (ExpBr expr)) res_ty
- = getStage `thenM` \ level ->
- case bracketOK level of {
- Nothing -> failWithTc (illegalBracket level) ;
- Just next_level ->
-
- -- Typecheck expr to make sure it is valid,
- -- but throw away the results. We'll type check
- -- it again when we actually use it.
- newMutVar [] `thenM` \ pending_splices ->
- getLIEVar `thenM` \ lie_var ->
- newTyVarTy openTypeKind `thenM` \ any_ty ->
-
- setStage (Brack next_level pending_splices lie_var) (
- getLIE (tcMonoExpr expr any_ty)
- ) `thenM` \ (expr', lie) ->
- tcSimplifyBracket lie `thenM_`
-
- tcMetaTy exprTyConName `thenM` \ meta_exp_ty ->
- unifyTauTy res_ty meta_exp_ty `thenM_`
-
- -- Return the original expression, not the type-decorated one
- readMutVar pending_splices `thenM` \ pendings ->
- returnM (HsBracketOut (ExpBr expr) pendings)
- }
-#endif GHCI
-\end{code}