Skip to content

Stack overflow in Roslyn when local variable is used before declared #691

@adamralph

Description

@adamralph

NOTE: scriptcs is using the Roslyn CTP NuGet package https://www.nuget.org/packages/Roslyn.Compilers.CSharp/ - I'm unaware if this problem exists in the current codeplex source

It's a Roslyn bug but I'm adding it here for reference.
image

And here's the exception in debug:
image

The legacy compiler (in VS2013) gives a sensible error message:

error CS0841: Cannot use local variable 'list' before it is declared

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions