Last active
December 8, 2018 20:21
-
-
Save SteveGilham/48ebeaab5fd23e0ac1d43e397a97ce07 to your computer and use it in GitHub Desktop.
What happens to a record with an [<Obsolete>] field?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| open System | |
| type R = | |
| { Wanted : String | |
| [<Obsolete("Use 'Wanted' instead")>] | |
| Unwanted : String } | |
| static member Create () = | |
| { Wanted = String.Empty | |
| Unwanted = String.Empty } | |
| let UseR s = | |
| let r1 = R.Create() | |
| printfn "%A" r1 | |
| let r2 = { R.Create() with Wanted = s } | |
| printfn "%A" r2 | |
| let r3 = { R.Create() with Unwanted = s } | |
| printfn "%A" r3 | |
| UseR "is this wanted?" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment