Skip to content
Merged
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
4 changes: 4 additions & 0 deletions FSharpBuild.Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
<DisableAutoSetFscCompilerPath>true</DisableAutoSetFscCompilerPath>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)' == 'Proto'">
<FSCoreVersion>$(FSCoreShippedVersion)</FSCoreVersion>
</PropertyGroup>

<PropertyGroup>
<FSharpSourcesRoot>$(RepoRoot)src</FSharpSourcesRoot>
<FSharpTestsRoot>$(RepoRoot)tests</FSharpTestsRoot>
Expand Down
15 changes: 8 additions & 7 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
<PropertyGroup>
<PreReleaseVersionLabel>beta</PreReleaseVersionLabel>
<!-- F# Version components -->
<FSMajorVersion>6</FSMajorVersion>
<FSMajorVersion>7</FSMajorVersion>
<FSMinorVersion>0</FSMinorVersion>
<FSBuildVersion>6</FSBuildVersion>
<FSBuildVersion>0</FSBuildVersion>
<FSRevisionVersion>0</FSRevisionVersion>
<!-- -->
<!-- F# Language version -->
Expand All @@ -28,26 +28,27 @@
<FSCoreReleaseNotesVersion>$(FSMajorVersion)-$(FSMinorVersion)-$(FSBuildVersion)</FSCoreReleaseNotesVersion>
<FSCoreVersionPrefix>$(FSMajorVersion).$(FSMinorVersion).$(FSBuildVersion)</FSCoreVersionPrefix>
<FSCoreVersion>$(FSMajorVersion).$(FSMinorVersion).0.0</FSCoreVersion>
<FSCoreShippedVersion>6.0.0.0</FSCoreShippedVersion>
<!-- -->
<!-- FSharp.Compiler.Service version -->
<FCSMajorVersion>41</FCSMajorVersion>
<FCSMinorVersion>0</FCSMinorVersion>
<FCSBuildVersion>6</FCSBuildVersion>
<FCSMajorVersion>42</FCSMajorVersion>
<FCSMinorVersion>7</FCSMinorVersion>
<FCSBuildVersion>100</FCSBuildVersion>
<FCSRevisionVersion>$(FSRevisionVersion)</FCSRevisionVersion>
<FSharpCompilerServicePackageVersion>$(FCSMajorVersion).$(FCSMinorVersion).$(FCSBuildVersion)</FSharpCompilerServicePackageVersion>
<FSharpCompilerServiceVersion>$(FCSMajorVersion).$(FCSMinorVersion).$(FCSBuildVersion).$(FCSRevisionVersion)</FSharpCompilerServiceVersion>
<FSharpCompilerServiceReleaseNotesVersion>$(FCSMajorVersion)$(FCSMinorVersion)$(FCSBuildVersion)</FSharpCompilerServiceReleaseNotesVersion>
<!-- -->
<!-- The current published nuget package -->
<FSharpCoreShippedPackageVersionValue>6.0.3</FSharpCoreShippedPackageVersionValue>
<FSharpCoreShippedPackageVersionValue>6.0.5</FSharpCoreShippedPackageVersionValue>
<!-- -->
<!-- The pattern for specifying the preview package -->
<FSharpCorePreviewPackageVersionValue>$(FSCorePackageVersionValue)-$(PreReleaseVersionLabel).*</FSharpCorePreviewPackageVersionValue>
<!-- -->
<!-- FSharp tools for Visual Studio version number -->
<FSToolsMajorVersion>12</FSToolsMajorVersion>
<FSToolsMinorVersion>0</FSToolsMinorVersion>
<FSToolsBuildVersion>4</FSToolsBuildVersion>
<FSToolsBuildVersion>5</FSToolsBuildVersion>
<FSToolsRevisionVersion>$(FSRevisionVersion)</FSToolsRevisionVersion>
<FSProductVersionPrefix>$(FSToolsMajorVersion).$(FSToolsMinorVersion).$(FSToolsBuildVersion)</FSProductVersionPrefix>
<FSProductVersionReleaseNotesVersion>$(FSToolsMajorVersion)-$(FSToolsMinorVersion)-$(FSToolsBuildVersion)</FSProductVersionReleaseNotesVersion>
Expand Down
29 changes: 17 additions & 12 deletions src/Compiler/Facilities/LanguageFeatures.fs
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,16 @@ type LanguageVersion(versionText) =
static let languageVersion47 = 4.7m
static let languageVersion50 = 5.0m
static let languageVersion60 = 6.0m
static let languageVersion70 = 7.0m
static let previewVersion = 9999m // Language version when preview specified
static let defaultVersion = languageVersion60 // Language version when default specified
static let defaultVersion = languageVersion70 // Language version when default specified
static let latestVersion = defaultVersion // Language version when latest specified
static let latestMajorVersion = languageVersion60 // Language version when latestmajor specified
static let latestMajorVersion = languageVersion70 // Language version when latestmajor specified

