* Add hole expressions
* Fix the issue of unreported holes
* Add tests
* New line in the end of the test file
* Update CHANGELOG
* Add hole expression to the docs
* Do not treat hole as a special type
* Update docs
* Update docs/sophia_features.md
Co-authored-by: Radosław Rowicki <35342116+radrow@users.noreply.github.com>
Co-authored-by: Radosław Rowicki <35342116+radrow@users.noreply.github.com>
* Ban calling contracts functions as functions namespaces
* Ban using contracts as namespaces
* Add tests
* Update CHANGELOG
* Separate guards with a semicolon
Add functions as fields before inferring
Unbound untyped fields before binding typed ones
Fix failing tests
Make complex_types contract non-compatible with aevm
Reduce code duplication
Undo changes to test.aes
Remove special handling of __constructor__ field
Resolve field constraint by arity of contract function
Update CHANGELOG
Update CHANGELOG.md
Co-authored-by: Radosław Rowicki <35342116+radrow@users.noreply.github.com>
Split bind_field function
Add a comment about rebinding
* Assume that void is a supertype of all types
* Add test for void supertype
* Unify functions with decls from implemented interfaces
* Rename delete_if_implementation
* Match only with function name and without typesig
* Move the missing_definition error to the type checker
* Move the parameterised_event and parameterised_state errors to the type checker
* Remove check_state_and_event_types from ast_to_fcode
* Move missing_init_function to the type checker
* Remove the code error last_declaration_must_be_main_contract
* Expand the tests for missing init function
* Remove found_void error
* Move the higher order entrypoint error to type checker
* Move invalid_aens_resolve_type error to type checker
* Add more tests for AENS.resolve
* Add test for AENS.resolve with using
* Move invalid_oracle_type error to type checker
* Move old code errors tests to compilable_contracts
* Remove the file aeso_code_errors.erl
* Add comment about state type
* Add polymorphism to syntax tree and parser
* Add polymorphism to infer types
* Fix pretty printing
* Add new tests and fix old tests
* Fix the comparison between unit and empty tuple
* Report undefined interface errors before checking implemented interfaces
* Add test for implementing multiple interfaces
* Add test for implementing two interfaces with entrypoints of same names and different types
* Add tests for interfaces implementing interfaces
* Draft: Add variance switching
* Revert "Draft: Add variance switching"
This reverts commit 92dc6ac169cfbff447ed59de04994f564876b3fb.
* Add variance switching
* Fix broken tests
* Fix broken abi tests
* Add tests for variance switching
* Fix tests after rebase
* Variance switching for custom datatypes
* Fix dialyzer warning
* Add testing for custom types variance switching
* Make opposite_variance a separate function
* Make is_subtype/4 a separate function
* Fix warning
* Mark tvars as invariant
* Add type_vars_uvar ets table to ets_tables()
* Don't destroy and recreate type errors table when not needed
* Fixes from the reviews
* Use is_list to check if a var is a list
* Compare named args in fun_t
* Test only for covariance and contravariance
* Remove arrows_in_type and use infer_type_vars_variance instead
* Add tests for option and type aliases
* Fix previous commit
* Rename check_implemented_interfaces_recursive to check_implemented_interfaces1
* Make interfaces declare functions from extended interfaces
* Restore test.aes
* Add test for variance switching in records
* Enable variance switching for record types
* Handle builtin types type variables separately
* Add tests for oracles and oracle queries
* Replace compare_types with non-throwing version of unify
* Add the context to unification error
* Test variance switching for bivariant records
* Give clear names to the records in records variance switching test
* Handle comments about polymorphism_variance_switching.aes
* Rename datatypes in custom types variance switching test for readability
* Change the variance of the oracle_query type vars
* Add test for accessing maps with the wrong type
* Default to invariant when the variance of the type vars is unknown
* Rename test files to have common prefix
* Rename functions in variance switching tests for readability
* Fix variance inference
* Eliminate redundant tests
* Test all cases for bivariant
* Fix stdlib warnings
* Mark unused includes when used from non-included files
* Do not mark indirectly included files as unused
* Show unused include warning only for files that are never used
* Remove unused include from Option.aes
* Consider functions passed as args as used
* Return warnings as a sorted list
* Fix failing tests
* Fix dialyzer warning
* Fix warning in Func.aes
* Add operator lambdas
* Do not register anonymous functions as called functions
* Add tests
* Update CHANGELOG
* Update the docs
* Do not allow (..) to be used as a lambda
* Rename the function sum to any
* Solve named argument constraints when record type dereferencing fails
* Revert "Solve named argument constraints when record type dereferencing fails"
This reverts commit ca38a171a9eefdddbc3f6a41f8a268c42662cd7a.
* Solve constraints together and in order
* Fix dialyzer warnings
* Add comment on solve_known_record_types
* Remove unused function
* Add compiler warnings
Add include_type annotation to position
Add warning for unused includes
Add warning for unused stateful annotation
Add warning for unused functions
Add warning for shadowed variables
Add division by zero warning
Add warning for negative spends
Add warning for unused variables
Add warning for unused parameters
Change the ets table type to set for unused vars
Add warning for unused type defs
Move unused variables warning to the top level
Temporarily disable unused functions warnings
Add all kinds of warnings to a single ets table
Enable warnings separately through options
Use when_option instead of enabled_warnings
Turn warnings into type errors with warn_error option
Enable warning package warn_all
Re-enable unused functions warnings
Report warnings as type errors in a separate function
Make unused_function a recognized warning
Report warnings as a result of compilation
Fix tests and error for unknown warnings options
Fix dialyzer warnings
Do not show warning for variables called "_"
Move warnings handling into a separate module
Do not show warning for unused public functions in namespaces
Add src file name to unused include warning
Mark public functions in namespaces as used
Add tests for added warnings
Add warning for unused return value
Add test for turning warnings into type errors
* Update CHANGELOG
* Add case guards to parser
* Add pattern guards to infer types and fcode generation
* Add functions guards
* Add test for patterns guards
* Update docs
* Update CHANGELOG.md
* Remove stateful context from Env for guards
* Elaborate on guards
* Add failing test for stateful pattern guards
* Implement multiple guards
* Fix tests
* Disable aevm related tests
* Split the sentence before if and otherwise
* Fix type in docs
* Implement multiple exprs in the same guard
* Fix pretty printing
* Change tests to include multiple guards
* Add test for non-boolean guards
* Desugar clauses with guards
* Fix incomplete patterns bug
* Fix docs
* Compile to icode when no guards are used
* Revert "Disable aevm related tests"
This reverts commit e828099bd97dffe11438f2e48f3a92ce3641e85b.
* Change syntax tree and parser
* Add assign pattern to type inference
* Use check_expr instead of hard-coded type
* Add fcode generation for assign pattern
* Implement rename_spat for assign pattern
* Add tests
* Update CHANGELOG.md
* Update docs and changelog
* Add letpat to aeso_syntax_utils:fold
* Use Plus instead of Scoped
* Add using namespace as to scanner and parser
* Change the alias from id() to con()
* Add using namespace to AST type inference
* Allow using namespace to appear in the top level
* Allow using namespace to appear inside functions
* Add a compiler test for using namespace
* Handle name collisions
* Implement mk_error for ambiguous_name
* Add failing test for ambiguous names
* Limit the scope of the used namespaces
* Add test for wrong scope of using namespace
* Use a single using declaration
* Split long line
* Forbid using undefined namespaces
* Add a test for using undefined namespaces
* Change the type of used_namespaces
* Add using namespace parts to scanner and parser
* Add using namespace parts to ast type inference
* Add tests for using namespace parts
* Update CHANGELOG.md
* Code cleaning
* Update the docs
* Update the docs about the same alias for multiple namespaces
* Support for CREATE, CLONE and BYTECODE_HASH
* Add missing files
* Pushed the clone example through the typechecker
* CLONE compiles
* Fix dependent type in CLONE
* Bytecode hash fixes
* Refactor
* Refactor 2
* move some logic away
* Fixed some error messages. Type inference of child contract still does some random shit\n(mistakes arguments with result type)
* CREATE sometimes compiles and sometimes not
* Fix some scoping/constraint issues
* works, needs cleanup
* cleanup
* Fix some tests. Remove optimization of singleton tuples
* Fix default argument for clone
* Cleanup
* CHANGELOG
* Mention void type
* Address review, fix some dialyzer errors
* Please dialyzer
* Fix failing tests
* Write negative tests
* Docs
* TOC
* missing 'the'
* missing 'the'
* missing 'the'
* missing 'the'
* mention pre-fund
* format
* pre-fund clarification
* format
* Grammar in docs
* Updated tests, banned type decls and toplevel letvals
* Properly ban nested contracts
* Fix including by path
* Fix error message test
* Fix prettpr attr display. Make dialyzer happy
* More tests
* Fixed type printing
* Updated docs
Also handle `\x{hhh..}` in strings... Character literals has to be a single character, not composite.
+ tests (and the corresponding fix to the char literal pretty printer)
* Allow block with separate type signature and definition of a function
For instance,
```
function
add : (int, int) => int
add(x, y) = x + y
```
cc #196
* Allow pattern matching in left-hand sides
* Changelog
* Fix type spec
* partial case-on-constructor
* Changelog for pattern-matching lets