Verified Commit 162dff55 authored by Camil Staps's avatar Camil Staps 🚀

Show a warning when a macro has no @type

parent f6606482
......@@ -2,6 +2,7 @@ implementation module CloogleDBFactory
import StdArray
import StdBool
import StdDebug
import StdFile
from StdFunc import const, flip, id, o
import StdList
......@@ -286,6 +287,9 @@ where
pd_rewriterules dcl defs st
= [( setLine dcl pos {zero & name=Just id.id_name}
, let doc = findDoc hideIsUsedReturn parseFunctionDoc id st in
if (needsTypeWarning doc)
(trace_n $ "Doc warning: expected @type for '" +++ id.id_name +++ "'")
(\x->x)
{ zero
& fe_kind=Macro
, fe_type=getTypeDoc =<< doc
......@@ -309,6 +313,10 @@ where
| id`.id_name == id.id_name = Just pd
findTypeSpec id [_:defs] = findTypeSpec id defs
needsTypeWarning :: (Maybe Documentation) -> Bool
needsTypeWarning Nothing = True
needsTypeWarning (Just (FunctionDoc _ _ _ _ t)) = isNothing t
pd_derivations :: !Bool ![ParsedDefinition] -> [('DB'.Name, [('DB'.Type, String, LocationInModule)])]
pd_derivations dcl defs
= [( id.id_name, [('T'.toType gc_type, cpp gc_type, setLine dcl gc_pos zero)])
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment