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

StringSyntax only applies to the first string argument when used with params. #64756

Closed
JamesNK opened this issue Oct 15, 2022 · 1 comment
Closed
Labels
Area-Compilers untriaged Issues and PRs which have not yet been triaged by a lead

Comments

@JamesNK
Copy link
Member

JamesNK commented Oct 15, 2022

Version Used:

Microsoft Visual Studio Enterprise 2022 (64-bit) - Preview
Version 17.4.0 Preview 2.1

Steps to Reproduce:

  1. Combine StringSyntax with params
  2. Call the method with multiple strings values
public static void StringSyntaxParamsText([StringSyntax("Regex")] params string[] args)
{
    StringSyntaxParamsText(new string[] { "^[sdf]$", "^[sdf]$" });
    
    StringSyntaxParamsText("^[sdf]$", "^[sdf]$");
}

Expected Behavior:

Syntax applies to all string arguments to the method.

Actual Behavior:

Only the first string uses the syntax:

image

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Compilers untriaged Issues and PRs which have not yet been triaged by a lead labels Oct 15, 2022
@CyrusNajmabadi
Copy link
Member

Fixed with #64553

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

No branches or pull requests

2 participants