-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Methods can now be called with null as argument
- Loading branch information
raphaelsack
committed
May 21, 2022
1 parent
7be5f82
commit 19e4e6a
Showing
12 changed files
with
364 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// Local or Field or Imported var Test | ||
class LOFOI { | ||
|
||
// This test is to determine wheter the order of finding the vars is correct | ||
|
||
int System; | ||
|
||
public LOFOI() { | ||
System = 10; | ||
} | ||
|
||
public int foo() { | ||
int System = 20; | ||
return System; | ||
} | ||
|
||
public int bar() { | ||
return System; | ||
} | ||
|
||
public int baz() { | ||
System.out.println('1'); | ||
} | ||
|
||
} | ||
|
||
class OtherLOFOI { | ||
|
||
LOFOI System; | ||
|
||
void foo() { | ||
System.out.println('1'); | ||
} | ||
|
||
} |
45 changes: 45 additions & 0 deletions
45
HouseOfCompiler/src/test/resources/FailTests/MultipleMethodsConflict.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
class MultipleMethodsConflict { | ||
|
||
// Test is used to determine wheter the Right method with the right types is | ||
// called | ||
|
||
public int foo(int i) { | ||
Helper help = new Helper(); | ||
if (i < 5) { | ||
return test(); | ||
} else if (i < 10) { | ||
return test(i); | ||
} else if (i < 20) { | ||
return test(this, null); | ||
} else if (i < 30) { | ||
return test(null, null); | ||
} else { | ||
return test(this, this); | ||
} | ||
} | ||
|
||
public int test() { | ||
System.out.println(0); | ||
return 0; | ||
} | ||
|
||
public int test(int i) { | ||
System.out.println(i); | ||
return i; | ||
} | ||
|
||
public int test(MultipleMethodsConflict o, MultipleMethodsConflict b) { | ||
System.out.println(1337); | ||
return 1337; | ||
} | ||
|
||
public int test(MultipleMethodsConflict o, Helper b) { | ||
System.out.println(420); | ||
return 420; | ||
} | ||
|
||
} | ||
|
||
class Helper { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Local or Field or Imported var Test | ||
class LOFOI { | ||
|
||
// This test is to determine wheter the order of finding the vars is correct | ||
|
||
int System; | ||
|
||
public LOFOI() { | ||
System = 10; | ||
} | ||
|
||
public int foo() { | ||
int System = 20; | ||
return System; | ||
} | ||
|
||
public int bar() { | ||
return System; | ||
} | ||
|
||
} |
Oops, something went wrong.