We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b9e35b3 commit 005de95Copy full SHA for 005de95
src/SourceGeneration.Reflection/SourceReflector.cs
@@ -4,6 +4,8 @@
4
5
namespace SourceGeneration.Reflection;
6
7
+#pragma warning disable IDE0305
8
+
9
public static class SourceReflector
10
{
11
private static readonly Dictionary<Type, SourceTypeInfo> _types = [];
@@ -12,8 +14,12 @@ public static class SourceReflector
12
14
[EditorBrowsable(EditorBrowsableState.Never)]
13
15
public static void Add(SourceTypeInfo typeInfo)
16
17
+#if NET5_0_OR_GREATER
18
+ _types.TryAdd(typeInfo.Type, typeInfo);
19
+#else
20
if (!_types.ContainsKey(typeInfo.Type))
21
_types.Add(typeInfo.Type, typeInfo);
22
+#endif
23
}
24
25
public static T CreateInstance<
0 commit comments