Commit graph

116 commits

Author SHA1 Message Date
Ayaz Hafiz
bbd09fed3c
Remove redundant references 2023-04-12 11:36:06 -05:00
Ayaz Hafiz
014ec8c092
Support multiple modules in uitest 2023-04-12 11:35:33 -05:00
Ayaz Hafiz
1afae9affd
Update emit headers 2023-04-12 10:55:56 -05:00
Ayaz Hafiz
53af6ed4eb
Offer a way to print mono IR in uitest 2023-04-12 10:52:39 -05:00
Ayaz Hafiz
32d4b45557
Add a uitest for pseudo-polymorphic specializations 2023-04-10 16:31:00 -05:00
Ayaz Hafiz
b9ab93fd98
Introduce annotation in first step of recursive solving independently
The algorithm for solving recursive definitions proceeds in several
steps. There are three main phases: introduction of what's known,
solving what's not known, and then checking our work of what was
inferred against what the programmer claimed. Concretely:

1. All explicitly-annotated signatures in the mutually recursive set are
   introduced and let-generalized.
2. Then, inference type variables (`_`) and unannotated def signatures are
   introduced to the cycle, without generalization. The bodies of these
   defs, that are either unannotated or have inference variables, are
   solved.
3. The defs from step (2) are now let-generalized, since we now know
   that their types are consistent. At this point, all the defs in the
   cycle have their types introduced and let-generalized, but we still
   haven't checked the bodies of the defs froom step (1).
4. Check the bodies of explicitly-annotated defs in recursive set. This
   might materially affect the actual types in the signature, for
   example do to fixpoint-fixing or alias expansion.
5. As a result of (4) possibly changing the structure of the annotated
   type, and because the previous annotated types in (1) were introduced
   at a lower rank, we now re-introduce and re-generalize the solved def
   types, in the same we did in step (3).
5. The rest of the program is solved.

Now, a very important thing here is that the annotation signature
introduced for (1) consists of different type variables than the
annotation signature introduced in (5). The reason is that they live at
different ranks. Prior to this patch we were not explicilty doing so;
this commit ensures that we do.
2023-04-10 16:31:00 -05:00
Ayaz Hafiz
c57aaecad4
Migrate pattern tests 2023-04-02 13:15:36 -05:00
Ayaz Hafiz
67364e1a42
Migrate polymorphic lambda set specialization tests 2023-04-02 13:12:51 -05:00
Ayaz Hafiz
e72e17fc82
Migrate list_of_lambdas 2023-04-02 13:03:18 -05:00
Ayaz Hafiz
88b044a765
Migrate ability resolution tests 2023-04-02 13:02:01 -05:00
Ayaz Hafiz
05af17af43
Migrate even more tests 2023-04-02 12:56:01 -05:00
Ayaz Hafiz
2dcafffb46
Migrate couple more tests 2023-04-02 12:53:06 -05:00
Ayaz Hafiz
8148f5d570
Get rid of unused source file 2023-04-02 12:50:24 -05:00
Ayaz Hafiz
b1f076e334
Print as debug 2023-04-02 09:15:37 -05:00
Ayaz Hafiz
25f58a74cc
Trim opts 2023-04-02 09:14:54 -05:00
Ayaz Hafiz
2f43aad8d0
Move uitests to their own crate 2023-04-02 09:11:31 -05:00