From f8bdf866653cb14450ad896cd9b6bdff761740c5 Mon Sep 17 00:00:00 2001 From: Matei Adriel Date: Thu, 9 Jul 2020 18:52:12 +0300 Subject: [PATCH] feat: an error for passing null to a function --- src/Data/Dataflow/Expression/Lint.purs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Data/Dataflow/Expression/Lint.purs b/src/Data/Dataflow/Expression/Lint.purs index 554092a..9af963a 100644 --- a/src/Data/Dataflow/Expression/Lint.purs +++ b/src/Data/Dataflow/Expression/Lint.purs @@ -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) @@ -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