summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorAlan Zimmerman <alan.zimm@gmail.com>2020-10-03 19:49:50 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-10-07 15:02:10 -0400
commitd6dff830754a97220eacf032c32cd54b18654917 (patch)
tree6cbe21b946af31e975c602f0bfc12e06cac7eb68 /testsuite
parent0e8b923d3c8a5ff415091b92c4c7b7e1e33d0ae6 (diff)
downloadhaskell-d6dff830754a97220eacf032c32cd54b18654917.tar.gz
Preserve as-parsed arrow type for HsUnrestrictedArrow
When linear types are disabled, HsUnrestrictedArrow is treated as HslinearArrow. Move this adjustment into the type checking phase, so that the parsed source accurately represents the source as parsed. Closes #18791
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/tests/haddock/should_compile_flag_haddock/T17544_kw.stderr2
-rw-r--r--testsuite/tests/parser/should_compile/DumpRenamedAst.stderr2
-rw-r--r--testsuite/tests/printer/T18791.hs5
-rw-r--r--testsuite/tests/printer/T18791.stderr63
-rw-r--r--testsuite/tests/printer/all.T1
5 files changed, 71 insertions, 2 deletions
diff --git a/testsuite/tests/haddock/should_compile_flag_haddock/T17544_kw.stderr b/testsuite/tests/haddock/should_compile_flag_haddock/T17544_kw.stderr
index 146b686357..2681ca9fb9 100644
--- a/testsuite/tests/haddock/should_compile_flag_haddock/T17544_kw.stderr
+++ b/testsuite/tests/haddock/should_compile_flag_haddock/T17544_kw.stderr
@@ -85,7 +85,7 @@
(Nothing)
(PrefixCon
[(HsScaled
- (HsLinearArrow)
+ (HsUnrestrictedArrow)
({ T17544_kw.hs:19:18-19 }
(HsTupleTy
(NoExtField)
diff --git a/testsuite/tests/parser/should_compile/DumpRenamedAst.stderr b/testsuite/tests/parser/should_compile/DumpRenamedAst.stderr
index 220a2ecd0b..4b5c58d43b 100644
--- a/testsuite/tests/parser/should_compile/DumpRenamedAst.stderr
+++ b/testsuite/tests/parser/should_compile/DumpRenamedAst.stderr
@@ -370,7 +370,7 @@
(Nothing)
(PrefixCon
[(HsScaled
- (HsLinearArrow)
+ (HsUnrestrictedArrow)
({ DumpRenamedAst.hs:19:10-34 }
(HsParTy
(NoExtField)
diff --git a/testsuite/tests/printer/T18791.hs b/testsuite/tests/printer/T18791.hs
new file mode 100644
index 0000000000..c79204aa55
--- /dev/null
+++ b/testsuite/tests/printer/T18791.hs
@@ -0,0 +1,5 @@
+{-# LANGUAGE GADTs #-}
+module T18791 where
+
+data T where
+ MkT :: Int -> T
diff --git a/testsuite/tests/printer/T18791.stderr b/testsuite/tests/printer/T18791.stderr
new file mode 100644
index 0000000000..00f8efc801
--- /dev/null
+++ b/testsuite/tests/printer/T18791.stderr
@@ -0,0 +1,63 @@
+
+==================== Parser AST ====================
+
+({ T18791.hs:1:1 }
+ (HsModule
+ (VirtualBraces
+ (1))
+ (Just
+ ({ T18791.hs:2:8-13 }
+ {ModuleName: T18791}))
+ (Nothing)
+ []
+ [({ T18791.hs:(4,1)-(5,17) }
+ (TyClD
+ (NoExtField)
+ (DataDecl
+ (NoExtField)
+ ({ T18791.hs:4:6 }
+ (Unqual
+ {OccName: T}))
+ (HsQTvs
+ (NoExtField)
+ [])
+ (Prefix)
+ (HsDataDefn
+ (NoExtField)
+ (DataType)
+ ({ <no location info> }
+ [])
+ (Nothing)
+ (Nothing)
+ [({ T18791.hs:5:3-17 }
+ (ConDeclGADT
+ (NoExtField)
+ [({ T18791.hs:5:3-5 }
+ (Unqual
+ {OccName: MkT}))]
+ ({ T18791.hs:5:10-17 }
+ (False))
+ []
+ (Nothing)
+ (PrefixCon
+ [(HsScaled
+ (HsUnrestrictedArrow)
+ ({ T18791.hs:5:10-12 }
+ (HsTyVar
+ (NoExtField)
+ (NotPromoted)
+ ({ T18791.hs:5:10-12 }
+ (Unqual
+ {OccName: Int})))))])
+ ({ T18791.hs:5:17 }
+ (HsTyVar
+ (NoExtField)
+ (NotPromoted)
+ ({ T18791.hs:5:17 }
+ (Unqual
+ {OccName: T}))))
+ (Nothing)))]
+ ({ <no location info> }
+ [])))))]
+ (Nothing)
+ (Nothing))) \ No newline at end of file
diff --git a/testsuite/tests/printer/all.T b/testsuite/tests/printer/all.T
index 9e62577855..2c605be5b8 100644
--- a/testsuite/tests/printer/all.T
+++ b/testsuite/tests/printer/all.T
@@ -58,3 +58,4 @@ test('T14343b', normal, compile_fail, [''])
test('T15761', normal, compile_fail, [''])
test('T18052a', normal, compile,
['-ddump-simpl -ddump-types -dno-typeable-binds -dsuppress-uniques'])
+test('T18791', normal, compile, ['-ddump-parsed-ast'])