flix / flix

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

Refactor `Files.flix` to use `InvokeConstructor2`, `InvokeMethod2`, and so forth #7869

Open magnus-madsen opened 2 weeks ago

magnus-madsen commented 2 weeks ago

We can start to refactor Files.flix to use the new Java constructs.

This will increase our confidence that they are usable.

For example, we can already use InvokeMethod2 to simplify a function like copyOver.

At the very end, we will replace the currency symbol by the chosen syntax and we can merge it.

magnus-madsen commented 2 weeks ago

For example, I was able to replace this:

            case ex: ##java.io.IOException =>
                import java.lang.Throwable.getMessage(): String \ IO;
                Err(Generic(getMessage(checked_cast(ex))))

by this

            case ex: ##java.io.IOException =>
                Err(Generic(ex¤getMessage()))