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

Typecheck fail with (bind) #1267

Open
CryptoPascal31 opened this issue Aug 3, 2023 · 2 comments
Open

Typecheck fail with (bind) #1267

CryptoPascal31 opened this issue Aug 3, 2023 · 2 comments
Labels
FV Formal verification

Comments

@CryptoPascal31
Copy link
Contributor

CryptoPascal31 commented Aug 3, 2023

Issue description

Typecheck fails with some trivial examples when using (bind)

Steps to reproduce

(module A G
   (defcap G() true)
   (defun get-data:integer () 
       (bind {'a:3} {'a:=val} 
          val))
)
pact> (typecheck 'A)
"Typecheck A: Unable to resolve all types"
<interactive>:3:34:OutputFailure: Unable to resolve type (TySchema {_tySchema = TyObject, _tySchemaType = TyVar {_tyVar = SchemaVar {_tvName = "bind3_row"}}, _tySchemaPartial = FullSchema})
<interactive>:3:41:OutputFailure: Unable to resolve type (TySchema {_tySchema = TyBinding, _tySchemaType = TyVar {_tyVar = SchemaVar {_tvName = "bind3_row"}}, _tySchemaPartial = FullSchema})

One other real-life example (extract data from the transaction)

(module A G
   (defcap G() true)
   (defun get-data:string () 
       (bind (read-msg) {'a:=val} 
          val))
)

Does not work either

Expected Behavior

I expect typecheck to work in those cases, which are 100% correct Pact examples.

@emilypi
Copy link
Member

emilypi commented Aug 10, 2023

Thanks @CryptoPascal31 - we're looking into it.

@jmcardon jmcardon added the FV Formal verification label Aug 31, 2023
@aserranoni
Copy link
Contributor

I have a similar problem with the where and at functions. You can look at this gist for an example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FV Formal verification
Projects
None yet
Development

No branches or pull requests

4 participants