Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unannotated return type checks to match prod core behavior #41

Merged
merged 1 commit into from
Dec 13, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 2 additions & 14 deletions pact-core/Pact/Core/IR/Desugar.hs
Original file line number Diff line number Diff line change
Expand Up @@ -476,25 +476,13 @@ desugarIfDef
=> Lisp.IfDef i
-> RenamerT b i m (IfDef ParsedName DesugarType b i)
desugarIfDef = \case
Lisp.IfDfun (Lisp.IfDefun n margs rty _ _ i) -> IfDfun <$> case margs of
[] -> do
pure $ IfDefun n [] rty i
_ -> do
let args = toArg <$> margs
rty' <- maybe (throwDesugarError (UnannotatedReturnType n) i) pure rty
pure $ IfDefun n args (Just rty') i
Lisp.IfDfun (Lisp.IfDefun n margs rty _ _ i) -> pure $ IfDfun $ IfDefun n (toArg <$> margs) rty i
-- Todo: check managed impl
Lisp.IfDCap (Lisp.IfDefCap n margs rty _ _ _meta i) -> IfDCap <$> do
let args = toArg <$> margs
pure $ IfDefCap n args rty i
Lisp.IfDConst dc -> IfDConst <$> desugarDefConst dc
Lisp.IfDPact (Lisp.IfDefPact n margs rty _ _ i) -> IfDPact <$> case margs of
[] -> do
pure $ IfDefPact n [] rty i
_ -> do
let args = toArg <$> margs
rty' <- maybe (throwDesugarError (UnannotatedReturnType n) i) pure rty
pure $ IfDefPact n args (Just rty') i
Lisp.IfDPact (Lisp.IfDefPact n margs rty _ _ i) -> pure $ IfDPact $ IfDefPact n (toArg <$> margs) rty i
Lisp.IfDSchema ds -> IfDSchema <$> desugarDefSchema ds

desugarDef
Expand Down