summaryrefslogtreecommitdiff
path: root/output/negative/TrickyOverload-error2.java
diff options
context:
space:
mode:
authorbd-912 <bdunahu@colostate.edu>2024-05-10 13:11:34 -0600
committerbd-912 <bdunahu@colostate.edu>2024-05-10 13:11:34 -0600
commit4b50a7a2b41373cc9b1644e584886f22da312848 (patch)
tree00e81d06dc29f31c43a2ca73dc19737f7478b31f /output/negative/TrickyOverload-error2.java
parent58fa180a069cef9692f002cb5b5eb401d6c90d0b (diff)
More examples, another small fix for detecting overloads
Diffstat (limited to 'output/negative/TrickyOverload-error2.java')
-rw-r--r--output/negative/TrickyOverload-error2.java21
1 files changed, 21 insertions, 0 deletions
diff --git a/output/negative/TrickyOverload-error2.java b/output/negative/TrickyOverload-error2.java
new file mode 100644
index 0000000..ee51626
--- /dev/null
+++ b/output/negative/TrickyOverload-error2.java
@@ -0,0 +1,21 @@
+class Overloading {
+ public static void main(String[] args) {
+ System.out.println(new A().init());
+ }
+}
+
+class A {
+ public int init() {
+ return 0;
+ }
+
+ public int x(B a) {
+ return 1;
+ }
+}
+
+class B extends A {
+ public int x(A a) {
+ return 2;
+ }
+}