Commit 43e7ee38 authored by Finn Teegen's avatar Finn Teegen
Browse files

Adjust warning message for potentially unreachable pattern matches

parent 9b17c498
...@@ -10,6 +10,7 @@ Under development (1.0.1) ...@@ -10,6 +10,7 @@ Under development (1.0.1)
functions `Prelude.fromInt` and `Prelude.fromFloat`. functions `Prelude.fromInt` and `Prelude.fromFloat`.
* Fixed bug with wrong original names of imported record labels * Fixed bug with wrong original names of imported record labels
* Fixed bug when compiling type constructor classes with super classes * Fixed bug when compiling type constructor classes with super classes
* Adjusted warning message for potentially unreachable pattern matches
Version 1.0.0 Version 1.0.0
============= =============
......
Name: curry-frontend Name: curry-frontend
Version: 1.0.0 Version: 1.0.1
Cabal-Version: >= 1.10 Cabal-Version: >= 1.10
Synopsis: Compile the functional logic language Curry to several Synopsis: Compile the functional logic language Curry to several
intermediate formats intermediate formats
...@@ -164,4 +164,4 @@ Test-Suite test-frontend ...@@ -164,4 +164,4 @@ Test-Suite test-frontend
default-language: Haskell2010 default-language: Haskell2010
test-module: TestFrontend test-module: TestFrontend
build-depends: base == 4.*, Cabal >= 1.20, curry-base == 1.0.0 build-depends: base == 4.*, Cabal >= 1.20, curry-base == 1.0.0
, curry-frontend == 1.0.0, filepath , curry-frontend == 1.0.1, filepath
...@@ -923,7 +923,7 @@ warnMissingPattern p loc pats = posMessage p ...@@ -923,7 +923,7 @@ warnMissingPattern p loc pats = posMessage p
-- additional pattern are abbreviated by dots. -- additional pattern are abbreviated by dots.
warnUnreachablePattern :: Position -> [[Pattern a]] -> Message warnUnreachablePattern :: Position -> [[Pattern a]] -> Message
warnUnreachablePattern p pats = posMessage p warnUnreachablePattern p pats = posMessage p
$ text "Pattern matches are unreachable" $ text "Pattern matches are potentially unreachable"
$+$ text "In a case alternative:" $+$ text "In a case alternative:"
$+$ nest 2 (vcat (ppExPats pats) <+> text "->" <+> text "...") $+$ nest 2 (vcat (ppExPats pats) <+> text "->" <+> text "...")
where where
......
...@@ -265,7 +265,7 @@ warnInfos = map (uncurry mkFailTest) ...@@ -265,7 +265,7 @@ warnInfos = map (uncurry mkFailTest)
[ "An fcase expression is potentially non-deterministic due to overlapping rules" [ "An fcase expression is potentially non-deterministic due to overlapping rules"
, "Pattern matches are non-exhaustive", "In an fcase alternative" , "Pattern matches are non-exhaustive", "In an fcase alternative"
, "In a case alternative", "In an equation for `fp'" , "In a case alternative", "In an equation for `fp'"
, "Pattern matches are unreachable" , "Pattern matches are potentially unreachable"
, "Function `fp' is potentially non-deterministic due to overlapping rules" , "Function `fp' is potentially non-deterministic due to overlapping rules"
, "Pattern matches are non-exhaustive" , "Pattern matches are non-exhaustive"
] ]
...@@ -299,7 +299,7 @@ warnInfos = map (uncurry mkFailTest) ...@@ -299,7 +299,7 @@ warnInfos = map (uncurry mkFailTest)
, "In an equation for `g'", "In an equation for `rec'"] , "In an equation for `g'", "In an equation for `rec'"]
) )
, ("OverlappingPatterns", , ("OverlappingPatterns",
[ "Pattern matches are unreachable", "In a case alternative" [ "Pattern matches are potentially unreachable", "In a case alternative"
, "An fcase expression is potentially non-deterministic due to overlapping rules" , "An fcase expression is potentially non-deterministic due to overlapping rules"
, "Function `i' is potentially non-deterministic due to overlapping rules" , "Function `i' is potentially non-deterministic due to overlapping rules"
, "Function `j' is potentially non-deterministic due to overlapping rules" , "Function `j' is potentially non-deterministic due to overlapping rules"
......
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