dotnet / dotnet/macios

[Generator] The generator writes bad code when one of the parameters is a T[] where T is a struct

Open
#6,994 0 comments 0 reactions 0 assignees View on GitHub
enhancement generator
Dominant language
C#
Stars
2.9k
Forks
576
Avg merge
2d 13h
Merged PRs (30d)
96

Description

For a code like the following, where MTLRegion is a struct:

```csharp
void ConvertSparseTileRegions (IntPtr tileRegions, IntPtr pixelRegions, MTLSize tileSize, nuint numRegions);
```

The generator writes calls as:
```csharp
var nsa_pixelRegions = NSArray.FromNSObjects (pixelRegions);
var nsa_tileRegions = NSArray.FromNSObjects (tileRegions);
```

That won't even compile because you cannot go from a struct to an NSObject.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.