summaryrefslogtreecommitdiff
path: root/testsuite/tests/rename
diff options
context:
space:
mode:
authorAlina Banerjee <alina@glitchgirl.us>2021-08-05 08:08:31 +0000
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-08-11 18:15:05 -0400
commit100ffe75f509a73f1b26e768237888646f522b6c (patch)
tree56702bfdf582572a41b1bfbe9b066039023c0f95 /testsuite/tests/rename
parentf5fdace5613914724eb00bcf7547c82f3ad12686 (diff)
downloadhaskell-100ffe75f509a73f1b26e768237888646f522b6c.tar.gz
Modify InlineSpec data constructor (helps fix #18138)
The inl_inline field of the InlinePragma record is modified to store pragma source text by adding a data constructor of type SourceText. This can help in tracking the actual text of pragma names. Add/modify functions, modify type instance for InlineSpec type Modify parser, lexer to handle InlineSpec constructors containing SourceText Modify functions with InlineSpec type Extract pragma source from InlineSpec for SpecSig, InlineSig types Modify cvtInline function to add SourceText to InlineSpec type Extract name for InlineSig, SpecSig from pragma, SpectInstSig from source (fixes #18138) Extract pragma name for SpecPrag pragma, SpecSig signature Add Haddock annotation for inlinePragmaName function Add Haddock annotations for using helper functions in hsSigDoc Remove redundant ppr in pragma name for SpecSig, InlineSig; update comment Rename test to T18138 for misplaced SPECIALIZE pragma testcase
Diffstat (limited to 'testsuite/tests/rename')
-rw-r--r--testsuite/tests/rename/should_fail/Misplaced.stderr4
-rw-r--r--testsuite/tests/rename/should_fail/T18138.hs (renamed from testsuite/tests/rename/should_fail/Misplaced.hs)0
-rw-r--r--testsuite/tests/rename/should_fail/T18138.stderr4
-rw-r--r--testsuite/tests/rename/should_fail/all.T2
4 files changed, 5 insertions, 5 deletions
diff --git a/testsuite/tests/rename/should_fail/Misplaced.stderr b/testsuite/tests/rename/should_fail/Misplaced.stderr
deleted file mode 100644
index 85f2d9e4e4..0000000000
--- a/testsuite/tests/rename/should_fail/Misplaced.stderr
+++ /dev/null
@@ -1,4 +0,0 @@
-
-Misplaced.hs:4:1: error:
- Misplaced {-# SPECIALISE instance pragma:
- {-# SPECIALISE instance Eq (T Int) #-}
diff --git a/testsuite/tests/rename/should_fail/Misplaced.hs b/testsuite/tests/rename/should_fail/T18138.hs
index ef4aa7ff9a..ef4aa7ff9a 100644
--- a/testsuite/tests/rename/should_fail/Misplaced.hs
+++ b/testsuite/tests/rename/should_fail/T18138.hs
diff --git a/testsuite/tests/rename/should_fail/T18138.stderr b/testsuite/tests/rename/should_fail/T18138.stderr
new file mode 100644
index 0000000000..dea2871a51
--- /dev/null
+++ b/testsuite/tests/rename/should_fail/T18138.stderr
@@ -0,0 +1,4 @@
+
+T18138.hs:4:1: error:
+ Misplaced SPECIALISE instance pragma:
+ {-# SPECIALISE instance Eq (T Int) #-}
diff --git a/testsuite/tests/rename/should_fail/all.T b/testsuite/tests/rename/should_fail/all.T
index c25a7c3d92..6c2f0134a0 100644
--- a/testsuite/tests/rename/should_fail/all.T
+++ b/testsuite/tests/rename/should_fail/all.T
@@ -79,7 +79,6 @@ test('T5385', [], multimod_compile_fail, ['T5385', '-v0'])
test('T5513', normal, compile_fail, [''])
test('T5533', normal, compile_fail, [''])
test('T5589', normal, compile_fail, [''])
-test('Misplaced', normal, compile_fail, [''])
test('T5657', normal, compile_fail, [''])
test('T5745', [], multimod_compile_fail, ['T5745', '-v0'])
test('T5892a', normal, compile_fail, ['-package containers'])
@@ -179,3 +178,4 @@ test('T19843k', normal, compile_fail, [''])
test('T19843l', normal, compile_fail, [''])
test('T19843m', normal, compile_fail, [''])
test('T11167_ambig', normal, compile_fail, [''])
+test('T18138', normal, compile_fail, [''])