Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 247201
Collapse All | Expand All

(-)src/org/eclipse/wst/jsdt/internal/compiler/ast/NameReference.java (-1 / +10 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2008 IBM Corporation and others.
2
 * Copyright (c) 2000, 2010 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 15-21 Link Here
15
import org.eclipse.wst.jsdt.internal.compiler.lookup.Binding;
15
import org.eclipse.wst.jsdt.internal.compiler.lookup.Binding;
16
import org.eclipse.wst.jsdt.internal.compiler.lookup.FieldBinding;
16
import org.eclipse.wst.jsdt.internal.compiler.lookup.FieldBinding;
17
17
18
import org.eclipse.wst.jsdt.internal.compiler.lookup.FunctionTypeBinding;
18
import org.eclipse.wst.jsdt.internal.compiler.lookup.InvocationSite;
19
import org.eclipse.wst.jsdt.internal.compiler.lookup.InvocationSite;
20
import org.eclipse.wst.jsdt.internal.compiler.lookup.LocalVariableBinding;
19
import org.eclipse.wst.jsdt.internal.compiler.lookup.MethodBinding;
21
import org.eclipse.wst.jsdt.internal.compiler.lookup.MethodBinding;
20
import org.eclipse.wst.jsdt.internal.compiler.lookup.ReferenceBinding;
22
import org.eclipse.wst.jsdt.internal.compiler.lookup.ReferenceBinding;
21
import org.eclipse.wst.jsdt.internal.compiler.lookup.TypeBinding;
23
import org.eclipse.wst.jsdt.internal.compiler.lookup.TypeBinding;
Lines 77-82 Link Here
77
	   {
79
	   {
78
		   MethodBinding constructorBinding=(MethodBinding)alternateBinding;
80
		   MethodBinding constructorBinding=(MethodBinding)alternateBinding;
79
		   alternateBinding=constructorBinding.returnType;
81
		   alternateBinding=constructorBinding.returnType;
82
	   } else if(alternateBinding instanceof LocalVariableBinding) {
83
		   if(((LocalVariableBinding)alternateBinding).type instanceof FunctionTypeBinding) {
84
			   FunctionTypeBinding functionBinding = (FunctionTypeBinding)((LocalVariableBinding)alternateBinding).type;
85
			   if(functionBinding.functionBinding.isConstructor()) {
86
				   alternateBinding = functionBinding.functionBinding.returnType;
87
			   }
88
		   }
80
	   }
89
	   }
81
	
90
	
82
	return alternateBinding;
91
	return alternateBinding;
(-)src/org/eclipse/wst/jsdt/internal/compiler/ast/FieldReference.java (+3 lines)
Lines 432-437 Link Here
432
					&& fieldBinding.declaringClass.canBeSeenBy(scope)) {
432
					&& fieldBinding.declaringClass.canBeSeenBy(scope)) {
433
				scope.problemReporter().indirectAccessToStaticField(this, fieldBinding);
433
				scope.problemReporter().indirectAccessToStaticField(this, fieldBinding);
434
			}
434
			}
435
		} else {
436
			if(receiverIsType)
437
				scope.problemReporter().staticFieldAccessToNonStaticVariable(this, fieldBinding);
435
		}
438
		}
436
		// perform capture conversion if read access
439
		// perform capture conversion if read access
437
		return this.resolvedType = fieldBinding.type;
440
		return this.resolvedType = fieldBinding.type;
(-)src/org/eclipse/wst/jsdt/internal/compiler/ast/SingleNameReference.java (-7 / +7 lines)
Lines 391-403 Link Here
391
//								scope.problemReporter().cannotReferToNonFinalOuterLocal((LocalVariableBinding)variable, this);
391
//								scope.problemReporter().cannotReferToNonFinalOuterLocal((LocalVariableBinding)variable, this);
392
//							}
392
//							}
393
							TypeBinding fieldType = variable.type;
393
							TypeBinding fieldType = variable.type;
