Closed lochana-chathura closed 7 months ago
Update:
Converted all the Nil, Boolean, Int, String, Decimal, and Float type value spaces into SemTypes and used them in the isAssigable()
. Other usages still have to be converted.
Current status of JBallerin unit tests: 8415 tests completed, 67 failed, 89 skipped
Update:
isAssigable()
to handle recursive cases as well with semtypes. Failed tests were down to 9. They are due to edge cases when resolving BFiniteType
.BFiniteType
was removed from JvmTypeGen
.Update:
valueSpace
(which was modeled as a set of expressions) to use resolved sem-type. There were about 90 usages.This issue had been parked for a while due to eggplant priorities. However, it is now back in progress.
Current state: All tests are passing except for the tests that rely upon the syntax order of the union type. e.g. cloneWithType After a discussion with James, It was concluded to maintain the order of the basic type bitset at least.
Current state: All tests are passing except for the tests that rely upon the syntax order of the union type. e.g. cloneWithType After a discussion with James, It was concluded to maintain the order of the basic type bitset at least.
Tests are all passing with the fix done with #42158.
Current state: Working on refactoring several places before sending the final PR.
Changes are now complete.
Following performance tests were conducted on top of the changes.
Results are attached with the screenshot.
In summary, there is a 2% performance drop with the changes. This could be because we are populating an extra sem-type property for each BType.
As discussed with @hasithaa, it was decided to not include these changes for update 9. However, will be shipped in a future release.
Closing the issue as changes are done and are available at the nutcracker branch.
Description
$subject.
Describe your problem(s)
In the current integration of sem-types, we can't ship it until we fully complete the sem-type engine for all the types. Therefore, as per our recent discussions we need to make the type checker work when only part of the type are sem-types.
Describe your solution(s)
A type would have two components. A
BType
component and aSemType
component. When we do type operations like union, intersection, and subtyping, we can split it into two sub-problems.Let type P = P1|P2 and Q = Q1|Q2. Here P1/Q1 are the BType components and P2/Q2 are the semtype components. We expect BType and SemType components to be disjoint.
Then we can derive the operations on top of P and Q like this.
In the above, each operation is split into two operations where the first operation is done from the existing logic whereas the second operation is done from the new logic.