flix / flix

The Flix Programming Language
https://flix.dev/
Other
2.08k stars 150 forks source link

Region escaping errors are confusing after revamping of the type system #7655

Open fr33m0nk opened 1 month ago

fr33m0nk commented 1 month ago

The region escaping errors are a bit confusing now

def main(): Unit \ {IO, rc} =
    let escaped = region rc {
        Array#{1, 2, 3} @ rc
    }; Array.forEach(println, escaped)

Error in REPL:

>> Unable to unify the effect formulas: 'IO + rc' and 'IO + rc'.

97 |     }; Array.forEach(println, escaped)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
            mismatched effect formulas.

Type One: IO + rc
Type Two: IO + rc

flix> 
mlutze commented 1 month ago

Part of the fix for this would be to detect shadowing of type variables.