Skip to content

Commit

Permalink
Fix type forwarding
Browse files Browse the repository at this point in the history
  • Loading branch information
stephentoub committed Nov 25, 2024
1 parent a983cab commit ee5d655
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// ------------------------------------------------------------------------------
// Changes to this file must follow the https://aka.ms/api-review process.
// ------------------------------------------------------------------------------

[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Collections.ObjectModel.ReadOnlySet<>))]
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
</PropertyGroup>
<ItemGroup>
<Compile Include="System.Collections.cs" />
<Compile Include="System.Collections.Forwards.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\System.Runtime\ref\System.Runtime.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,8 @@ public void AsReadOnly_TurnsISetIntoReadOnlySet()
ISet<string> set = new HashSet<string> { "A", "B" };
ReadOnlySet<string> readOnlySet = set.AsReadOnly();
Assert.NotNull(readOnlySet);
Assert.NotSame(set, readOnlySet);
Assert.NotSame(readOnlySet, set.AsReadOnly());
CollectionAsserts.Equal(set, readOnlySet);
}

Expand Down

0 comments on commit ee5d655

Please sign in to comment.