Richard Feldman
718b999751
Merge pull request #2857 from rtfeldman/abilities-mono
...
Codegen for abilities
2022-04-16 22:59:16 -04:00
Sean Hagstrom
c67a1bb8d4
fix(repl) and fix(pretty_print): update pretty_print output for Num FloatingPoint *
to be Float *
instead of F64
2022-04-15 16:37:39 +01:00
Ayaz Hafiz
7d4a006377
Bugfix sorting must implement constraints
...
Also makes things go faster
2022-04-15 09:29:12 -04:00
Ayaz Hafiz
8f335c3278
Add solve test for aliasing ability
2022-04-14 17:25:44 -04:00
Ayaz Hafiz
b79b351136
The first ability... compiles
2022-04-14 16:50:41 -04:00
Ayaz Hafiz
6b4294307f
Start saving ability signature on designated variable again
2022-04-14 16:22:54 -04:00
Ayaz Hafiz
8f906826fc
Include parent ability in specialization tests
2022-04-14 08:57:32 -04:00
Ayaz Hafiz
d630562d99
forgive me clippy
2022-04-13 15:30:02 -04:00
Ayaz Hafiz
8eec930260
More and smarter checking and error reporting for abilities
2022-04-13 15:25:19 -04:00
Ayaz Hafiz
0792ccbbe8
Calling ability with non-specialized type is an error
2022-04-13 11:49:33 -04:00
Ayaz Hafiz
d110fbde6c
Annotation specializes ability
2022-04-13 10:44:34 -04:00
Ayaz Hafiz
25b3aa7ca7
Typed body specializations solve
2022-04-13 10:42:46 -04:00
Ayaz Hafiz
a1c1dc1a9f
Ask rustc to please always inline
2022-04-13 08:49:27 -04:00
Ayaz Hafiz
0336b6ad27
Clippy
2022-04-12 19:02:58 -04:00
Ayaz Hafiz
67b5ab7fe7
Add test for when specialization types conflict
2022-04-12 19:01:36 -04:00
Ayaz Hafiz
cf1a6691dd
Fix solve tests
2022-04-12 18:54:12 -04:00
Ayaz Hafiz
d94556d807
Report overly general specializations
2022-04-12 18:52:49 -04:00
Ayaz Hafiz
16d0060824
Report errors for type errors in specializations outside of ability impl
2022-04-12 18:41:20 -04:00
Ayaz Hafiz
127d435ff2
Report incomplete ability implementations
2022-04-12 18:26:19 -04:00
Ayaz Hafiz
462f443956
Comment
2022-04-12 17:23:03 -04:00
Ayaz Hafiz
64b559073d
Clippy
2022-04-12 16:18:07 -04:00
Ayaz Hafiz
15a040ec87
Basic type inference and solving for abilities
...
Note that is still pretty limited. We only permit opaque types to
implement abilities, abilities cannot have type arguments, and also no
other functions may depend on abilities
2022-04-12 16:18:07 -04:00
Ayaz Hafiz
913d97cab1
Add needed imports
2022-04-12 16:18:07 -04:00
Nikita Mounier
0f0e9bdf14
Fix test in solve_expr.rs
2022-04-12 12:12:29 +00:00
Richard Feldman
d81228df80
cargo fmt
2022-04-11 13:17:46 -04:00
Nikita Mounier
1df1b4bc84
Fix typo.
2022-04-11 12:34:23 +00:00
Nikita Mounier
8206f345c7
Merge remote-tracking branch 'origin/trunk' into div-no-result
2022-04-11 11:45:06 +00:00
Nikita Mounier
4ecf2a8c24
Modify division behaviour to panic when dividing by 0, and add divChecked
, divFloorChecked and
divCeilingChecked` for safe alternatives which return a Result, mimicking the previous behaviour.
2022-04-11 11:23:33 +00:00
Richard Feldman
8322ed95ed
Merge pull request #2806 from rtfeldman/toF32
...
Num.toF32/toF64 for LLVM backend
2022-04-08 08:28:07 -04:00
Ayaz Hafiz
17b3c7d8ee
Generate type variables when there are lots
...
Closes #2797
2022-04-07 17:49:48 -04:00
Richard Feldman
cd00a98636
Add toF32/64 and checked versions
2022-04-07 16:13:57 -04:00
Richard Feldman
bd623d65bc
Formatting whitespace
2022-04-07 16:13:57 -04:00
Ayaz Hafiz
163c6b39d6
Unify type alias "real variables"
...
Turns out that we can't always assume that a successful unification of
type alias type variables means that those aliases had the same real
type from the start. Because type variables may contain unbound type
variables and grow during their unification (for example,
`[InvalidNumStr]a ~ [ListWasEmpty]b` unify to give `[InvalidNumStr,
ListWasEmpty]`), the real type may grow as well.
For this reason, continue to explicitly unify alias real types for now.
We can get away with not having to do so when the type variable
unification causes no changes to the unification tree at all, but we
don't have a great way to detect that right now (maybe snapshots?)
Closes #2583
2022-04-05 11:21:52 -04:00
Folkert
311e464b70
add load_internal
2022-03-23 15:18:22 +01:00
Folkert
d8fa2b8d92
stop passing stdlib (use lazy_static)
2022-03-22 19:53:02 +01:00
Folkert
38c2710fc5
intern common tag names
2022-03-20 15:30:47 +01:00
hafiz
3f07afe3b5
Merge pull request #2750 from rtfeldman/delay-instantiating-aliases-fix-limitations
...
Delay instantiating aliases fix limitations
2022-03-19 20:41:14 -04:00
hafiz
418e71e95c
Merge pull request #2755 from rtfeldman/dense-let-constraints
...
Constraint gen tweaks
2022-03-19 20:39:55 -04:00
Folkert
7f92de69ab
some comments
2022-03-19 23:44:28 +01:00
Folkert
55d9dc745c
track if an alias is exposed
2022-03-19 17:10:29 +01:00
Richard Feldman
5f2054aeb6
Merge pull request #2754 from rtfeldman/remove-type-solvedtype-conversion
...
Remove Type/Subs -> SolvedType conversion
2022-03-19 10:48:42 -04:00
Folkert
5a15a121ff
remove Content -> SolvedType conversion
2022-03-19 12:26:21 +01:00
Folkert
21a51464f3
various small type-related changes
2022-03-18 22:35:12 +01:00
Folkert
a3b00fbf55
Merge branch 'explicit-closed-tag-record' into delay-instantiating-aliases
2022-03-17 20:34:52 +01:00
Folkert
f8a73e0baa
use unreachable!
2022-03-17 19:50:16 +01:00
Folkert
426bfe3ff1
implement solve crate
2022-03-17 19:31:54 +01:00
Folkert
c5fb4f2e47
rewrite and fix builtin alias instantiation
2022-03-16 22:10:04 +01:00
Folkert
7fd420bb95
optimize instantiation of builtins
2022-03-16 21:15:54 +01:00
Folkert
ad6fd18b05
optimizations for known aliases and identity substitutions
2022-03-16 18:33:53 +01:00
Folkert
b3dce7317d
hook up aliases
2022-03-15 22:23:40 +01:00