Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 30281 #515

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{-# LANGUAGE DerivingStrategies #-}

module DerivingStrategies where

data Foo = Foo
deriving Eq
deriving Ord
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module Deriving-DerivingStrategies where

data Foo = Foo
deriving Eq
deriving Ord
4 changes: 4 additions & 0 deletions message-index/messages/GHC-30281/deriving-strategies/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
title: Resolve by using the `DerivingStrategies` language extension
order: 2
---
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module Tuple where

data Foo = Foo
deriving (Eq, Show)
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module Tuple where

data Foo = Foo
deriving Eq
deriving Show
4 changes: 4 additions & 0 deletions message-index/messages/GHC-30281/deriving-tuple/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
title: Resolve by `deriving` a tuple of type classes
order: 1
---
14 changes: 14 additions & 0 deletions message-index/messages/GHC-30281/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
title: Multiple `deriving` clauses
summary: Multiple `deriving` clauses are not allowed.
severity: error
introduced: 9.6.1
---

Using the `deriving` clause multiple times on the same `data` or `newtype` definition is illegal.

Can be resolved by either:

- Using deriving with a tuple (`deriving (Eq, Ord)`)
- Using the `DerivingStrategies` language extension

Loading