Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ Here's an example of some of the new features that **PolySharp** can enable down
- `[ConstantExpected]` (see [proposal](https://github.com/dotnet/runtime/issues/33771))
- `[CompilerLoweringPreserve]` (see [proposal](https://github.com/dotnet/runtime/issues/103430))
- `[ExtensionMarker]` (needed for [extensions](https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-14#extension-members))
- `[IsClosedType]` (needed for [closed hierarchies](https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/proposals/csharp-15.0/closed-hierarchies))
- `[RequiresUnsafe]` (needed for [unsafe evolution](https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/proposals/unsafe-evolution))

To leverage them, make sure to bump your C# language version. You can do this by setting the `<LangVersion>` MSBuild property in your project. For instance, by adding `<LangVersion>14.0</LangVersion>` (or your desired C# version) to the first `<PropertyGroup>` of your .csproj file. For more info on this, [see here](https://sergiopedri.medium.com/enabling-and-using-c-9-features-on-older-and-unsupported-runtimes-ce384d8debb), but remember that you don't need to manually copy polyfills anymore: simply adding a reference to **PolySharp** will do this for you automatically.

Expand Down
2 changes: 2 additions & 0 deletions src/PolySharp.Package/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ Here's an example of some of the new features that **PolySharp** can enable down
- `[ConstantExpected]` (see [proposal](https://github.com/dotnet/runtime/issues/33771))
- `[CompilerLoweringPreserve]` (see [proposal](https://github.com/dotnet/runtime/issues/103430))
- `[ExtensionMarker]` (needed for [extensions](https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-14#extension-members))
- `[IsClosedType]` (needed for [closed hierarchies](https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/proposals/csharp-15.0/closed-hierarchies))
- `[RequiresUnsafe]` (needed for [unsafe evolution](https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/proposals/unsafe-evolution))

To leverage them, make sure to bump your C# language version. You can do this by setting the `<LangVersion>` MSBuild property in your project. For instance, by adding `<LangVersion>14.0</LangVersion>` (or your desired C# version) to the first `<PropertyGroup>` of your .csproj file. For more info on this, [see here](https://sergiopedri.medium.com/enabling-and-using-c-9-features-on-older-and-unsupported-runtimes-ce384d8debb), but remember that you don't need to manually copy polyfills anymore: simply adding a reference to **PolySharp** will do this for you automatically.

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// <auto-generated/>
#pragma warning disable
#nullable enable annotations

// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

namespace System.Diagnostics.CodeAnalysis
{
/// <summary>
/// Indicates that the specified member requires the caller to be in an unsafe context.
/// </summary>
[global::System.AttributeUsage(
global::System.AttributeTargets.Constructor |
global::System.AttributeTargets.Event |
global::System.AttributeTargets.Method |
global::System.AttributeTargets.Property,
Inherited = false,
AllowMultiple = false)]
[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
[global::Microsoft.CodeAnalysis.Embedded]
internal sealed class RequiresUnsafeAttribute : global::System.Attribute
{
/// <summary>
/// Initializes a new instance of the <see cref="RequiresUnsafeAttribute"/> class.
/// </summary>
public RequiresUnsafeAttribute() { }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// <auto-generated/>
#pragma warning disable
#nullable enable annotations

// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

namespace System.Runtime.CompilerServices
{
/// <summary>
/// Reserved for use by a compiler for tracking metadata.
/// This attribute should not be used by developers in source code.
/// </summary>
[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
[global::System.AttributeUsage(AttributeTargets.Class, Inherited = false)]
[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
[global::Microsoft.CodeAnalysis.Embedded]
public sealed class IsClosedTypeAttribute : global::System.Attribute
{
private global::System.Type[] _derivedTypes = global::System.Type.EmptyTypes;

/// <summary>Initializes the attribute.</summary>
public IsClosedTypeAttribute()
{
}

/// <summary>Gets or sets the derived types of the closed type.</summary>
/// <value>An array of the derived types of the closed type. A <see langword="null" /> value is normalized to an empty array.</value>
public global::System.Type[] DerivedTypes
{
get => _derivedTypes;
set => _derivedTypes = value ?? global::System.Type.EmptyTypes;
}
}
}
Loading