Skip to content
This repository has been archived by the owner on Mar 4, 2024. It is now read-only.

Commit

Permalink
feat: an error for passing null to a function
Browse files Browse the repository at this point in the history
  • Loading branch information
prescientmoon committed Jul 9, 2020
1 parent 3574486 commit f8bdf86
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Data/Dataflow/Expression/Lint.purs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import Lunarbox.Data.Dataflow.Expression (Expression(..), VarName, foldExpressio

data LintError l
= UnusedDeclaration VarName l
| UnsaturatedFunction l l

-- | Collect linting errors inside an expression
lint :: forall l. Expression l -> Array (LintError l)
Expand All @@ -16,6 +17,10 @@ lint = foldExpression go
[ UnusedDeclaration name location
]

go (FunctionCall location _ (TypedHole argLocation)) =
[ UnsaturatedFunction location argLocation
]

go a = []

-- | Get all the places a variable is referenced in
Expand Down

0 comments on commit f8bdf86

Please sign in to comment.