@@ -34,6 +34,7 @@ import Control.Monad
3434
3535-- | Elaborate a record declaration
3636elabRecord :: ElabInfo
37+ -> ElabWhat
3738 -> (Docstring (Either Err PTerm)) -- ^ The documentation for the whole declaration
3839 -> SyntaxInfo -> FC -> DataOpts
3940 -> Name -- ^ The name of the type being defined
@@ -45,7 +46,7 @@ elabRecord :: ElabInfo
4546 -> (Docstring (Either Err PTerm)) -- ^ Constructor Doc
4647 -> SyntaxInfo -- ^ Constructor SyntaxInfo
4748 -> Idris ()
48−elabRecord info doc rsyn fc opts tyn nfc params paramDocs fields cname cdoc csyn
49+elabRecord info what doc rsyn fc opts tyn nfc params paramDocs fields cname cdoc csyn
4950 = do logLvl 1 $ "Building data declaration for " ++ show tyn
5051 -- Type constructor
5152 let tycon = generateTyConType params
@@ -58,17 +59,20 @@ elabRecord info doc rsyn fc opts tyn nfc params paramDocs fields cname cdoc csyn
5859
5960 -- Build data declaration for elaboration
6061 logLvl 1 $ foldr (++) "" $ intersperse "\n" (map show dconsArgDocs)
61− let datadecl = PDatadecl tyn NoFC tycon [(cdoc, dconsArgDocs, dconName, NoFC, dconTy, fc, [])]
62+ let datadecl = case what of
63+ ETypes -> PLaterdecl tyn NoFC tycon
64+ _ -> PDatadecl tyn NoFC tycon [(cdoc, dconsArgDocs, dconName, NoFC, dconTy, fc, [])]
6265 elabData info rsyn doc paramDocs fc opts datadecl
6366
64− logLvl 1 $ "fieldsWithName " ++ show fieldsWithName
65− logLvl 1 $ "fieldsWIthNameAndDoc " ++ show fieldsWithNameAndDoc
66− elabRecordFunctions info rsyn fc tyn paramsAndDoc fieldsWithNameAndDoc dconName target
67+ when (what /= ETypes) $ do
68+ logLvl 1 $ "fieldsWithName " ++ show fieldsWithName
69+ logLvl 1 $ "fieldsWIthNameAndDoc " ++ show fieldsWithNameAndDoc
70+ elabRecordFunctions info rsyn fc tyn paramsAndDoc fieldsWithNameAndDoc dconName target
6771
68− sendHighlighting $
69− [(nfc, AnnName tyn Nothing Nothing Nothing)] ++
70− maybe [] (\(_, cnfc) -> [(cnfc, AnnName dconName Nothing Nothing Nothing)]) cname ++
71− [(ffc, AnnBoundName fn False) | (fn, ffc, _, _, _) <- fieldsWithName]
72+ sendHighlighting $
73+ [(nfc, AnnName tyn Nothing Nothing Nothing)] ++
74+ maybe [] (\(_, cnfc) -> [(cnfc, AnnName dconName Nothing Nothing Nothing)]) cname ++
75+ [(ffc, AnnBoundName fn False) | (fn, ffc, _, _, _) <- fieldsWithName]
7276
7377 where
7478 -- | Generates a type constructor.