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

Enable langversion switch to control warnings about preview library functions. #825

KevinRansom opened this issue Jan 7, 2020 · 1 comment


Copy link

@KevinRansom KevinRansom commented Jan 7, 2020

Enable langversion switch to control warnings about preview library functions.

I propose ... the F# compiler supports an ExperimentalAttribute (doc'd Here. This attribute is used to tag values that are part of an experimental library feature.

We can use this attribute to mark new APIs added to FSharp.Core and adjust the compiler so that it doesn't issue a warning when the compiler is executed with the preview switch.

The existing way of approaching this problem in F# is ...
use nowarn switch or pragma to disable the warning. When displayed by the compiler.

With the switch the warning would appear if the compiler is run without langversion:preview speciifed

Pros and Cons

We can preview library features alongside language features, without the developers having to understand whether the warning was scary or not.

The disadvantages of making this adjustment to F# are ...
RTM Libraries will ship with preview APIs, potentially encouraging developers to depend on these preview APIs that may change shape or go away.

Extra information

Estimated cost (XS, S, M, L, XL, XXL):

Related suggestions: (put links to related suggestions here)

Affidavit (please submit!)

Please tick this by placing a cross in the box:

  • [ x] This is not a question (e.g. like one you might ask on stackoverflow) and I have searched stackoverflow for discussions of this issue
  • [ x] I have searched both open and closed suggestions on this site and believe this is not a duplicate
  • [ x] This is not something which has obviously "already been decided" in previous versions of F#. If you're questioning a fundamental design decision that has obviously already been taken (e.g. "Make F# untyped") then please don't submit it.

Please tick all that apply:

  • [ x] This is not a breaking change to the F# language design
  • [ x] I or my company would be willing to help implement and/or test this

This comment has been minimized.

Copy link

@cartermp cartermp commented Jan 14, 2020

Closing out as this has been implemented and will ship in the first F# 5 previews.

@cartermp cartermp closed this Jan 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
2 participants
You can’t perform that action at this time.