Skip to content

Name the non-array default argument - #262

Merged
kzu merged 1 commit into
mainfrom
dev/langversion-array-exception
Oct 4, 2026
Merged

kzu merged 1 commit into
mainfrom
dev/langversion-array-exception

Conversation

@kzu

@kzu kzu commented Oct 4, 2026 •

Copy link
Copy Markdown
Member

Summary

  • DefaultValueProvider.CreateArray used to throw ArgumentException with nameof(type) as the message and no parameter name when the type was not an array. It now reports Type must be an array type. and sets ParamName to type.

Test plan

  • Confirm a non-array type passed to the array default path throws ArgumentException with parameter name type.

@kzu kzu added the enhancement New feature or request label Oct 4, 2026
@kzu
kzu enabled auto-merge (rebase) October 4, 2026 15:06
@kzu
kzu disabled auto-merge October 4, 2026 15:07
@kzu
kzu force-pushed the dev/langversion-array-exception branch from cdd7b19 to 1bd96d8 Compare October 4, 2026 15:09
@kzu kzu changed the title Set LangVersion to latest and name the non-array default argument Name the non-array default argument Oct 4, 2026
@kzu
kzu enabled auto-merge (rebase) October 4, 2026 15:09
@kzu
kzu merged commit ddd7bef into main Oct 4, 2026
6 checks passed
@kzu
kzu deleted the dev/langversion-array-exception branch October 4, 2026 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant