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

Tuple 数组作为参数或返回值时,不生效,但是List 可以 #415

Open
Vongolar opened this issue Jan 25, 2024 · 0 comments
Open

Comments

@Vongolar
Copy link

数组不行:
(double bps, int workers, int streams)[] Test1((double bps, int workers, int streams)[] table)
{
return new (double bps, int workers, int streams)[] {
(0.3f, 1, 2),
(10f, 1, 8),
(30f, 1, 16),
(70f, 1, 32),
};
}

但是List可以:
List<(double bps, int workers, int streams)> Test1(List<(double bps, int workers, int streams)> table)
{
return new (double bps, int workers, int streams)[] {
(0.3f, 1, 2),
(10f, 1, 8),
(30f, 1, 16),
(70f, 1, 32),
}.ToList();
}

用Tuple<double, int , int)[] 也可以

请问下有知道原因的吗?

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

No branches or pull requests

1 participant