Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/release-notes/.FSharp.Compiler.Service/11.0.100.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@

### Changed

* Removed the always-on `OpenTypeDeclaration` language feature flag; `open type` declarations are unconditional and `--disableLanguageFeature:OpenTypeDeclaration` is no longer a recognized feature name. ([Issue #20148](https://github.com/dotnet/fsharp/issues/20148), [PR #20215](https://github.com/dotnet/fsharp/pull/20215))
* Improvements in error and warning messages: new error FS3885 when `let!`/`use!` is the final expression in a computation expression; new warning FS3886 when a list literal contains a single tuple element (likely missing `;` separator); improved wording for FS0003, FS0025, FS0039, FS0072, FS0247, FS0597, FS0670, FS3082, and SRTP operator-not-in-scope hints. ([PR #19398](https://github.com/dotnet/fsharp/pull/19398))
* Exception field serialization (`GetObjectData` and field-restoring constructor) is now gated behind `langversion:11` (`LanguageFeature.ExceptionFieldSerializationSupport`). With langversion ≤10, exception codegen is unchanged from pre-#19342 behavior. ([PR #19746](https://github.com/dotnet/fsharp/pull/19746))
* Lower string-typed interpolated strings to `System.String.Concat` rather than the reflection-based `printf` engine, making them trim- and NativeAOT-compatible. This generalizes and ungates the previous all-string `String.Concat` optimization, so it now applies to every string-typed interpolation. ([Language suggestion #1108](https://github.com/fsharp/fslang-suggestions/issues/1108), [PR #19971](https://github.com/dotnet/fsharp/pull/19971))
Expand Down
1 change: 1 addition & 0 deletions docs/release-notes/.Language/preview.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

### Changed

* Removed the always-on `OpenTypeDeclaration` language feature flag; `open type` declarations are unconditional and `--disableLanguageFeature:OpenTypeDeclaration` is no longer a recognized feature name. ([Issue #20148](https://github.com/dotnet/fsharp/issues/20148), [PR #20215](https://github.com/dotnet/fsharp/pull/20215))
* Direct delegate construction ([PR #19993](https://github.com/dotnet/fsharp/pull/19993))
* A delegate built from a method or function now points straight at that method instead of an intermediate closure, so `delegate.Method` is the real target and no closure class is generated.
* Two delegates built from the same method and target now compare equal, where the previous closure form produced distinct instances; this also makes `Delegate.Remove` (and `-=` on events) match and remove such a delegate that it previously left in place.
Expand Down
20 changes: 9 additions & 11 deletions src/Compiler/Checking/CheckDeclarations.fs
Original file line number Diff line number Diff line change
Expand Up @@ -782,11 +782,9 @@ let TcOpenModuleOrNamespaceDecl tcSink g amap scopem env (longId, m) =
let env = OpenModuleOrNamespaceRefs tcSink g amap scopem false env modrefs openDecl
env, [openDecl]

let TcOpenTypeDecl (cenv: cenv) mOpenDecl scopem env (synType: SynType, m) =
let TcOpenTypeDecl (cenv: cenv) scopem env (synType: SynType, m) =
let g = cenv.g

checkLanguageFeatureAndRecover g.langVersion LanguageFeature.OpenTypeDeclaration mOpenDecl

let ty, _tpenv = TcType cenv NoNewTypars CheckCxs ItemOccurrence.Open WarnOnIWSAM.Yes env emptyUnscopedTyparEnv synType

if not (isAppTy g ty) then
Expand All @@ -799,14 +797,14 @@ let TcOpenTypeDecl (cenv: cenv) mOpenDecl scopem env (synType: SynType, m) =
let env = OpenTypeContent cenv.tcSink g cenv.amap scopem env ty openDecl
env, [openDecl]

let TcOpenDecl (cenv: cenv) mOpenDecl scopem env target =
let TcOpenDecl (cenv: cenv) scopem env target =
let g = cenv.g
match target with
| SynOpenDeclTarget.ModuleOrNamespace (longId, m) ->
TcOpenModuleOrNamespaceDecl cenv.tcSink g cenv.amap scopem env (longId.LongIdent, m)

| SynOpenDeclTarget.Type (synType, m) ->
TcOpenTypeDecl cenv mOpenDecl scopem env (synType, m)
TcOpenTypeDecl cenv scopem env (synType, m)

let MakeSafeInitField (cenv: cenv) env m isStatic =
let id =
Expand Down Expand Up @@ -1852,8 +1850,8 @@ module MutRecBindingChecking =

// Process the 'open' declarations
let envForDecls =
(envForDecls, opens) ||> List.fold (fun env (target, m, moduleRange, openDeclsRef) ->
let env, openDecls = TcOpenDecl cenv m moduleRange env target
(envForDecls, opens) ||> List.fold (fun env (target, _, moduleRange, openDeclsRef) ->
let env, openDecls = TcOpenDecl cenv moduleRange env target
openDeclsRef.Value <- openDecls
env)

Expand Down Expand Up @@ -2824,8 +2822,8 @@ module EstablishTypeDefinitionCores =
use _holder = TemporarilySuspendReportingTypecheckResultsToSink cenv.tcSink
(env, shapes) ||> List.fold (fun env shape ->
match shape with
| MutRecShape.Open(MutRecDataForOpen(SynOpenDeclTarget.ModuleOrNamespace _ as target, openm, moduleRange, _)) ->
let env, _ = TcOpenDecl cenv openm moduleRange env target
| MutRecShape.Open(MutRecDataForOpen(SynOpenDeclTarget.ModuleOrNamespace _ as target, _, moduleRange, _)) ->
let env, _ = TcOpenDecl cenv moduleRange env target
env
| _ -> env))

Expand Down Expand Up @@ -5261,7 +5259,7 @@ let rec TcSignatureElementNonMutRec (cenv: cenv) parent typeNames endm (env: TcE

| SynModuleSigDecl.Open (target, m) ->
let scopem = unionRanges m.EndRange endm
let env, _openDecl = TcOpenDecl cenv m scopem env target
let env, _openDecl = TcOpenDecl cenv scopem env target
return env

| SynModuleSigDecl.Val (vspec, m) ->
Expand Down Expand Up @@ -5667,7 +5665,7 @@ let rec TcModuleOrNamespaceElementNonMutRec (cenv: cenv) parent typeNames scopem

| SynModuleDecl.Open (target, m) ->
let scopem = unionRanges m.EndRange scopem
let env, openDecls = TcOpenDecl cenv m scopem env target
let env, openDecls = TcOpenDecl cenv scopem env target
let defns =
match openDecls with
| [] -> []
Expand Down
1 change: 0 additions & 1 deletion src/Compiler/Checking/NameResolution.fs
Original file line number Diff line number Diff line change
Expand Up @@ -1374,7 +1374,6 @@ and private AddStaticPartsOfTyconRefToNameEnv bulkAddMode ownDefinition g amap m
eUnindexedExtensionMembers = eUnindexedExtensionMembers }

and private CanAutoOpenTyconRef (g: TcGlobals) (tcref: TyconRef) =
g.langVersion.SupportsFeature LanguageFeature.OpenTypeDeclaration &&
not tcref.IsILTycon &&
EntityHasWellKnownAttribute g WellKnownEntityAttributes.AutoOpenAttribute tcref.Deref &&
tcref.Typars |> List.isEmpty
Expand Down
1 change: 0 additions & 1 deletion src/Compiler/FSComp.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1568,7 +1568,6 @@ featureWildCardInForLoop,"wild card in for loop"
featureRelaxWhitespace,"whitespace relaxation"
featureNameOf,"nameof"
featureImplicitYield,"implicit yield"
featureOpenTypeDeclaration,"open type declaration"
featureDotlessFloat32Literal,"dotless float32 literal"
featurePackageManagement,"package management"
featureFromEndSlicing,"from-end slicing"
Expand Down
3 changes: 0 additions & 3 deletions src/Compiler/Facilities/LanguageFeatures.fs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ type LanguageFeature =
| RelaxWhitespace2
| NameOf
| ImplicitYield
| OpenTypeDeclaration
| DotlessFloat32Literal
| PackageManagement
| FromEndSlicing
Expand Down Expand Up @@ -163,7 +162,6 @@ type LanguageVersion(versionText, ?disabledFeaturesArray: LanguageFeature array)
LanguageFeature.AndBang, languageVersion50
LanguageFeature.NullableOptionalInterop, languageVersion50
LanguageFeature.DefaultInterfaceMemberConsumption, languageVersion50
LanguageFeature.OpenTypeDeclaration, languageVersion50
LanguageFeature.PackageManagement, languageVersion50
LanguageFeature.WitnessPassing, languageVersion50
LanguageFeature.InterfacesWithMultipleGenericInstantiation, languageVersion50
Expand Down Expand Up @@ -369,7 +367,6 @@ type LanguageVersion(versionText, ?disabledFeaturesArray: LanguageFeature array)
| LanguageFeature.RelaxWhitespace2 -> FSComp.SR.featureRelaxWhitespace2 ()
| LanguageFeature.NameOf -> FSComp.SR.featureNameOf ()
| LanguageFeature.ImplicitYield -> FSComp.SR.featureImplicitYield ()
| LanguageFeature.OpenTypeDeclaration -> FSComp.SR.featureOpenTypeDeclaration ()
| LanguageFeature.DotlessFloat32Literal -> FSComp.SR.featureDotlessFloat32Literal ()
| LanguageFeature.PackageManagement -> FSComp.SR.featurePackageManagement ()
| LanguageFeature.FromEndSlicing -> FSComp.SR.featureFromEndSlicing ()
Expand Down
1 change: 0 additions & 1 deletion src/Compiler/Facilities/LanguageFeatures.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ type LanguageFeature =
| RelaxWhitespace2
| NameOf
| ImplicitYield
| OpenTypeDeclaration
| DotlessFloat32Literal
| PackageManagement
| FromEndSlicing
Expand Down
5 changes: 0 additions & 5 deletions src/Compiler/xlf/FSComp.txt.cs.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 0 additions & 5 deletions src/Compiler/xlf/FSComp.txt.de.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 0 additions & 5 deletions src/Compiler/xlf/FSComp.txt.es.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 0 additions & 5 deletions src/Compiler/xlf/FSComp.txt.fr.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 0 additions & 5 deletions src/Compiler/xlf/FSComp.txt.it.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 0 additions & 5 deletions src/Compiler/xlf/FSComp.txt.ja.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 0 additions & 5 deletions src/Compiler/xlf/FSComp.txt.ko.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 0 additions & 5 deletions src/Compiler/xlf/FSComp.txt.pl.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 0 additions & 5 deletions src/Compiler/xlf/FSComp.txt.pt-BR.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 0 additions & 5 deletions src/Compiler/xlf/FSComp.txt.ru.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 0 additions & 5 deletions src/Compiler/xlf/FSComp.txt.tr.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 0 additions & 5 deletions src/Compiler/xlf/FSComp.txt.zh-Hans.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 0 additions & 5 deletions src/Compiler/xlf/FSComp.txt.zh-Hant.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading