c3lang / c3c

Compiler for the C3 language
https://c3-lang.org
GNU Lesser General Public License v3.0
2.65k stars 157 forks source link

llvm issue with try when bool is combined #1467

Open fernandolguevara opened 18 hours ago

fernandolguevara commented 18 hours ago
module program;

import std::io;

fn bool! get_bool() {
    return true;
}

fn void! main(String[] args){
    bool b;
    if (try v = get_bool() && b) {
        io::printfn("v=%s", v);
    }
    /*
    Assertion failed: (llvm_value_is_bool(&res)), function llvm_emit_try_unwrap_chain, file llvm_codegen_expr.c, line 6911.
    */

    if (try v = get_bool() && v) {
        io::printfn("v=%s", v);
    }
    /*
    Assertion failed: (llvm_value_is_bool(&res)), function llvm_emit_try_unwrap_chain, file llvm_codegen_expr.c, line 6911.
    */
}
lerno commented 18 hours ago

This should be fixed now.