You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -55,6 +55,8 @@ Here's an example of some of the new features that **PolySharp** can enable down
55
55
-`[OverloadResolutionPriority]` (needed for [overload resolution priority](https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-13#overload-resolution-priority))
56
56
-`[ParamsCollection]` (needed for [params collection](https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-13#params-collections))
57
57
-`[ConstantExpected]` (see [proposal](https://github.com/dotnet/runtime/issues/33771))
58
+
-`[CompilerLoweringPreserve]` (see [proposal](https://github.com/dotnet/runtime/issues/103430))
59
+
-`[ExtensionMarker]` (needed for [extensions](https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-14#extension-members))
58
60
59
61
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>13.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.
60
62
@@ -84,6 +86,7 @@ It also includes the following optional runtime-supported polyfills:
84
86
-`[FeatureGuard]`
85
87
-`[FeatureSwitchDefinition]`
86
88
-`[WasmImportLinkage]` (see [here](https://github.com/dotnet/runtime/pull/93823))
89
+
-`[UnsafeAccessorType]` (see [here](https://github.com/dotnet/runtime/issues/90081))
Copy file name to clipboardExpand all lines: src/PolySharp.Package/README.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -53,6 +53,8 @@ Here's an example of some of the new features that **PolySharp** can enable down
53
53
-`[OverloadResolutionPriority]` (needed for [overload resolution priority](https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-13#overload-resolution-priority))
54
54
-`[ParamsCollection]` (needed for [params collection](https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-13#params-collections))
55
55
-`[ConstantExpected]` (see [proposal](https://github.com/dotnet/runtime/issues/33771))
56
+
-`[CompilerLoweringPreserve]` (see [proposal](https://github.com/dotnet/runtime/issues/103430))
57
+
-`[ExtensionMarker]` (needed for [extensions](https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-14#extension-members))
56
58
57
59
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>13.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.
58
60
@@ -82,6 +84,7 @@ It also includes the following optional runtime-supported polyfills:
82
84
-`[FeatureGuard]`
83
85
-`[FeatureSwitchDefinition]`
84
86
-`[WasmImportLinkage]` (see [here](https://github.com/dotnet/runtime/pull/93823))
87
+
-`[UnsafeAccessorType]` (see [here](https://github.com/dotnet/runtime/issues/90081))
// Licensed to the .NET Foundation under one or more agreements.
6
+
// The .NET Foundation licenses this file to you under the MIT license.
7
+
8
+
usingSystem.ComponentModel;
9
+
10
+
namespaceSystem.Runtime.CompilerServices
11
+
{
12
+
/// <summary>
13
+
/// This attribute is used to mark extension members and associate them with a specific marker type (which provides detailed information about an extension block and its receiver parameter).
14
+
/// This attribute should not be used by developers in source code.
Copy file name to clipboardExpand all lines: src/PolySharp.SourceGenerators/EmbeddedResources/RuntimeSupported/System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute.cs
+2Lines changed: 2 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -134,6 +134,8 @@ public DynamicDependencyAttribute(global::System.Diagnostics.CodeAnalysis.Dynami
134
134
/// <summary>
135
135
/// Gets or sets the condition in which the dependency is applicable, e.g. "DEBUG".
136
136
/// </summary>
137
+
[global::System.Obsolete("This property is no longer supported.")]
Copy file name to clipboardExpand all lines: src/PolySharp.SourceGenerators/EmbeddedResources/RuntimeSupported/System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute.cs
/// Instantiates an <see cref="UnsafeAccessorTypeAttribute"/> providing access to a type supplied by <paramref name="typeName"/>.
25
+
/// </summary>
26
+
/// <param name="typeName">A fully qualified or partially qualified type name.</param>
27
+
/// <remarks>
28
+
/// <paramref name="typeName"/> is expected to follow the same rules as if it were being
29
+
/// passed to <see name="global::System.Type.GetType(global::System.String)"/>. When unbound generics are involved they
30
+
/// should follow the IL syntax of referencing a type or method generic variables using
31
+
/// the syntax of <c>!N</c> or <c>!!N</c> respectively, where N is the zero-based index of the
32
+
/// generic parameters. The generic rules defined for <see cref="global::System.Diagnostics.CodeAnalysis.UnsafeAccessorAttribute"/>
33
+
/// apply to this attribute as well, meaning the arity and type of generic parameter must match
34
+
/// the target type.
35
+
///
36
+
/// This attribute only has behavior on parameters or return values of methods marked with <see cref="global::System.Diagnostics.CodeAnalysis.UnsafeAccessorAttribute"/>.
37
+
///
38
+
/// This attribute should only be applied to parameters or return types of methods that are
39
+
/// typed as follows:
40
+
///
41
+
/// <ul>
42
+
/// <li>References should be typed as <lang>object</lang>.</li>
43
+
/// <li>Byref arguments should be typed with <lang>in</lang>, <lang>ref</lang>, or <lang>out</lang> to <lang>object</lang>.</li>
44
+
/// <li>Unmanaged pointers should be typed as <lang>void*</lang>.</li>
45
+
/// <li>Byref arguments to reference types or arrays should be typed with <lang>in</lang>, <lang>ref</lang>, or <lang>out</lang> to <lang>object</lang>.</li>
46
+
/// <li>Byref arguments to unmanaged pointer types should be typed with <lang>in</lang>, <lang>ref</lang>, or <lang>out</lang> to <lang>void*</lang>.</li>
47
+
/// </ul>
48
+
///
49
+
/// Value types are not supported.
50
+
///
51
+
/// Due to lack of variance for byrefs, returns involving byrefs are not supported. This
52
+
/// specifically means that accessors for fields of inaccessible types are not supported.
53
+
/// </remarks>
54
+
publicUnsafeAccessorTypeAttribute(stringtypeName)
55
+
{
56
+
TypeName=typeName;
57
+
}
58
+
59
+
/// <summary>
60
+
/// Fully qualified or partially qualified type name to target.
0 commit comments