Closed AjaniBilby closed 3 years ago
struct Person {
int id;
int age;
float height;
}
Person init() {
Person p = Blank#[Person]();
decompose p;
p.id = 0;
p.age = 18;
compose p;
return p;
}
int main() {
Person p = init();
print(p.age);
return 0;
}
struct Person {
int id;
int age;
float height;
}
Person init(bool ofAge) {
Person p = Blank#[Person]();
p.id = 0;
if (ofAge) {
p.age = 21;
} else {
p.age = 16;
}
return p;
}
FAILED
Now successfully passes both test cases
Able to decompose by automatically
Person p = Blank#[Person]();
p.age = 18;
Able to handle multiple composition states
Person p = Blank#[Person]();
if (ofAge) {
p.age = 21;
}
consume(p);
Progress Summary:
Progress Summary: