Fix overloading of functions with unnamed arguments (specifically for prefer params=single-object)
This commit is contained in:
committed by
Steve Chavez
parent
b091586394
commit
e08bb3a197
@@ -153,6 +153,7 @@ decodeProcs =
|
||||
parseArgs :: Text -> [PgArg]
|
||||
parseArgs = mapMaybe parseArg . filter (not . isPrefixOf "OUT" . toS) . map strip . split (==',')
|
||||
|
||||
-- TODO: does parseArg properly handle unnamed "character varying" arguments or arguments with spaces in their names?
|
||||
parseArg :: Text -> Maybe PgArg
|
||||
parseArg arg =
|
||||
let isVariadic = isPrefixOf "VARIADIC " $ toS arg
|
||||
@@ -161,7 +162,9 @@ decodeProcs =
|
||||
(body, def) = breakOn " DEFAULT " argNoMode
|
||||
(name, typ) = breakOn " " body in
|
||||
if T.null typ
|
||||
then Nothing
|
||||
-- Handle unnamed args. TODO: refactor to types
|
||||
then Just $
|
||||
PgArg mempty (strip name) (T.null def) isVariadic
|
||||
else Just $
|
||||
PgArg (dropAround (== '"') name) (strip typ) (T.null def) isVariadic
|
||||
|
||||
|
||||
Reference in New Issue
Block a user