-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Test plan for "nested stackalloc" #28968
Labels
Area-Compilers
Test
Test failures in roslyn-CI
Test-Gap
Describes a specific feature or scenario that does not have test coverage
Milestone
Comments
gafter
added a commit
to gafter/roslyn
that referenced
this issue
Jul 31, 2018
The display for a stackalloc expression should be its type if it has one. Fixes dotnet#26759 Additional tests are needed before integration into a product branch; see dotnet#28968
Need a test something like this: [Fact]
[WorkItem(13590, "https://github.com/dotnet/roslyn/issues/13590")]
public void RefStructVariable()
{
string source =
@"public ref struct RS
{
public static implicit operator RS(Span<int> span) => new RS();
}
RS x = new stackalloc[100]; // error: escape into field
";
var tree = Parse(source, options: TestOptions.Script);
var compilation = CreateCompilationWithMscorlib45(new[] { tree });
compilation.VerifyDiagnostics(
// some appropriate error
);
} |
gafter
pushed a commit
that referenced
this issue
Aug 14, 2018
The test suggested just above isn't a scenario because you can't declare a variable of a ref struct type at the top level in a script. Such a variable would become a field and it is an error. |
gafter
added
the
Test-Gap
Describes a specific feature or scenario that does not have test coverage
label
Jan 2, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Area-Compilers
Test
Test failures in roslyn-CI
Test-Gap
Describes a specific feature or scenario that does not have test coverage
This is a placeholder for a test plan for #26759 where we permit
stackalloc
expressions in positions other than those to which they were restricted in C# 7.3.csharplang
. (See Champion "Permit stackalloc in nested expressions" (16.3, Core 3) csharplang#1412)The text was updated successfully, but these errors were encountered: