You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Can't pipe byref into function, but can apply it directly #5286
Passing a byref argument using the forward-pipe doesn't work, get "error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL."
Repro steps
openSystem.Buffers.BinarymoduleX =letthisIsOK s = BinaryPrimitives.ReadInt32BigEndian s
letthisIsNot s = s |> BinaryPrimitives.ReadInt32BigEndian
Expected behavior
The forward-pipe should work the same as directly supplying the parameter to the function
Actual behavior
The compiler complains
Known workarounds
Not using the forward-pipe
Related information
.net standard 2.0
VisualStudio.15.Preview/15.8.0-pre.3.0+27825.0
Visual F# Tools 10.2 for F# 4.5 15.8.0.0. Commit Hash: ac667ab
Activity
TIHan commentedon Jul 3, 2018
This is intended. Because
|>is a generic function, the rules state you can't have abyref<_>as a type arg, ex:callSomething<byref<int>>.