From 34085b501d99bd0b185a4addb0577330fa1f8356 Mon Sep 17 00:00:00 2001 From: Aditya Date: Sat, 25 Jun 2016 19:51:36 +0530 Subject: Correct the message displayed for syntax error (#12146) --- compiler/rename/RnSource.hs | 4 ++-- testsuite/tests/ghci/scripts/T1914.stderr | 4 ++-- testsuite/tests/ghci/scripts/T6106.stderr | 4 ++-- testsuite/tests/rename/should_fail/T4042.stderr | 4 ++-- 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. -- cgit v1.2.1