Skip to content

Commit 7441d11

Browse files
committed
Add test cases to detect class declaration order bugs
1 parent 9b53cf6 commit 7441d11

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

src/types/checker/__tests__/classes.test.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,29 @@ const testcases: {
9696
}
9797
`,
9898
result: { type: null, errors: [new CyclicInheritanceError()] }
99+
},
100+
{
101+
input: `
102+
class A extends B {}
103+
class B {}
104+
105+
public class Main {
106+
public static void main(String[] args) {}
107+
}
108+
`,
109+
result: { type: null, errors: [] }
110+
},
111+
{
112+
input: `
113+
class A {
114+
public void hello(B b) {}
115+
}
116+
class B {}
117+
public class Main {
118+
public static void main(String[] args) {}
119+
}
120+
`,
121+
result: { type: null, errors: [] }
99122
}
100123
]
101124

0 commit comments

Comments
 (0)