ohua-dev / ohua-core

Core Haskell library for the compiler
https://ohua-dev.github.io
Eclipse Public License 1.0
5 stars 0 forks source link

Non-exhaustive patterns in function bindingFromLit #28

Closed Feliix42 closed 5 years ago

Feliix42 commented 5 years ago

When trying to compile the following algorithm:

ns some_ns;

use sf conditionals::iftest::{modify_string_positive, modify_string_negative};

fn main(ctrl: bool, inp: String) -> String {
    if (ctrl) {
        modify_string_positive(inp)
    } else {
        modify_string_negative(inp)
    }
}

ohuac emits the following error message, originating from this file:

ohuac: src/Ohua/ALang/Util.hs:(79,5)-(81,65): Non-exhaustive patterns in function bindingFromLit

For reference: I am using the latest ohuac version, modified to use the latest ohua-core version.

sertel commented 5 years ago

Running ohuac build --dump-stage "alang-resolved" if_envarcs.ohuac outputs:

let ctrl = $0 in
let inp = $1 in
ohua.lang/if ctrl (λ _ -> conditionals.iftest/modify_string_positive inp)
  (λ _ -> conditionals.iftest/modify_string_negative inp)
JustusAdam commented 5 years ago

Jo, that's your Non-exhaustive pattern though @sertel 😛

(Just kidding, will have a look at it next week.)

sertel commented 5 years ago

I know ;)

Thanks!