- -- Most of the work of specialisation is done by
- -- the desugarer, guided by the SpecPrag
-
+tcPrag poly_id (SpecInstSig hs_ty)
+ = do { let name = idName poly_id
+ ; (tyvars, theta, tau) <- tcHsInstHead hs_ty
+ ; let spec_ty = mkSigmaTy tyvars theta tau
+ ; co_fn <- tcSubExp (SpecPragOrigin name) (idType poly_id) spec_ty
+ ; return (SpecPrag (mkHsWrap co_fn (HsVar poly_id)) spec_ty defaultInlineSpec) }
+
+tcPrag _ (InlineSig _ inl) = return (InlinePrag inl)
+tcPrag _ sig = pprPanic "tcPrag" (ppr sig)
+
+