File tree Expand file tree Collapse file tree 6 files changed +73
-1
lines changed Expand file tree Collapse file tree 6 files changed +73
-1
lines changed Original file line number Diff line number Diff line change
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
+ // See the LICENSE file in the project root for more information.
4
+
5
+ #if ! NET6_0_OR_GREATER
6
+
7
+ namespace System . Runtime . CompilerServices ;
8
+
9
+ /// <summary>
10
+ /// Used to indicate to the compiler that the <c>.locals init</c> flag should not be set in method headers.
11
+ /// </summary>
12
+ /// <remarks>Internal copy of the .NET 5 attribute.</remarks>
13
+ [ AttributeUsage (
14
+ AttributeTargets . Module |
15
+ AttributeTargets . Class |
16
+ AttributeTargets . Struct |
17
+ AttributeTargets . Interface |
18
+ AttributeTargets . Constructor |
19
+ AttributeTargets . Method |
20
+ AttributeTargets . Property |
21
+ AttributeTargets . Event ,
22
+ Inherited = false ) ]
23
+ internal sealed class SkipLocalsInitAttribute : Attribute
24
+ {
25
+ }
26
+
27
+ #endif
Original file line number Diff line number Diff line change
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
+ // See the LICENSE file in the project root for more information.
4
+
5
+ using System . Runtime . CompilerServices ;
6
+
7
+ // See notes in CommunityToolkit.HighPerformance for more info
8
+ [ module: SkipLocalsInit ]
Original file line number Diff line number Diff line change @@ -41,7 +41,6 @@ public static class ValueTypeExtensions
41
41
/// Console.WriteLine((-1).ToHexString()); // "0xFFFFFFFF"
42
42
/// </code>
43
43
/// </remarks>
44
- [ SkipLocalsInit ]
45
44
public static unsafe string ToHexString < T > ( this T value )
46
45
where T : unmanaged
47
46
{
Original file line number Diff line number Diff line change
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
+ // See the LICENSE file in the project root for more information.
4
+
5
+ using System . Runtime . CompilerServices ;
6
+
7
+ // See notes in CommunityToolkit.HighPerformance for more info
8
+ [ module: SkipLocalsInit ]
Original file line number Diff line number Diff line change 4
4
5
5
using System . Runtime . CompilerServices ;
6
6
7
+ // See notes in CommunityToolkit.HighPerformance for more info
8
+ [ module: SkipLocalsInit ]
9
+
7
10
[ assembly: InternalsVisibleTo ( "CommunityToolkit.Mvvm.Internals.UnitTests" ) ]
Original file line number Diff line number Diff line change
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
+ // See the LICENSE file in the project root for more information.
4
+
5
+ #if ! NET6_0_OR_GREATER
6
+
7
+ namespace System . Runtime . CompilerServices ;
8
+
9
+ /// <summary>
10
+ /// Used to indicate to the compiler that the <c>.locals init</c> flag should not be set in method headers.
11
+ /// </summary>
12
+ /// <remarks>Internal copy from the BCL attribute.</remarks>
13
+ [ AttributeUsage (
14
+ AttributeTargets . Module |
15
+ AttributeTargets . Class |
16
+ AttributeTargets . Struct |
17
+ AttributeTargets . Interface |
18
+ AttributeTargets . Constructor |
19
+ AttributeTargets . Method |
20
+ AttributeTargets . Property |
21
+ AttributeTargets . Event ,
22
+ Inherited = false ) ]
23
+ internal sealed class SkipLocalsInitAttribute : Attribute
24
+ {
25
+ }
26
+
27
+ #endif
You can’t perform that action at this time.
0 commit comments