Commit 137b3313 authored by thomie's avatar thomie Committed by Herbert Valerio Riedel
Browse files

Deprecate Data.Version.versionTags (#2496)

The library submission was accepted:

  http://www.haskell.org/pipermail/libraries/2014-September/023777.html

The T5892ab testcases were changed to use `Data.Tree` instead of `Data.Version`

Reviewed By: ekmett

Differential Revision: https://phabricator.haskell.org/D395
parent 2cc854b7
......@@ -92,6 +92,8 @@ data Version =
-- on the entity that this version applies to.
}
deriving (Read,Show,Typeable)
{-# DEPRECATED versionTags "See GHC ticket #2496" #-}
-- TODO. Remove all references to versionTags in GHC 7.12 release.
instance Eq Version where
v1 == v2 = versionBranch v1 == versionBranch v2
......
......@@ -29,7 +29,7 @@ import Data.Version
-- | The version of 'compilerName' with which the program was compiled
-- or is being interpreted.
compilerVersion :: Version
compilerVersion = Version {versionBranch=[major, minor], versionTags=[]}
compilerVersion = Version [major, minor] []
where (major, minor) = compilerVersionRaw `divMod` 100
#include "ghcplatform.h"
......
......@@ -3,10 +3,10 @@
module T5892a where
import Data.Version ( Version( Version, versionBranch ))
-- Not importing its field: versionTags
import Data.Tree ( Tree( Node, rootLabel ))
-- Not importing field 'subForest'
foo :: Version -> Version
foo (Version {..}) -- Pattern match does not bind versionTags
= let versionBranch = []
in Version {..} -- Hence warning here
foo :: Tree [Int] -> Tree [Int]
foo (Node {..}) -- Pattern match does not bind 'subForest'
= let rootLabel = []
in Node {..} -- 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 {..}
Fields of ‘Node’ not initialised: Data.Tree.subForest
In the expression: Node {..}
In the expression: let rootLabel = [] in Node {..}
In an equation for ‘foo’:
foo (Version {..}) = let versionBranch = ... in Version {..}
foo (Node {..}) = let rootLabel = ... in Node {..}
<no location info>:
Failing due to -Werror.
{-# LANGUAGE RecordWildCards #-}
module T5892b where
import Data.Version ( Version( Version, versionBranch ))
-- Not importing its field: versionTags
import Data.Tree ( Tree( Node, rootLabel ))
-- Not importing field 'subForest'
Version{..} = Version [] []
-- Binds versionBranch only
Node{..} = Node [] []
-- Binds 'rootLabel' only
foo = T5892b.versionBranch
bar = T5892b.versionTags
foo = T5892b.rootLabel
bar = T5892b.subForest
T5892b.hs:11:7:
Not in scope: ‘T5892b.versionTags’
Perhaps you meant ‘T5892b.versionBranch’ (line 7)
T5892b.hs:11:7: Not in scope: ‘T5892b.subForest’
......@@ -98,8 +98,8 @@ 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, [''])
test('T5892a', normal, compile_fail, ['-package containers'])
test('T5892b', normal, compile_fail, ['-package containers'])
test('T5951', normal, compile_fail, [''])
test('T6060', normal, compile_fail, [''])
test('T6148', normal, compile_fail, [''])
......
......@@ -493,7 +493,7 @@ readPackageArg False str = Id `fmap` readGlobPkgId str
-- globVersion means "all versions"
globVersion :: Version
globVersion = Version{ versionBranch=[], versionTags=["*"] }
globVersion = Version [] ["*"]
-- -----------------------------------------------------------------------------
-- Package databases
......
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