-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
4 changed files
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
title: Type equality not in scope | ||
summary: The type equality operator has not been imported into the current module | ||
severity: warning | ||
flag: "-Wcompat" | ||
introduced: 9.6.1 | ||
--- | ||
|
||
In prior versions of GHC, the type equality operator `~` was built-in syntax. In more recent versions, it is an ordinary operator that is part of the `Prelude` and of `Data.Type.Equality`. Restricting imports from `Prelude` can result in `~` not being imported. For now, GHC has a compatibility warning to help migrate old code. In a future version of GHC, this warning will be an error. |
8 changes: 8 additions & 0 deletions
8
message-index/messages/GHC-12003/out-of-scope/after/TypeEqNotImported.hs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{-# LANGUAGE ExplicitNamespaces #-} | ||
{-# OPTIONS -Wcompat #-} | ||
module TypeEqNotImported where | ||
|
||
import Prelude (id, type (~)) | ||
|
||
f :: (a ~ b) => a -> b | ||
f = id |
8 changes: 8 additions & 0 deletions
8
message-index/messages/GHC-12003/out-of-scope/before/TypeEqNotImported.hs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
|
||
{-# OPTIONS -Wcompat #-} | ||
module TypeEqNotImported where | ||
|
||
import Prelude (id) | ||
|
||
f :: (a ~ b) => a -> b | ||
f = id |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
title: Type equality not imported from Prelude | ||
--- | ||
|
||
In this example, the type equality operator was not imported from the `Prelude`. To remove the warning, it must be imported. |