Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into lexing-deobfuscation
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin521 committed Oct 9, 2024
2 parents 5a8daa1 + 4fb264d commit 8b6cedb
Show file tree
Hide file tree
Showing 377 changed files with 3,260 additions and 2,061 deletions.
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
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": [
"fsharp@microsoft.com"
],
"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/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<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
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 8b6cedb

Please sign in to comment.