Opened 16 months ago

Last modified 15 months ago

#12446 new bug

Doesn't suggest TypeApplications when `~` used prefix

Reported by: Iceland_jack Owned by:
Priority: normal Milestone:
Component: Compiler Version: 8.0.1
Keywords: TypeApplications Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

Description

$ ghci -ignore-dot-ghci
GHCi, version 8.0.1: http://www.haskell.org/ghc/  :? for help
Prelude> :t undefined @(_ ~ _)

<interactive>:1:1: error:
    Pattern syntax in expression context: undefined@(_ (~(_)))
    Did you mean to enable TypeApplications?

It is suggested with non-~ type operators

Prelude> :t undefined @((+) _ _)

<interactive>:1:1: error:
    Pattern syntax in expression context: undefined@((+) (_) (_))
    Did you mean to enable TypeApplications?

but not with

Prelude> :t undefined @((~) _ _)

<interactive>:1:15: error: parse error on input ‘)’

Change History (3)

comment:1 Changed 15 months ago by simonpj

That does look odd. Any volunteers to investigate and fix?

comment:2 Changed 15 months ago by bgamari

I suspect the problem is that ~ simply isn't a valid constructor lexeme. For instance,

λ> import Lexeme
λ> import FastString
λ> isLexCon $ fsLit "~"
False

The lexer probably implements the same grammar, hence the parse error.

Last edited 15 months ago by bgamari (previous) (diff)

comment:3 Changed 15 months ago by goldfire

Keywords: TypeApplications added
Note: See TracTickets for help on using tickets.