View | Details | Raw Unified | Return to bug 162400
Collapse All | Expand All

(-)compiler/org/eclipse/jdt/internal/compiler/ast/ArrayInitializer.java (+1 lines)
Lines 154-159 Link Here
154
			TypeBinding elementType = this.binding.elementsType();
154
			TypeBinding elementType = this.binding.elementsType();
155
			for (int i = 0, length = this.expressions.length; i < length; i++) {
155
			for (int i = 0, length = this.expressions.length; i < length; i++) {
156
				Expression expression = this.expressions[i];
156
				Expression expression = this.expressions[i];
157
				expression.setExpectedType(elementType);
157
				TypeBinding exprType = expression instanceof ArrayInitializer
158
				TypeBinding exprType = expression instanceof ArrayInitializer
158
						? expression.resolveTypeExpecting(scope, elementType)
159
						? expression.resolveTypeExpecting(scope, elementType)
159
						: expression.resolveType(scope);
160
						: expression.resolveType(scope);
(-)src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java (+16 lines)
Lines 33960-33963 Link Here
33960
		}, 
33960
		}, 
33961
		"");
33961
		"");
33962
}
33962
}
33963
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=162400
33964
public void test1056() {
33965
	this.runConformTest(
33966
		new String[] {
33967
			"X.java",
33968
			"public class X {\n" + 
33969
			"	static <T> T foo() {\n" + 
33970
			"		return null;\n" + 
33971
			"	}\n" + 
33972
			"	public static void main(String[] args) {\n" + 
33973
			"		String[] s = { foo() };\n" + 
33974
			"	}	\n" + 
33975
			"}\n",
33976
		}, 
33977
		"");
33978
}
33963
}
33979
}

Return to bug 162400