I'm leaving out visit_fn (type checking user-defined functions) unimplemented due to lack of parsing support and more examples.
Some checks for me and the reviewers:
[x] I just realized the only working example: cargo run -- instr --script tests/scripts/fault_injection/dfinity/dfinity_async_strcmp_fn.mm --app tests/apps/dfinity/users.wasm requires me to typecheck strcmp((arg0, arg1), "bookings"). Extend Option<DataType> to have AssumeGood field.
Now I have fake support for this. The issues are:
I can't really put AssumeGood in DataType::Tuple since AssumeGood is defined one level above. We might want to extend DataType to have the AssumeGood field
I don't know how to find the return type of a function call in Record::Fn
[x] Check if I used enter_named_scope correctly (to skip the scopes of compiler provided Fns).
[ ] Now the type checker rejects a lot of code since it performs environment lookup. Might want to add more examples of valid scripts here.
[x] change type checking error to fatal (should I?) (NO)
[x] Add ret_ty to Record::Fn
[x] delegate AssumeGood to parser::types::Datatype
Supporting some basic type checking #4
I'm leaving out
visit_fn
(type checking user-defined functions) unimplemented due to lack of parsing support and more examples.Some checks for me and the reviewers:
cargo run -- instr --script tests/scripts/fault_injection/dfinity/dfinity_async_strcmp_fn.mm --app tests/apps/dfinity/users.wasm
requires me to typecheckstrcmp((arg0, arg1), "bookings")
. ExtendOption<DataType>
to haveAssumeGood
field.Now I have fake support for this. The issues are:
I can't really put
AssumeGood
inDataType::Tuple
sinceAssumeGood
is defined one level above. We might want to extendDataType
to have theAssumeGood
fieldI don't know how to find the return type of a function call in
Record::Fn
[x] Check if I used
enter_named_scope
correctly (to skip the scopes of compiler providedFns
).[ ] Now the type checker rejects a lot of code since it performs environment lookup. Might want to add more examples of valid scripts here.
[x] change type checking error to fatal (should I?) (NO)
[x] Add
ret_ty
toRecord::Fn
[x] delegate
AssumeGood
toparser::types::Datatype