394
							if (fieldType.isAnonymousType() && !fieldType.isObjectLiteralType()) {
394
//							if (fieldType.isAnonymousType() && !fieldType.isObjectLiteralType()) {
395
								LocalDeclaration declaration = ((LocalVariableBinding)binding).declaration;
395
//								LocalDeclaration declaration = ((LocalVariableBinding)binding).declaration;
396
								if(declaration != null && !(declaration.getInitialization() instanceof AllocationExpression) &&
396
//								if(declaration != null && !(declaration.getInitialization() instanceof AllocationExpression) &&
397
										! (declaration.getInitialization() instanceof Literal)) {
397
//										! (declaration.getInitialization() instanceof Literal)) {
398
									bits |= Binding.TYPE;
398
//									bits |= Binding.TYPE;
399
								}
399
//								}
400
							}
400
//							}
401
								
401
								
402
							if (useType!=null && !(useType.id==T_null ||useType.id==T_any))
402
							if (useType!=null && !(useType.id==T_null ||useType.id==T_any))
403
							{
403
							{
(-)src/org/eclipse/wst/jsdt/internal/compiler/ast/OperatorExpression.java (-1 / +2 lines)
Lines 1472-1478 Link Here
1472
		//	table[(T_JavaLangString<<4)+T_undefined] 	= T_undefined;
1472
		//	table[(T_JavaLangString<<4)+T_undefined] 	= T_undefined;
1473
		table[(T_JavaLangString<<4)+T_long] 		= (String2String<<12)+(Long2Long<<4)+T_JavaLangString;
1473
		table[(T_JavaLangString<<4)+T_long] 		= (String2String<<12)+(Long2Long<<4)+T_JavaLangString;
1474
		table[(T_JavaLangString<<4)+T_short] 		= (String2String<<12)+(Short2Short<<4)+T_JavaLangString;
1474
		table[(T_JavaLangString<<4)+T_short] 		= (String2String<<12)+(Short2Short<<4)+T_JavaLangString;
1475
		//	table[(T_JavaLangString<<4)+T_void] 		= T_undefined;
1475
		table[(T_JavaLangString<<4)+T_void] 		= T_JavaLangString;
1476
		table[(T_JavaLangString<<4)+T_JavaLangString] 		= (String2String<<12)+(String2String<<4)+T_JavaLangString;
1476
		table[(T_JavaLangString<<4)+T_JavaLangString] 		= (String2String<<12)+(String2String<<4)+T_JavaLangString;
1477
		table[(T_JavaLangString<<4)+T_JavaLangObject] 		= (String2String<<12)+(Object2Object<<4)+T_JavaLangString;
1477
		table[(T_JavaLangString<<4)+T_JavaLangObject] 		= (String2String<<12)+(Object2Object<<4)+T_JavaLangString;
1478
		table[(T_JavaLangString<<4)+T_double] 		= (String2String<<12)+(Double2Double<<4)+T_JavaLangString;
1478
		table[(T_JavaLangString<<4)+T_double] 		= (String2String<<12)+(Double2Double<<4)+T_JavaLangString;
Lines 1482-1487 Link Here
1482
		table[(T_JavaLangString<<4)+T_int] 			= (String2String<<12)+(Int2Int<<4)+T_JavaLangString;
1482
		table[(T_JavaLangString<<4)+T_int] 			= (String2String<<12)+(Int2Int<<4)+T_JavaLangString;
1483
		table[(T_JavaLangString<<4)+T_null] 		= (String2String<<12)+(T_null<<8)+(T_null<<4)+T_JavaLangString;
1483
		table[(T_JavaLangString<<4)+T_null] 		= (String2String<<12)+(T_null<<8)+(T_null<<4)+T_JavaLangString;
1484
		table[(T_JavaLangString<<4)+T_any] 			= T_JavaLangString;
1484
		table[(T_JavaLangString<<4)+T_any] 			= T_JavaLangString;
1485
		table[(T_JavaLangString<<4)+T_function]		= T_any;
1485
1486
1486
		//	table[(T_Object<<4)+T_undefined] 	= T_undefined;
1487
		//	table[(T_Object<<4)+T_undefined] 	= T_undefined;
1487
		//	table[(T_Object<<4)+T_byte] 		= T_undefined;
1488
		//	table[(T_Object<<4)+T_byte] 		= T_undefined;

Return to bug 247201