diff options
author | bd-912 <bdunahu@colostate.edu> | 2024-05-09 00:36:50 -0600 |
---|---|---|
committer | bd-912 <bdunahu@colostate.edu> | 2024-05-09 00:36:50 -0600 |
commit | f86e714a4fdebb994101813a5fa6664f5883a0ab (patch) | |
tree | 727bec17afbb6fc373d6a6b73a69ba47ad1b7a4c /output/negative/CallNonSubType-error.java | |
parent | f59241de07bfc0170fe3a18dc279d2a66bd58fdb (diff) |
Many final bug-fixes in heat visitor, symbol table
Diffstat (limited to 'output/negative/CallNonSubType-error.java')
-rw-r--r-- | output/negative/CallNonSubType-error.java | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/output/negative/CallNonSubType-error.java b/output/negative/CallNonSubType-error.java new file mode 100644 index 0000000..f1cc63d --- /dev/null +++ b/output/negative/CallNonSubType-error.java @@ -0,0 +1,38 @@ +class CallNonSubType { + public static void main(String[] z) { + A a ; + A b ; + C c ; + a = new A() ; + b = new A() ; + c = new C() ; + System.out.println(c.play_with_classes(a, b)) ; + } +} + +class A { + + public int get_tt() { + return 32 ; + } + +} + +class B extends A { + + int useless ; + +} + +class C { + + public int play_with_classes(A a, B b) { + int ret ; + int x ; + int y ; + x = a.get_tt() ; + y = b.get_tt() ; + ret = x + y ; + return ret ; + } +} |