Opened 6 years ago

Closed 6 years ago

#5492 closed bug (invalid)

Underscore not a valid name for a class member

Reported by: trinithis Owned by:
Priority: normal Milestone:
Component: Compiler Version: 7.0.4
Keywords: underscore _ Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: GHC rejects valid program Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


The following program is rejected:

class Foo a where
  _ :: a

Note I could only reproduce when using a single underscore character. Multiple underscores work fine. Mixing underscores with other identifier characters works as well.

Change History (2)

comment:1 Changed 6 years ago by trinithis

Type of failure: None/UnknownGHC rejects valid program

comment:2 Changed 6 years ago by simonpj

Resolution: invalid
Status: newclosed

"_" is a pattern, not an identifier. So it's rightly rejected. Have a look at the Report.

Note: See TracTickets for help on using tickets.