Commit graph

499 commits

Author SHA1 Message Date
Anton-4
02cf61f985
Merge pull request #7038 from mulias/expr-dbg
Support `dbg` in expressions
2024-09-02 13:30:32 +02:00
Elias Mulhall
dc5c8aeaf9 cargo fmt --all 2024-08-28 11:53:44 -04:00
Elias Mulhall
3120a1ea46 Replace panic! with internal_error! 2024-08-28 11:53:44 -04:00
Agus Zubiaga
519ff56a85
Create can::module::ModuleParams for convenience 2024-08-17 13:10:37 -03:00
Agus Zubiaga
762799052e
Merge branch 'main' into typecheck-module-params 2024-08-07 18:55:33 -03:00
Ayaz Hafiz
0e52a7e069
Make sure FunctionKind is determined in all entry points
There are a lot of entry points for a Roc program. They should probably
be all consolidated into one, but for now, when FunctionKind is needed,
determine it from the environment. This fixes EXPERIMENTAL_ROC_ERASE for
`roc test` etc.

Also print the location of a failure when `internal_error!` is called. I
think this should panic instead, and I thought it used to - does anyone
know if that changed?
2024-07-07 16:01:14 -05:00
Agus Zubiaga
26fe91b02f
Always use "MODULE PARAMS" term in errors
The theory is that this will be more searchable
2024-07-06 22:07:29 -03:00
Agus Zubiaga
0cbb352a89
Move unexpected params warning to solve 2024-07-06 21:36:26 -03:00
Agus Zubiaga
d23a8dc618
Fix importing of module params vars 2024-07-02 22:48:47 -03:00
Agus Zubiaga
89fc1104f0
Report import params mismatch 2024-07-02 11:10:00 -03:00
Agus Zubiaga
d2c9953429
Handle import params lambda sets and abilities in solve 2024-07-02 11:10:00 -03:00
Agus Zubiaga
922b1c44ef
Report missing params 2024-07-02 11:10:00 -03:00
Agus Zubiaga
bc6a84a215
Report unexpected params 2024-07-02 11:09:59 -03:00
Agus Zubiaga
f0fe0a3ea6
Module params are not extensible 2024-07-02 04:10:47 -03:00
Agus Zubiaga
5ec4b042bb
Constrain and solve import params
No reporting yet
2024-07-02 04:10:46 -03:00
Agus Zubiaga
dcb2767b6e
Do not create unnecessary scope in solve run_help 2024-07-02 04:10:45 -03:00
Agus Zubiaga
dd0e28240a
Add module param identifiers to solve's scope 2024-07-02 04:10:45 -03:00
Ayaz Hafiz
8cdb193301
Update stale document references 2024-06-26 02:16:20 -04:00
shua
f7bec802c0
PR: rename to List.concatUtf8 2024-06-08 13:36:20 +02:00
shua
33e8a7a439
implement Str.concatUtf8 2024-06-07 19:05:52 +02:00
Anton-4
f7011c8e33
Merge pull request #6644 from roc-lang/rust-1-76-0-upgrade
Rust 1.76.0 upgrade
2024-05-03 07:25:19 +02:00
Agus Zubiaga
7ebfc6d06d
Support both inline and header imports
Load will now convert header imports to inline import defs, so that
we can support both temporarily.
2024-04-20 19:04:09 -03:00
Anton-4
e4b814ce1c
clippy 2024-04-15 16:50:44 +02:00
Anton-4
f085b96f78
removed unused deps, added CI test 2024-04-09 19:47:31 +02:00
Richard Feldman
24a38c4a26
Merge remote-tracking branch 'origin/main' into remove-nat 2024-02-11 12:26:36 -05:00
Anton-4
3c7a834da1
update to new interpolation syntax 2024-02-02 13:39:10 +01:00
Richard Feldman
204cee7d60
Clean up more unused Nat stuff 2024-01-26 16:23:21 -05:00
Richard Feldman
bf660ad094
Remove Nat from tests 2024-01-26 16:19:52 -05:00
Richard Feldman
502b0fddf2
Remove Nat from Hash, Inspect, Encode, Decode 2024-01-26 16:17:05 -05:00
Richard Feldman
7e51dfd526
Update test fixtures to not use Nat indices 2024-01-26 16:06:07 -05:00
Anton-4
1126f85b5a
fix clippy unnecessary hashes 2024-01-01 16:38:36 +01:00
Anton-4
cd632fe549
Merge branch 'main' of github.com:roc-lang/roc into clippy-1.74 2023-12-25 17:05:37 +01:00
Bryce Miller
59eb28ef58
Add builtin List.walkWithIndexUntil 2023-12-11 23:04:40 -05:00
Ayaz
aaba3f4d82
Merge branch 'main' into clippy-1.74 2023-12-02 20:09:06 -06:00
Ayaz Hafiz
a53da2bc24
Make sure late specializations of opaques inherit Inspect as needed
A "late specialization" of a type is an ability specialization that
is not visible or needed until after type-specialization; i.e. during
monomorphization.

The `Inspect.toInspector` ability is special-cased for opaques that do
not claim or explicitly implement `Inspect`. In such cases, they are
treated as structural types, and given the immediate specialization of
`Inpect.inspectOpaque`.

However, prior to this commit, that special-casing would only be applied
during early specialiation (i.e. specializations visible during
generalized type inference). This commit applies the special case to
late specialization as well - the specialization decision for an opaque
type is always the specialization of the opaque type in the late case,
but now, when we go to look up the ambient lambda set of the
specialization, if it does not exist and corresponds to
`Inspect.toInspector`, we fall back to the immediate.

One concern I have here is that in a case like

```
Op := {}

x =
    dbg (@Op {})
```

the specialization of `Inspect.toInspector` for `Op` should be known
early. Indeed, the program

```
Op := {}

x =
    Inspect.toInspector (@Op {}) |> Inspect.apply (Inspect.init {}) |> Inspect.toDbgStr
```

Compiles fine without this change. This makes me suspect there is an
issue with the implementation of `dbg`'s desugaring. If possible, this
should be addressed sooner rather than later.

Closes #6127
2023-11-30 22:25:08 -06:00
Brendan Hansknecht
c49046291a
misc cleanup suggestions 2023-11-28 16:40:43 -08:00
Brendan Hansknecht
c443bdcf4f
check_adhoc for inspect 2023-11-28 16:40:41 -08:00
Brendan Hansknecht
82cda1965c
use INSPECT_INSPECT_ABILITY instead of INSPECT_INSPECT 2023-11-28 16:40:41 -08:00
Brendan Hansknecht
35078a2295
allow nat in DeriveInspect 2023-11-28 16:40:41 -08:00
Brendan Hansknecht
3434d3154a
Ayaz's fix and first passing inspect test 2023-11-28 16:40:40 -08:00
Richard Feldman
443f6593c5
Add Inspect.Inspect to subs and auto-derive 2023-11-28 16:40:40 -08:00
Ayaz Hafiz
5c805ce80f
Get first inspect for non-Inspect-implementing opaques specialized 2023-11-28 16:40:39 -08:00
Richard Feldman
00c27b087b
Add Inspect to builtin_module_with_unlisted_ability_impl 2023-11-28 16:40:39 -08:00
Richard Feldman
fb9e0fc777
Add Inspect to obligation checker 2023-11-28 16:40:39 -08:00
Folkert
c019ced31d
various 2023-11-18 23:05:55 +01:00
Richard Feldman
6bd9fcd6e9
roc_solve shouldn't depend on itself 2023-11-10 16:04:06 -05:00
Isaac Van Doren
139d3c6f89
make dropFirst and dropLast drop n elements 2023-10-29 13:23:33 -05:00
Ayaz Hafiz
6e89821233
Update language server to support apps 2023-10-25 17:14:33 -05:00
Ayaz Hafiz
b706a57e16
Update LSP 2023-10-25 17:14:33 -05:00
Ayaz Hafiz
9d365a8a57
Support basic diagnostic reporting 2023-10-25 17:14:32 -05:00