{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/roslyn/issues/9407","repository_url":"https://api.github.com/repos/dotnet/roslyn","labels_url":"https://api.github.com/repos/dotnet/roslyn/issues/9407/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/roslyn/issues/9407/comments","events_url":"https://api.github.com/repos/dotnet/roslyn/issues/9407/events","html_url":"https://github.com/dotnet/roslyn/issues/9407","id":137936197,"number":9407,"title":"[Bug] Interpolated strings in attributes","user":{"login":"p-e-timoshenko","id":5479740,"avatar_url":"https://avatars.githubusercontent.com/u/5479740?v=3","gravatar_id":"","url":"https://api.github.com/users/p-e-timoshenko","html_url":"https://github.com/p-e-timoshenko","followers_url":"https://api.github.com/users/p-e-timoshenko/followers","following_url":"https://api.github.com/users/p-e-timoshenko/following{/other_user}","gists_url":"https://api.github.com/users/p-e-timoshenko/gists{/gist_id}","starred_url":"https://api.github.com/users/p-e-timoshenko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/p-e-timoshenko/subscriptions","organizations_url":"https://api.github.com/users/p-e-timoshenko/orgs","repos_url":"https://api.github.com/users/p-e-timoshenko/repos","events_url":"https://api.github.com/users/p-e-timoshenko/events{/privacy}","received_events_url":"https://api.github.com/users/p-e-timoshenko/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/dotnet/roslyn/labels/Area-Compilers","name":"Area-Compilers","color":"5319e7"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-03-02T17:19:35Z","updated_at":"2016-03-03T02:33:09Z","closed_at":null,"body":"**Version Used**: CS 6\r\n\r\n**Steps to Reproduce**:\r\n```C#\r\n    class SomeClass\r\n    {\r\n        public const String FirstNameDef = \"Pavel\";\r\n\r\n        [Required(ErrorMessage = \"Field 'FirstName' is required.\")]\r\n\r\n        [Required(ErrorMessage = $\"Field {nameof(FirstName)} is required.\")] \r\n        // Error: An attribute argument must be a constant expression, \r\n        // typeof expression or array creation expression of an attribute parameter type\r\n\r\n        [DefaultValue(FirstNameDef)]\r\n        \r\n        [DefaultValue($\"{FirstNameDef}\")]  \r\n        // Error: An attribute argument must be a constant expression, \r\n        // typeof expression or array creation expression of an attribute parameter type\r\n\r\n        public String FirstName {\r\n            get { return _firstName; }\r\n            set { _firstName = value; }\r\n        }\r\n\r\n        public String _firstName = $\"{FirstNameDef}\";\r\n    }\r\n```"},"comment":{"url":"https://api.github.com/repos/dotnet/roslyn/issues/comments/191548096","html_url":"https://github.com/dotnet/roslyn/issues/9407#issuecomment-191548096","issue_url":"https://api.github.com/repos/dotnet/roslyn/issues/9407","id":191548096,"user":{"login":"markhurd","id":5046880,"avatar_url":"https://avatars.githubusercontent.com/u/5046880?v=3","gravatar_id":"","url":"https://api.github.com/users/markhurd","html_url":"https://github.com/markhurd","followers_url":"https://api.github.com/users/markhurd/followers","following_url":"https://api.github.com/users/markhurd/following{/other_user}","gists_url":"https://api.github.com/users/markhurd/gists{/gist_id}","starred_url":"https://api.github.com/users/markhurd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/markhurd/subscriptions","organizations_url":"https://api.github.com/users/markhurd/orgs","repos_url":"https://api.github.com/users/markhurd/repos","events_url":"https://api.github.com/users/markhurd/events{/privacy}","received_events_url":"https://api.github.com/users/markhurd/received_events","type":"User","site_admin":false},"created_at":"2016-03-03T02:33:09Z","updated_at":"2016-03-03T02:33:09Z","body":"And that was the first method relating to string interpolation I added to my LinqPad extensions: \r\n\r\n```\r\n    // Interpolation invariant helper\r\n    public static string Invariant(this IFormattable str)\r\n    {\r\n        return str.ToString(null, System.Globalization.CultureInfo.InvariantCulture);\r\n    }\r\n```\r\n\r\nBut it's still clearly not a constant expression."}}