Created
March 21, 2019 17:42
-
-
Save benknoble/e4cab8fab2245b0fdb7d1d333d6d04ce to your computer and use it in GitHub Desktop.
Tests for identification pass; all commented code should be errors
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
// PA2 pass new expr | |
class A { | |
int[] is; | |
int x; | |
// uncomment to test hiding | |
// int x; | |
int x() { return 0 ; } | |
A alpha; | |
static int S() { | |
// uncomment and see what happens | |
// f(); | |
// B.P(); | |
// if (true) | |
// int x = 5; | |
// else | |
// int y = 5; | |
// while (true) | |
// int z = 5; | |
// this.x(); | |
S(); | |
B.S(); | |
return 1; | |
} | |
void p(A ala){ | |
int[] b = new int[10]; | |
A a = new A(); | |
S(); | |
int y_prime = x; | |
int yy_prime = x(); | |
int z = b[2]; | |
// int zz = i; | |
d(0); | |
d(f()); | |
d(yy_prime); | |
int[] aa = new int[f()]; | |
int y = this.x; | |
// int yyy = this.x.x(); | |
int yy = this.x(); | |
int is_prime = this.is[2]; | |
this.d(0); | |
this.S(); | |
this.alpha.x(); | |
int alpha_i = this.alpha.is[2]; | |
this.alpha.S(); | |
int ala_i = this.ala.is[2]; | |
int a_i = a.is[2]; | |
} | |
void d(int i) { } | |
int f() { return 0; } | |
private void pr() { } | |
// uncomment to test hiding | |
// void hide(int i) { int i = 1; } | |
// uncomment to test duplicates | |
// int d(int i) { } | |
} | |
class B { | |
public static void main(String[] args) { | |
A a = new A(); | |
a.p(a); | |
a.d(a.f()); | |
A.S(); | |
a.S(); | |
// uncomment and see what happens | |
// a.pr(); | |
} | |
public static void S() {} | |
private static void P() {} | |
} | |
// class B {} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment