Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid reporting redundant and possibly misleading WRN_InlineArrayNotSupportedByLanguage #74283

Merged
merged 1 commit into from
Jul 15, 2024

Conversation

AlekseyTs
Copy link
Contributor

Fixes #73556.

@AlekseyTs AlekseyTs requested review from jjonescz and cston July 8, 2024 14:03
@AlekseyTs AlekseyTs requested a review from a team as a code owner July 8, 2024 14:03
@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged Issues and PRs which have not yet been triaged by a lead label Jul 8, 2024
@AlekseyTs AlekseyTs requested a review from a team July 9, 2024 11:28
@AlekseyTs
Copy link
Contributor Author

@cston, @dotnet/roslyn-compiler For the second review

1 similar comment
@AlekseyTs
Copy link
Contributor Author

@cston, @dotnet/roslyn-compiler For the second review

// (12,7): warning CS9184: 'Inline arrays' language feature is not supported for an inline array type that is not valid as a type argument, or has element type that is not valid as a type argument.
// S _f;
Diagnostic(ErrorCode.WRN_InlineArrayNotSupportedByLanguage, "_f").WithLocation(12, 7)
// (3,12): warning CS9184: 'Inline arrays' language feature is not supported for an inline array type that is not valid as a type argument, or has element type that is not valid as a type argument.
Copy link
Member

@cston cston Jul 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning CS9184: 'Inline arrays' language feature is not supported for an inline array type that is not valid as a type argument, or has element type that is not valid as a type argument.

Is this warning correct? Couldn't S1<T> be used as a type argument a type C<T> where T : allows ref struct? #Resolved

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this warning correct?

In a general case a ref struct cannot be used as a type argument. That is the case the warning refers to. If that will be confusing, we will be able to adjust the wording in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Compilers New Feature - RefStructInterfaces untriaged Issues and PRs which have not yet been triaged by a lead
Projects
None yet
Development

Successfully merging this pull request may close these issues.

A misleading warning is reported for an inline array type with ref like type parameter as an element type
4 participants