pact
pact copied to clipboard
Typechecker issue with select
(defschema loan-history
"Row type for loan transaction"
id:integer
loanId:string
userFullname:string
borrower:string
seller:string
investor:string
loanName:string
loanAmount:integer
attachment:list
price:integer
originalAmount:integer
availableAmount:integer
drawdownAmount:integer
dateOfDrawdown:time
vote:string
)
(defun read-history-for-loan(loanId:string)
"Read history of a loan."
(select loan-history-table (where "loanId" (= loanId))))
In the above snippet, type specification was expected to be unnecessary in read-history-for-loan function becuase loanId's type is specified in the defschema. However, typechecker throws error when type is not specified. (this only happens if select is used inside the function)