@@ -219,8 +219,6 @@ reifyRawApp t [n, b, x]
219219 return $ RBind n' b' x'
220220reifyRawApp t [f, x]
221221 | t == reflm "RApp" = liftM2 RApp (reifyRaw f) (reifyRaw x)
222−reifyRawApp t [t']
223− | t == reflm "RForce" = liftM RForce (reifyRaw t')
224222reifyRawApp t [c]
225223 | t == reflm "RConstant" = liftM RConstant (reifyTTConst c)
226224reifyRawApp t args = fail ("Unknown reflection raw term in reifyRawApp: " ++ show (t, args))
@@ -475,18 +473,15 @@ reflectTTQuotePattern unq (Constant c)
475473 = do fill $ reflCall "TConst" [reflectConstant c]
476474 solve
477475reflectTTQuotePattern unq (Proj t i)
478− = do t' <- claimTy (sMN 0 "t") (Var (reflm "TT")) ; movelast t'
479− fill $ reflCall "Proj" [Var t', RConstant (I i)]
480− solve
481− focus t'; reflectTTQuotePattern unq t
482−reflectTTQuotePattern unq (Erased)
476+ = lift . tfail . InternalMsg $
477+ "Phase error! The Proj constructor is for optimization only and should not have been reflected during elaboration."
478+reflectTTQuotePattern unq Erased
483479 = do erased <- claimTy (sMN 0 "erased") (Var (reflm "TT"))
484480 movelast erased
485481 fill $ (Var erased)
486− solve
487−reflectTTQuotePattern unq (Impossible)
488− = do fill $ Var (reflm "Impossible")
489− solve
482+reflectTTQuotePattern unq Impossible
483+ = lift . tfail . InternalMsg $
484+ "Phase error! The Impossible constructor is for optimization only and should not have been reflected during elaboration."
490485reflectTTQuotePattern unq (TType exp)
491486 = do ue <- getNameFrom (sMN 0 "uexp")
492487 claim ue (Var (sNS (sUN "TTUExp") ["Reflection", "Language"]))
@@ -539,7 +534,6 @@ reflectRawQuotePattern unq (RBind n b sc) =
539534 freeNamesR (RApp f x) = freeNamesR f ++ freeNamesR x
540535 freeNamesR RType = []
541536 freeNamesR (RUType _) = []
542− freeNamesR (RForce r) = freeNamesR r
543537 freeNamesR (RConstant _) = []
544538reflectRawQuotePattern unq (RApp f x) =
545539 do fH <- getNameFrom (sMN 0 "f")
@@ -562,13 +556,6 @@ reflectRawQuotePattern unq (RUType univ) =
562556 fill $ reflCall "RUType" [Var uH]
563557 solve
564558 focus uH; fill (reflectUniverse univ); solve
565−reflectRawQuotePattern unq (RForce r) =
566− do rH <- getNameFrom (sMN 0 "raw")
567− claim rH (Var (reflm "Raw"))
568− movelast rH
569− fill $ reflCall "RForce" [Var rH]
570− solve
571− focus rH; reflectRawQuotePattern unq r
572559reflectRawQuotePattern unq (RConstant c) =
573560 do cH <- getNameFrom (sMN 0 "const")
574561 claim cH (Var (reflm "Constant"))
@@ -651,12 +638,13 @@ reflectTTQuote unq (App _ f x)
651638 = reflCall "App" [reflectTTQuote unq f, reflectTTQuote unq x]
652639reflectTTQuote unq (Constant c)
653640 = reflCall "TConst" [reflectConstant c]
654−reflectTTQuote unq (Proj t i)
655− = reflCall "Proj" [reflectTTQuote unq t, RConstant (I i)]
656−reflectTTQuote unq (Erased) = Var (reflm "Erased")
657−reflectTTQuote unq (Impossible) = Var (reflm "Impossible")
658641reflectTTQuote unq (TType exp) = reflCall "TType" [reflectUExp exp]
659642reflectTTQuote unq (UType u) = reflCall "UType" [reflectUniverse u]
643+reflectTTQuote _ (Proj _ _) =
644+ error "Phase error! The Proj constructor is for optimization only and should not have been reflected during elaboration."
645+reflectTTQuote unq Erased = Var (reflm "Erased")
646+reflectTTQuote _ Impossible =
647+ error "Phase error! The Impossible constructor is for optimization only and should not have been reflected during elaboration."
660648
661649reflectRawQuote :: [Name] -> Raw -> Raw
662650reflectRawQuote unq (Var n)
@@ -669,7 +657,6 @@ reflectRawQuote unq (RApp f x) =
669657reflectRawQuote unq RType = Var (reflm "RType")
670658reflectRawQuote unq (RUType u) =
671659 reflCall "RUType" [reflectUniverse u]
672−reflectRawQuote unq (RForce r) = reflCall "RForce" [reflectRawQuote unq r]
673660reflectRawQuote unq (RConstant cst) = reflCall "RConstant" [reflectConstant cst]
674661
675662reflectNameType :: NameType -> Raw