Commit ec22bacd authored by Ryan Scott's avatar Ryan Scott

Add test for #12788

Commit bce99086 (#12584) fixed #12788. Let's
add a test to make sure it stays fixed.
parent eaa34823
{-# LANGUAGE TemplateHaskell #-}
module T12788 where
import Language.Haskell.TH
import T12788_Lib
data Bad = Bad { _bad :: String } deriving (Eq, Ord, Show)
$(deriveJSON defaultOptions{} ''Bad)
T12788.hs:9:14: error: Empty record update
module T12788_Lib where
import Language.Haskell.TH
data Options = Options
{ fieldLabelModifier :: String -> String
, constructorTagModifier :: String -> String
, allNullaryToStringTag :: Bool
, omitNothingFields :: Bool
, sumEncoding :: SumEncoding
, unwrapUnaryRecords :: Bool
}
data SumEncoding =
TaggedObject { tagFieldName :: String
, contentsFieldName :: String
}
| ObjectWithSingleField
| TwoElemArray
deriveJSON :: Options -> Name -> Q [Dec]
deriveJSON _ _ = return []
......@@ -433,3 +433,6 @@ test('T12478_3', omit_ways(['ghci']), compile, ['-v0'])
test('T12478_4', omit_ways(['ghci']), compile_fail, ['-v0'])
test('T12513', omit_ways(['ghci']), compile_fail, ['-v0'])
test('T12530', normal, compile, ['-v0 -ddump-splices -dsuppress-uniques'])
test('T12788', extra_clean(['T12788_Lib.hi', 'T12788_Lib.o']),
multimod_compile_fail,
['T12788.hs', '-v0 ' + config.ghc_th_way_flags])
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment