Skip to content

Instantly share code, notes, and snippets.

@mstrobel
Last active August 29, 2015 14:27
Show Gist options
  • Save mstrobel/7a272d8709c8c4380e98 to your computer and use it in GitHub Desktop.
Save mstrobel/7a272d8709c8c4380e98 to your computer and use it in GitHub Desktop.
using System;
namespace ReSharperBugs
{
internal class Program
{
private static void Main()
{
var sideEffectOccurred = false;
try
{
//
// 1. Run and note the result (sideEffectOccurred = true).
// 2. Apply "Use string interpolation" quick fix.
// 3. Run again, note that the result changes (sideEffectOccurred = false).
//
Console.WriteLine(
string.Format(
"{0:BadFormat}: " +
"{1}",
Guid.Empty,
sideEffectOccurred = true));
}
catch {}
finally
{
Console.WriteLine("sideEffectOccurred: {0}", sideEffectOccurred);
Console.ReadLine();
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment