{"action":"closed","issue":{"url":"https://api.github.com/repos/dotnet/roslyn/issues/4646","labels_url":"https://api.github.com/repos/dotnet/roslyn/issues/4646/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/roslyn/issues/4646/comments","events_url":"https://api.github.com/repos/dotnet/roslyn/issues/4646/events","html_url":"https://github.com/dotnet/roslyn/issues/4646","id":101868701,"number":4646,"title":"Invalid 'Cast is redundant' Inspection Inside Format String","user":{"login":"MrKWatkins","id":345796,"avatar_url":"https://avatars.githubusercontent.com/u/345796?v=3","gravatar_id":"","url":"https://api.github.com/users/MrKWatkins","html_url":"https://github.com/MrKWatkins","followers_url":"https://api.github.com/users/MrKWatkins/followers","following_url":"https://api.github.com/users/MrKWatkins/following{/other_user}","gists_url":"https://api.github.com/users/MrKWatkins/gists{/gist_id}","starred_url":"https://api.github.com/users/MrKWatkins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MrKWatkins/subscriptions","organizations_url":"https://api.github.com/users/MrKWatkins/orgs","repos_url":"https://api.github.com/users/MrKWatkins/repos","events_url":"https://api.github.com/users/MrKWatkins/events{/privacy}","received_events_url":"https://api.github.com/users/MrKWatkins/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/dotnet/roslyn/labels/Area-IDE","name":"Area-IDE","color":"5319e7"},{"url":"https://api.github.com/repos/dotnet/roslyn/labels/Bug","name":"Bug","color":"fc2929"},{"url":"https://api.github.com/repos/dotnet/roslyn/labels/Resolution-Duplicate","name":"Resolution-Duplicate","color":"cccccc"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-08-19T11:19:24Z","updated_at":"2015-08-19T20:24:24Z","closed_at":"2015-08-19T20:24:24Z","body":"The following test case will pass in Visual Studio 2015:\r\n\r\n    var colourString = $\"Colour value: {(int) ConsoleColor.Red}\";\r\n\r\n    Assert.Equal(\"Colour value: 12\", colourString);\r\n\r\nHowever I get an invalid Roslyn inspection come up on the cast to int:\r\n\r\n![invalidinspection](https://cloud.githubusercontent.com/assets/345796/9354902/2fb91e5a-466c-11e5-80aa-96d1ddf7ca8b.png)\r\n\r\nIf I go ahead with that inspection and remove the cast then my code will break as the `ConsoleColor.Red.ToString()` will be used instead, giving `colourString` the value `\"Colour value: Red\"` instead."}}