static let validOptions = [| "preview"; "default"; "latest"; "latestmajor" |]

static let languageVersions =
set [| languageVersion46; languageVersion47; languageVersion50; languageVersion60 |]
set [| languageVersion46; languageVersion47; languageVersion50; languageVersion60; languageVersion70 |]

static let features =
dict
Expand Down Expand Up @@ -110,17 +111,19 @@ type LanguageVersion(versionText) =
LanguageFeature.AttributesToRightOfModuleKeyword, languageVersion60
LanguageFeature.DelegateTypeNameResolutionFix, languageVersion60

// F# 7.0
LanguageFeature.MLCompatRevisions, languageVersion70
LanguageFeature.BetterExceptionPrinting, languageVersion70
LanguageFeature.ReallyLongLists, languageVersion70
LanguageFeature.ErrorOnDeprecatedRequireQualifiedAccess, languageVersion70
LanguageFeature.RequiredPropertiesSupport, languageVersion70
LanguageFeature.InitPropertiesSupport, languageVersion70
LanguageFeature.LowercaseDUWhenRequireQualifiedAccess, languageVersion70
LanguageFeature.InterfacesWithAbstractStaticMembers, languageVersion70
LanguageFeature.SelfTypeConstraints, languageVersion70

// F# preview
LanguageFeature.FromEndSlicing, previewVersion
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we move the from end slicing too? I thought it needs some work?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

LanguageFeature.MLCompatRevisions, previewVersion
LanguageFeature.BetterExceptionPrinting, previewVersion
LanguageFeature.ReallyLongLists, previewVersion
LanguageFeature.ErrorOnDeprecatedRequireQualifiedAccess, previewVersion
LanguageFeature.RequiredPropertiesSupport, previewVersion
LanguageFeature.InitPropertiesSupport, previewVersion
LanguageFeature.LowercaseDUWhenRequireQualifiedAccess, previewVersion
LanguageFeature.InterfacesWithAbstractStaticMembers, previewVersion
LanguageFeature.SelfTypeConstraints, previewVersion
]

static let defaultLanguageVersion = LanguageVersion("default")
Expand All @@ -138,6 +141,8 @@ type LanguageVersion(versionText) =
| "5" -> languageVersion50
| "6.0"
| "6" -> languageVersion60
| "7.0"
| "7" -> languageVersion70
| _ -> 0m

let specified = getVersionFromString versionText
Expand Down
10 changes: 1 addition & 9 deletions src/FSharp.Build/FSharp.Build.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,7 @@
<None Include="Microsoft.FSharp.Overrides.NetSdk.targets" CopyToOutputDirectory="PreserveNewest" />
</ItemGroup>

<ItemGroup Condition="'$(Configuration)' == 'Proto' and '$(DotNetBuildFromSource)' != 'true'">
<!--
The FSharp.Build built here may be loaded directly into a shipped Visual Studio, to that end, we cannot
rely on new API's just being added to FSharp.Core.
-->
<PackageReference Include="FSharp.Core" Version="$(FSharpCoreShippedPackageVersionValue)" />
</ItemGroup>

