Commit graph

141 commits

Author SHA1 Message Date
Brendan Hansknecht
4587c4ebc5
update uitest and mono_test 2023-12-02 21:18:31 -08: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
f5fb01fd53
Get tests passing
Add roc_dbg to some platforms.
Also start updating some roc_panic impls.
2023-11-29 21:05:49 -08:00
Brendan Hansknecht
83bf3cbd3a
update tests 2023-11-28 16:40:42 -08:00
Brendan Hansknecht
5e36395369
correct Inspect custom impl to use Inspect.apply 2023-11-28 16:40:42 -08:00
Brendan Hansknecht
4c25c60cdc
expand ui tests for inspect 2023-11-28 16:40:41 -08:00
Brendan Hansknecht
c443bdcf4f
check_adhoc for inspect 2023-11-28 16:40:41 -08:00
Brendan Hansknecht
a1a563074d
expand ui tests to numbers 2023-11-28 16:40:41 -08:00
Brendan Hansknecht
f0dee1f6e9
add missing ToInspector case 2023-11-28 16:40:40 -08:00
Brendan Hansknecht
c57bc4db11
add uitest to view bool inspect derive 2023-11-28 16:40:40 -08:00
Ayaz Hafiz
d36eba98fc
Add a few more opaque tests
`specialize/inspect/opaque_derived` does not yet pass.
2023-11-28 16:40:39 -08:00
Ayaz Hafiz
5c805ce80f
Get first inspect for non-Inspect-implementing opaques specialized 2023-11-28 16:40:39 -08:00
Isaac Van Doren
139d3c6f89
make dropFirst and dropLast drop n elements 2023-10-29 13:23:33 -05:00
Folkert
60afb79cc7
simplify regex expression strings 2023-10-07 19:11:37 +02:00
Richard Feldman
15a6bc34f4
Merge remote-tracking branch 'origin/main' into inspect-builtin 2023-08-14 15:03:27 -04:00
Richard Feldman
f68272944c
Update uitest 2023-08-11 06:34:17 -04:00
Richard Feldman
7908645895
Fix more tests 2023-08-10 22:24:24 -04:00
Richard Feldman
2da41be29f
Merge remote-tracking branch 'origin/main' into abilities-syntax 2023-08-10 20:36:01 -04:00
Ayaz Hafiz
dac4d842d8
Fix types 2023-07-17 09:52:14 -05:00
Ayaz Hafiz
a2574a5a98
Update vars 2023-07-12 17:01:31 -05:00
Ayaz Hafiz
937e042c8f
Fixed erased with nullable unwrapped union 2023-07-12 16:01:44 -05:00
Ayaz Hafiz
5e9a06e537
Boxed helpers 2023-07-12 15:55:25 -05:00
Ayaz Hafiz
8d9c6d09b9
Load as a stack pointer 2023-07-12 14:46:11 -05:00
Ayaz Hafiz
fde75d5432
Correct calling branches 2023-07-12 14:45:03 -05:00
Ayaz Hafiz
fcb907b0c9
Don't pass empty captures 2023-07-12 14:45:02 -05:00
Ayaz Hafiz
cd64134b0a
Allow direct packing, unpacking of erased types 2023-07-12 14:43:25 -05:00
Ayaz Hafiz
dc56a0ffef
First pass update erasure IR 2023-07-12 14:43:24 -05:00
Ayaz Hafiz
b2d3b52bd5
First compile of erased lambdas 2023-07-12 14:21:28 -05:00
Ayaz Hafiz
a9e3f967a8
First pass at erased function layouts 2023-07-12 13:57:19 -05:00
Ayaz Hafiz
6e5a308557
Content variant ErasedLambda 2023-07-12 13:57:17 -05:00
Ayaz Hafiz
c459757062
Thread simple model of "ErasedLambdas" through proc layouts
But none of these paths are yet exercised.
2023-07-12 13:53:52 -05:00
Ayaz Hafiz
6eae480e36
Check in first erasure test 2023-07-12 13:53:52 -05:00
Ayaz Hafiz
6014370b91
Initial support for erasure in tests 2023-07-12 13:53:51 -05:00
Ayaz Hafiz
44c4797d9a
Parameterize program solving on a FunctionKind
This new flag determines whether we should introduce a new kind to
represent lambda sets, or whether lambdas should be erased. The latter
is not yet implemented.
2023-07-12 13:53:50 -05:00
Folkert
ef39bad7c6
auto clippy fixes 2023-07-10 18:27:08 +02:00
Richard Feldman
f12b378249
cargo uitest 2023-06-27 16:20:27 -04:00
Ayaz Hafiz
49a92e5ef1
Support fixpoint-fixing under recursion variables
Sometimes, we might need to fixpoint-fix a unification like

[ Bar [ Bar <a>, Foo ], Foo ] as <a>  🛠️  [ Bar <b>, Foo ] as <b>

where we hit a comparison between <a> and <b>. In this case, follow each
recursion point independently and see if we can find the chain to the needle
we were searching for.

Closes #5476
2023-06-13 17:15:11 -05:00
Bryce Miller
0132df9b5a
merge main 2023-06-10 15:04:25 -04:00
Luke Boswell
4bb0f4c2d0
update uitest failure 2023-06-08 19:34:52 +10:00
Bryce Miller
cb08225bf0
| -> where 2023-06-05 20:19:00 -04:00
Bryce Miller
7e8a151604
Merge branch 'main' into abilities-syntax 2023-06-01 12:57:16 -04:00
J.Teeuwissen
93ea086115
Merge branch 'main' into record-update-index-top 2023-05-30 10:47:19 +02:00
Bryce Miller
ffa622e065
Merge branch 'main' into abilities-syntax
Signed-off-by: Bryce Miller <sandprickle@users.noreply.github.com>
2023-05-29 13:42:36 +02:00
J.Teeuwissen
576558b9d0
update test 2023-05-28 09:44:27 +02:00
Bryce Miller
c68807bc5a
has -> implements in roc code 2023-05-26 20:39:01 -04:00
Ayaz
62cdceabd6
Merge pull request #5457 from roc-lang/tuple-aliases
Add test for tuple annotations
2023-05-26 17:28:56 -05:00
Ayaz Hafiz
52a719bc18
Add test for tuple annotations
Closes #5447
2023-05-26 12:14:41 -05:00
Ayaz Hafiz
3585d5bb5b
Implement hash for Dec 2023-05-26 11:38:30 -05:00
Brendan Hansknecht
0c13564ad7
update mono and uitests 2023-05-25 11:01:14 -07:00
Bryce Miller
91e37293a2
abilities syntax has -> implements 2023-05-24 21:29:38 -04:00