Lines 122-128
Link Here
|
122 |
static { |
122 |
static { |
123 |
// TESTS_NAMES = new String[] {"test0602"}; |
123 |
// TESTS_NAMES = new String[] {"test0602"}; |
124 |
// TESTS_RANGE = new int[] { 713, -1 }; |
124 |
// TESTS_RANGE = new int[] { 713, -1 }; |
125 |
// TESTS_NUMBERS = new int[] { 710, 711 }; |
125 |
// TESTS_NUMBERS = new int[] { 718 }; |
126 |
} |
126 |
} |
127 |
public static Test suite() { |
127 |
public static Test suite() { |
128 |
return buildModelTestSuite(ASTConverterTestAST3_2.class); |
128 |
return buildModelTestSuite(ASTConverterTestAST3_2.class); |
Lines 10496-10499
Link Here
|
10496 |
} |
10496 |
} |
10497 |
}); |
10497 |
}); |
10498 |
} |
10498 |
} |
|
|
10499 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=296629 |
10500 |
public void test0718() throws JavaModelException { |
10501 |
ICompilationUnit workingCopy = null; |
10502 |
try { |
10503 |
workingCopy = getWorkingCopy("/Converter/src/X.java", true/*resolve*/); |
10504 |
String contents = |
10505 |
"public class X {\n" + |
10506 |
" public void v() {\n" + |
10507 |
" class Test2 {}\n" + |
10508 |
" Test2 t = get();\n" + |
10509 |
" t.toString();\n" + |
10510 |
" }\n" + |
10511 |
" public Object get() {return null;}\n" + |
10512 |
"}"; |
10513 |
|
10514 |
CompilationUnit unit = (CompilationUnit) buildAST( |
10515 |
contents, |
10516 |
workingCopy, |
10517 |
false); |
10518 |
VariableDeclarationStatement statement = (VariableDeclarationStatement) getASTNode(unit, 0, 0, 1); |
10519 |
ITypeBinding typeBinding = statement.getType().resolveBinding(); |
10520 |
ITypeBinding typeBinding2 = ((VariableDeclarationFragment) statement.fragments().get(0)).getInitializer().resolveTypeBinding(); |
10521 |
assertTrue("Is not cast compatible", typeBinding.isCastCompatible(typeBinding2)); |
10522 |
} finally { |
10523 |
if (workingCopy != null) { |
10524 |
workingCopy.discardWorkingCopy(); |
10525 |
} |
10526 |
} |
10527 |
} |
10499 |
} |
10528 |
} |