Skip to content

Instantly share code, notes, and snippets.

@jcouv
Last active February 16, 2016 23:38
Show Gist options
  • Save jcouv/055d1ee3730d3cf4686b to your computer and use it in GitHub Desktop.
Save jcouv/055d1ee3730d3cf4686b to your computer and use it in GitHub Desktop.
Repro for stack overflow issue: https://github.com/dotnet/roslyn/issues/6536
[Fact]
public void TestStackOverflow()
{
var longCode = "";
for (var i = 0; i<3000; i++)
{
longCode += @"""asdf"" + ";
}
var code = @"class Foo
{
void Bar()
{
string test = " + longCode + @"
}
}";
var tree = SyntaxFactory.ParseSyntaxTree(code);
var position = 4000;
var trivia = tree.GetCompilationUnitRoot().FindTrivia(position);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment