Skip to content
This repository has been archived by the owner on Sep 5, 2023. It is now read-only.

InferType-changes #903

Draft
wants to merge 36 commits into
base: cairo-1.0
Choose a base branch
from
Draft

InferType-changes #903

wants to merge 36 commits into from

Conversation

AlejandroLabourdette
Copy link
Contributor

@AlejandroLabourdette AlejandroLabourdette commented Feb 7, 2023

This PR is to solve all conflicts from the use of the new InferType class to get node's types. Infer Type and the current way to compute types using e parser over typeString node's property are not compatible and they can't exist together so this branch can only be merged once it's completed the transition.

Remaining errors
Before the transition to Cairo 1, there were 7 behavior tests failing, some of them were caused by hard modifications to the AST that leave it in an inconsistent state that the former parser approach couldn't identify. Those AST modifications have a meaning if we have in mind the big picture and the last state of the transpiration, but in an immediate step it seams like an error. An example of those is the simulation of an or operation with a substraction of booleans (assuming false is 0 and true 1). A subtraction of two booleans have no semantic meaning.

These errors do not exist's anymore with the transition to Cairo 1 so was decided to go for the transition but with the new version we also lost all testing over the transpiled files. The final state of warp pass some of the behavior test but not all of them and until don't exist a test pool strong like the one for Cairo 0 it's not advised to merge this changes. The implementation of new features can be stuck by errors related to Infer Type if we merge these changes and could be hard to trace them back to this as a cause.

Known errors

  • typeOfLiterals returns a specific and narrower set of types, the logic over some of the assumption on the expected types must be changed. Handling literals is an open discussion Handle literals #849
  • Can not Abi-encode mapping types. Warp create new function definitions along the transpiling process, It's common for inferType to compute the type of those func computing their signature. This is not always possible for the new functions.
  • safeGetNodeType with inferType return a specialized type, some cases were implemented thinking in a generalized type

@AlejandroLabourdette AlejandroLabourdette marked this pull request as draft February 7, 2023 18:37
Bumps [@sideway/formula](https://github.com/sideway/formula) from 3.0.0 to 3.0.1.
- [Release notes](https://github.com/sideway/formula/releases)
- [Commits](hapijs/formula@v3.0.0...v3.0.1)

---
updated-dependencies:
- dependency-name: "@sideway/formula"
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
@JorikSchellekens
Copy link
Contributor

This pr is waiting for behaviour tests to be working on the Cairo 1.0 branch.

@JorikSchellekens JorikSchellekens changed the base branch from develop to cairo-1.0 April 7, 2023 13:45
@piwonskp piwonskp mentioned this pull request Jun 19, 2023
16 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants