提交 fe80ed28 编写于 作者: N Nick Guerrera

Fix build break in closed project sharing source file

上级 c5d42df4
......@@ -9,7 +9,10 @@ internal partial class SpecializedCollections
{
private partial class Empty
{
internal class Set<T> : Collection<T>, ISet<T>, IReadOnlySet<T>
internal class Set<T> : Collection<T>, ISet<T>
#if COMPILERCORE
, IReadOnlySet<T>
#endif
{
public static readonly new Set<T> Instance = new Set<T>();
......
......@@ -9,7 +9,10 @@ internal partial class SpecializedCollections
{
private partial class ReadOnly
{
internal class Set<TUnderlying, T> : Collection<TUnderlying, T>, ISet<T>, IReadOnlySet<T>
internal class Set<TUnderlying, T> : Collection<TUnderlying, T>, ISet<T>
#if COMPILERCORE
, IReadOnlySet<T>
#endif
where TUnderlying : ISet<T>
{
public Set(TUnderlying underlying)
......
......@@ -44,10 +44,12 @@ public static ISet<T> EmptySet<T>()
return Empty.Set<T>.Instance;
}
#if COMPILERCORE
public static IReadOnlySet<T> EmptyReadOnlySet<T>()
{
return Empty.Set<T>.Instance;
}
#endif
public static IDictionary<TKey, TValue> EmptyDictionary<TKey, TValue>()
{
......@@ -98,11 +100,13 @@ public static ISet<T> ReadOnlySet<T>(ISet<T> set)
: new ReadOnly.Set<ISet<T>, T>(set);
}
#if COMPILERCORE
public static IReadOnlySet<T> StronglyTypedReadOnlySet<T>(ISet<T> set)
{
return set == null || set.Count == 0
? EmptyReadOnlySet<T>()
: new ReadOnly.Set<ISet<T>, T>(set);
}
#endif
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册