Skip to content

LibraryImport do not copy this #102690

@MrScautHD

Description

@MrScautHD

Description

Hello, i tried to make extensions methods for my project and as i tried doing this it gave me a compile error.
grafik

There is no this in the generated code:
grafik

It told me:
grafik
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

grafik

Regression?

No response

Known Workarounds

No response

Configuration

No response

Other information

No response

Metadata

Metadata

Assignees

Type

No type

Projects

Status

No status

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions