CS153/hw5/hw5programs/tc_subtyping_err8.oat
jmug cfe502c598 Add all the assignment code.
Signed-off-by: jmug <u.g.a.mariano@gmail.com>
2025-01-24 18:59:28 -08:00

19 lines
No EOL
280 B
Text

struct A { int x }
struct B { int x ; int y }
struct C { int x ; int y ; int z }
/* C <: B B <: B */
/* ---------------------- */
/* (B) -> B <: (C) -> B */
B? f(B b) {
return b;
}
void g((C) -> B f) {
return;
}
int program(string[] args) {
g(f);
return 0;
}