File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ public static class USGFullNameOf
6
6
{
7
7
///<summary>Refactor-ready full name generator.</summary>
8
8
///<remarks>Ex: usg<MyClass.InnerClass>(nameof(Something), "Generated")</remarks>
9
- ///<returns>Full.Namespace.To.MyClass.InnerClass.Something.Generated</returns>
9
+ ///<returns>global:: Full.Namespace.To.MyClass.InnerClass.Something.Generated</returns>
10
10
public static string usg < T > ( params string [ ] memberNames )
11
11
{
12
12
var ret = GetTypeDef ( typeof ( T ) , true ) ;
@@ -15,7 +15,7 @@ public static string usg<T>(params string[] memberNames)
15
15
16
16
for ( int i = 0 ; i < memberNames . Length ; i ++ )
17
17
{
18
- if ( memberNames [ i ] ? . Length is null or 0 )
18
+ if ( memberNames [ i ] == null || memberNames [ i ] . Length == 0 )
19
19
continue ;
20
20
ret += '.' + memberNames [ i ] ;
21
21
}
@@ -63,7 +63,8 @@ public static string usg(object valueOrType, bool isFullName = true)
63
63
t = t . GetElementType ( ) ;
64
64
}
65
65
66
- if ( ! TryGetBuiltinDef ( ref ret ) && isFullName && ns . Length > 0 )
66
+ bool isBuiltinType = TryGetBuiltinDef ( ref ret ) ;
67
+ if ( ! isBuiltinType && isFullName && ns . Length > 0 )
67
68
ret = ns + ret ;
68
69
69
70
if ( t . IsGenericType )
@@ -85,7 +86,7 @@ public static string usg(object valueOrType, bool isFullName = true)
85
86
arrayDim -- ;
86
87
}
87
88
88
- if ( isFullName )
89
+ if ( ! isBuiltinType && isFullName )
89
90
ret = "global::" + ret ;
90
91
91
92
return ret ;
You can’t perform that action at this time.
0 commit comments