private boolean initialCallExpressionCheck(CallExpression node) {
            // handle expressions
            Expression expr = node.getExpression();

            // if expression is a variable handle as either a variable or as a
            // reference to a fully-qualified application
            if (expr instanceof VariableRef) {
                String name = ((VariableRef) expr).getName();

                // if variable not defined, attempt to lookup as a
                // fully-qualifed application or type reference
                if (mScope.getDeclaredVariable(name) == null) {
                    // check if type reference
                    Class<?> type = lookupType(name, 0, null);
                    if (type != null) {
                        expr = checkForTypeExpression(expr);
                        if (expr == null) {
                            return false;
                        }

                        node.setExpression(expr);
                    }

                    // otherwise, assume fully-qualified application target
                    else {
                        Name target = node.getTarget();
                        String tname = name + '.' + target.getName();

                        expr = null;
                        node.setExpression(null);
                        node.setTarget(new Name(target.getSourceInfo(), tname));
                    }
                }

                // otherwise, assume standard function on the variable
                else {
                    // nothing to do...check will ensure proper type.
                }
            }

            // handle lookups by determining if static field or normal function
            // call on a looked up property
            else if (expr instanceof Lookup) {
                expr = checkForTypeExpression(expr);
                if (expr == null) {
                    return false;
                }

                node.setExpression(expr);
            }

            // check expression if available
            if (expr != null) {
                check(expr);
            }

            // check params list
            ExpressionList params = node.getParams();
            check(params);

            // check initializer
            Statement init = node.getInitializer();
            if (init != null) {
                check(init);
            }

            // handle substitution block
            Block subParam = node.getSubstitutionParam();
            if (subParam != null) {
                // Enter a new scope because variable declarations local
                // to a substitution block might never get a value assigned
                // because there is no guarantee it will ever execute.
                Scope subScope = enterScope();
                check(subParam);
                exitScope();

                Variable[] vars = subScope.promote();

                if (vars.length > 0) {
                    // Since the subParam can be executed multiple times,
                    // variables must be of the correct type before entering
                    // the scope.
                    node.setInitializer
                        (createConversions(mScope, vars,node.getSourceInfo()));

                    // Apply any conversions at the end of the subParam as well
                    // in order for the variables to be of the correct type
                    // when accessed again at the start of the body.
                    subParam.setFinalizer
                        (createConversions
                         (subScope, vars, subParam.getSourceInfo()));

                    // Promoted variables need to become fields
                    for (int i=0; i<vars.length; i++) {
                        vars[i].setField(true);
                    }

                    // Declare all promoted variables outside subParam scope.
                    mScope.declareVariables(vars);

                    // Re-check subParam to account for variable declaration
                    // changes.
                    if (mErrorCount == 0) {
                        subScope.delete();
                        subScope = enterScope();
                        check(subParam);
                        exitScope();
                    }
                }

                // References inside a substitution block to variables
                // outside need to be fields so that they can be shared.
                VariableRef[] refs = subScope.getOutOfScopeVariableRefs();
                for (int i=0; i<refs.length; i++) {
                    refs[i].getVariable().setField(true);
                }
            }

            Expression[] exprs = params.getExpressions();
            int length = exprs.length;
            for (int i=0; i<length; i++) {
                if (exprs[i].getType() == null) {
                    // Type of a parameter is unknown, so bail out.
                    return false;
                }
            }

            Compiler compiler = mUnit.getCompiler();
            if (compiler == null) {
                return false;
            }

            return true;
        }