mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-24 03:52:50 -06:00
fix in the Haskell binding: functionType should throw error if the function is not defined
This commit is contained in:
@@ -149,7 +149,9 @@ functionType p fn =
|
|||||||
withGuPool $ \tmpPl -> do
|
withGuPool $ \tmpPl -> do
|
||||||
c_fn <- newUtf8CString fn tmpPl
|
c_fn <- newUtf8CString fn tmpPl
|
||||||
c_type <- pgf_function_type (pgf p) c_fn
|
c_type <- pgf_function_type (pgf p) c_fn
|
||||||
peekType c_type
|
if c_type == nullPtr
|
||||||
|
then throwIO (PGFError ("Function '"++fn++"' is not defined"))
|
||||||
|
else peekType c_type
|
||||||
where
|
where
|
||||||
peekType c_type = do
|
peekType c_type = do
|
||||||
cid <- (#peek PgfType, cid) c_type >>= peekUtf8CString
|
cid <- (#peek PgfType, cid) c_type >>= peekUtf8CString
|
||||||
|
|||||||
Reference in New Issue
Block a user