Homework 3
This commit is contained in:
parent
bf60a078d7
commit
0afc86ceeb
129 changed files with 3163 additions and 4316 deletions
|
@ -0,0 +1,19 @@
|
|||
// call an method that does not exist (even in superclass)
|
||||
|
||||
class Main extends Other {
|
||||
void main() {
|
||||
aux();
|
||||
go();
|
||||
}
|
||||
|
||||
void aux() {}
|
||||
}
|
||||
|
||||
class Other {
|
||||
void aux() {}
|
||||
void otherAux() {}
|
||||
void noGo() {}
|
||||
void GO() {}
|
||||
void gO() {}
|
||||
void Go() {}
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
// No such type in method body (handled by TypeGenerator)
|
||||
|
||||
class Main {
|
||||
void method(NoSuchType param) {}
|
||||
void main() {}
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
// No such type in method body (handled by checkCircularInheritance)
|
||||
|
||||
class Main extends NoSuchType {
|
||||
void main() {}
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
// No such type in method body (handled by ExprVisitor and StmtVisitor)
|
||||
|
||||
class Main {
|
||||
void main() {
|
||||
Object a;
|
||||
write((NoType) a);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
// Test NO SUCH VARIABLE
|
||||
// All referenced variables must exist.
|
||||
|
||||
class Main extends Other {
|
||||
int a;
|
||||
int b;
|
||||
int C;
|
||||
Object notC;
|
||||
|
||||
void main() {
|
||||
int a;
|
||||
boolean b;
|
||||
write(c + 1);
|
||||
}
|
||||
}
|
||||
|
||||
class Other {
|
||||
boolean a;
|
||||
boolean b;
|
||||
boolean C;
|
||||
Object[] notC;
|
||||
|
||||
void main() {
|
||||
int a;
|
||||
boolean b;
|
||||
Object c;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue