Closed rtfeldman closed 2 years ago
This is blocking https://github.com/rtfeldman/roc/pull/2105
Applying 8acab97 appears to fix this:
$ cargo run -- examples/cli/Files.roc
Finished dev [unoptimized + debuginfo] target(s) in 0.39s
Running `target/debug/roc examples/cli/Files.roc`
🔨 Rebuilding host...
── UNUSED DEFINITION ───────────────────────────────────────────────────────────
index is not used anywhere in your code.
83│ Err (BadUtf8 problem index) -> Task.succeed ""
^^^^^
If you didn't intend on using index then remove it so future readers
of your code don't wonder why it is there.
── UNUSED DEFINITION ───────────────────────────────────────────────────────────
problem is not used anywhere in your code.
83│ Err (BadUtf8 problem index) -> Task.succeed ""
^^^^^^^
If you didn't intend on using problem then remove it so future readers
of your code don't wonder why it is there.
── UNUSED IMPORT ───────────────────────────────────────────────────────────────
Nothing from Stdout is used in this module.
3│ imports [ fx.Effect, Task.{ Task }, Stdout ]
^^^^^^
Since Stdout isn't used, you don't need to import it.
── UNUSED IMPORT ───────────────────────────────────────────────────────────────
Nothing from File is used in this module.
5│ imports [ Task.{ Task }, File.{ ReadErr, ReadErrTag, ReadUtf8Err } ]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Since File isn't used, you don't need to import it.
────────────────────────────────────────────────────────────────────────────────
Done!
What file should I read?
03098d4096135fe53f8da5d0ec2d9607d7b13979 has no type mismatches reported in
roc check
but causes a panic in layout.rs:assertion failed: ext_var_is_empty_tag_union(subs, ext_var)', compiler/mono/src/layout.rs:1538:13
The diff here is:
The
Err readErr
was returned by this function:However, the function with the
Err readErr -> Task.fail readErr
in it does not return aReadErr *
likereadBytes
does. Instead it returns this:The reason this isn't a type mismatch is that
ReadUtf8Err
is actually a superset ofReadErr
:So although it type-checks, it doesn't compile due to a layout error.