roc-lang / roc

A fast, friendly, functional language.
https://roc-lang.org
Universal Permissive License v1.0
4.19k stars 300 forks source link

Compiler crashe #2275

Open dullbananas opened 2 years ago

dullbananas commented 2 years ago

In this example, when trying to run ArenaAlloc.roc, I get this output:

    Finished dev [unoptimized + debuginfo] target(s) in 0.20s
     Running `target/debug/roc examples/arena-allocator/ArenaAlloc.roc`
Mismatch in compiler/unify/src/unify.rs Line 1173 Column 13
Trying to unify two flat types that are incompatible: EmptyTagUnion ~ [ Global('Err') [1068], Global('Ok') [1079], ]<1136>

Mismatch in compiler/unify/src/unify.rs Line 1173 Column 13
Trying to unify two flat types that are incompatible: EmptyTagUnion ~ [ Global('Err') [1182], Global('Ok') [1193], ]<1250>

Mismatch in compiler/unify/src/unify.rs Line 1173 Column 13
Trying to unify two flat types that are incompatible: Func([410, 407, 412], 408, 407) ~ Func([151, 155], 157, 158)

Mismatch in compiler/unify/src/unify.rs Line 1173 Column 13
Trying to unify two flat types that are incompatible: Func([273], 503, 485) ~ Func([104, 136], 138, 139)

Mismatch in compiler/unify/src/unify.rs Line 1173 Column 13
Trying to unify two flat types that are incompatible: [ Private(`fx.Effect.Effect`) [520], ]<512> ~ Func([128], 130, 131)

thread '<unnamed>' panicked at 'index out of bounds: the len is 0 but the index is 0', compiler/mono/src/ir.rs:8259:35
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
dullbananas commented 2 years ago

I fixed some errors with 75d72c0. They were caused by using Effect.map instead of Effect.after.

dullbananas commented 2 years ago

Another error was caused by forgetting to use the await function.

Ivo-Balbaert commented 1 year ago

Is there still a recent version of ArenaAlloc.roc with which this could be tested?

dullbananas commented 1 year ago

Is there still a recent version of ArenaAlloc.roc with which this could be tested?

I tried to make it work in #4943 but it doesn't work