diff --git a/testsuite/tests/ghci/scripts/T8931.script b/testsuite/tests/ghci/scripts/T8931.script
new file mode 100644
index 0000000000000000000000000000000000000000..152747681c0017e44b02d986da37e40e5f65e896
--- /dev/null
+++ b/testsuite/tests/ghci/scripts/T8931.script
@@ -0,0 +1,3 @@
+:m +Data.Typeable
+let {f :: Typeable a => (a->Bool) -> Bool; f _ = True}
+f (\x -> (x == 3))
diff --git a/testsuite/tests/ghci/scripts/T8931.stdout b/testsuite/tests/ghci/scripts/T8931.stdout
new file mode 100644
index 0000000000000000000000000000000000000000..0ca95142bb715442d0c2c82a7c573a08c4593845
--- /dev/null
+++ b/testsuite/tests/ghci/scripts/T8931.stdout
@@ -0,0 +1 @@
+True
diff --git a/testsuite/tests/ghci/scripts/all.T b/testsuite/tests/ghci/scripts/all.T
index e985ce112eff4865b7d6edf978057fac4a1818a6..6991603563bfba3bc2e674c14daa13172cb3e371 100755
--- a/testsuite/tests/ghci/scripts/all.T
+++ b/testsuite/tests/ghci/scripts/all.T
@@ -169,3 +169,4 @@ test('T8696', normal, ghci_script, ['T8696.script'])
 test('T8776', normal, ghci_script, ['T8776.script'])
 test('T8831', normal, ghci_script, ['T8831.script'])
 test('T8917', normal, ghci_script, ['T8917.script'])
+test('T8931', normal, ghci_script, ['T8931.script'])