Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 52746 Details for
Bug 162400
[1.5][compiler] Return type inference does not perform well in array initializer
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed patch
162400.txt (text/plain), 2.04 KB, created by
Philipe Mulet
on 2006-10-26 09:46:47 EDT
(
hide
)
Description:
Proposed patch
Filename:
MIME Type:
Creator:
Philipe Mulet
Created:
2006-10-26 09:46:47 EDT
Size:
2.04 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: compiler/org/eclipse/jdt/internal/compiler/ast/ArrayInitializer.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ArrayInitializer.java,v >retrieving revision 1.44 >diff -u -r1.44 ArrayInitializer.java >--- compiler/org/eclipse/jdt/internal/compiler/ast/ArrayInitializer.java 13 Oct 2006 19:20:46 -0000 1.44 >+++ compiler/org/eclipse/jdt/internal/compiler/ast/ArrayInitializer.java 26 Oct 2006 13:50:25 -0000 >@@ -154,6 +154,7 @@ > TypeBinding elementType = this.binding.elementsType(); > for (int i = 0, length = this.expressions.length; i < length; i++) { > Expression expression = this.expressions[i]; >+ expression.setExpectedType(elementType); > TypeBinding exprType = expression instanceof ArrayInitializer > ? expression.resolveTypeExpecting(scope, elementType) > : expression.resolveType(scope); >#P org.eclipse.jdt.core.tests.compiler >Index: src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java,v >retrieving revision 1.543 >diff -u -r1.543 GenericTypeTest.java >--- src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java 19 Oct 2006 12:11:12 -0000 1.543 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java 26 Oct 2006 13:50:39 -0000 >@@ -33960,4 +33960,20 @@ > }, > ""); > } >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=162400 >+public void test1056() { >+ this.runConformTest( >+ new String[] { >+ "X.java", >+ "public class X {\n" + >+ " static <T> T foo() {\n" + >+ " return null;\n" + >+ " }\n" + >+ " public static void main(String[] args) {\n" + >+ " String[] s = { foo() };\n" + >+ " } \n" + >+ "}\n", >+ }, >+ ""); >+} > } >\ No newline at end of file
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 162400
: 52746