pact icon indicating copy to clipboard operation
pact copied to clipboard

Typechecker issue with select

Open ggobugi27 opened this issue 7 years ago • 0 comments

  (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)

ggobugi27 avatar Oct 25 '18 22:10 ggobugi27