197 ste(MAIN_SNIPPET, VALID, VALID, false, null), |
197 ste(MAIN_SNIPPET, VALID, VALID, false, null), |
198 ste(a, VALID, OVERWRITTEN, false, MAIN_SNIPPET)); |
198 ste(a, VALID, OVERWRITTEN, false, MAIN_SNIPPET)); |
199 assertActiveKeys(); |
199 assertActiveKeys(); |
200 } |
200 } |
201 |
201 |
|
202 // 8199762 |
|
203 public void methodsRedeclaration5() { |
|
204 Snippet m1 = methodKey(assertEval("int m(Object o) { return 10; }")); |
|
205 assertMethods(method("(Object)int", "m")); |
|
206 |
|
207 Snippet m2 = methodKey(assertEval("int m(Object o) { return 30; }", |
|
208 ste(MAIN_SNIPPET, VALID, VALID, false, null), |
|
209 ste(m1, VALID, OVERWRITTEN, false, MAIN_SNIPPET))); |
|
210 |
|
211 assertEval("<T> int m(T o) { return 30; }", |
|
212 ste(MAIN_SNIPPET, VALID, VALID, true, null), |
|
213 ste(m2, VALID, OVERWRITTEN, false, MAIN_SNIPPET)); |
|
214 assertMethods(method("(T)int", "m")); |
|
215 assertEval("m(null)", "30"); |
|
216 assertActiveKeys(); |
|
217 } |
|
218 |
202 public void methodsErrors() { |
219 public void methodsErrors() { |
203 assertDeclareFail("String f();", |
220 assertDeclareFail("String f();", |
204 new ExpectedDiagnostic("compiler.err.missing.meth.body.or.decl.abstract", 0, 11, 7, -1, -1, Diagnostic.Kind.ERROR)); |
221 new ExpectedDiagnostic("compiler.err.missing.meth.body.or.decl.abstract", 0, 11, 7, -1, -1, Diagnostic.Kind.ERROR)); |
205 assertNumberOfActiveMethods(0); |
222 assertNumberOfActiveMethods(0); |
206 assertActiveKeys(); |
223 assertActiveKeys(); |