Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into fix-17501
Browse files Browse the repository at this point in the history
  • Loading branch information
vzarytovskii committed Oct 14, 2024
2 parents f95583d + 20f1408 commit 16d764a
Show file tree
Hide file tree
Showing 388 changed files with 3,532 additions and 2,129 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// For format details, see https://aka.ms/vscode-remote/devcontainer.json or this file's README at:
{
"name": "F#",
"image": "mcr.microsoft.com/dotnet/sdk:9.0.100-rc.1",
"image": "mcr.microsoft.com/dotnet/sdk:9.0.100-rc.2",
"features": {
"ghcr.io/devcontainers/features/common-utils:2.5.1": {},
"ghcr.io/devcontainers/features/git:1.3.2": {},
Expand Down
3 changes: 3 additions & 0 deletions .fantomasignore
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@ src/Compiler/Facilities/AsyncMemoize.fsi
src/Compiler/Facilities/AsyncMemoize.fs
src/Compiler/AbstractIL/il.fs

src/Compiler/Driver/GraphChecking/Graph.fsi
src/Compiler/Driver/GraphChecking/Graph.fs

# Fantomas limitations on implementation files (to investigate)

src/Compiler/AbstractIL/ilwrite.fs
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ about: Create a report to help us improve F#
title: ''
labels: [Bug, Needs-Triage]
assignees: ''

type: 'Bug'
---

Please provide a succinct description of the issue.
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ about: Suggest an idea for the F# tools or compiler
title: ''
labels: [Feature Request, Needs-Triage]
assignees: ''

type: 'Feature'
---

**Is your feature request related to a problem? Please describe.**
Expand Down
8 changes: 6 additions & 2 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@
<IgnoreMibc Condition="'$(IgnoreMibc)' == ''">$(DotNetBuildSourceOnly)</IgnoreMibc>
</PropertyGroup>

<PropertyGroup>
<!-- TODO: These need to be removed once we merge/release the new SDK with noward and line fixes. -->
<NoWarn>$(NoWarn);FS0064;FS1182</NoWarn>
</PropertyGroup>

<!--
When developers load the FSharp.Compiler.Service solution we set FSHARPCORE_USE_PACKAGE to true if it hasn't already been set to a value.
This option ensures that building and testing uses the specified FSharp.Core nuget package instead of the local FSharp.Core project.
Expand Down Expand Up @@ -47,8 +52,7 @@
<PropertyGroup Condition="'$(BUILDING_USING_DOTNET)' == 'true'">
<DisableAutoSetFscCompilerPath>false</DisableAutoSetFscCompilerPath>

<!-- TODO(vlza): This probably should be `true` once fslib with nullness ships, since shipped library is preferred by default when building this solution. -->
<FSHARPCORE_USE_PACKAGE Condition="'$(FSHARPCORE_USE_PACKAGE)' == ''">false</FSHARPCORE_USE_PACKAGE>
<FSHARPCORE_USE_PACKAGE Condition="'$(FSHARPCORE_USE_PACKAGE)' == ''">true</FSHARPCORE_USE_PACKAGE>

<DISABLE_ARCADE Condition="'$(DISABLE_ARCADE)' == ''">true</DISABLE_ARCADE>
<ArtifactsDir>$(MSBuildThisFileDirectory)artifacts/</ArtifactsDir>
Expand Down
56 changes: 29 additions & 27 deletions FSharpTests.Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -7,33 +7,35 @@
Returns=""
DependsOnTargets="$(CoreCompileDependsOn)"
>
<Fsi Condition=" '%(_CoreCompileResourceInputs.WithCulture)' != 'true' "
CodePage="$(CodePage)"
DefineConstants="$(DefineConstants)"
DisabledWarnings="$(NoWarn)"
DotnetFsiCompilerPath="$(DotnetFsiCompilerPath)"
FsiExec="@(FsiExec)"
LangVersion="$(LangVersion)"
LCID="$(LCID)"
LoadSources="@(LoadSource)"
NoFramework="false"
Optimize="$(Optimize)"
OtherFlags="$(OtherFlags)"
PreferredUILang="$(PreferredUILang)"
ProvideCommandLineArgs="$(ProvideCommandLineArgs)"
UseSources="@(UseSource)"
SkipCompilerExecution="$(SkipCompilerExecution)"
Sources="@(CompileBefore);@(Compile);@(CompileAfter)"
Tailcalls="$(Tailcalls)"
TargetProfile="$(TargetProfile)"
ToolExe="$(FsiToolExe)"
ToolPath="$(FsiToolPath)"
TreatWarningsAsErrors="$(TreatWarningsAsErrors)"
Utf8Output="$(Utf8Output)"
WarningLevel="$(WarningLevel)"
WarningsAsErrors="$(WarningsAsErrors)">
<Output TaskParameter="CommandLineArgs" ItemName="FsiCommandLineArgs" />
</Fsi>
<Fsi Condition=" '%(_CoreCompileResourceInputs.WithCulture)' != 'true' "
CodePage="$(CodePage)"
DefineConstants="$(DefineConstants)"
DisabledWarnings="$(NoWarn)"
DotnetFsiCompilerPath="$(DotnetFsiCompilerPath)"
FsiExec="@(FsiExec)"
LangVersion="$(LangVersion)"
LCID="$(LCID)"
LoadSources="@(LoadSource)"
NoFramework="false"
Optimize="$(Optimize)"
OtherFlags="$(OtherFlags)"
PreferredUILang="$(PreferredUILang)"
ProvideCommandLineArgs="$(ProvideCommandLineArgs)"
UseSources="@(UseSource)"
SkipCompilerExecution="$(SkipCompilerExecution)"
Sources="@(CompileBefore);@(Compile);@(CompileAfter)"
Tailcalls="$(Tailcalls)"
TargetProfile="$(TargetProfile)"
ToolExe="$(FsiToolExe)"
ToolPath="$(FsiToolPath)"
TreatWarningsAsErrors="$(TreatWarningsAsErrors)"
Utf8Output="$(Utf8Output)"
WarningLevel="$(WarningLevel)"
WarningsAsErrors="$(WarningsAsErrors)"
CaptureTextOutput="true" >
<Output TaskParameter="CommandLineArgs" ItemName="FsiCommandLineArgs" />
<Output TaskParameter="TextOutput" ItemName="FsiTextOutput" />
</Fsi>

<ItemGroup>
<_CoreCompileResourceInputs Remove="@(_CoreCompileResourceInputs)" />
Expand Down
7 changes: 5 additions & 2 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ variables:
# Should be 'current' release branch name, i.e. 'release/dev17.10' in dotnet/fsharp/refs/heads/main, 'release/dev17.10' in dotnet/fsharp/refs/heads/release/dev17.10 and 'release/dev17.9' in dotnet/fsharp/refs/heads/release/dev17.9
# Should **never** be 'main' in dotnet/fsharp/refs/heads/main, since it will start inserting to VS twice.
- name: FSharpReleaseBranchName
value: release/dev17.12
value: release/dev17.13
# VS Insertion branch name (NOT the same as F# branch)
# Should be previous release branch or 'main' in 'main' and 'main' in release branch
# (since for all *new* release branches we insert into VS main and for all *previous* releases we insert into corresponding VS release),
Expand Down Expand Up @@ -73,6 +73,9 @@ extends:
sbom:
enabled: false # VS SBOM is generated with other steps
justificationForDisabling: 'SBOM for F# is generated via build process. Will be migrated at later date.'
tsa:
enabled: true
configFile: '$(Build.SourcesDirectory)/eng/TSAConfig.gdntsa'
sourceAnalysisPool:
name: NetCore1ESPool-Svc-Internal
image: 1es-windows-2022
Expand All @@ -85,7 +88,7 @@ extends:
# Signed build #
#-------------------------------------------------------------------------------------------------------------------#
# Localization: we only run it for specific release branches
- ${{ if eq(variables['Build.SourceBranch'], 'refs/heads/release/dev17.12') }}:
- ${{ if eq(variables['Build.SourceBranch'], 'refs/heads/release/dev17.13') }}:
- template: /eng/common/templates-official/job/onelocbuild.yml@self
parameters:
MirrorRepo: fsharp
Expand Down
3 changes: 2 additions & 1 deletion docs/release-notes/.FSharp.Compiler.Service/9.0.100.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,11 @@
* Enable FSharp 9.0 Language Version ([Issue #17497](https://github.com/dotnet/fsharp/issues/17438)), [PR](https://github.com/dotnet/fsharp/pull/17500)))
* Enable LanguageFeature.EnforceAttributeTargets in F# 9.0. ([Issue #17514](https://github.com/dotnet/fsharp/issues/17558), [PR #17516](https://github.com/dotnet/fsharp/pull/17558))
* Parser: better recovery for unfinished patterns ([PR #17231](https://github.com/dotnet/fsharp/pull/17231), [PR #17232](https://github.com/dotnet/fsharp/pull/17232)))
* Enable consuming generic arguments defined as `allows ref struct` in C# ([Issue #17597](https://github.com/dotnet/fsharp/issues/17597)
* Enable consuming generic arguments defined as `allows ref struct` in C# ([Issue #17597](https://github.com/dotnet/fsharp/issues/17597), display them in tooltips [PR #17706](https://github.com/dotnet/fsharp/pull/17706))
* Trivia for SynTypeConstraint.WhereTyparNotSupportsNull. ([Issue #17721](https://github.com/dotnet/fsharp/issues/17721), [PR #17745](https://github.com/dotnet/fsharp/pull/17745))
* Trivia for SynType.WithNull. ([Issue #17720](https://github.com/dotnet/fsharp/issues/17720), [PR #17745](https://github.com/dotnet/fsharp/pull/17745))


### Changed

* Change compiler default setting realsig+ when building assemblies ([Issue #17384](https://github.com/dotnet/fsharp/issues/17384), [PR #17378](https://github.com/dotnet/fsharp/pull/17385))
Expand Down
8 changes: 6 additions & 2 deletions docs/release-notes/.FSharp.Compiler.Service/9.0.200.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
### Fixed

* Fix false negatives for passing null to "obj" arguments. Only "obj | null" can now subsume any type ([PR #17757](https://github.com/dotnet/fsharp/pull/17757))
* Fix internal error when calling 'AddSingleton' and other overloads only differing in generic arity ([PR #17804](https://github.com/dotnet/fsharp/pull/17804))
* Fix extension methods support for non-reference system assemblies ([PR #17799](https://github.com/dotnet/fsharp/pull/17799))
* Ensure `frameworkTcImportsCache` mutations are threadsafe. ([PR #17795](https://github.com/dotnet/fsharp/pull/17795))

* Ensure `frameworkTcImportsCache` mutations are thread-safe. ([PR #17795](https://github.com/dotnet/fsharp/pull/17795))
* Fix concurrency issue in `ILPreTypeDefImpl` ([PR #17812](https://github.com/dotnet/fsharp/pull/17812))

### Added

* Support literal attribute on decimals ([PR #17769](https://github.com/dotnet/fsharp/pull/17769))

### Changed

* Make ILTypeDef interface impls calculation lazy. ([PR #17392](https://github.com/dotnet/fsharp/pull/17392))
* Remove non-functional useSyntaxTreeCache option. ([PR #17768](https://github.com/dotnet/fsharp/pull/17768))
* Better ranges for CE `let!` and `use!` error reporting. ([PR #17712](https://github.com/dotnet/fsharp/pull/17712))
* Better ranges for CE `do!` error reporting. ([PR #17779](https://github.com/dotnet/fsharp/pull/17779))
* Better ranges for CE `return, yield, return! and yield!` error reporting. ([PR #17792](https://github.com/dotnet/fsharp/pull/17792))
* Better ranges for CE `match!`. ([PR #17789](https://github.com/dotnet/fsharp/pull/17789))
* Better ranges for CE `use` error reporting. ([PR #17811](https://github.com/dotnet/fsharp/pull/17811))

### Breaking Changes
3 changes: 2 additions & 1 deletion docs/release-notes/.VisualStudio/17.12.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
### Added

### Changed
* Fix unwanted navigation on hover [PR #17592](https://github.com/dotnet/fsharp/pull/17592)
* Update `RemoveReturnOrYield` code fix range calculation [PR #17792](https://github.com/dotnet/fsharp/pull/17792)
* Fix unwanted navigation on hover [PR #17592](https://github.com/dotnet/fsharp/pull/17592))
* Remove non-functional useSyntaxTreeCache option. ([PR #17768](https://github.com/dotnet/fsharp/pull/17768))


### Breaking Changes
* Enable FSharp 9.0 Language Version ([Issue #17497](https://github.com/dotnet/fsharp/issues/17438)), [PR](https://github.com/dotnet/fsharp/pull/17500)))
16 changes: 16 additions & 0 deletions eng/TSAConfig.gdntsa
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"codebaseName": "FSharp-GitHub",
"notificationAliases": [
"[email protected]"
],
"codebaseAdmins": [
"EUROPE\\vlza",
"REDMOND\\kevinransom",
"EUROPE\\tomasgrosup"
],
"instanceUrl": "https://devdiv.visualstudio.com",
"projectName": "DevDiv",
"areaPath": "DevDiv\\FSharp",
"iterationPath": "DevDiv",
"allTools": true
}
4 changes: 2 additions & 2 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<Dependencies>
<ProductDependencies>
<Dependency Name="Microsoft.SourceBuild.Intermediate.source-build-reference-packages" Version="10.0.0-alpha.1.24459.1">
<Dependency Name="Microsoft.SourceBuild.Intermediate.source-build-reference-packages" Version="10.0.0-alpha.1.24507.1">
<Uri>https://github.com/dotnet/source-build-reference-packages</Uri>
<Sha>08649fed58d668737a54913f7d4c649a8da5dc6e</Sha>
<Sha>fd609e3b427601180d23633e2f1a4cdac6c42c20</Sha>
<SourceBuild RepoName="source-build-reference-packages" ManagedOnly="true" />
</Dependency>
<!-- Intermediate is necessary for source build. -->
Expand Down
6 changes: 3 additions & 3 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@
<FSharpLibrariesChangelogVersion>$(FSMajorVersion).$(FSMinorVersion).$(FSBuildVersion)</FSharpLibrariesChangelogVersion>
<!-- -->
<!-- The current published nuget package -->
<FSharpCoreShippedPackageVersionValue>8.0.400</FSharpCoreShippedPackageVersionValue>
<FSharpCoreShippedPackageVersionValue>9.0.100-beta.24466.6</FSharpCoreShippedPackageVersionValue>
<!-- -->
<!-- The pattern for specifying the preview package -->
<FSharpCorePreviewPackageVersionValue>$(FSCorePackageVersionValue)-$(PreReleaseVersionLabel).*</FSharpCorePreviewPackageVersionValue>
<!-- -->
<!-- FSharp tools for Visual Studio version number -->
<FSToolsMajorVersion>12</FSToolsMajorVersion>
<FSToolsMajorVersion>13</FSToolsMajorVersion>
<FSToolsMinorVersion>9</FSToolsMinorVersion>
<FSToolsBuildVersion>$(FSBuildVersion)</FSToolsBuildVersion>
<FSToolsRevisionVersion>$(FSRevisionVersion)</FSToolsRevisionVersion>
Expand All @@ -53,7 +53,7 @@
<PropertyGroup>
<!-- These have to be in sync with latest release branch -->
<VSMajorVersion>17</VSMajorVersion>
<VSMinorVersion>12</VSMinorVersion>
<VSMinorVersion>13</VSMinorVersion>
<VSGeneralVersion>$(VSMajorVersion).0</VSGeneralVersion>
<VSAssemblyVersionPrefix>$(VSMajorVersion).$(VSMinorVersion).0</VSAssemblyVersionPrefix>
<VSAssemblyVersion>$(VSAssemblyVersionPrefix).0</VSAssemblyVersion>
Expand Down
4 changes: 2 additions & 2 deletions global.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"sdk": {
"version": "9.0.100-rc.1.24452.12",
"version": "9.0.100-rc.2.24474.11",
"allowPrerelease": true
},
"tools": {
"dotnet": "9.0.100-rc.1.24452.12",
"dotnet": "9.0.100-rc.2.24474.11",
"vs": {
"version": "17.8",
"components": [
Expand Down
32 changes: 7 additions & 25 deletions src/Compiler/AbstractIL/il.fs
Original file line number Diff line number Diff line change
Expand Up @@ -2913,35 +2913,17 @@ and [<NoEquality; NoComparison>] ILPreTypeDef =

/// This is a memory-critical class. Very many of these objects get allocated and held to represent the contents of .NET assemblies.
and [<Sealed>] ILPreTypeDefImpl(nameSpace: string list, name: string, metadataIndex: int32, storage: ILTypeDefStored) =
let mutable store: ILTypeDef = Unchecked.defaultof<_>
let mutable storage = storage
let stored =
lazy
match storage with
| ILTypeDefStored.Given td -> td
| ILTypeDefStored.Computed f -> f ()
| ILTypeDefStored.Reader f -> f metadataIndex

interface ILPreTypeDef with
member _.Namespace = nameSpace
member _.Name = name

member x.GetTypeDef() =
match box store with
| null ->
let syncObj = storage
Monitor.Enter(syncObj)

try
match box store with
| null ->
let value =
match storage with
| ILTypeDefStored.Given td -> td
| ILTypeDefStored.Computed f -> f ()
| ILTypeDefStored.Reader f -> f metadataIndex

store <- value
storage <- Unchecked.defaultof<_>
value
| _ -> store
finally
Monitor.Exit(syncObj)
| _ -> store
member x.GetTypeDef() = stored.Value

and ILTypeDefStored =
| Given of ILTypeDef
Expand Down
2 changes: 1 addition & 1 deletion src/Compiler/AbstractIL/ilreflect.fs
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ type TypeBuilder with

match m with
| null -> raise (MissingMethodException nm)
| m -> m.Invoke(null, args)
| m -> m.Invoke(null, (args: obj array))

member typB.SetCustomAttributeAndLog(cinfo, bytes) =
if logRefEmitCalls then
Expand Down
4 changes: 2 additions & 2 deletions src/Compiler/Checking/AttributeChecking.fs
Original file line number Diff line number Diff line change
Expand Up @@ -466,9 +466,9 @@ let MethInfoIsUnseen g (m: range) (ty: TType) minfo =

let isUnseenByHidingAttribute () =
#if !NO_TYPEPROVIDERS
not (isObjTy g ty) &&
not (isObjTyAnyNullness g ty) &&
isAppTy g ty &&
isObjTy g minfo.ApparentEnclosingType &&
isObjTyAnyNullness g minfo.ApparentEnclosingType &&
let tcref = tcrefOfAppTy g ty
match tcref.TypeReprInfo with
| TProvidedTypeRepr info ->
Expand Down
Loading

0 comments on commit 16d764a

Please sign in to comment.