Example #1
0
 private string FilenamePartForParameter(TypeElement parameterType)
 {
     if (parameterType.IsGenericType)
     {
         TypeElement[] genericArguments = parameterType.GetGenericArguments();
         // FIX: do not use Member here
         string genericType = parameterType.GetGenericTypeDefinition().Member.FullName.Split('`')[0];
         return genericType + "`" + string.Join(",", genericArguments.Select(FilenamePartForParameter));
     }
     else
     {
         // FIX: do not use Member here
         return SystemTypes.Alias(parameterType) ?? parameterType.Member.FullName;
     }
 }
Example #2
0
        /// <summary>
        /// Normalizes the given type element.
        /// </summary>
        public TypeElement Normalize(TypeElement type)
        {
            if (type.IsGenericType && !type.IsGenericTypeDefinition)
            {
                return type.GetGenericTypeDefinition();
            }

            return type;
        }