Commit Graph

401 Commits

Author SHA1 Message Date
Richard Feldman
4eec34becf
Update to use new square brace formatting 2022-05-22 23:15:54 -04:00
Folkert
d43bda83b4
cleanup 2022-05-21 20:50:06 +02:00
Folkert
98ce9f4d09
remove the snapshots 2022-05-21 20:42:19 +02:00
Folkert
cb40aab21f
refactor number bounds 2022-05-21 18:53:50 +02:00
Folkert
b46721e43b
exit early from range checking 2022-05-21 18:28:11 +02:00
Ayaz Hafiz
f1e09fbe78
Pass ability specializations back down 2022-05-19 18:21:41 -04:00
Ayaz Hafiz
28d6f30cc7
Fix type errors 2022-05-19 18:21:40 -04:00
Ayaz Hafiz
0f4be93e44
Add JSON builtin, pass along solved specializations per module 2022-05-19 18:21:40 -04:00
Ayaz Hafiz
312cdd0b70
Correct imports of Encode and abilities across modules 2022-05-19 18:21:40 -04:00
Richard Feldman
0f3709da6f
Merge pull request #3090 from rtfeldman/expr-blank 2022-05-18 21:25:07 -04:00
Folkert
f285e7ce93
add a TypedHole node to Expr, for use in the editor 2022-05-18 16:39:24 +02:00
Ayaz Hafiz
a8265426df
Simplify ExposedModuleTypes
The `Invalid` variant was never constructed, so we can eliminate it.
2022-05-18 09:59:37 -04:00
Anton-4
0f59f3097a
cargo fix --edition 2022-05-16 17:04:17 +02:00
Folkert
c161140aec
Merge remote-tracking branch 'origin/trunk' into more-tyck 2022-05-14 14:48:54 +02:00
Folkert
7face320eb
move back to one loc_symbols vector 2022-05-14 14:44:37 +02:00
Ayaz Hafiz
c9e8f6130b
Cleanup constrain_def_make_constraint 2022-05-11 19:28:39 -04:00
Ayaz Hafiz
1609a1a48b
Add some comments and tests showing why recursive defs are constrained this way 2022-05-11 19:16:10 -04:00
Ayaz Hafiz
3f0449292d
My bad 2022-05-11 14:57:03 -04:00
Ayaz Hafiz
710a10a29c
Check for invalid cycles after type solving recursive defs
Disallow cycles that pass through a non-function value. Since we
evaluate eagerly, having one such cycle means there is at least one path
in the program that (likely) has unbounded recursion. Of course we can't
be certain (halting problem), but it's very likely, and avoids stuff
like #1926. Also, mono (as it's done today) won't work if things in a
cycle aren't functions.

Closes #1926
2022-05-11 14:57:01 -04:00
Ayaz Hafiz
7420276116
Avoid an allocation 2022-05-11 11:20:17 -04:00
Ayaz Hafiz
d0c6c06ca1
Remove KnownSizeIterator 2022-05-11 09:06:25 -04:00
Ayaz Hafiz
da00c47102
Opportunistically resolve specializations during solving 2022-05-11 08:53:15 -04:00
Richard Feldman
df7df4ccf8
Merge branch 'trunk' into mfonism/rename-num-float-type-to-frac 2022-05-08 20:54:33 -04:00
Ayaz Hafiz
a47dc711f3 Remove a couple vec allocs 2022-05-08 15:08:19 -04:00
Ayaz Hafiz
5cc6727e9f Simplify introduced variables in ability member 2022-05-08 15:08:19 -04:00
Ayaz Hafiz
f208f7b4a1 Ability members are functions too 2022-05-08 15:08:18 -04:00
Ayaz Hafiz
638c446c2f Fix constraints 2022-05-08 15:08:17 -04:00
Ayaz Hafiz
edee222763 Add AbilityMember can variant for resolving ability specializations 2022-05-08 15:08:16 -04:00
Ayaz Hafiz
2e57bf0b6a Permit able variables in aliases, and thread them through 2022-05-08 15:08:14 -04:00
Ayaz Hafiz
01af970b49 Constraining ability members is the same as a usual def 2022-05-08 15:07:27 -04:00
Ayaz Hafiz
c67bc5a8d6 Remove when-related changes 2022-05-08 15:07:27 -04:00
Ayaz Hafiz
c01baa9168 Fix failing reporting tests 2022-05-08 15:07:27 -04:00
Folkert
b21a226281
simplify constraints 2022-05-08 20:11:12 +02:00
Folkert
7be41d8c09
remove unused variables from let/letrec 2022-05-08 20:06:00 +02:00
Mfon Eti-mfon
85c622b169
Update symbols definition 2022-05-08 15:54:34 +01:00
ayazhafiz
ef77ff35cf
Improve expectation for platform requires mismatch
```
── TYPE MISMATCH ───── examples/hello-world/rust-platform/./Package-Config.roc ─

Something is off with the type annotation of the main required symbol:

2│      requires {} { main : a -> a }
                             ^^^^^^

This #UserApp.main value is a:

    Str

But the type annotation on main says it should be:

    a -> a

────────────────────────────────────────────────────────────────────────────────
```
2022-05-06 12:06:27 -04:00
Richard Feldman
388f402a26
remove unnecessary clone (thanks, clippy!) 2022-05-06 12:06:27 -04:00
Ayaz Hafiz
77a1f644a4
Thread error message information for requires 2022-05-06 12:06:27 -04:00
Ayaz Hafiz
c7142da116
Correctly generate type constraints for required symbols in platform 2022-05-06 12:06:27 -04:00
Ayaz Hafiz
e8fbda44fc
Revert "Revert "Thread through symbols_from_requires""
This reverts commit 8ac1dfac1a.
2022-05-06 12:06:27 -04:00
Richard Feldman
8ac1dfac1a
Revert "Thread through symbols_from_requires"
This reverts commit 1421aebcd3.
2022-05-05 16:19:34 -04:00
Richard Feldman
1421aebcd3
Thread through symbols_from_requires 2022-05-05 16:18:47 -04:00
Ayaz Hafiz
83c6c3a17d
Remove Lowercase from Alias and Opaque 2022-04-29 11:36:31 -04:00
Ayaz Hafiz
ca7c9ec5e6
No more lowercase for opaques 2022-04-29 10:41:27 -04:00
Ayaz Hafiz
5f8834d6b4 I dont got no references 2022-04-28 20:34:04 -04:00
Ayaz Hafiz
12234c36ad Remove unnecessary var introduction 2022-04-28 20:34:04 -04:00
Ayaz Hafiz
2cc47f184f Remove unncessary variable introduction 2022-04-28 20:34:04 -04:00
Ayaz Hafiz
9dac9e4bc2 Coalesce 2022-04-28 20:34:03 -04:00
Ayaz Hafiz
bd4f004cea Some marks are always known 2022-04-28 20:33:48 -04:00
Ayaz Hafiz
51c8702820 Smarter marks 2022-04-28 20:33:48 -04:00