Add all the assignment code.
Signed-off-by: jmug <u.g.a.mariano@gmail.com>
This commit is contained in:
parent
58c6b1f81c
commit
cfe502c598
1277 changed files with 48709 additions and 1 deletions
19
hw6/hw5programs/tc_subtyping8.oat
Normal file
19
hw6/hw5programs/tc_subtyping8.oat
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
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;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue