class Foo { var int f ....}
class Bar extends Foo{ var int g ....}
function void test(Foo x){}
let x = new Bar();
test(x) // LLVM complains as Bar * struct rather than Foo * struct
Since a Bar struct
{
int f,
int g
}
just extends the Foo representation
{
int f
}
this only requires a pointer bit-cast - just a small subtlety to keep LLVM happy.
If we have
Since a Bar struct
just extends the Foo representation
this only requires a pointer bit-cast - just a small subtlety to keep LLVM happy.