roc/crates/compiler/uitest/tests
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
..
ability Make sure late specializations of opaques inherit Inspect as needed 2023-11-30 22:25:08 -06:00
exhaustive Add open union under tuple test 2023-05-24 13:12:47 -05:00
instantiate Fix more tests 2023-08-10 22:24:24 -04:00
lambda_set Fixed erased with nullable unwrapped union 2023-07-12 16:01:44 -05:00
oiop Move uitests to their own crate 2023-04-02 09:11:31 -05:00
pattern Correctly introduce new openness variables at the union rank 2023-05-01 13:14:58 -05:00
ranged Move uitests to their own crate 2023-04-02 09:11:31 -05:00
record Move uitests to their own crate 2023-04-02 09:11:31 -05:00
recursion update tests 2023-11-28 16:40:42 -08:00
recursive_type Support fixpoint-fixing under recursion variables 2023-06-13 17:15:11 -05:00
solve Get tests passing 2023-11-29 21:05:49 -08:00
specialize update test 2023-05-28 09:44:27 +02:00
weaken Move uitests to their own crate 2023-04-02 09:11:31 -05:00