core
core copied to clipboard
Add support for F# 8.0 features
New language/FSharp.Core features: (See Announcing F# 8)
- [x] Update to
FSharp.Compiler.Service 43.8.100 -
_.Propertyshorthand (should be handled by FCS without AST change)- [x] Tests added
- Nested record field copy and update (should be handled by FCS without AST change)
- [x] Tests added
-
while!- syntax sugar handled by FCS, uses already existingBind+Whilemethods- [x] Tests added
- [x] Extended string interpolation syntax - multiple $ now marks multiple { } needed. String interpolation macro needs to be updated
- [x] Tests added
- [x] Use and compose string literals for printf and related functions (probably handled by FCS and we can extract string literal the same way, needs to be tested)
- [x] Tests added
- Arithmetic operators in literals - do we translate expression or compute literal? Both should work, but latter is optimal.
- [x] Tests added
- Type constraint intersection syntax - type system upgrade, should have no effect on us, but add test to be sure
- [x] Tests added
- Extended
fixedbindings - WS has no support forfixed, it's just ignored - Easier
[<Extension>]method definition - syntax upgrade to test- [ ] Tests added
- [x] Static members in interfaces - we already have support for same in C#, to bring over to F# ProjectReader
- [x] Tests added
- Static let in discriminated unions, records, structs, and types without primary constructors - should be handled by FCS but needs test. All static lets are hoisted to run on module initialization by F# semantics anyways
- [x] Tests added
-
try-withwithinseq{},[]and[||]collection expressions - needs proxy forRuntimeHelpers.EnumerateTryWithandEnumerateFromFunctions- [x] Tests added
I don't think while! needs new proxies actually: it is desugared into a combination of existing methods Bind, While, and mutable variables. Ie an expression like
while! cond do
action
is desugared as if it was written
let! x = cond
let mutable x' = x
while x' do
action
let! x = cond
x' <- x
@Tarmil Thanks! Indeed, TDD would have discovered this, I skipped testing while! for some reason while I checked what try-with within seq{} does. I have seen comparing methods in RuntimeHelpers that we also miss EnumerateFromFunctions, but I can't see in dotnet/fsharp where it's actually used yet... maybe deprecated?