Skip to content
Snippets Groups Projects
Commit 5eba91b6 authored by Aaron Allen's avatar Aaron Allen Committed by Marge Bot
Browse files

Add :doc test case for duplicate record fields

Tests that the output of the `:doc` command is correct for duplicate
record fields defined using -XDuplicateRecordFields.
parent 4548d1f8
No related branches found
No related tags found
No related merge requests found
......@@ -5,6 +5,7 @@
-- this test is constructed with simple text (without markup) only.
--
{-# LANGUAGE DuplicateRecordFields #-}
module Test where
-- | This is the haddock comment of a data declaration for Data1.
......@@ -21,6 +22,18 @@ newtype Data4 =
-- | This is the haddock comment of a data constructor for Data4.
Data4 { getData4 :: Int }
data DupeFields1 =
DF1 { dupeField :: Int -- ^ This is the first haddock comment of a duplicate record field.
}
data DupeFields2 =
DF2 { dupeField :: Int -- ^ This is the second haddock comment of a duplicate record field.
}
data DupeFields3 =
DF3 { dupeField :: Int -- No haddock
}
-- | This is the haddock comment of a function declaration for func1.
func1 :: Int -> Int -> Int
func1 x y = x + y
......
......@@ -7,6 +7,7 @@
:doc Val2b
:doc Data3
:doc Data4
:doc dupeField
:doc func1
:doc func2
......
......@@ -3,6 +3,9 @@
This is the haddock comment of a data value for Val2b
This is the haddock comment of a data declaration for Data3.
This is the haddock comment of a data constructor for Data4.
This is the second haddock comment of a duplicate record field.
This is the first haddock comment of a duplicate record field.
This is the haddock comment of a function declaration for func1.
<has no documentation>
This is the haddock comment of a function declaration for func3.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment