Skip to content

Allow overrides for array paramters of different size - #1971

Merged
tritao merged 1 commit into
mono:mainfrom
nbeck-SMT:fix/override-array-parameter-sizes
Nov 10, 2026
Merged

tritao merged 1 commit into
mono:mainfrom
nbeck-SMT:fix/override-array-parameter-sizes

Conversation

@nbeck-SMT

Copy link
Copy Markdown
Contributor

The current CLI generator has an issue with certain overridden functions.

In C++ the following override is valid because array parameters decay to pointers:

class A
{
public:
    virtual void Method(double values[2]);
};

class B : public A
{
public:
    void Method(double values[3]) override;
};

However, the generated CLI code is missing the override which causes an error.

public ref class A
{
public:
    virtual void Method(cli::array<double>^ values);
}

public ref class B : public A
{
public:
    virtual void Method(cli::array<double>^ values);
}

The proposed fix also decays array parameters to pointers in the CanOverride() check.

@tritao

tritao commented Nov 10, 2026

Copy link
Copy Markdown
Collaborator

Looks fine but has some conflicts now, can you please rebase this to latest for merge? Thanks.

@nbeck-SMT
nbeck-SMT force-pushed the fix/override-array-parameter-sizes branch from 7c70b03 to 397eb01 Compare November 10, 2026 18:45
@tritao
tritao merged commit 182c3b1 into mono:main Nov 10, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants