Opened 3 years ago

Closed 3 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 Difficulty:
Test Case: Blocked By:
Blocking: Related Tickets:

Description

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 3 years ago by trinithis

  • Type of failure changed from None/Unknown to GHC rejects valid program

comment:2 Changed 3 years ago by simonpj

  • Resolution set to invalid
  • Status changed from new to closed

"_" 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.