Skip to content

Commit b7d1e0e

Browse files
committed
Fix type forwarding
1 parent a983cab commit b7d1e0e

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the MIT license.
3+
// ------------------------------------------------------------------------------
4+
// Changes to this file must follow the https://aka.ms/api-review process.
5+
// ------------------------------------------------------------------------------
6+
7+
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Collections.ObjectModel.ReadOnlySet<>))]

src/libraries/System.Collections/ref/System.Collections.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
</PropertyGroup>
55
<ItemGroup>
66
<Compile Include="System.Collections.cs" />
7+
<Compile Include="System.Collections.Forwards.cs" />
78
</ItemGroup>
89
<ItemGroup>
910
<ProjectReference Include="..\..\System.Runtime\ref\System.Runtime.csproj" />

src/libraries/System.Collections/tests/Generic/CollectionExtensionsTests.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,8 @@ public void AsReadOnly_TurnsISetIntoReadOnlySet()
122122
ISet<string> set = new HashSet<string> { "A", "B" };
123123
ReadOnlySet<string> readOnlySet = set.AsReadOnly();
124124
Assert.NotNull(readOnlySet);
125+
Assert.NotSame(set, readOnlySet);
126+
Assert.NotSame(readOnlySet, set.AsReadOnly());
125127
CollectionAsserts.Equal(set, readOnlySet);
126128
}
127129

0 commit comments

Comments
 (0)