Ayaz Hafiz
a0461679dd
Restrict usages of type variables in non-generalized contexts
...
Type variables can only be used on functions (and in number literals as
a carve-out for now). In all other cases, a type variable takes on a
single, concrete type based on later usages. This check emits errors
when this is violated.
The implementation is to check the rank of a variable after it could be
generalized. If the variable is not generalized but annotated as a type
variable, emit an error.
2025-01-02 14:26:37 -06: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
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
fdaaca8c8b
replace cargo deps with workspace in lower_parms, module, mono, parse, problem, roc_target, serialize, solve, solve_problem, specialize_types, test_*
2024-11-29 11:29:04 +11:00
JRI98
dcb6c543c0
Remove unused TypedHole variant from roc_can::expr::Expr
2024-11-28 20:11:37 +00: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
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
89a918cebe
Fix unifying pure with flex vars
2024-11-07 18:54:19 -03:00
Agus Zubiaga
6533e9084d
Add fx to ErrorType
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
d22b2a79f5
Suffixed pure function warning
2024-11-07 18:54:17 -03:00
Agus Zubiaga
1da8af390b
Unsuffixed effectul function warning
2024-11-07 18:54:16 -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
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
Agus Zubiaga
75177c9c98
Rename effect_type to fx_type and add to FunctionDef
2024-11-07 18:54:12 -03:00
Agus Zubiaga
386a5055ee
Add effect_type to can ClosureData
2024-11-07 18:54:11 -03: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
Agus Zubiaga
9ce5b8b50b
Fix zero-arity home value def var
2024-09-01 19:11:56 -03:00
Agus Zubiaga
ed931a458e
Use fresh vars for home params destructures
2024-09-01 19:11:09 -03:00
Agus Zubiaga
ad27129fd7
Rename todo with comment
2024-08-27 19:19:30 -03:00
Agus Zubiaga
d033057a58
Hide params from annotation type mismatches
2024-08-27 19:06:31 -03:00
Agus Zubiaga
a4f4d00ff0
Add unexpected fn params test case
2024-08-27 17:24:13 -03:00
Agus Zubiaga
121a087328
Handle TOO MANY ARGS error for value defs
2024-08-27 17:04:39 -03:00
Agus Zubiaga
658c6963c5
Remove param arguments from TOO MANY ARGS error
2024-08-27 16:08:26 -03:00
Agus Zubiaga
8b9cb22f49
Add custom CalledVia for naked param vars
2024-08-27 13:39:20 -03:00
Agus Zubiaga
49a6b1bfba
Capture whole params record when needed
2024-08-27 11:20:59 -03:00
Agus Zubiaga
80770fae11
Handle aliases at call instead
2024-08-27 02:51:23 -03:00
Agus Zubiaga
b70d48fd33
Handle simple params extended def alias
2024-08-27 01:32:08 -03:00
Agus Zubiaga
36df43fadc
Handle simple aliased fn in params value def
2024-08-27 01:27:54 -03:00
Agus Zubiaga
6cffe9b1db
Return params in params_extended_home_symbol
2024-08-27 00:32:35 -03:00
Agus Zubiaga
3c6a2f11d7
Capture params in lowered passed fns from importer side
2024-08-27 00:02:26 -03:00
Agus Zubiaga
0bf833dae9
Lower passed imported functions
2024-08-26 23:21:18 -03:00
Agus Zubiaga
2f4e80b696
Gather arities while building can declarations
2024-08-26 22:39:35 -03:00
Agus Zubiaga
50f8f2cb1d
Use correct function bodies index
2024-08-26 21:49:56 -03:00
Agus Zubiaga
ef2073ba4c
Use var from home_params_argument
2024-08-23 17:11:53 -03:00
Agus Zubiaga
be4ebfe901
Lower passed top-level functions in a module with params
2024-08-21 20:07:08 -03:00
Agus Zubiaga
0adad85634
Move lower_params/lib to lower_params/lower
2024-08-17 16:23:17 -03:00
Agus Zubiaga
50887e6265
Capture params in nested defs
2024-08-17 16:13:44 -03:00
Agus Zubiaga
c85c634387
Visit all declarations while lowering params
2024-08-17 15:23:28 -03:00
Agus Zubiaga
6588a32195
Visit the whole Expr tree while lowering params
2024-08-17 15:10:54 -03:00
Agus Zubiaga
bcd8e7e28a
Lower top-level fn calls in home module with params
2024-08-17 13:44:19 -03:00