Commit e4ab8ba7 authored by Ryan Scott's avatar Ryan Scott

Add pragCompleteDName to templateHaskellNames

95dc6dc0 forgot to add `pragCompleteDName`
to the list of `templateHaskellNames`, which caused a panic if you actually
tried to splice a `COMPLETE` pragma using Template Haskell. This applies the
easy fix and augments the regression test to check for this in the future.
parent c344005b
......@@ -67,7 +67,7 @@ templateHaskellNames = [
classDName, instanceWithOverlapDName,
standaloneDerivWithStrategyDName, sigDName, forImpDName,
pragInlDName, pragSpecDName, pragSpecInlDName, pragSpecInstDName,
pragRuleDName, pragAnnDName, defaultSigDName,
pragRuleDName, pragCompleteDName, pragAnnDName, defaultSigDName,
dataFamilyDName, openTypeFamilyDName, closedTypeFamilyDName,
dataInstDName, newtypeInstDName, tySynInstDName,
infixLDName, infixRDName, infixNDName,
......
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE ViewPatterns #-}
module T13098 where
......@@ -7,3 +9,19 @@ import Language.Haskell.TH
$( sequence [ dataD (cxt []) (mkName "T") [PlainTV (mkName "a")]
Nothing [normalC (mkName "T") []] []
, pragCompleteD [mkName "T"] Nothing ] )
$([d| class LL f where
go :: f a -> ()
instance LL [] where
go _ = ()
pattern T2 :: LL f => f a
pattern T2 <- (go -> ())
{-# COMPLETE T2 :: [] #-}
-- No warning
foo :: [a] -> Int
foo T2 = 5
|])
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