summaryrefslogtreecommitdiff
path: root/testsuite/tests/ghci/should_run
diff options
context:
space:
mode:
authorAdam Gundry <adam@well-typed.com>2016-02-01 16:41:03 +0100
committerBen Gamari <ben@smart-cactus.org>2016-02-01 22:12:52 +0100
commitdd0b7c78f64f2498594d3ef89d3bf884402f14d9 (patch)
tree792e32b256531c2593e37de30a80f43692e2ded0 /testsuite/tests/ghci/should_run
parent73293109645efe42bf3fdf3335f4ab7cef39001b (diff)
downloadhaskell-dd0b7c78f64f2498594d3ef89d3bf884402f14d9.tar.gz
Avoid mangled/derived names in GHCi autocomplete (fixes #11328)
This changes `getRdrNamesInScope` to use field labels rather than selector names for fields from modules with `DuplicateRecordFields` enabled. Moreover, it filters out derived names (e.g. type representation bindings) that shouldn't show up in autocomplete. Test Plan: New test ghci/should_run/T11328 Reviewers: kolmodin, austin, bgamari, simonpj Reviewed By: bgamari, simonpj Subscribers: simonpj, thomie Differential Revision: https://phabricator.haskell.org/D1870 GHC Trac Issues: #11328
Diffstat (limited to 'testsuite/tests/ghci/should_run')
-rw-r--r--testsuite/tests/ghci/should_run/T11328.script4
-rw-r--r--testsuite/tests/ghci/should_run/T11328.stdout5
-rw-r--r--testsuite/tests/ghci/should_run/all.T1
3 files changed, 10 insertions, 0 deletions
diff --git a/testsuite/tests/ghci/should_run/T11328.script b/testsuite/tests/ghci/should_run/T11328.script
new file mode 100644
index 0000000000..410e4b7f47
--- /dev/null
+++ b/testsuite/tests/ghci/should_run/T11328.script
@@ -0,0 +1,4 @@
+:seti -XDuplicateRecordFields
+data T = MkT { foo :: Int }
+:complete repl "foo"
+:complete repl "$"
diff --git a/testsuite/tests/ghci/should_run/T11328.stdout b/testsuite/tests/ghci/should_run/T11328.stdout
new file mode 100644
index 0000000000..272da7975c
--- /dev/null
+++ b/testsuite/tests/ghci/should_run/T11328.stdout
@@ -0,0 +1,5 @@
+1 1 ""
+"foo"
+2 2 ""
+"$"
+"$!"
diff --git a/testsuite/tests/ghci/should_run/all.T b/testsuite/tests/ghci/should_run/all.T
index 68c74072f6..930f14b7a1 100644
--- a/testsuite/tests/ghci/should_run/all.T
+++ b/testsuite/tests/ghci/should_run/all.T
@@ -22,3 +22,4 @@ test('T9914', just_ghci, ghci_script, ['T9914.script'])
test('T9915', just_ghci, ghci_script, ['T9915.script'])
test('T10145', just_ghci, ghci_script, ['T10145.script'])
test('T7253', just_ghci, ghci_script, ['T7253.script'])
+test('T11328', just_ghci, ghci_script, ['T11328.script'])