<ItemGroup Condition="'$(Configuration)' != 'Proto' or '$(DotNetBuildFromSource)' == 'true'">
<ItemGroup Condition="">
<ProjectReference Include="$(MSBuildThisFileDirectory)..\FSharp.Core\FSharp.Core.fsproj" />
</ItemGroup>

Expand Down
7 changes: 0 additions & 7 deletions src/FSharp.Core/prim-types.fs
Original file line number Diff line number Diff line change
Expand Up @@ -4107,7 +4107,6 @@ namespace Microsoft.FSharp.Collections
let start = if i < 0 then 0 else i
PrivateListHelpers.sliceTake (j - start) (PrivateListHelpers.sliceSkip start l)

[<Experimental(ExperimentalAttributeMessages.RequiresPreview)>]
member l.GetReverseIndex(_: int, offset: int) =
l.Length - offset - 1

Expand Down Expand Up @@ -6901,10 +6900,8 @@ namespace Microsoft.FSharp.Core
if n >= 0 then PowDecimal x n else 1.0M / PowDecimal x n)

[<AutoOpen>]
[<Experimental(ExperimentalAttributeMessages.RequiresPreview)>]
module ArrayExtensions =
type ``[,,,]``<'T> with
[<Experimental(ExperimentalAttributeMessages.RequiresPreview)>]
member arr.GetReverseIndex(dim: int, offset: int) =
let len =
match dim with
Expand All @@ -6917,7 +6914,6 @@ namespace Microsoft.FSharp.Core
len - offset - 1

type ``[,,]``<'T> with
[<Experimental(ExperimentalAttributeMessages.RequiresPreview)>]
member arr.GetReverseIndex(dim: int, offset: int) =
let len =
match dim with
Expand All @@ -6929,7 +6925,6 @@ namespace Microsoft.FSharp.Core
len - offset - 1

type ``[,]``<'T> with
[<Experimental(ExperimentalAttributeMessages.RequiresPreview)>]
member arr.GetReverseIndex(dim: int, offset: int) =
let len =
match dim with
Expand All @@ -6940,11 +6935,9 @@ namespace Microsoft.FSharp.Core
len - offset - 1

type ``[]``<'T> with
[<Experimental(ExperimentalAttributeMessages.RequiresPreview)>]
member arr.GetReverseIndex (_: int, offset: int) = arr.Length - offset - 1

type String with
[<Experimental(ExperimentalAttributeMessages.RequiresPreview)>]
member str.GetReverseIndex (_: int, offset: int) = str.Length - offset - 1

namespace Microsoft.FSharp.Control
Expand Down
7 changes: 0 additions & 7 deletions src/FSharp.Core/prim-types.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -2555,7 +2555,6 @@ namespace Microsoft.FSharp.Collections
/// <param name="offset">The offset from the end.</param>
///
/// <returns>The corresponding index from the start.</returns>
[<Experimental("Experimental library feature, requires '--langversion:preview'")>]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the from end slicing remains in preview, shall those methods too?

member GetReverseIndex: rank: int * offset: int -> int

/// <summary>Returns a list with <c>head</c> as its first element and <c>tail</c> as its subsequent elements</summary>
Expand Down Expand Up @@ -4601,7 +4600,6 @@ namespace Microsoft.FSharp.Core
/// <summary>Contains extension methods to allow the use of F# indexer notation with arrays.
/// This module is automatically opened in all F# code.</summary>
[<AutoOpen>]
[<Experimental("Experimental library feature, requires '--langversion:preview'")>]
module ArrayExtensions =
type ``[,,,]``<'T> with
/// <summary>Get the index for the element offset elements away from the end of the collection.</summary>
Expand All @@ -4610,7 +4608,6 @@ namespace Microsoft.FSharp.Core
/// <param name="offset">The offset from the end.</param>
///
/// <returns>The corresponding index from the start.</returns>
[<Experimental("Experimental library feature, requires '--langversion:preview'")>]
member GetReverseIndex: rank: int * offset: int -> int

