Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expand support for byref to match C# 7 #22

Open
baronfel opened this issue Oct 14, 2016 · 0 comments
Open

Expand support for byref to match C# 7 #22

baronfel opened this issue Oct 14, 2016 · 0 comments

Comments

@baronfel
Copy link
Owner

Expand support for byref to match C# 7 [11125137]

Submitted by Keith Battocchi on 12/17/2015 12:00:00 AM
14 votes on UserVoice prior to migration

C# is adding support for byref locals and returns (see dotnet/roslyn#118, slated for milestone 1.3). This will result in many libraries that expose these features (which the CLR already supports), but methods with such return types aren't currently usable from F#. F# already supports byref locals, but doesn't support implementing byref-returning methods nor does it support calling byref-returning methods.
At a minimum, F# should support calling byref-returning-methods (e.g. SomeRefReturningMethod(x,y,z) <- w), since C# users will be creating methods like these and being unable to call them will limit F#'s reach.
It would be nice if on top of that base level of support F# also supported declaring such methods, using the same safety rules that C# is using (e.g. the only refs that are safe to return are those that point to values stored on the heap or existing refs that are passed into the method).

Response

** by fslang-admin on 1/23/2016 12:00:00 AM **

Yes, this should be done, thanks
Approved in primciple subject to a detailed design, resolution of any remaining issues, and an implementation, with testing. Also subject to the feature actually appearing in C# 7 :)
Don Syme, F# Language Evolution

Original UserVoice Submission
Archived Uservoice Comments

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

No branches or pull requests

1 participant