haskell-suite/haskell-src-exts

Parse error for operator `(@:)` when `TypeApplications` is enabled

autotaker opened this issue · 1 comments

The following code is acceptable for GHC-8.6.3 but HSE cannot parse it.

{-# LANGUAGE TypeApplications #-}
(@:) a b = a
$ cabal new-repl --build-depends "haskell-src-exts == 1.21.0"
Resolving dependencies...
Build profile: -w ghc-8.6.3 -O1
In order, the following will be built (use -v for more details):
 - fake-package-0 (lib) (first run)
Configuring library for fake-package-0..
Preprocessing library for fake-package-0..
Warning: No exposed modules
GHCi, version 8.6.3: http://www.haskell.org/ghc/  :? for help
Prelude Language.Haskell.Exts> parseFileContents "{-# LANGUAGE TypeApplications #-}\n(@:) a b = a\n"
ParseFailed (SrcLoc "<unknown>.hs" 2 3) "Parse error: :"

If TypeApplications is disabled, HSE can parse it.

{-# LANGUAGE NoTypeApplications #-}
(@:) a b = a -- HSE can parse this.

Interestingly, HSE can parse (@+) and (@=) even if TypeApplications is enabled.

{-# LANGUAGE TypeApplications #-}
(@+) a b = a -- OK
(@=) a b = a -- OK
(@:) a b = a -- Parse Error for HSE

I noticed that this is duplicated to #326. Sorry!