type ``[,,]``<'T> with
Expand All @@ -4620,7 +4617,6 @@ namespace Microsoft.FSharp.Core
/// <param name="offset">The offset from the end.</param>
///
/// <returns>The corresponding index from the start.</returns>
[<Experimental("Experimental library feature, requires '--langversion:preview'")>]
member GetReverseIndex: rank: int * offset: int -> int

type ``[,]``<'T> with
Expand All @@ -4630,7 +4626,6 @@ namespace Microsoft.FSharp.Core
/// <param name="offset">The offset from the end.</param>
///
/// <returns>The corresponding index from the start.</returns>
[<Experimental("Experimental library feature, requires '--langversion:preview'")>]
member GetReverseIndex: rank: int * offset: int -> int

type ``[]``<'T> with
Expand All @@ -4640,7 +4635,6 @@ namespace Microsoft.FSharp.Core
/// <param name="offset">The offset from the end.</param>
///
/// <returns>The corresponding index from the start.</returns>
[<Experimental("Experimental library feature, requires '--langversion:preview'")>]
member GetReverseIndex: rank: int * offset: int -> int

type System.String with
Expand All @@ -4650,7 +4644,6 @@ namespace Microsoft.FSharp.Core
/// <param name="offset">The offset from the end.</param>
///
/// <returns>The corresponding index from the start.</returns>
[<Experimental("Experimental library feature, requires '--langversion:preview'")>]
member GetReverseIndex: rank: int * offset: int -> int

/// <summary>A module of compiler intrinsic functions for efficient implementations of F# integer ranges
Expand Down
1 change: 0 additions & 1 deletion src/FSharp.Core/tasks.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ namespace Microsoft.FSharp.Control
/// The extra data stored in ResumableStateMachine for tasks
/// </summary>
[<Struct; NoComparison; NoEquality>]
[<Experimental("Experimental library feature, requires '--langversion:preview'")>]
[<CompilerMessage("This construct is for use by compiled F# code and should not be used directly", 1204, IsHidden=true)>]
type TaskStateMachineData<'T> =

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ module ModuleDefinitions =
let ``Production_OCamlCompat_fsx`` compilation =
compilation
|> withOcamlCompat
|> withLangVersion50
|> verifyCompileAndRun
|> shouldSucceed

