summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--compiler/GHC/Parser.y2
-rw-r--r--testsuite/tests/ghci/T18060/T18060.script2
-rw-r--r--testsuite/tests/ghci/T18060/T18060.stdout12
-rw-r--r--testsuite/tests/ghci/T18060/all.T1
4 files changed, 17 insertions, 0 deletions
diff --git a/compiler/GHC/Parser.y b/compiler/GHC/Parser.y
index 00ea6fbda8..6dde13f7a9 100644
--- a/compiler/GHC/Parser.y
+++ b/compiler/GHC/Parser.y
@@ -644,6 +644,8 @@ identifier :: { Located RdrName }
| qconop { $1 }
| '(' '->' ')' {% ams (sLL $1 $> $ getRdrName funTyCon)
[mop $1,mu AnnRarrow $2,mcp $3] }
+ | '->' {% ams (sLL $1 $> $ getRdrName funTyCon)
+ [mu AnnRarrow $1] }
-----------------------------------------------------------------------------
-- Backpack stuff
diff --git a/testsuite/tests/ghci/T18060/T18060.script b/testsuite/tests/ghci/T18060/T18060.script
new file mode 100644
index 0000000000..1206525a47
--- /dev/null
+++ b/testsuite/tests/ghci/T18060/T18060.script
@@ -0,0 +1,2 @@
+:i ->
+:i ~
diff --git a/testsuite/tests/ghci/T18060/T18060.stdout b/testsuite/tests/ghci/T18060/T18060.stdout
new file mode 100644
index 0000000000..9d6ab23dba
--- /dev/null
+++ b/testsuite/tests/ghci/T18060/T18060.stdout
@@ -0,0 +1,12 @@
+type (->) :: * -> * -> *
+data (->) a b
+ -- Defined in ‘GHC.Prim’
+infixr -1 ->
+instance Applicative ((->) r) -- Defined in ‘GHC.Base’
+instance Functor ((->) r) -- Defined in ‘GHC.Base’
+instance Monad ((->) r) -- Defined in ‘GHC.Base’
+instance Monoid b => Monoid (a -> b) -- Defined in ‘GHC.Base’
+instance Semigroup b => Semigroup (a -> b) -- Defined in ‘GHC.Base’
+type (~) :: forall k. k -> k -> Constraint
+class (a ~ b) => (~) a b
+ -- Defined in ‘GHC.Types’
diff --git a/testsuite/tests/ghci/T18060/all.T b/testsuite/tests/ghci/T18060/all.T
new file mode 100644
index 0000000000..5d6cf4299f
--- /dev/null
+++ b/testsuite/tests/ghci/T18060/all.T
@@ -0,0 +1 @@
+test('T18060', normal, ghci_script, ['T18060.script'])