*** empty log message ***
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / internal / compiler / ast / CastExpression.java
index f295b80..e103ccc 100644 (file)
 package net.sourceforge.phpdt.internal.compiler.ast;
 
 import net.sourceforge.phpdt.internal.compiler.IAbstractSyntaxTreeVisitor;
-import net.sourceforge.phpdt.internal.compiler.impl.*;
-import net.sourceforge.phpdt.internal.compiler.codegen.*;
-import net.sourceforge.phpdt.internal.compiler.flow.*;
-import net.sourceforge.phpdt.internal.compiler.lookup.*;
+import net.sourceforge.phpdt.internal.compiler.codegen.CodeStream;
+import net.sourceforge.phpdt.internal.compiler.flow.FlowContext;
+import net.sourceforge.phpdt.internal.compiler.flow.FlowInfo;
+import net.sourceforge.phpdt.internal.compiler.impl.Constant;
+import net.sourceforge.phpdt.internal.compiler.lookup.ArrayBinding;
+import net.sourceforge.phpdt.internal.compiler.lookup.BaseTypeBinding;
+import net.sourceforge.phpdt.internal.compiler.lookup.BlockScope;
+import net.sourceforge.phpdt.internal.compiler.lookup.MethodBinding;
+import net.sourceforge.phpdt.internal.compiler.lookup.ReferenceBinding;
+import net.sourceforge.phpdt.internal.compiler.lookup.Scope;
+import net.sourceforge.phpdt.internal.compiler.lookup.TypeBinding;
 
 public class CastExpression extends Expression {
 
@@ -75,7 +82,7 @@ public class CastExpression extends Expression {
                                        constant = expression.constant; //use the same constant
                                        return;
                                }
-                               if (scope.areTypesCompatible(expressionTb, castTb)
+                               if (BlockScope.areTypesCompatible(expressionTb, castTb)
                                        || BaseTypeBinding.isNarrowing(castTb.id, expressionTb.id)) {
                                        expression.implicitConversion = (castTb.id << 4) + expressionTb.id;
                                        if (expression.constant != Constant.NotAConstant)
@@ -138,9 +145,9 @@ public class CastExpression extends Expression {
                                }
                        } else if (
                                castTb.isClass()) { // ----- (castTb.isClass) expressionTb.isClass ------
-                               if (scope.areTypesCompatible(expressionTb, castTb)) // no runtime error
+                               if (BlockScope.areTypesCompatible(expressionTb, castTb)) // no runtime error
                                        return;
-                               if (scope.areTypesCompatible(castTb, expressionTb)) {
+                               if (BlockScope.areTypesCompatible(castTb, expressionTb)) {
                                        // potential runtime  error
                                        needRuntimeCheckcast = true;
                                        return;
@@ -148,7 +155,7 @@ public class CastExpression extends Expression {
                        } else { // ----- (castTb.isInterface) expressionTb.isClass -------  
                                if (((ReferenceBinding) expressionTb).isFinal()) {
                                        // no subclass for expressionTb, thus compile-time check is valid
-                                       if (scope.areTypesCompatible(expressionTb, castTb))
+                                       if (BlockScope.areTypesCompatible(expressionTb, castTb))
                                                return;
                                } else { // a subclass may implement the interface ==> no check at compile time
                                        needRuntimeCheckcast = true;
@@ -174,7 +181,7 @@ public class CastExpression extends Expression {
                                return;
                        if (((ReferenceBinding) castTb).isFinal()) {
                                // no subclass for castTb, thus compile-time check is valid
-                               if (!scope.areTypesCompatible(castTb, expressionTb)) {
+                               if (!BlockScope.areTypesCompatible(castTb, expressionTb)) {
                                        // potential runtime error
                                        scope.problemReporter().typeCastError(this, castTb, expressionTb);
                                        return;