{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/roslyn/issues/4982","labels_url":"https://api.github.com/repos/dotnet/roslyn/issues/4982/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/roslyn/issues/4982/comments","events_url":"https://api.github.com/repos/dotnet/roslyn/issues/4982/events","html_url":"https://github.com/dotnet/roslyn/issues/4982","id":104774944,"number":4982,"title":"[Proposed feature] Improve optional parameter default value supporting implicit","user":{"login":"MatthieuMEZIL","id":8710406,"avatar_url":"https://avatars.githubusercontent.com/u/8710406?v=3","gravatar_id":"","url":"https://api.github.com/users/MatthieuMEZIL","html_url":"https://github.com/MatthieuMEZIL","followers_url":"https://api.github.com/users/MatthieuMEZIL/followers","following_url":"https://api.github.com/users/MatthieuMEZIL/following{/other_user}","gists_url":"https://api.github.com/users/MatthieuMEZIL/gists{/gist_id}","starred_url":"https://api.github.com/users/MatthieuMEZIL/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MatthieuMEZIL/subscriptions","organizations_url":"https://api.github.com/users/MatthieuMEZIL/orgs","repos_url":"https://api.github.com/users/MatthieuMEZIL/repos","events_url":"https://api.github.com/users/MatthieuMEZIL/events{/privacy}","received_events_url":"https://api.github.com/users/MatthieuMEZIL/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/dotnet/roslyn/labels/Area-Language%20Design","name":"Area-Language Design","color":"5319e7"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2015-09-03T20:29:06Z","updated_at":"2015-09-04T17:59:38Z","closed_at":null,"body":"Using the following class:\r\nclass C\r\n{\r\n    public static implicit operator C(int i)\r\n    {\r\n        return null;\r\n    }\r\n}\r\n\r\nI would like to be able to use this method:\r\nvoid Foo(C c = 0)\r\n{\r\n}\r\n\r\nCurrently I have the following error:\r\nError CS1750\tA value of type 'int' cannot be used as a default parameter because there are no standard conversions to type 'C'"},"comment":{"url":"https://api.github.com/repos/dotnet/roslyn/issues/comments/137806690","html_url":"https://github.com/dotnet/roslyn/issues/4982#issuecomment-137806690","issue_url":"https://api.github.com/repos/dotnet/roslyn/issues/4982","id":137806690,"user":{"login":"HaloFour","id":10102290,"avatar_url":"https://avatars.githubusercontent.com/u/10102290?v=3","gravatar_id":"","url":"https://api.github.com/users/HaloFour","html_url":"https://github.com/HaloFour","followers_url":"https://api.github.com/users/HaloFour/followers","following_url":"https://api.github.com/users/HaloFour/following{/other_user}","gists_url":"https://api.github.com/users/HaloFour/gists{/gist_id}","starred_url":"https://api.github.com/users/HaloFour/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HaloFour/subscriptions","organizations_url":"https://api.github.com/users/HaloFour/orgs","repos_url":"https://api.github.com/users/HaloFour/repos","events_url":"https://api.github.com/users/HaloFour/events{/privacy}","received_events_url":"https://api.github.com/users/HaloFour/received_events","type":"User","site_admin":false},"created_at":"2015-09-04T17:59:38Z","updated_at":"2015-09-04T17:59:38Z","body":"@MatthieuMEZIL Such a change is by definition a breaking change as the contract for the method will be different.  Any implicit conversion, even if it were possible, would need to be done in the callers, not the callee, but any existing compiled code would still be pushing the enum value onto the stack and attempting to call this function.  Either your callers are going to have to change/recompiled  or you'll have to keep the enum around, define a new class and define overloads or an implicit conversion.  Your use case doesn't seem very compelling for a new language feature, especially one that violates CLS and the metadata expectations for the optional parameter value."}}