-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Closed
Labels
area-System.Runtime.InteropServicessource-generatorIndicates an issue with a source generator featureIndicates an issue with a source generator feature
Milestone
Description
Description
Hello, i tried to make extensions methods for my project and as i tried doing this it gave me a compile error.

There is no this in the generated code:

It told me:

0>LibraryImports.g.cs(1075,72): Error CS0755 : Both partial method declarations must be extension methods, or neither can be an extension method.
Reproduction Steps
Here is a small example:
public static partial class Camera3DExtensions {
/// <summary>
/// Update camera position for selected mode.
/// </summary>
/// <param name="camera">The camera to update.</param>
/// <param name="mode">The camera mode.</param>
[LibraryImport(Raylib.Name, EntryPoint = "UpdateCamera")]
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
public static partial void Update(this ref Camera3D camera, CameraMode mode);
}Expected behavior
No compile error.
Actual behavior
Regression?
No response
Known Workarounds
No response
Configuration
No response
Other information
No response
Kaganox, copperdevs, AITYunivers, sdevRay, hez2010 and 1 more
Metadata
Metadata
Assignees
Labels
area-System.Runtime.InteropServicessource-generatorIndicates an issue with a source generator featureIndicates an issue with a source generator feature
Type
Projects
Status
No status