Skip to content
Snippets Groups Projects
Commit 3adf2089 authored by Simon Peyton Jones's avatar Simon Peyton Jones
Browse files

Test Trac #5892

parent 24074aa2
No related branches found
No related tags found
No related merge requests found
{-# LANGUAGE RecordWildCards #-}
{-# OPTIONS_GHC -Werror #-}
module T5892a where
import Data.Version ( Version( Version, versionBranch ))
-- Not importing its field: versionTags
foo :: Version -> Version
foo (Version {..}) -- Pattern match does not bind versionTags
= let versionBranch = []
in Version {..} -- Hence warning here
T5892a.hs:12:8: Warning:
Fields of `Version' not initialised: Data.Version.versionTags
In the expression: Version {..}
In the expression: let versionBranch = [] in Version {..}
In an equation for `foo':
foo (Version {..}) = let versionBranch = [] in Version {..}
<no location info>:
Failing due to -Werror.
{-# LANGUAGE RecordWildCards #-}
module T5892b where
import Data.Version ( Version( Version, versionBranch ))
-- Not importing its field: versionTags
Version{..} = Version [] []
-- Binds versionBranch only
foo = T5892b.versionBranch
bar = T5892b.versionTags
T5892b.hs:11:7:
Not in scope: `T5892b.versionTags'
Perhaps you meant `T5892b.versionBranch' (line 7)
......@@ -99,3 +99,5 @@ test('T5657', normal, compile_fail, [''])
test('T5745',
extra_clean(['T5745a.hi', 'T5745a.o', 'T5745b.hi', 'T5745b.o']),
multimod_compile_fail, ['T5745', '-v0'])
test('T5892a', normal, compile_fail, [''])
test('T5892b', normal, compile_fail, [''])
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