Skip to content

Add line numbers to contract failures#53916

Merged
CyrusNajmabadi merged 1 commit intodotnet:mainfrom
CyrusNajmabadi:lineNumbers
Jun 7, 2021
Merged

Add line numbers to contract failures#53916
CyrusNajmabadi merged 1 commit intodotnet:mainfrom
CyrusNajmabadi:lineNumbers

Conversation

@CyrusNajmabadi
Copy link
Contributor

Fixes #53706

The goal here is to make it easier to investigate reports where we get a failure report where we get nothing more than: Unexpected in a particular method. When there is just a single Contract.ThrowIfNull in that method, then the issue is obvious. However, when tehre are several contract calls, it can be extremely difficult to tell which one actually failed. By adding the line number we can vastly improve understanding what has failed, without needing a dump.

@CyrusNajmabadi CyrusNajmabadi requested a review from a team as a code owner June 7, 2021 16:04
@ghost ghost added the Area-IDE label Jun 7, 2021
@CyrusNajmabadi CyrusNajmabadi merged commit a74d3aa into dotnet:main Jun 7, 2021
@ghost ghost added this to the Next milestone Jun 7, 2021
@CyrusNajmabadi CyrusNajmabadi deleted the lineNumbers branch June 7, 2021 17:22
@jasonmalinowski
Copy link
Member

@CyrusNajmabadi: nice! We should have done this years ago.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

'Contract' methods should take CallerLineNumber

4 participants