summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAditya <adityadivekar03@gmail.com>2016-06-25 19:51:36 +0530
committerThomas Miedema <thomasmiedema@gmail.com>2016-07-07 17:14:41 +0200
commit34085b501d99bd0b185a4addb0577330fa1f8356 (patch)
treecdb663e6bec5fcfa1a35c3471f72d535b4bdd48c
parent9858552d607f643db0385be2133a04dd4b5ff753 (diff)
downloadhaskell-34085b501d99bd0b185a4addb0577330fa1f8356.tar.gz
Correct the message displayed for syntax error (#12146)
-rw-r--r--compiler/rename/RnSource.hs4
-rw-r--r--testsuite/tests/ghci/scripts/T1914.stderr4
-rw-r--r--testsuite/tests/ghci/scripts/T6106.stderr4
-rw-r--r--testsuite/tests/rename/should_fail/T4042.stderr4
4 files changed, 8 insertions, 8 deletions
diff --git a/compiler/rename/RnSource.hs b/compiler/rename/RnSource.hs
index 4790adad1f..67cf7fd9f2 100644
--- a/compiler/rename/RnSource.hs
+++ b/compiler/rename/RnSource.hs
@@ -2114,8 +2114,8 @@ add gp loc (SpliceD splice@(SpliceDecl _ flag)) ds
; return (gp, Just (splice, ds)) }
where
- badImplicitSplice = text "Parse error: naked expression at top level"
- $$ text "Perhaps you intended to use TemplateHaskell"
+ badImplicitSplice = text "Parse error: module header, import declaration"
+ $$ text "or top-level declaration expected."
-- Class declarations: pull out the fixity signatures to the top
add gp@(HsGroup {hs_tyclds = ts, hs_fixds = fs}) l (TyClD d) ds
diff --git a/testsuite/tests/ghci/scripts/T1914.stderr b/testsuite/tests/ghci/scripts/T1914.stderr
index b6357f2a8b..6dd83fab58 100644
--- a/testsuite/tests/ghci/scripts/T1914.stderr
+++ b/testsuite/tests/ghci/scripts/T1914.stderr
@@ -1,4 +1,4 @@
T1914A.hs:1:38:
- Parse error: naked expression at top level
- Perhaps you intended to use TemplateHaskell
+ Parse error: module header, import declaration
+ or top-level declaration expected.
diff --git a/testsuite/tests/ghci/scripts/T6106.stderr b/testsuite/tests/ghci/scripts/T6106.stderr
index ad925244a2..7023e2f709 100644
--- a/testsuite/tests/ghci/scripts/T6106.stderr
+++ b/testsuite/tests/ghci/scripts/T6106.stderr
@@ -1,4 +1,4 @@
T6106.hs:1:1:
- Parse error: naked expression at top level
- Perhaps you intended to use TemplateHaskell
+ Parse error: module header, import declaration
+ or top-level declaration expected.
diff --git a/testsuite/tests/rename/should_fail/T4042.stderr b/testsuite/tests/rename/should_fail/T4042.stderr
index a00cec60e3..65d737b6bd 100644
--- a/testsuite/tests/rename/should_fail/T4042.stderr
+++ b/testsuite/tests/rename/should_fail/T4042.stderr
@@ -1,4 +1,4 @@
T4042.hs:6:1:
- Parse error: naked expression at top level
- Perhaps you intended to use TemplateHaskell
+ Parse error: module header, import declaration
+ or top-level declaration expected.