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

Test plan for "nested stackalloc" #28968

Open
9 tasks
gafter opened this issue Jul 31, 2018 · 2 comments
Open
9 tasks

Test plan for "nested stackalloc" #28968

gafter opened this issue Jul 31, 2018 · 2 comments
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
Copy link
Member

gafter commented Jul 31, 2018

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.

@gafter gafter added Area-Compilers Test Test failures in roslyn-CI labels Jul 31, 2018
@gafter gafter added this to the 16.0 milestone Jul 31, 2018
@gafter gafter self-assigned this Jul 31, 2018
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
@gafter
Copy link
Member Author

gafter commented Aug 9, 2018

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 display for a stackalloc expression should be its type if it has one.
Fixes #26759
Additional tests are needed before integration into a product branch;
    see #28968
@gafter
Copy link
Member Author

gafter commented 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 gafter removed their assignment Aug 18, 2018
@gafter gafter self-assigned this May 1, 2019
@gafter gafter modified the milestones: 16.0, 16.2 May 1, 2019
@gafter gafter modified the milestones: 16.2, 16.3 Jun 3, 2019
@gafter gafter modified the milestones: 16.3, 16.4 Aug 4, 2019
@jaredpar jaredpar modified the milestones: 16.4, Compiler.Next Sep 9, 2019
@gafter gafter added the Test-Gap Describes a specific feature or scenario that does not have test coverage label Jan 2, 2020
@gafter gafter removed their assignment Apr 7, 2020
@gafter gafter removed the 3 - Working label Apr 7, 2020
@jaredpar jaredpar modified the milestones: Compiler.Next, Backlog Sep 12, 2023
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
Projects
None yet
Development

No branches or pull requests

3 participants