Пример #1
0
        public IPythonType GetBuiltinType(BuiltinTypeId id)
        {
            if (id == BuiltinTypeId.Unknown || _database.BuiltinModule == null)
            {
                return(null);
            }
            var name = SharedDatabaseState.GetBuiltinTypeName(id, _database.LanguageVersion);
            var res  = _database.BuiltinModule.GetAnyMember(name) as IPythonType;

            if (res == null)
            {
                throw new KeyNotFoundException(string.Format("{0} ({1})", id, (int)id));
            }
            return(res);
        }
Пример #2
0
 string ITypeDatabaseReader.GetBuiltinTypeName(BuiltinTypeId id)
 {
     return(_sharedState.GetBuiltinTypeName(id));
 }