Skip to content

Conversation

DedSec256
Copy link
Contributor

Let's examine the code example:

open System.Buffers

let _ =
    let reader = SequenceReader<byte>()
    let mutable totalLength = -1
    reader.TryReadBigEndian(&totalLength)

This code results in an error

image

because the actual method signature requires ref this, and byref as an additional parameter

image

This error message may be confusing because from the user perspective this parameter is passed implicitly and the first explicit parameter passed in this case is totalLength, which is passed correctly.

This PR offers a more explicit error message indicating a problem with this parameter.

@DedSec256 DedSec256 requested a review from a team as a code owner October 5, 2023 23:20
@T-Gro T-Gro merged commit f7913ff into dotnet:main Oct 10, 2023
@DedSec256 DedSec256 deleted the dedsec256-fix-message branch October 10, 2023 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

5 participants