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

Verify accuracy of TupleElementNames tests for Implement Interface #54325

Closed
sharwell opened this issue Jun 23, 2021 · 4 comments
Closed

Verify accuracy of TupleElementNames tests for Implement Interface #54325

sharwell opened this issue Jun 23, 2021 · 4 comments
Labels
Area-IDE Feature - Tuples Tuples Test-Gap Describes a specific feature or scenario that does not have test coverage

Comments

@sharwell
Copy link
Member

sharwell commented Jun 23, 2021

Can someone from the @dotnet/roslyn-compiler team verify that we are testing Implement Interface with an accurate representation of TupleElementNames metadata?

[Fact, Trait(Traits.Feature, Traits.Features.CodeActionsImplementInterface), CompilerTrait(CompilerFeature.Tuples)]
public async Task TupleWithNamesInMethod()
{
// Note: we're putting the attribute by hand to simulate metadata
await TestWithAllCodeStyleOptionsOffAsync(
@"interface IInterface
{
[return: {|CS8138:System.Runtime.CompilerServices.TupleElementNames(new[] { ""a"", ""b"" })|}]
(int a, int b)[] Method1((int c, string) x);
}
class Class : {|CS0535:IInterface|}
{
}",
@"interface IInterface
{
[return: {|CS8138:System.Runtime.CompilerServices.TupleElementNames(new[] { ""a"", ""b"" })|}]
(int a, int b)[] Method1((int c, string) x);
}
class Class : IInterface
{
public (int a, int b)[] Method1((int c, string) x)
{
throw new System.NotImplementedException();
}
}");
}

💭 It seems like if we apply TupleElementNames manually, the test should be written with ValueTuple<int, int> syntax instead of (int a, int b) syntax.

🔗 Observed during review in #54310 (comment)

@sharwell sharwell added Area-Compilers Test-Gap Describes a specific feature or scenario that does not have test coverage labels Jun 23, 2021
@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged Issues and PRs which have not yet been triaged by a lead label Jun 23, 2021
@Youssef1313
Copy link
Member

@sharwell Is Area-Compilers intentional here? I interpret the issue as a problem in IDE test.

@sharwell
Copy link
Member Author

Yes, this one is a verification request for the compiler team (to make sure we are testing the correct thing).

@jaredpar
Copy link
Member

jaredpar commented Jul 9, 2021

It seems like if we apply TupleElementNames manually, the test should be written with ValueTuple<int, int> syntax instead of (int a, int b) syntax.

I'm not sure what the ask is here. Both of these are cases that the compiler needs to understand (users can legally do both so we have to have a response to each of the scenarios). It depends on what the IDE intent is here and what scenario you are trying to exercise.

@jcouv

@jaredpar jaredpar added Area-IDE Feature - Tuples Tuples and removed Area-Compilers untriaged Issues and PRs which have not yet been triaged by a lead labels Jul 9, 2021
@CyrusNajmabadi
Copy link
Member

I don't think there's any compiler info needed here. This is also not a priority scenario for IDE if a user manually supplies these attributes.

@CyrusNajmabadi CyrusNajmabadi closed this as not planned Won't fix, can't repro, duplicate, stale Nov 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE Feature - Tuples Tuples Test-Gap Describes a specific feature or scenario that does not have test coverage
Projects
None yet
Development

No branches or pull requests

4 participants