Opened 6 years ago

Closed 6 years ago

#8246 closed bug (fixed)

Role annotations does not allow the use of parenthesis

Reported by: DaniilFrumin Owned by: goldfire
Priority: normal Milestone:
Component: Compiler (Parser) Version: 7.7
Keywords: roles 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

There is an inconsistency in roles/kinds annotations wrt parenthesis.

For example, the following code compiles just fine

data A (a::*) = A

unlike this code

data A (a@R) = A

which results in a compilation error:

Unexpected type `a@R' where type variable expected

In the declaration of `A (a@R)'

As Austin Seipp has pointed out, it boils down to simply: 'data A (a) = A'

This also prompts for further discussion about role annotations in presence of kind annotations [1]. For example, should '((a :: *)@R)' be a correct annotation?

Related (?) ticket: #8185

Change History (3)

comment:1 Changed 6 years ago by goldfire

Owner: set to goldfire

Thanks for this report. I'll make sure to fix in the general annotation syntax overhaul from #8185.

comment:2 Changed 6 years ago by Richard Eisenberg <eir@…>

In f4046b508a5a71ff2e28f438b30048867dbad428/ghc:

Change role annotation syntax.

This fixes bugs #8185, #8234, and #8246. The new syntax is explained
in the comments to #8185, appears in the "Roles" subsection of the
manual, and on the [wiki:Roles] wiki page.

This change also removes the ability for a role annotation on type
synonyms, as noted in #8234.

comment:3 Changed 6 years ago by goldfire

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.