AnyDSL / artic

The AlteRnaTive Impala Compiler
MIT License
25 stars 6 forks source link

assigning/initializing pointer to member of struct accessed through mutable pointer triggers assertion #14

Closed michael-kenzel closed 1 year ago

michael-kenzel commented 2 years ago

the following code will reproduce the issue:


struct Req {}

struct X {
    req: Req
}

fn test(x: &mut X) {
    let mut p = x;
    let r = &mut p.req;
}

triggers

artic/src/emit.cpp:776: void artic::Emitter::bind(const artic::ast::IdPtrn&, const thorin::Def*): Assertion `id_ptrn.type->convert(*this) == value->type()' failed.
madmann91 commented 1 year ago

Fixed in commit #6edefe9