Support nullary data types

Add tests for nullary prefix data types and nullary record data types.
pull/259/head
Evan Rutledge Borden 2019-11-12 16:02:14 -06:00
parent 0381b9fe24
commit 80f370a8e1
2 changed files with 6 additions and 1 deletions

View File

@ -318,6 +318,11 @@ func = f
###############################################################################
###############################################################################
#test nullary data type
data Foo = Bar {}
data Biz = Baz
#test single record
data Foo = Bar { foo :: Baz }

View File

@ -289,7 +289,7 @@ createDetailsDoc consNameStr details = case details of
IndentPolicyLeft -> docAlt [singleLine, leftIndented]
IndentPolicyMultiple -> docAlt [singleLine, multiIndented]
IndentPolicyFree -> docAlt [singleLine, multiIndented]
RecCon (L _ []) -> docEmpty
RecCon (L _ []) -> docSeq [docLit consNameStr, docSeparator, docLit $ Text.pack "{}"]
#if MIN_VERSION_ghc(8,6,0) /* ghc-8.6 */
RecCon lRec@(L _ [lField@(L _ (ConDeclField _ext names t _))]) ->
#else