Commit graph

268 commits

Author SHA1 Message Date
Ayaz Hafiz
561f3d9711
Store lambda set variables as flex inference variables
This is actually correct - the rigid approach is not. Lambda set
variables should be inferred in-scope.
2025-01-05 23:54:37 -05:00
Ayaz Hafiz
54cc5e4c29
Unify let-introduction in a single path
Remove branches on determining how let-bindings are introduced to the
scope. This is maybe a little more inefficient, but I think it is a huge
simplification.

One additional change this required was changing how fx suffixes are
checked. The current implementation would add additional constraints for
patterns in let bindings conditionally. However, this is unnecessary. I
believe it is sufficient to check the fx suffix by running the checks on
all introduced symbols after the type is well known (i.e. the body is
checked).
2025-01-05 23:54:37 -05:00
Ayaz Hafiz
bd2dd66c96
Store rigid vars with location during constraining 2025-01-05 23:54:36 -05:00
Ayaz Hafiz
830f0ac35f
Bugfix association of inferred-tag-extension variables
These are inferred vars, not rigids.
2025-01-05 23:54:36 -05:00
Sam Mohr
de626102c8
Use new try impl for ? operator 2024-12-05 02:13:13 -08:00
Sam Mohr
eedade8e81
Initial working version of proper try keyword 2024-12-04 02:31:59 -08:00
Sam Mohr
0a82f313c3
Merge branch 'main' into allow-try-in-statements 2024-12-01 23:02:41 -05:00
Sam Mohr
febe95c228
Generalize return vars 2024-12-01 02:24:51 -08:00
Sam Mohr
29c8759bc0
Merge branch 'main' into allow-try-in-statements 2024-12-01 00:35:18 -08:00
Richard Feldman
0e550a7f68
Merge pull request #7265 from roc-lang/workspace-deps
Update cargo dependencies to use workspace
2024-11-29 17:38:03 -05:00
Luke Boswell
56228a25c0
replace cargo deps with workspace in checkmate, constrain, derive 2024-11-29 11:15:26 +11:00
JRI98
dcb6c543c0
Remove unused TypedHole variant from roc_can::expr::Expr 2024-11-28 20:11:37 +00:00
Agus Zubiaga
2e96aca0fd
Merge branch 'main' into specialize-exprs 2024-11-23 01:48:51 -03:00
Sam Mohr
d8b73f25e6
Merge branch 'main' into allow-try-in-statements
Signed-off-by: Sam Mohr <sam@sammohr.dev>
2024-11-21 21:03:27 -08:00
Sam Mohr
d449d83a84
Allow pure statements that contain early returns 2024-11-21 12:22:01 -08:00
Sam Mohr
f857872903
Properly type constrain all function types 2024-11-21 04:09:47 -08:00
Sam Mohr
20ba4a92de
Merge branch 'main' into constrain-early-return-functions 2024-11-21 02:45:14 -08:00
Sam Mohr
7ca305b5dc
Merge branch 'main' into constrain-early-return-functions 2024-11-18 15:04:34 -08:00
JRI98
a18232bd8b
Cleanup after #7227 2024-11-18 11:04:07 +00:00
Joshua Warner
9ead801536
Remove expect-fx syntax and handling
This was never fully hooked up in platforms, and the plan is to replace the need for this with doing purity-inference on normal `expect` statements.

On the other hand, fuzzing is finding some bugs caused by having a hyphenated keyword, so this is a great time to go ahead and remove it!
2024-11-17 20:25:37 -08:00
Richard Feldman
dd031855a9
Revert "Try fixing a surprising constraint behavior"
This reverts commit ae2855628e.
2024-11-16 23:49:20 -05:00
Richard Feldman
ae2855628e
Try fixing a surprising constraint behavior 2024-11-16 23:48:57 -05:00
Agus Zubiaga
12c735644f
Do not warn about pure functions in suffixed record literal fields
Records fields that allow effectful functions, should also accept
pure functions.
2024-11-09 01:05:06 -03:00
Sam Mohr
9a2b99c148
Constrain early returns in functions in addition to closures 2024-11-08 00:05:56 -08:00
Richard Feldman
ed6ad1bc82
Get a failing specialize_expr test 2024-11-08 00:55:04 -05:00
Agus Zubiaga
a2f940be4e
Use byte literal instead of cast and ignore too_many_args 2024-11-07 18:54:22 -03:00
Agus Zubiaga
c9f001b041
Allow ignored defs with an effectful RHS 2024-11-07 18:54:22 -03:00
Agus Zubiaga
cfc4be5254
Treat untyped suffixed functions as effectful 2024-11-07 18:54:21 -03:00
Agus Zubiaga
af6fc6306f
Treat untyped unsuffixed functions as pure 2024-11-07 18:54:21 -03:00
Agus Zubiaga
e75b1cf7a0
Check suffixes of all pattern identifiers 2024-11-07 18:54:20 -03:00
Agus Zubiaga
215de707fa
Report unsuffixed record literal field with effectful function 2024-11-07 18:54:20 -03:00
Agus Zubiaga
2859829ea8
Mark flex fx vars as pure after solving body 2024-11-07 18:54:19 -03:00
Agus Zubiaga
89a918cebe
Fix unifying pure with flex vars 2024-11-07 18:54:19 -03:00
Agus Zubiaga
6adc6d9168
Report ignored statement results 2024-11-07 18:54:18 -03:00
Agus Zubiaga
b01771c5ae
Show effectful function name in mismatches 2024-11-07 18:54:18 -03:00
Agus Zubiaga
f666dba67d
Report effectful top-level exprs 2024-11-07 18:54:17 -03:00
Agus Zubiaga
b62665e49e
Report effectful statement in pure function 2024-11-07 18:54:17 -03:00
Agus Zubiaga
69e026f8bb
Leftover statement warning for pure statements 2024-11-07 18:54:16 -03:00
Agus Zubiaga
6e6382ab23
Canonicalize and constrain statement expr in purity inference mode 2024-11-07 18:54:15 -03:00
Agus Zubiaga
7af05cc6c9
Constrain function annotation fx to body 2024-11-07 18:54:13 -03:00
Agus Zubiaga
5a5abe3bc5
Unify call's fx var with that of the enclosing function 2024-11-07 18:54:12 -03:00
Agus Zubiaga
e8d7820f34
Add fx var to can's Call 2024-11-07 18:54:12 -03:00
Agus Zubiaga
3cef756559
Add fx var to Type::Function et al 2024-11-07 18:54:12 -03:00
Sam Mohr
294f0c0d1f
Merge branch 'main' into return-keyword 2024-10-24 23:01:10 -07:00
Richard Feldman
8997c80573
Remove deprecated roc_collections::soa things 2024-10-21 23:17:20 -04:00
Richard Feldman
62b4fe6943
clippy 2024-10-21 22:10:43 -04:00
Richard Feldman
b2ea0b842c
Revert "Do some checked SoA stuff"
This reverts commit c79d7745f6eb345fd50a7cb4a2a7dd6fb6f8f1fc.
2024-10-21 22:10:43 -04:00
Richard Feldman
a8d3280b02
Do some checked SoA stuff 2024-10-21 22:10:42 -04:00
Sam Mohr
7518a2c5ab
Address PR comments, add syntax tests 2024-10-21 03:06:43 -07:00
Sam Mohr
b3e60f9d3a
Implement return keyword 2024-10-20 08:58:59 -07:00