computeCurrentBogusState() public method

public computeCurrentBogusState ( ) : bool
return bool
Exemplo n.º 1
0
        public bool CheckBogus(CType pType)
        {
            if (pType == null)
            {
                return(false);
            }

            if (!pType.hasBogus())
            {
                bool fBogus = pType.computeCurrentBogusState();

                if (fBogus)
                {
                    // Only set this if everything is declared or
                    // at least 1 declared thing is bogus
                    pType.setBogus(fBogus);
                }
            }

            return(pType.hasBogus() && pType.checkBogus());
        }
Exemplo n.º 2
0
        public bool CheckBogus(CType pType)
        {
            if (pType == null)
            {
                return false;
            }

            if (!pType.hasBogus())
            {
                bool fBogus = pType.computeCurrentBogusState();

                if (fBogus)
                {
                    // Only set this if everything is declared or
                    // at least 1 declared thing is bogus
                    pType.setBogus(fBogus);
                }
            }

            return pType.hasBogus() && pType.checkBogus();
        }
Exemplo n.º 3
0
Arquivo: Symbol.cs Projeto: qzb/corefx
        public bool computeCurrentBogusState()
        {
            if (hasBogus())
            {
                return(checkBogus());
            }

            bool fBogus = false;

            switch (getKind())
            {
            case SYMKIND.SK_PropertySymbol:
            case SYMKIND.SK_MethodSymbol:
            {
                MethodOrPropertySymbol meth = (MethodOrPropertySymbol)this;

                if (meth.RetType != null)
                {
                    fBogus = meth.RetType.computeCurrentBogusState();
                }
                if (meth.Params != null)
                {
                    for (int i = 0; !fBogus && i < meth.Params.Count; i++)
                    {
                        fBogus |= meth.Params[i].computeCurrentBogusState();
                    }
                }
            }
            break;

            /*
             * case SYMKIND.SK_ParameterModifierType:
             * case SYMKIND.SK_OptionalModifierType:
             * case SYMKIND.SK_PointerType:
             * case SYMKIND.SK_ArrayType:
             * case SYMKIND.SK_NullableType:
             * case SYMKIND.SK_PinnedType:
             *  if (this.AsType().GetBaseOrParameterOrElementType() != null)
             *  {
             *      fBogus = this.AsType().GetBaseOrParameterOrElementType().computeCurrentBogusState();
             *  }
             *  break;
             */

            case SYMKIND.SK_EventSymbol:
                CType evType = ((EventSymbol)this).type;
                if (evType != null)
                {
                    fBogus = evType.computeCurrentBogusState();
                }
                break;

            case SYMKIND.SK_FieldSymbol:
                var fiType = ((FieldSymbol)this).GetType();
                if (fiType != null)
                {
                    fBogus = fiType.computeCurrentBogusState();
                }
                break;

            /*
             * case SYMKIND.SK_ErrorType:
             *  this.setBogus(false);
             *  break;
             *
             * case SYMKIND.SK_AggregateType:
             *  fBogus = this.AsAggregateType().getAggregate().computeCurrentBogusState();
             *  for (int i = 0; !fBogus && i < this.AsAggregateType().GetTypeArgsAll().size; i++)
             *  {
             *      fBogus |= this.AsAggregateType().GetTypeArgsAll()[i].computeCurrentBogusState();
             *  }
             *  break;
             */

            case SYMKIND.SK_TypeParameterSymbol:
            case SYMKIND.SK_LocalVariableSymbol:
                setBogus(false);
                break;

            case SYMKIND.SK_AggregateSymbol:
                fBogus = hasBogus() && checkBogus();
                break;

            default:
                Debug.Assert(false, "CheckBogus with invalid Symbol kind");
                setBogus(false);
                break;
            }

            if (fBogus)
            {
                // Only set this if at least 1 declared thing is bogus
                setBogus(fBogus);
            }

            return(hasBogus() && checkBogus());
        }