-
Notifications
You must be signed in to change notification settings - Fork 563
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
43 changed files
with
645 additions
and
441 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,30 @@ | ||
-- @shouldWarnWith DuplicateExportRef | ||
-- @shouldWarnWith DuplicateExportRef | ||
-- @shouldWarnWith DuplicateExportRef | ||
-- @shouldWarnWith DuplicateExportRef | ||
-- @shouldWarnWith DuplicateExportRef | ||
-- @shouldWarnWith DuplicateExportRef | ||
-- @shouldWarnWith DuplicateExportRef | ||
module Main | ||
( X(X, X), X | ||
, fn, fn | ||
, (!), (!) | ||
, class Y, class Y | ||
, Natural, type (~>), type (~>) | ||
, module Prelude, module Prelude | ||
) where | ||
|
||
import Prelude (Unit) | ||
|
||
data X = X | ||
|
||
fn :: X -> X -> X | ||
fn _ _ = X | ||
|
||
infix 2 fn as ! | ||
|
||
class Y a | ||
|
||
type Natural f g = forall a. f a -> g a | ||
|
||
infixl 1 type Natural as ~> |
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,10 @@ | ||
-- @shouldWarnWith DuplicateImport | ||
module Main where | ||
|
||
import Prelude (Unit, unit, pure) | ||
import Prelude (Unit, unit, pure) | ||
|
||
import Control.Monad.Eff (Eff) | ||
|
||
main :: Eff () Unit | ||
main = pure unit |
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,18 @@ | ||
-- @shouldWarnWith DuplicateImportRef | ||
-- @shouldWarnWith DuplicateImportRef | ||
-- @shouldWarnWith DuplicateImportRef | ||
-- @shouldWarnWith DuplicateImportRef | ||
module Main where | ||
|
||
import Prelude | ||
( Unit, Unit | ||
, unit, unit | ||
, class Functor, class Functor | ||
, (<>), (<>) | ||
) | ||
|
||
u :: Unit | ||
u = unit <> unit | ||
|
||
fid :: forall f a. Functor f => f a -> f a | ||
fid fa = fa |
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,10 @@ | ||
-- @shouldWarnWith DuplicateSelectiveImport | ||
module Main where | ||
|
||
import Prelude (Unit, unit) | ||
import Prelude (pure) | ||
|
||
import Control.Monad.Eff (Eff) | ||
|
||
main :: Eff () Unit | ||
main = pure unit |
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 @@ | ||
-- @shouldWarnWith HidingImport | ||
-- @shouldWarnWith HidingImport | ||
module Main where | ||
|
||
import Prelude hiding (one) | ||
import Control.Monad.Eff hiding (runPure) | ||
|
||
main :: Eff () Unit | ||
main = pure unit |
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 @@ | ||
-- @shouldWarnWith ImplicitImport | ||
-- @shouldWarnWith ImplicitImport | ||
module Main where | ||
|
||
import Prelude | ||
import Control.Monad.Eff | ||
|
||
main :: Eff () Unit | ||
main = pure unit |
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,11 @@ | ||
-- @shouldWarnWith ImplicitQualifiedImport | ||
-- @shouldWarnWith ImplicitQualifiedImport | ||
module Main where | ||
|
||
import Data.Unit | ||
|
||
import Control.Monad.Eff as E | ||
import Control.Monad.Eff.Console as E | ||
|
||
main :: E.Eff (console :: E.CONSOLE) Unit | ||
main = E.log "test" |
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,4 @@ | ||
-- @shouldWarnWith MissingTypeDeclaration | ||
module Main where | ||
|
||
x = 0 |
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,17 @@ | ||
-- @shouldWarnWith OverlappingInstances | ||
module Main where | ||
|
||
class Test a where | ||
test :: a -> a | ||
|
||
instance testRefl :: Test a where | ||
test x = x | ||
|
||
instance testInt :: Test Int where | ||
test _ = 0 | ||
|
||
-- The OverlappingInstances instances warning only arises when there are two | ||
-- choices for a dictionary, not when the instances are defined. So without | ||
-- `value` this module would not raise a warning. | ||
value :: Int | ||
value = test 1 |
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,15 @@ | ||
-- @shouldWarnWith OverlappingPattern | ||
-- @shouldWarnWith OverlappingPattern | ||
module Main where | ||
|
||
data X = A | B | ||
|
||
pat1 :: X -> Boolean | ||
pat1 A = true | ||
pat1 A = true | ||
pat1 B = false | ||
|
||
pat2 :: X -> Boolean | ||
pat2 A = true | ||
pat2 _ = false | ||
pat2 B = false |
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,13 @@ | ||
-- @shouldWarnWith ScopeShadowing | ||
module Main where | ||
|
||
import Prelude | ||
|
||
-- No warning at the definition, only when the name is later resolved | ||
data Unit = Unit | ||
|
||
-- This is only a warning as the `Prelude` import is implicit. If `Unit` was | ||
-- named explicitly in an import list, then this refernce to `Unit` | ||
-- would be a `ScopeConflict` error instead. | ||
test :: Unit | ||
test = const Unit unit |
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 @@ | ||
-- @shouldWarnWith ShadowedTypeVar | ||
module Main where | ||
|
||
f :: forall a. (forall a. a -> a) -> a -> a | ||
f g x = g x |
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 @@ | ||
exports.out = null; |
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 @@ | ||
-- @shouldWarnWith UnnecessaryFFIModule | ||
module Main where | ||
|
||
t :: Boolean | ||
t = true |
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 @@ | ||
-- @shouldWarnWith UnusedDctorExplicitImport | ||
module Main where | ||
|
||
import Data.Ordering (Ordering(EQ, LT)) | ||
|
||
f :: Ordering -> Ordering | ||
f EQ = EQ | ||
f x = x |
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,7 @@ | ||
-- @shouldWarnWith UnusedDctorImport | ||
module Main where | ||
|
||
import Data.Ordering (Ordering(..)) | ||
|
||
f :: Ordering -> Ordering | ||
f x = x |
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,7 @@ | ||
-- @shouldWarnWith UnusedDctorImport | ||
module Main where | ||
|
||
import Data.Ordering (Ordering(EQ)) | ||
|
||
f :: Ordering -> Ordering | ||
f x = x |
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 @@ | ||
-- @shouldWarnWith UnusedExplicitImport | ||
module Main where | ||
|
||
import Prelude (Unit, unit, pure, bind) | ||
import Control.Monad.Eff (Eff) | ||
|
||
main :: Eff () Unit | ||
main = pure unit |
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,2 @@ | ||
exports.yes = true; | ||
exports.no = false; |
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,4 @@ | ||
-- @shouldWarnWith UnusedFFIImplementations | ||
module Main where | ||
|
||
foreign import yes :: Boolean |
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,14 @@ | ||
-- @shouldWarnWith UnusedImport | ||
-- @shouldWarnWith UnusedImport | ||
-- @shouldWarnWith UnusedImport | ||
module Main where | ||
|
||
import Data.Unit (Unit, unit) | ||
|
||
-- All of the below are unused | ||
import Control.Monad.Eff | ||
import Control.Monad.Eff.Console as Console | ||
import Test.Assert () | ||
|
||
main :: Unit | ||
main = unit |
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 @@ | ||
-- @shouldWarnWith UnusedTypeVar | ||
module Main where | ||
|
||
f :: forall a b. a -> a | ||
f x = x |
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,23 @@ | ||
-- @shouldWarnWith WildcardInferredType | ||
-- @shouldWarnWith WildcardInferredType | ||
-- @shouldWarnWith WildcardInferredType | ||
-- @shouldWarnWith WildcardInferredType | ||
module Main where | ||
|
||
x :: Int | ||
x = 0 :: _ | ||
|
||
y :: _ | ||
y = 0 | ||
|
||
z :: Int | ||
z = | ||
let n :: _ | ||
n = 0 | ||
in n | ||
|
||
w :: Int | ||
w = n | ||
where | ||
n :: _ | ||
n = 0 |
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
Oops, something went wrong.