public static TypeReference CompleteOrNull(this TypeReference tr, bool tryInterface = false, IDictionary <string, string> typeRedirs = null, params string[] suffixes)
        {
            var outer = tr;

            tr = tr.GetInteriorType(out var txfs, true);

            if (tr is TypeDefinition)
            {
                return(tr.ApplyTransforms(txfs));
            }

            var typeName = tr.Name;
            var typeNs   = tr.Namespace;

            if (string.IsNullOrEmpty(typeNs))
            {
                typeNs = "";
            }
            else
            {
                typeNs = typeNs + '.';
            }

            ModuleDefinition module = null;
            TypeReference    result;

            if (typeRedirs != null && typeRedirs.TryGetValue(typeName, out var redir))
            {
                module   = tr.Module;
                typeName = redir;
                result   = module.GetType(typeNs + typeName, true).Require(true);
            }
            else if (typeRedirs != null && typeRedirs.TryGetValue(typeNs + typeName, out var redirWithNs))
            {
                throw new NotImplementedException();
            }
            else
            {
                result = tr.Require(true);
                if (result == null)
                {
                    module = tr.Module;
                    result = module.GetType(typeNs + typeName, true).Require(true);
                }
            }

            if (result != null)
            {
                return(result.ApplyTransforms(txfs));
            }

            if (module == null)
            {
                module = tr.Module;
            }

            if (tryInterface)
            {
                result = module.GetType(typeNs + "I" + typeName, true).Require(true);
            }

            if (result != null)
            {
                return(result.ApplyTransforms(txfs));
            }
            ;

            if (suffixes == null)
            {
                return(null);
            }

            for (var i = 0; result == null && i < suffixes.Length; ++i)
            {
                var suffix = suffixes[i];
                result = module.GetType(typeNs + typeName + suffix, true).Require(true);
            }

            return(result.ApplyTransforms(txfs));;
        }