{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/coreclr/issues/1098","labels_url":"https://api.github.com/repos/dotnet/coreclr/issues/1098/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/coreclr/issues/1098/comments","events_url":"https://api.github.com/repos/dotnet/coreclr/issues/1098/events","html_url":"https://github.com/dotnet/coreclr/issues/1098","id":85257842,"number":1098,"title":"Add the failing method/indexer when the runtimes throws a NullReferenceException","user":{"login":"mburbea","id":213233,"avatar_url":"https://avatars.githubusercontent.com/u/213233?v=3","gravatar_id":"","url":"https://api.github.com/users/mburbea","html_url":"https://github.com/mburbea","followers_url":"https://api.github.com/users/mburbea/followers","following_url":"https://api.github.com/users/mburbea/following{/other_user}","gists_url":"https://api.github.com/users/mburbea/gists{/gist_id}","starred_url":"https://api.github.com/users/mburbea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mburbea/subscriptions","organizations_url":"https://api.github.com/users/mburbea/orgs","repos_url":"https://api.github.com/users/mburbea/repos","events_url":"https://api.github.com/users/mburbea/events{/privacy}","received_events_url":"https://api.github.com/users/mburbea/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-06-04T20:13:56Z","updated_at":"2015-06-05T15:30:58Z","closed_at":null,"body":"Currently, the null reference exception does not tell you much.\r\n`object reference not set to an instance of an object`. If you are in debug or compiled with Pdbs you might get line numbers too.\r\nBut that doesn't tell a lot. I think it would be very useful if the exact method that's failing was also added. This will help narrow down the error quite a bit. Consider the following line.\r\n`person.AddressInfo.PhoneNumber.E164Normalize()`\r\nAny one of those properties could throw, but if It instead told me that `it was PhoneNumber get_AddressInfo()`, I now know where to look. \r\n\r\nEven in a virtual call type of case this is still tremendously more helpful.\r\n`object reference not set to an instance of an object, failing call: Int32 Object.GetHashCode()`, \r\n\r\nI can at least see which method threw via the stacktrace and then I can look for usage of this method. While C#7 is going to add support for the `?.` safe navigator operator, there is still plenty of code written before the operator, and still plenty of null reference exceptions that can happen unexpectedly. (e.g. `Dictionary.TryGetValue` can throw a NullRefException if somebody is adding to the dictionary on a separate thread)"},"comment":{"url":"https://api.github.com/repos/dotnet/coreclr/issues/comments/109329605","html_url":"https://github.com/dotnet/coreclr/issues/1098#issuecomment-109329605","issue_url":"https://api.github.com/repos/dotnet/coreclr/issues/1098","id":109329605,"user":{"login":"mburbea","id":213233,"avatar_url":"https://avatars.githubusercontent.com/u/213233?v=3","gravatar_id":"","url":"https://api.github.com/users/mburbea","html_url":"https://github.com/mburbea","followers_url":"https://api.github.com/users/mburbea/followers","following_url":"https://api.github.com/users/mburbea/following{/other_user}","gists_url":"https://api.github.com/users/mburbea/gists{/gist_id}","starred_url":"https://api.github.com/users/mburbea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mburbea/subscriptions","organizations_url":"https://api.github.com/users/mburbea/orgs","repos_url":"https://api.github.com/users/mburbea/repos","events_url":"https://api.github.com/users/mburbea/events{/privacy}","received_events_url":"https://api.github.com/users/mburbea/received_events","type":"User","site_admin":false},"created_at":"2015-06-05T15:30:58Z","updated_at":"2015-06-05T15:30:58Z","body":"That was supposed to be the return type, not the actual reference. As for the inlining its true, but perhaps it can be looked up? I'm not sure. "}}