Closed
Description
The code fix for SYSLIB1054 generates an attribute that contains the now outdated new Type[] { ... }
syntax. This should be replaced with a collection expression instead.
Proposed Change
class C
{
[LibraryImport(...)]
- [UnmanagedCallConv(CallConvs = new Type[] { ... })]
+ [UnmanagedCallConv(CallConvs = [...])]
public static partial void DoAThing();
}
Example
After the fix, this code:
/// <summary>
/// Returns if the application's window is currently fullscreen
/// </summary>
[DllImport("cool_name_here", CallingConvention = CallingConvention.Cdecl)]
public static extern bool IsWindowFullscreen();
Will change to the following:
/// <summary>
/// Returns if the application's window is currently fullscreen
/// </summary>
[LibraryImport("cool_name_here")]
[UnmanagedCallConv(CallConvs = [typeof(System.Runtime.CompilerServices.CallConvCdecl)])]
public static extern bool IsWindowFullscreen();
Metadata
Metadata
Assignees
Type
Projects
Status
No status