Pytocs.TypeInference.State.lookupType C# (CSharp) Method

lookupType() public method

Look for a binding named {@code name} and if found, return its type.
public lookupType ( string name ) : DataType
name string
return DataType
        public DataType lookupType(string name)
        {
            ISet<Binding> bs = Lookup(name);
            if (bs == null)
            {
                return null;
            }
            else
            {
                return MakeUnion(bs);
            }
        }

Usage Example

Beispiel #1
0
        ModuleType GetCachedModule(string file)
        {
            DataType t = ModuleTable.lookupType(GetModuleQname(file));

            if (t == null)
            {
                return(null);
            }
            else if (t is UnionType)
            {
                foreach (DataType tt in ((UnionType)t).types)
                {
                    if (tt is ModuleType)
                    {
                        return((ModuleType)tt);
                    }
                }
                return(null);
            }
            else if (t is ModuleType)
            {
                return((ModuleType)t);
            }
            else
            {
                return(null);
            }
        }