diff options
author | Shayne Fletcher <shayne@shaynefletcher.org> | 2020-12-01 12:27:43 -0500 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-12-05 09:06:38 -0500 |
commit | 4a437bc19d2026845948356a932b2cac2417eb12 (patch) | |
tree | cc712e196b83e2d0873ee028f2c9d4ab9a08d346 /testsuite/tests/module | |
parent | 33ec3a0600fe8c009ab8ed6d86941a8fd88fb033 (diff) | |
download | haskell-4a437bc19d2026845948356a932b2cac2417eb12.tar.gz |
Fix bad span calculations of post qualified imports
Diffstat (limited to 'testsuite/tests/module')
-rw-r--r-- | testsuite/tests/module/all.T | 1 | ||||
-rw-r--r-- | testsuite/tests/module/mod185.hs | 5 | ||||
-rw-r--r-- | testsuite/tests/module/mod185.stderr | 62 |
3 files changed, 68 insertions, 0 deletions
diff --git a/testsuite/tests/module/all.T b/testsuite/tests/module/all.T index 7ca6d5d443..dd2d0ca727 100644 --- a/testsuite/tests/module/all.T +++ b/testsuite/tests/module/all.T @@ -268,6 +268,7 @@ test('mod181', normal, compile, ['']) test('mod182', normal, compile_fail, ['']) test('mod183', normal, compile_fail, ['']) test('mod184', normal, compile, ['-Wprepositive-qualified-module']) +test('mod185', normal, compile, ['-ddump-parsed-ast']) test('T1148', normal, compile, ['']) test('T1074', normal, compile, ['']) diff --git a/testsuite/tests/module/mod185.hs b/testsuite/tests/module/mod185.hs new file mode 100644 index 0000000000..f1b9860b2e --- /dev/null +++ b/testsuite/tests/module/mod185.hs @@ -0,0 +1,5 @@ +{-# LANGUAGE ImportQualifiedPost #-} +-- The span of the import decl should include the 'qualified' keyword. +import Prelude qualified + +main = Prelude.undefined diff --git a/testsuite/tests/module/mod185.stderr b/testsuite/tests/module/mod185.stderr new file mode 100644 index 0000000000..f2bb93c3e9 --- /dev/null +++ b/testsuite/tests/module/mod185.stderr @@ -0,0 +1,62 @@ +==================== Parser AST ==================== + +({ mod185.hs:1:1 } + (HsModule + (VirtualBraces + (1)) + (Nothing) + (Nothing) + [({ mod185.hs:3:1-24 } + (ImportDecl + (NoExtField) + (NoSourceText) + ({ mod185.hs:3:8-14 } + {ModuleName: Prelude}) + (Nothing) + (NotBoot) + (False) + (QualifiedPost) + (False) + (Nothing) + (Nothing)))] + [({ mod185.hs:5:1-24 } + (ValD + (NoExtField) + (FunBind + (NoExtField) + ({ mod185.hs:5:1-4 } + (Unqual + {OccName: main})) + (MG + (NoExtField) + ({ mod185.hs:5:1-24 } + [({ mod185.hs:5:1-24 } + (Match + (NoExtField) + (FunRhs + ({ mod185.hs:5:1-4 } + (Unqual + {OccName: main})) + (Prefix) + (NoSrcStrict)) + [] + (GRHSs + (NoExtField) + [({ mod185.hs:5:6-24 } + (GRHS + (NoExtField) + [] + ({ mod185.hs:5:8-24 } + (HsVar + (NoExtField) + ({ mod185.hs:5:8-24 } + (Qual + {ModuleName: Prelude} + {OccName: undefined}))))))] + ({ <no location info> } + (EmptyLocalBinds + (NoExtField))))))]) + (FromSource)) + [])))] + (Nothing) + (Nothing))) |