Expand Down Expand Up @@ -271,13 +272,13 @@ module ModuleDefinitions =
|> verifyCompile
|> shouldFail
|> withDiagnostics [
(Warning 62, Line 14, Col 13, Line 14, Col 19, "This construct is for ML compatibility. The syntax 'module ... = struct .. end' is not used in F# code. Consider using 'module ... = begin .. end'. You can disable this warning by using '--mlcompatibility' or '--nowarn:62'.")
(Warning 62, Line 18, Col 13, Line 18, Col 19, "This construct is for ML compatibility. The syntax 'module ... = struct .. end' is not used in F# code. Consider using 'module ... = begin .. end'. You can disable this warning by using '--mlcompatibility' or '--nowarn:62'.")
(Warning 62, Line 22, Col 13, Line 22, Col 19, "This construct is for ML compatibility. The syntax 'module ... = struct .. end' is not used in F# code. Consider using 'module ... = begin .. end'. You can disable this warning by using '--mlcompatibility' or '--nowarn:62'.")
(Warning 62, Line 26, Col 13, Line 26, Col 19, "This construct is for ML compatibility. The syntax 'module ... = struct .. end' is not used in F# code. Consider using 'module ... = begin .. end'. You can disable this warning by using '--mlcompatibility' or '--nowarn:62'.")
(Warning 62, Line 30, Col 13, Line 30, Col 19, "This construct is for ML compatibility. The syntax 'module ... = struct .. end' is not used in F# code. Consider using 'module ... = begin .. end'. You can disable this warning by using '--mlcompatibility' or '--nowarn:62'.")
(Warning 62, Line 35, Col 13, Line 35, Col 19, "This construct is for ML compatibility. The syntax 'module ... = struct .. end' is not used in F# code. Consider using 'module ... = begin .. end'. You can disable this warning by using '--mlcompatibility' or '--nowarn:62'.")
(Warning 62, Line 39, Col 13, Line 39, Col 19, "This construct is for ML compatibility. The syntax 'module ... = struct .. end' is not used in F# code. Consider using 'module ... = begin .. end'. You can disable this warning by using '--mlcompatibility' or '--nowarn:62'.")
(Error 62, Line 14, Col 13, Line 14, Col 19, "This construct is deprecated. The use of 'module M = struct ... end ' was deprecated in F# 2.0 and is no longer supported. Remove the 'struct' and 'end' and use indentation instead. You can enable this feature by using '--langversion:5.0' and '--mlcompatibility'.")
(Error 62, Line 18, Col 13, Line 18, Col 19, "This construct is deprecated. The use of 'module M = struct ... end ' was deprecated in F# 2.0 and is no longer supported. Remove the 'struct' and 'end' and use indentation instead. You can enable this feature by using '--langversion:5.0' and '--mlcompatibility'.")
(Error 62, Line 22, Col 13, Line 22, Col 19, "This construct is deprecated. The use of 'module M = struct ... end ' was deprecated in F# 2.0 and is no longer supported. Remove the 'struct' and 'end' and use indentation instead. You can enable this feature by using '--langversion:5.0' and '--mlcompatibility'.")
(Error 62, Line 26, Col 13, Line 26, Col 19, "This construct is deprecated. The use of 'module M = struct ... end ' was deprecated in F# 2.0 and is no longer supported. Remove the 'struct' and 'end' and use indentation instead. You can enable this feature by using '--langversion:5.0' and '--mlcompatibility'.")
(Error 62, Line 30, Col 13, Line 30, Col 19, "This construct is deprecated. The use of 'module M = struct ... end ' was deprecated in F# 2.0 and is no longer supported. Remove the 'struct' and 'end' and use indentation instead. You can enable this feature by using '--langversion:5.0' and '--mlcompatibility'.")
(Error 62, Line 35, Col 13, Line 35, Col 19, "This construct is deprecated. The use of 'module M = struct ... end ' was deprecated in F# 2.0 and is no longer supported. Remove the 'struct' and 'end' and use indentation instead. You can enable this feature by using '--langversion:5.0' and '--mlcompatibility'.")
(Error 62, Line 39, Col 13, Line 39, Col 19, "This construct is deprecated. The use of 'module M = struct ... end ' was deprecated in F# 2.0 and is no longer supported. Remove the 'struct' and 'end' and use indentation instead. You can enable this feature by using '--langversion:5.0' and '--mlcompatibility'.")
]

//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module UseBindings =
let ``UseBindings - UseBindingDiscard01_fs - Current LangVersion`` compilation =
compilation
|> asFsx
|> withOptions ["--langversion:preview"]
|> withLangVersion60
|> compile
|> shouldSucceed
|> ignore
Expand Down Expand Up @@ -57,6 +57,6 @@ if ctorCalls <> 1 then

"""
|> asExe
|> withLangVersionPreview
|> withLangVersion60
|> compileAndRun
|> shouldSucceed
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ module RecursiveSafetyAnalysis =
let ``E_CyclicReference01_fs`` compilation =
compilation
|> withOptions ["--mlcompatibility"; "--flaterrors"]
|> withLangVersion50
|> asExe
|> compile
|> shouldFail
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ module SymbolicOperators =
|> compile
|> shouldFail
|> withErrorCode 0670
|> withDiagnosticMessageMatches " \^a\) could not be generalized because it would escape its scope"
|> withDiagnosticMessageMatches " 'a\) could not be generalized because it would escape its scope"
|> ignore

// This test was automatically generated (moved from FSharpQA suite - Conformance/LexicalAnalysis/SymbolicOperators)
Expand Down
Loading