As far as I can tell, I am using F# 4.5.
However, VS2017 does not like the following code
let someAsyncIntOption = async{
return Some 1
}
let someAsyncString = async{
match! someAsyncIntOption with
|Some 1 -> return "Some one"
|_ -> return "None"
}
match! is not recognized as valid syntax.
What do I need to do to make this work?
F# 4.5 was released in VS 2017 v15.8 preview 5. It's not enough to target the F# 4.5 runtime; you also have to have the F# 4.5 compiler in order for that syntax to be accepted. And the F# 4.5 compiler comes with VS 15.8 preview 5; if you're running a Visual Studio version older than 15.8 preview 5, then you have an older F# compiler that doesn't know about the match!
syntax.