diff --git a/.gitignore b/.gitignore index e599502bb48..418b3677b36 100644 --- a/.gitignore +++ b/.gitignore @@ -1,12 +1,9 @@ -# Downloaded packages and build tools. -/lkg -/packages -/Tools +# output location +artifacts/ + +packages/ /tests/scripts/current -/release -/debug -/Proto # Patches that may have been generated by scripts. # (These aren't generally useful to commit directly; if anything, they should be applied.) @@ -82,10 +79,9 @@ lib/bootstrap/4.1/*.xml lib/bootstrap/4.1/fsharpc lib/bootstrap/4.1/fsharpi lib/bootstrap/4.1/policy* +obj/ +bin/ aclocal.m4 -Debug -Release -Proto sign_temp .libs configure @@ -109,7 +105,6 @@ ossreadme*.txt *.cto *.vstman project.lock.json -Tools/ Backup/ tests/fsharp/core/array/dont.run.peverify tests/fsharp/core/innerpoly/dont.run.peverify @@ -118,7 +113,6 @@ times /tests/fsharpqa/testenv/bin/System.ValueTuple.dll source_link.json .vs/ -/VSRelease/net40/bin System.ValueTuple.dll tests/fsharpqa/testenv/bin/System.ValueTuple.dll */.fake diff --git a/.vsts-pr.yaml b/.vsts-pr.yaml index 0d7262e418a..44c277a3943 100644 --- a/.vsts-pr.yaml +++ b/.vsts-pr.yaml @@ -1,32 +1,34 @@ -phases: -- phase: Linux - queue: - name: Hosted Linux Preview - timeoutInMinutes: 90 - parallel: 2 +jobs: +- job: Linux + pool: + vmImage: ubuntu-16.04 + timeoutInMinutes: 90 + strategy: + maxParallel: 2 matrix: - release_default: - _command: ./mono/cibuild.sh - _args: release + dotnet_sdk: + _command: make + _args: Configuration=release # disabled until it can be properly fixed - #release_fcs: - # _command: ./fcs/build.sh - # _args: Build + release_fcs: + _command: ./fcs/build.sh + _args: Build steps: - - script: $(_command) $(_args) - - task: PublishBuildArtifacts@1 - inputs: - PathtoPublish: '$(Build.SourcesDirectory)/tests/TestResults' - ArtifactName: 'Linux $(_command) $(_args)' - publishLocation: Container - continueOnError: true - condition: failed() + - script: $(_command) $(_args) + - task: PublishBuildArtifacts@1 + inputs: + PathtoPublish: '$(Build.SourcesDirectory)/artifacts/TestResults' + ArtifactName: 'Linux $(_command) $(_args)' + publishLocation: Container + continueOnError: true + condition: failed() -- phase: Windows - queue: - name: Hosted VS2017 - timeoutInMinutes: 90 - parallel: 7 +- job: Windows + pool: + vmImage: vs2017-win2016 + timeoutInMinutes: 120 + strategy: + maxParallel: 7 matrix: ci_part1: _command: build.cmd @@ -50,11 +52,11 @@ phases: _command: fcs\build.cmd _args: TestAndNuget steps: - - script: $(_command) $(_args) - - task: PublishBuildArtifacts@1 - inputs: - PathtoPublish: '$(Build.SourcesDirectory)\tests\TestResults' - ArtifactName: 'Windows $(_command) $(_args)' - publishLocation: Container - continueOnError: true - condition: failed() + - script: $(_command) $(_args) + - task: PublishBuildArtifacts@1 + inputs: + PathtoPublish: '$(Build.SourcesDirectory)\artifacts\TestResults' + ArtifactName: 'Windows $(_command) $(_args)' + publishLocation: Container + continueOnError: true + condition: failed() diff --git a/.vsts-signed.yaml b/.vsts-signed.yaml index df4e8a6bd5f..823ac20297a 100644 --- a/.vsts-signed.yaml +++ b/.vsts-signed.yaml @@ -1,100 +1,140 @@ -queue: - name: VSEng-MicroBuildVS2017 - timeoutInMinutes: 300 - demands: - - visualstudio - - DotNetFramework - - msbuild - variables: - MSBuildConfiguration: 'Release' +- name: PB_PublishBlobFeedUrl + value: https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json +- group: DotNet-Blob-Feed +- name: PB_PublishBlobFeedKey + value: $(dotnetfeed-storage-access-key-1) + +jobs: +- job: Full_Signed + pool: + name: VSEng-MicroBuildVS2017 + timeoutInMinutes: 300 + variables: + BuildConfiguration: 'Release' + steps: + # Install Signing Plugin + - task: ms-vseng.MicroBuildTasks.30666190-6959-11e5-9f96-f56098202fef.MicroBuildSigningPlugin@1 + displayName: Install Signing Plugin + inputs: + signType: real + condition: and(succeeded(), in(variables['PB_SignType'], 'test', 'real')) -steps: -# Install Signing Plugin -- task: ms-vseng.MicroBuildTasks.30666190-6959-11e5-9f96-f56098202fef.MicroBuildSigningPlugin@1 - displayName: Install Signing Plugin - inputs: - signType: real - condition: and(succeeded(), in(variables['PB_SignType'], 'test', 'real')) + # Install Swix Plugin + - task: ms-vseng.MicroBuildTasks.32f78468-e895-4f47-962c-58a699361df8.MicroBuildSwixPlugin@1 + displayName: Install Swix Plugin -# Install Swix Plugin -- task: ms-vseng.MicroBuildTasks.32f78468-e895-4f47-962c-58a699361df8.MicroBuildSwixPlugin@1 - displayName: Install Swix Plugin + # Run build.cmd + - task: CmdLine@1 + displayName: Run build.cmd + inputs: + filename: build.cmd + arguments: microbuild -# Run build.cmd -- task: CmdLine@1 - displayName: Run build.cmd - inputs: - filename: build.cmd - arguments: microbuild + # Publish nightly package to MyGet + - task: PowerShell@1 + displayName: Publish nightly package to MyGet + inputs: + scriptName: 'setup\publish-assets.ps1' + arguments: '-binariesPath artifacts\bin -configuration $(BuildConfiguration) -branchName $(Build.SourceBranch) -apiKey $(FSharp.MyGetApiKey)' + condition: and(succeeded(), contains(variables['PB_PublishType'], 'myget')) -# Publish nightly package to MyGet -- task: PowerShell@1 - displayName: Publish nightly package to MyGet - inputs: - scriptName: 'setup\publish-assets.ps1' - arguments: '-binariesPath $(MSBuildConfiguration) -branchName $(Build.SourceBranch) -apiKey $(FSharp.MyGetApiKey)' - condition: and(succeeded(), contains(variables['PB_PublishType'], 'myget')) + # Package publish + - task: CmdLine@1 + displayName: Restore package publishing + inputs: + filename: '.nuget\NuGet.exe' + arguments: 'restore packages.config -PackagesDirectory packages -Source https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json' + condition: and(succeeded(), contains(variables['PB_PublishType'], 'blob')) + - task: MSBuild@1 + displayName: Publish packages to Azure Blob Storage + inputs: + solution: PublishToBlob.proj + msbuildArguments: '/t:Build /p:Configuration=$(BuildConfiguration) /p:ExpectedFeedUrl=$(PB_PublishBlobFeedUrl) /p:AccountKey=$(PB_PublishBlobFeedKey) /p:ManifestRepouri=$(Build.Repository.Uri) /p:ManifestBranch=$(Build.SourceBranch) /p:ManifestCommit=$(Build.SourceVersion) /p:ManifestBuildId=$(Build.BuildNumber) /bl:$(Build.SourcesDirectory)/artifacts/log/$(BuildConfiguration)/pub/publish.binlog' + condition: and(succeeded(), contains(variables['PB_PublishType'], 'blob')) + - task: PublishBuildArtifacts@1 + displayName: Publish publishing bin log + inputs: + PathtoPublish: '$(Build.SourcesDirectory)/artifacts/log/$(BuildConfiguration)/pub' + ArtifactName: 'Publish_bin_log' + publishLocation: Container + continueOnError: true + condition: and(succeeded(), contains(variables['PB_PublishType'], 'blob')) + - task: CopyFiles@2 + displayName: Gather Asset Manifests + inputs: + SourceFolder: '$(Build.SourcesDirectory)/artifacts/log/$(BuildConfiguration)/AssetManifest' + TargetFolder: '$(Build.StagingDirectory)/AssetManifests' + continueOnError: true + condition: and(succeeded(), contains(variables['PB_PublishType'], 'blob')) + - task: PublishBuildArtifacts@1 + displayName: Push Asset Manifests + inputs: + PathtoPublish: '$(Build.StagingDirectory)/AssetManifests' + PublishLocation: Container + ArtifactName: AssetManifests + continueOnError: true + condition: and(succeeded(), contains(variables['PB_PublishType'], 'blob')) -# Publish packages to Azure Blob Storage -- task: MSBuild@1 - displayName: Publish packages to Azure Blob Storage - inputs: - solution: PublishToBlob.proj - msbuildArguments: '/t:Build /p:ExpectedFeedUrl=$(PB_PublishBlobFeedUrl) /p:AccountKey=$(PB_PublishBlobFeedKey) /p:ManifestBranch=$(SourceBranch) /p:ManifestCommit=$(SourceVersion) /p:ManifestBuildId=$(OfficialBuildId)' - condition: and(succeeded(), contains(variables['PB_PublishType'], 'blob')) + # Create static drop + - task: PublishBuildArtifacts@1 + displayName: Create static drop + inputs: + PathtoPublish: 'artifacts' + ArtifactName: '$(Build.BuildNumber)' + publishLocation: FilePath + TargetPath: '$(DropRoot)\$(Build.DefinitionName)\$(Build.SourceBranchName)' + Parallel: true + ParallelCount: 64 + condition: and(succeeded(), contains(variables['PB_PublishType'], 'drop')) -# Create static drop -- task: PublishBuildArtifacts@1 - displayName: Create static drop - inputs: - PathtoPublish: '$(MSBuildConfiguration)' - ArtifactName: '$(Build.BuildNumber)' - publishLocation: FilePath - TargetPath: '$(DropRoot)\$(Build.DefinitionName)\$(Build.SourceBranchName)' - Parallel: true - ParallelCount: 64 - condition: and(succeeded(), contains(variables['PB_PublishType'], 'drop')) + # Publish symbols + - task: PublishSymbols@1 + displayName: Publish symbols + inputs: + SymbolsPath: '$(DropRoot)\$(Build.DefinitionName)\$(Build.SourceBranchName)\$(Build.BuildNumber)\Symbols' + SearchPattern: '**\*.dll;**\*.exe;**\*.pdb' + SymbolsFolder: '$(Build.SourcesDirectory)\artifacts\SymStore' + TreatNotIndexedAsWarning: true + SymbolsProduct: '$(Build.DefinitionName)' + SymbolsVersion: '$(Build.BuildNumber)' + continueOnError: true + condition: and(succeeded(), contains(variables['PB_PublishType'], 'symbols')) -# Publish symbols -- task: PublishSymbols@1 - displayName: Publish symbols - inputs: - SymbolsPath: '$(DropRoot)\$(Build.DefinitionName)\$(Build.SourceBranchName)\$(Build.BuildNumber)\Symbols' - SearchPattern: '**\*.dll;**\*.exe;**\*.pdb' - SymbolsFolder: '$(Build.SourcesDirectory)\$(MSBuildConfiguration)' - TreatNotIndexedAsWarning: true - SymbolsProduct: '$(Build.DefinitionName)' - SymbolsVersion: '$(Build.BuildNumber)' - continueOnError: true - condition: and(succeeded(), contains(variables['PB_PublishType'], 'symbols')) + # Upload VSTS Drop + - task: ms-vseng.MicroBuildTasks.4305a8de-ba66-4d8b-b2d1-0dc4ecbbf5e8.MicroBuildUploadVstsDropFolder@1 + displayName: Upload VSTS Drop + inputs: + DropFolder: '$(Build.SourcesDirectory)\artifacts\VSSetup\$(BuildConfiguration)\Insertion' + condition: and(succeeded(), contains(variables['PB_PublishType'], 'vsts')) -# Upload VSTS Drop -- task: ms-vseng.MicroBuildTasks.4305a8de-ba66-4d8b-b2d1-0dc4ecbbf5e8.MicroBuildUploadVstsDropFolder@1 - displayName: Upload VSTS Drop - inputs: - DropFolder: '$(Build.SourcesDirectory)\$(MSBuildConfiguration)\insertion' - condition: and(succeeded(), contains(variables['PB_PublishType'], 'vsts')) + # Execute cleanup tasks + - task: ms-vseng.MicroBuildTasks.521a94ea-9e68-468a-8167-6dcf361ea776.MicroBuildCleanup@1 + displayName: Execute cleanup tasks + condition: succeededOrFailed() -# Execute cleanup tasks -- task: ms-vseng.MicroBuildTasks.521a94ea-9e68-468a-8167-6dcf361ea776.MicroBuildCleanup@1 - displayName: Execute cleanup tasks - condition: succeededOrFailed() + # Publish Artifact: MicroBuildOutputs + - task: PublishBuildArtifacts@1 + displayName: 'Publish Artifact: MicroBuildOutputs' + inputs: + PathtoPublish: '$(Build.StagingDirectory)\MicroBuild\Output' + ArtifactName: MicroBuildOutputs + publishLocation: Container + condition: and(succeeded(), contains(variables['PB_PublishType'], 'microbuild')) -# Publish Artifact: MicroBuildOutputs -- task: PublishBuildArtifacts@1 - displayName: 'Publish Artifact: MicroBuildOutputs' - inputs: - PathtoPublish: '$(Build.StagingDirectory)\MicroBuild\Output' - ArtifactName: MicroBuildOutputs - publishLocation: Container - condition: and(succeeded(), contains(variables['PB_PublishType'], 'microbuild')) + # Publish Symbols to Symweb + - task: ms-vscs-artifact.build-tasks.artifactSymbolTask-1.artifactSymbolTask@0 + displayName: Publish symbols to SymWeb + inputs: + symbolServiceURI: 'https://microsoft.artifacts.visualstudio.com/DefaultCollection' + sourcePath: '$(DropRoot)\$(Build.DefinitionName)\$(Build.SourceBranchName)\$(Build.BuildNumber)\SymStore' + usePat: false + condition: and(succeeded(), contains(variables['PB_PublishType'], 'symweb')) -# Publish Symbols to Symweb -- task: ms-vscs-artifact.build-tasks.artifactSymbolTask-1.artifactSymbolTask@0 - displayName: Publish symbols to SymWeb - inputs: - symbolServiceURI: 'https://microsoft.artifacts.visualstudio.com/DefaultCollection' - sourcePath: '$(DropRoot)\$(Build.DefinitionName)\$(Build.SourceBranchName)\$(Build.BuildNumber)\Symbols' - usePat: false - condition: and(succeeded(), contains(variables['PB_PublishType'], 'symweb')) +- template: /eng/common/templates/job/publish-build-assets.yml + parameters: + dependsOn: + - Full_Signed + pool: + vmImage: vs2017-win2016 + enablePublishBuildArtifacts: true diff --git a/CoordinateXlif.targets b/CoordinateXlif.targets new file mode 100644 index 00000000000..ea1ed17aaa2 --- /dev/null +++ b/CoordinateXlif.targets @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/DEVGUIDE.md b/DEVGUIDE.md index 22098bee1a9..f7a8531cd2d 100644 --- a/DEVGUIDE.md +++ b/DEVGUIDE.md @@ -130,7 +130,8 @@ Testing the .NET Core version of the F# compiler on macOS and Linux is TBD. To build and test Visual F# IDE Tools, install these requirements: -- [Visual Studio 2017](https://www.visualstudio.com/downloads/) +- Download [Visual Studio 2017](https://www.visualstudio.com/downloads/) +- Launch the Visual Studio Installer - Under the "Windows" workloads, select ".NET desktop development" - Select "F# desktop language support" under the optional components - Under the "Other Toolsets" workloads, select "Visual Studio extension development" @@ -166,12 +167,12 @@ components installed in that VS installation. You can revert this step by disab For **Debug**, uninstall then reinstall: VSIXInstaller.exe /u:"VisualFSharp" - VSIXInstaller.exe debug\net40\bin\VisualFSharpFull.vsix + VSIXInstaller.exe artifacts\bin\VisualFSharpFull\Debug\net46\VisualFSharpFull.vsix For **Release**, uninstall then reinstall: VSIXInstaller.exe /u:"VisualFSharp" - VSIXInstaller.exe release\net40\bin\VisualFSharpFull.vsix + VSIXInstaller.exe artifacts\bin\VisualFSharpFull\Release\net46\VisualFSharpFull.vsix Restart Visual Studio, it should now be running your freshly-built Visual F# IDE Tools with updated F# Interactive. @@ -229,14 +230,22 @@ See the "Debugging The Compiler" section of this [article](https://medium.com/@w - We use the proto compiler to compile the source for `FSharp.Core.dll` in this distribution. - We use the proto compiler to compile the source for `FSharp.Compiler.dll`, `fsc.exe`, `fsi.exe`, and other binaries found in this distribution. -#### Updating FSComp.fs +#### Updating FSComp.fs, FSComp.resx and XLF If you change error messages you may need to update FSComp.fs in `src\buildfromsource\FSharp.Compiler.Private`. To do this, build the non-buildfromsource version of FSharp.Compiler.Private (src\fsharp\FSharp.Compiler.Private) then check its obj\ directory for `FSComp.fs` and manually copy that into the buildfromsource directory. .\build net40 - copy /y src\fsharp\FSharp.Compiler.Private\obj\release\net40\FSComp.* src\buildfromsource\FSharp.Compiler.Private\ + copy /y artifacts\obj\FSharp.Compiler.Private\Release\net46\FSComp.* src\buildfromsource\FSharp.Compiler.Private\ + +If your changes involve modifying the list of language keywords in any way, (e.g. when implementing a new keyword), the XLF localization files need to be synced with the corresponding resx files. This can be done automatically by running + + pushd src\fsharp\FSharp.Compiler.Private + msbuild FSharp.Compiler.Private.fsproj /t:UpdateXlf + popd + +This only works on Windows/.NETStandard framework, so changing this from any other platform requires editing and syncing all of the XLF files manually. You can also change build.cmd to default COPY_FSCOMP_RESOURCE_FOR_BUILD_FROM_SOURCES to 1 under ":ARGUMENTS_OK" label. @@ -250,12 +259,6 @@ If you are behind a proxy server, NuGet client tool must be configured to use it Where you should set proper proxy address, user name and password. -#### When modifying, adding, or removing keywords or compiler messages - -If your changes involve modifying the list of language keywords in any way, (e.g. when implementing a new keyword), the XLF localization files need to be synced with the corresponding resx files. This can be done automatically by running `msbuild FSharp.Compiler.Private.fsproj /t:UpdateXlf` (located in [src\fsharp\FSharp.Compiler.Private](https://github.com/Microsoft/visualfsharp/tree/master/src/fsharp/FSharp.Compiler.Private)). This only works on Windows/.NETStandard framework, so changing this from any other platform requires editing and syncing all of the XLF files manually. - -After this, you must copy any differing `resx` files from the output directory into the corresponding subdirectory in [src\buildfromsource](https://github.com/Microsoft/visualfsharp/tree/master/src/fsharp/FSharp.Compiler.Private). This step will soon be eliminated (see issue [#3905](https://github.com/Microsoft/visualfsharp/issues/3905)). - #### Resources The primary technical guide to the core compiler code is [The F# Compiler Technical Guide](http://fsharp.github.io/2015/09/29/fsharp-compiler-guide.html). Please read and contribute to that guide. diff --git a/DotnetCLIToolsVersion.txt b/DotnetCLIToolsVersion.txt index 6e840019a3b..8c63a20474c 100644 --- a/DotnetCLIToolsVersion.txt +++ b/DotnetCLIToolsVersion.txt @@ -1 +1 @@ - 2.1.400-preview-009197 +2.1.500 diff --git a/DotnetCLIVersion.txt b/DotnetCLIVersion.txt deleted file mode 100644 index 6d7fdc186f6..00000000000 --- a/DotnetCLIVersion.txt +++ /dev/null @@ -1 +0,0 @@ -1.0.0-preview3-003886 \ No newline at end of file diff --git a/FSharp.Directory.Build.targets b/FSharp.Directory.Build.targets index 0c0448113ce..84125426d58 100644 --- a/FSharp.Directory.Build.targets +++ b/FSharp.Directory.Build.targets @@ -2,5 +2,6 @@ + diff --git a/src/FSharp.Profiles.props b/FSharp.Profiles.props similarity index 83% rename from src/FSharp.Profiles.props rename to FSharp.Profiles.props index 915781c9534..2e2edb73702 100644 --- a/src/FSharp.Profiles.props +++ b/FSharp.Profiles.props @@ -2,14 +2,15 @@ - + $(DefineConstants);CROSS_PLATFORM_COMPILER $(DefineConstants);ENABLE_MONO_SUPPORT $(DefineConstants);BE_SECURITY_TRANSPARENT $(DefineConstants);FX_LCIDFROMCODEPAGE - + + $(DefineConstants);NETSTANDARD $(DefineConstants);NETSTANDARD1_6 $(DefineConstants);FX_NO_APP_DOMAINS $(DefineConstants);FX_NO_ARRAY_LONG_LENGTH @@ -18,13 +19,11 @@ $(DefineConstants);FX_NO_CONVERTER $(DefineConstants);FX_NO_DEFAULT_DEPENDENCY_TYPE $(DefineConstants);FX_NO_CORHOST_SIGNER - $(DefineConstants);FX_NO_CRYPTO $(DefineConstants);FX_NO_EVENTWAITHANDLE_IDISPOSABLE $(DefineConstants);FX_NO_EXIT_CONTEXT_FLAGS $(DefineConstants);FX_NO_HEAPTERMINATION $(DefineConstants);FX_NO_LINKEDRESOURCES $(DefineConstants);FX_NO_LOADER_OPTIMIZATION - $(DefineConstants);FX_NO_SIMPLIFIED_LOADER $(DefineConstants);FX_NO_PARAMETERIZED_THREAD_START $(DefineConstants);FX_NO_PDB_READER $(DefineConstants);FX_NO_PDB_WRITER @@ -41,16 +40,13 @@ $(DefineConstants);FX_NO_WEB_CLIENT $(DefineConstants);FX_NO_WIN_REGISTRY $(DefineConstants);FX_NO_WINFORMS + $(DefineConstants);FX_NO_INDENTED_TEXT_WRITER $(DefineConstants);FX_REDUCED_EXCEPTIONS $(DefineConstants);FX_REDUCED_CONSOLE $(DefineConstants);FX_RESHAPED_REFEMIT - $(DefineConstants);FX_RESHAPED_CONSOLE $(DefineConstants);FX_RESHAPED_GLOBALIZATION $(DefineConstants);FX_RESHAPED_REFLECTION - $(DefineConstants);FX_JITTRACKING_ISSUE - $(DefineConstants);FX_NO_INDENTED_TEXT_WRITER - $(DefineConstants);FX_RESHAPED_REFLECTION_CORECLR - $(DefineConstants);FSI_TODO_NETCORE + $(DefineConstants);FX_RESHAPED_MSBUILD $(OtherFlags) --simpleresolution diff --git a/FSharpBuild.Directory.Build.props b/FSharpBuild.Directory.Build.props index 560885e394b..c5e4108181c 100644 --- a/FSharpBuild.Directory.Build.props +++ b/FSharpBuild.Directory.Build.props @@ -1,6 +1,8 @@ + + @@ -8,9 +10,16 @@ Debug $(MSBuildThisFileDirectory) $(RepoRoot)src - $(RepoRoot)Tools - false - $(RepoRoot)Proto\net40\bin + $(RepoRoot)artifacts + $(ArtifactsDir)\toolset + $(ArtifactsDir)\bin + $(ArtifactsDir)\obj + $(ArtifactsDir)\packages + $(ArtifactsBinDir)\$(MSBuildProjectName) + $(ArtifactsObjDir)\$(MSBuildProjectName) + $(ArtifactsDir)\SymStore + $(ArtifactsBinDir)\fsc\Proto\net46 + $(ArtifactsBinDir)/fsc/Proto/netcoreapp2.1 4.4.0 @@ -18,10 +27,20 @@ $(NUGET_PACKAGES) - $(MSBuildThisFileDirectory)packages + $(UserProfile)\.nuget\packages\ + $(HOME)/.nuget/packages/ $(NuGetPackageRoot)\ $(NuGetPackageRoot)/ + + true + + + + + true + /usr/lib/mono/4.5-api + /usr/lib/mono/4.6-api @@ -32,15 +51,15 @@ true true - - - - true + + $(FSharpSourcesRoot)\fsharp\test.snk + false + STRONG_NAME_FSHARP_COMPILER_WITH_TEST_KEY;$(DefineConstants) - false + false true @@ -53,10 +72,11 @@ - - $(ProtoOutputPath)\Microsoft.FSharp.NetSdk.props - $(ProtoOutputPath)\Microsoft.FSharp.NetSdk.targets - $(ProtoOutputPath)\Microsoft.FSharp.Overrides.NetSdk.targets + + $(ProtoOutputPath)\Microsoft.FSharp.Targets + $(ProtoOutputPath)\Microsoft.FSharp.NetSdk.props + $(ProtoOutputPath)\Microsoft.FSharp.NetSdk.targets + $(ProtoOutputPath)\Microsoft.FSharp.Overrides.NetSdk.targets diff --git a/FSharpBuild.Directory.Build.targets b/FSharpBuild.Directory.Build.targets index a447c35111a..fa39d7498fd 100644 --- a/FSharpBuild.Directory.Build.targets +++ b/FSharpBuild.Directory.Build.targets @@ -1,39 +1,40 @@ + + en;$(XlfLanguages) - coreclr - net40 - $(MSBuildProjectDirectory)\$(OutputPath) - $(OutputPath) - $(RepoRoot)$(Configuration)\$(TargetDotnetProfile)\bin - $(RepoRoot)$(Configuration)\$(TargetDotnetProfile)\obj - + + $(AssetTargetFallback);net462 + - - - - + + $(CompileDependsOn);CopyAndSubstituteTextFiles + - - - - + + + <_ReplacementText>$([System.IO.File]::ReadAllText('%(CopyAndSubstituteText.FullPath)')) + <_ReplacementText Condition="'%(CopyAndSubstituteText.Pattern1)' != ''">$(_ReplacementText.Replace('%(CopyAndSubstituteText.Pattern1)', '%(CopyAndSubstituteText.Replacement1)')) + <_ReplacementText Condition="'%(CopyAndSubstituteText.Pattern2)' != ''">$(_ReplacementText.Replace('%(CopyAndSubstituteText.Pattern2)', '%(CopyAndSubstituteText.Replacement2)')) + + + + + + - + diff --git a/FSharpTests.Directory.Build.props b/FSharpTests.Directory.Build.props index 7deaa0eb9b0..46e9b6fb369 100644 --- a/FSharpTests.Directory.Build.props +++ b/FSharpTests.Directory.Build.props @@ -1,36 +1,43 @@ - - - <_FSharpCompilerPath>$(MSBuildThisFileDirectory)$(Configuration)/net40/bin + + true - $(_FSharpCompilerPath) + $(MSBuildThisFileDirectory)artifacts\bin\fsc\$(Configuration)\net46 fsc.exe + + $(MSBuildThisFileDirectory)artifacts\bin\fsi\$(Configuration)\net46 + fsi.exe + - - - <_FSharpCompilerPath>$(MSBuildThisFileDirectory)$(Configuration)/coreclr/bin + + true - $(MSBuildThisFileDirectory)Tools/dotnet20 + $(MSBuildThisFileDirectory)artifacts\toolset\dotnet dotnet.exe dotnet - $(_FSharpCompilerPath)/fsc.exe + $(MSBuildThisFileDirectory)artifacts\bin\fsc\$(Configuration)\netcoreapp2.1\fsc.exe + + $(MSBuildThisFileDirectory)artifacts\toolset\dotnet + dotnet.exe + dotnet + $(MSBuildThisFileDirectory)artifacts\bin\fsi\$(Configuration)\netcoreapp2.1\fsi.exe - $(_FSharpCompilerPath)/Microsoft.FSharp.NetSdk.props - $(_FSharpCompilerPath)/Microsoft.FSharp.NetSdk.targets - $(_FSharpCompilerPath)/Microsoft.FSharp.Overrides.NetSdk.targets - + <_FSharpBuildTargetFramework Condition="'$(FSharpTestCompilerVersion)' == 'net40'">net46 + <_FSharpBuildTargetFramework Condition="'$(FSharpTestCompilerVersion)' == 'coreclr'">netstandard2.0 + <_FSharpBuildBinPath>$(MSBuildThisFileDirectory)artifacts\bin\FSharp.Build\$(Configuration)\$(_FSharpBuildTargetFramework) + $(_FSharpBuildBinPath)\FSharp.Build.dll - - - $(MSBuildThisFileDirectory)$(Configuration)\coreclr\bin\FSharp.Build.dll - $(MSBuildThisFileDirectory)$(Configuration)\net40\bin\FSharp.Build.dll + $(_FSharpBuildBinPath)/Microsoft.FSharp.Targets + $(_FSharpBuildBinPath)/Microsoft.FSharp.NetSdk.props + $(_FSharpBuildBinPath)/Microsoft.FSharp.NetSdk.targets + $(_FSharpBuildBinPath)/Microsoft.FSharp.Overrides.NetSdk.targets - \ No newline at end of file + diff --git a/FSharpTests.Directory.Build.targets b/FSharpTests.Directory.Build.targets index e5b000ce518..fe916bf2df2 100644 --- a/FSharpTests.Directory.Build.targets +++ b/FSharpTests.Directory.Build.targets @@ -1,21 +1,41 @@ - - + - - $([System.IO.File]::ReadAllText('$(MSBuildThisFileDirectory)DotnetCLIToolsVersion.txt').Trim()) - - - - - - - - + + + + + + <_CoreCompileResourceInputs Remove="@(_CoreCompileResourceInputs)" /> + + diff --git a/Makefile b/Makefile index 14f7aef4870..dfb567b394b 100644 --- a/Makefile +++ b/Makefile @@ -1,101 +1,46 @@ -include $(topsrcdir)mono/config.make +Configuration ?= release +DotNetVersion = `cat DotnetCLIToolsVersion.txt` +DotNetToolPath = $(CURDIR)/artifacts/toolset/dotnet +DotNetExe = "$(DotNetToolPath)/dotnet" -.PHONY: restore build build-proto +all: proto restore build test -restore: - MONO_ENV_OPTIONS=$(monoopts) mono .nuget/NuGet.exe restore packages.config -PackagesDirectory packages -ConfigFile ./NuGet.Config - chmod u+x packages/FSharp.Compiler.Tools.4.1.27/tools/fsi.exe - chmod u+x packages/FsLexYacc.7.0.6/build/fslex.exe - chmod u+x packages/FsLexYacc.7.0.6/build/fsyacc.exe - -# Make the proto using the bootstrap, then make the final compiler using the proto -# We call MAKE sequentially because we don't want build-final to explicitly depend on build-proto, -# as that causes a complete recompilation of both proto and final everytime you touch the -# compiler sources. -all: - @echo ----------- - @echo prefix=$(prefix) - @echo topdir=$(topdir) - @echo monodir=$(monodir) - @echo monolibdir=$(monolibdir) - @echo monobindir=$(monobindir) - @echo ----------- - $(MAKE) restore - $(MAKE) build-proto - $(MAKE) build - -build-proto: - MONO_ENV_OPTIONS=$(monoopts) $(MSBUILD) /p:Configuration=Proto /p:TargetDotnetProfile=$(TargetDotnetProfile) src/fsharp/FSharp.Build-proto/FSharp.Build-proto.fsproj - MONO_ENV_OPTIONS=$(monoopts) $(MSBUILD) /p:Configuration=Proto /p:TargetDotnetProfile=$(TargetDotnetProfile) src/fsharp/Fsc-proto/Fsc-proto.fsproj - -# The main targets -build: - MONO_ENV_OPTIONS=$(monoopts) $(MSBUILD) /p:Configuration=$(Configuration) /p:TargetDotnetProfile=net40 src/fsharp/FSharp.Core/FSharp.Core.fsproj - MONO_ENV_OPTIONS=$(monoopts) $(MSBUILD) /p:Configuration=$(Configuration) /p:TargetDotnetProfile=net40 src/fsharp/FSharp.Build/FSharp.Build.fsproj - MONO_ENV_OPTIONS=$(monoopts) $(MSBUILD) /p:Configuration=$(Configuration) /p:TargetDotnetProfile=net40 src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj - MONO_ENV_OPTIONS=$(monoopts) $(MSBUILD) /p:Configuration=$(Configuration) /p:TargetDotnetProfile=net40 src/fsharp/Fsc/Fsc.fsproj - MONO_ENV_OPTIONS=$(monoopts) $(MSBUILD) /p:Configuration=$(Configuration) /p:TargetDotnetProfile=net40 src/fsharp/FSharp.Compiler.Interactive.Settings/FSharp.Compiler.Interactive.Settings.fsproj - MONO_ENV_OPTIONS=$(monoopts) $(MSBUILD) /p:Configuration=$(Configuration) /p:TargetDotnetProfile=net40 src/fsharp/FSharp.Compiler.Server.Shared/FSharp.Compiler.Server.Shared.fsproj - MONO_ENV_OPTIONS=$(monoopts) $(MSBUILD) /p:Configuration=$(Configuration) /p:TargetDotnetProfile=net40 src/fsharp/fsi/Fsi.fsproj - MONO_ENV_OPTIONS=$(monoopts) $(MSBUILD) /p:Configuration=$(Configuration) /p:TargetDotnetProfile=net40 src/fsharp/fsiAnyCpu/FsiAnyCPU.fsproj - MONO_ENV_OPTIONS=$(monoopts) $(MSBUILD) /p:Configuration=$(Configuration) /p:TargetDotnetProfile=net40 tests/FSharp.Core.UnitTests/FSharp.Core.UnitTests.fsproj - mkdir -p $(Configuration)/fsharp30/net40/bin - mkdir -p $(Configuration)/fsharp31/net40/bin - mkdir -p $(Configuration)/fsharp40/net40/bin - cp -p packages/FSharp.Core.3.0.2/lib/net40/* $(Configuration)/fsharp30/net40/bin - cp -p packages/FSharp.Core.3.1.2.5/lib/net40/* $(Configuration)/fsharp31/net40/bin - cp -p packages/FSharp.Core.4.0.0.1/lib/net40/* $(Configuration)/fsharp40/net40/bin - mkdir -p $(Configuration)/portable7/bin - cp -p packages/FSharp.Core.4.1.17/lib/portable-net45+netcore45/* $(Configuration)/portable7/bin - mkdir -p $(Configuration)/portable47/bin - cp -p packages/FSharp.Core.4.1.17/lib/portable-net45+sl5+netcore45/* $(Configuration)/portable47/bin - mkdir -p $(Configuration)/portable78/bin - cp -p packages/FSharp.Core.4.1.17/lib/portable-net45+netcore45+wp8/* $(Configuration)/portable78/bin - mkdir -p $(Configuration)/portable259/bin - cp -p packages/FSharp.Core.4.1.17/lib/portable-net45+netcore45+wpa81+wp8/* $(Configuration)/portable259/bin - mkdir -p $(Configuration)/monoandroid10+monotouch10+xamarinios10/bin - cp -p packages/FSharp.Core.4.1.17/lib/portable-net45+monoandroid10+monotouch10+xamarinios10/* $(Configuration)/monoandroid10+monotouch10+xamarinios10/bin - mkdir -p $(Configuration)/xamarinmacmobile/bin - cp -p packages/FSharp.Core.4.1.17/lib/xamarinmac20/* $(Configuration)/xamarinmacmobile/bin +tools: + $(CURDIR)/scripts/dotnet-install.sh --version $(DotNetVersion) --install-dir "$(DotNetToolPath)" +proto: tools + $(DotNetExe) build-server shutdown + $(DotNetExe) restore src/buildtools/buildtools.proj + $(DotNetExe) restore src/fsharp/FSharp.Build/FSharp.Build.fsproj + $(DotNetExe) restore src/fsharp/fsc/fsc.fsproj + $(DotNetExe) build src/buildtools/buildtools.proj -c Proto + $(DotNetExe) build src/fsharp/FSharp.Build/FSharp.Build.fsproj -f netstandard2.0 -c Proto + $(DotNetExe) build src/fsharp/fsc/fsc.fsproj -f netcoreapp2.1 -c Proto - -install: - -rm -fr $(DESTDIR)$(monodir)/fsharp - -rm -fr $(DESTDIR)$(monodir)/Microsoft\ F# - -rm -fr $(DESTDIR)$(monodir)/Microsoft\ SDKs/F# - -rm -fr $(DESTDIR)$(monodir)/msbuild/Microsoft/VisualStudio/v/FSharp - -rm -fr $(DESTDIR)$(monodir)/msbuild/Microsoft/VisualStudio/v11.0/FSharp - -rm -fr $(DESTDIR)$(monodir)/msbuild/Microsoft/VisualStudio/v12.0/FSharp - -rm -fr $(DESTDIR)$(monodir)/msbuild/Microsoft/VisualStudio/v14.0/FSharp - -rm -fr $(DESTDIR)$(monodir)/msbuild/Microsoft/VisualStudio/v15.0/FSharp - $(MAKE) -C mono/FSharp.Core TargetDotnetProfile=net40 install - $(MAKE) -C mono/FSharp.Build install - $(MAKE) -C mono/FSharp.Compiler.Private install - $(MAKE) -C mono/Fsc install - $(MAKE) -C mono/FSharp.Compiler.Interactive.Settings install - $(MAKE) -C mono/FSharp.Compiler.Server.Shared install - $(MAKE) -C mono/fsi install - $(MAKE) -C mono/fsiAnyCpu install - $(MAKE) -C mono/FSharp.Core TargetDotnetProfile=net40 FSharpCoreBackVersion=3.0 install - $(MAKE) -C mono/FSharp.Core TargetDotnetProfile=net40 FSharpCoreBackVersion=3.1 install - $(MAKE) -C mono/FSharp.Core TargetDotnetProfile=net40 FSharpCoreBackVersion=4.0 install - $(MAKE) -C mono/FSharp.Core TargetDotnetProfile=portable47 install - $(MAKE) -C mono/FSharp.Core TargetDotnetProfile=portable7 install - $(MAKE) -C mono/FSharp.Core TargetDotnetProfile=portable78 install - $(MAKE) -C mono/FSharp.Core TargetDotnetProfile=portable259 install - $(MAKE) -C mono/FSharp.Core TargetDotnetProfile=monoandroid10+monotouch10+xamarinios10 install - $(MAKE) -C mono/FSharp.Core TargetDotnetProfile=xamarinmacmobile install - echo "------------------------------ INSTALLED FILES --------------" - ls -xlR $(DESTDIR)$(monodir)/fsharp $(DESTDIR)$(monodir)/msbuild $(DESTDIR)$(monodir)/xbuild $(DESTDIR)$(monodir)/Reference\ Assemblies $(DESTDIR)$(monodir)/gac/FSharp* $(DESTDIR)$(monodir)/Microsoft* || true - -dist: - -rm -r fsharp-$(DISTVERSION) fsharp-$(DISTVERSION).tar.bz2 - mkdir -p fsharp-$(DISTVERSION) - (cd $(topdir) && git archive HEAD |(cd $(builddir)fsharp-$(DISTVERSION) && tar xf -)) - list='$(EXTRA_DIST)'; for s in $$list; do \ - (cp $(topdir)$$s fsharp-$(DISTVERSION)/$$s) \ - done; - tar cvjf fsharp-$(DISTVERSION).tar.bz2 $(patsubst %,--exclude=%, $(NO_DIST)) fsharp-$(DISTVERSION) - du -b fsharp-$(DISTVERSION).tar.bz2 - +restore: + $(DotNetExe) restore src/fsharp/FSharp.Core/FSharp.Core.fsproj + $(DotNetExe) restore src/fsharp/FSharp.Build/FSharp.Build.fsproj + $(DotNetExe) restore src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj + $(DotNetExe) restore src/fsharp/fsc/fsc.fsproj + $(DotNetExe) restore src/fsharp/FSharp.Compiler.Interactive.Settings/FSharp.Compiler.Interactive.Settings.fsproj + $(DotNetExe) restore src/fsharp/fsi/fsi.fsproj + $(DotNetExe) restore tests/FSharp.Core.UnitTests/FSharp.Core.UnitTests.fsproj + $(DotNetExe) restore tests/FSharp.Build.UnitTests/FSharp.Build.UnitTests.fsproj + +build: proto restore + $(DotNetExe) build-server shutdown + $(DotNetExe) build -c $(Configuration) -f netstandard1.6 src/fsharp/FSharp.Core/FSharp.Core.fsproj + $(DotNetExe) build -c $(Configuration) -f netstandard2.0 src/fsharp/FSharp.Build/FSharp.Build.fsproj + $(DotNetExe) build -c $(Configuration) -f netstandard1.6 src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj + $(DotNetExe) build -c $(Configuration) -f netcoreapp2.1 src/fsharp/fsc/fsc.fsproj + $(DotNetExe) build -c $(Configuration) -f netstandard1.6 src/fsharp/FSharp.Compiler.Interactive.Settings/FSharp.Compiler.Interactive.Settings.fsproj + $(DotNetExe) build -c $(Configuration) -f netcoreapp2.1 src/fsharp/fsi/fsi.fsproj + $(DotNetExe) build -c $(Configuration) -f netcoreapp2.0 tests/FSharp.Core.UnitTests/FSharp.Core.UnitTests.fsproj + $(DotNetExe) build -c $(Configuration) -f netcoreapp2.0 tests/FSharp.Build.UnitTests/FSharp.Build.UnitTests.fsproj + +test: build + $(DotNetExe) test -f netcoreapp2.1 -c $(Configuration) --no-restore --no-build tests/FSharp.Core.UnitTests/FSharp.Core.UnitTests.fsproj -l "trx;LogFileName=$(CURDIR)/tests/TestResults/FSharp.Core.UnitTests.coreclr.trx" + $(DotNetExe) test -f netcoreapp2.1 -c $(Configuration) --no-restore --no-build tests/FSharp.Build.UnitTests/FSharp.Build.UnitTests.fsproj -l "trx;LogFileName=$(CURDIR)/tests/TestResults/FSharp.Build.UnitTests.coreclr.trx" + +clean: + rm -rf $(CURDIR)/artifacts diff --git a/NuGet.Config b/NuGet.Config index c89208eb6da..fdf6d3eda46 100644 --- a/NuGet.Config +++ b/NuGet.Config @@ -1,22 +1,15 @@  - - - + + - - - - - - - - - - + + - + + + diff --git a/PublishToBlob.proj b/PublishToBlob.proj index 00bcee63359..21e8ec6eb6f 100644 --- a/PublishToBlob.proj +++ b/PublishToBlob.proj @@ -10,26 +10,33 @@ Microsoft.DotNet.Build.Tasks.Feed - 2.1.0-prerelease-02419-02 + 2.2.0-beta.19066.1 - - + + + + $(MSBuildThisFileDirectory)artifacts\log\$(Configuration)\ + AnyCPU + $(Platform) + $(ArtifactsLogDir)AssetManifest\$(OS)-$(PlatformName).xml + + + AssetManifestPath="$(AssetManifestFilePath)" /> diff --git a/RoslynPackageVersion.txt b/RoslynPackageVersion.txt index d0a9234a2fb..593eafec198 100644 --- a/RoslynPackageVersion.txt +++ b/RoslynPackageVersion.txt @@ -1 +1 @@ -2.9.0-beta8-63208-01 \ No newline at end of file +2.9.0-beta8-63208-01 diff --git a/TESTGUIDE.md b/TESTGUIDE.md index 86ba173a08e..80f51322d7e 100644 --- a/TESTGUIDE.md +++ b/TESTGUIDE.md @@ -10,7 +10,7 @@ To run tests, use variations such as the following, depending on which test suit build.cmd vs test build.cmd all test -You can also submit pull requests to http://github.com/Microsoft/visualfsharp and run the tests via continuoous integration. Most people do wholesale testing that way. +You can also submit pull requests to http://github.com/Microsoft/visualfsharp and run the tests via continuous integration. Most people do wholesale testing that way. ## Prerequisites diff --git a/VisualFSharp.sln b/VisualFSharp.sln index e6bcc50bbd2..ea9bbe592d7 100644 --- a/VisualFSharp.sln +++ b/VisualFSharp.sln @@ -1,14 +1,13 @@  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 -VisualStudioVersion = 15.0.27130.2036 +VisualStudioVersion = 15.0.28010.2036 MinimumVisualStudioVersion = 10.0.40219.1 +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharp.VS.FSI", "vsintegration\src\FSharp.VS.FSI\FSharp.VS.FSI.fsproj", "{991DCF75-C2EB-42B6-9A0D-AA1D2409D519}" +EndProject Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FSharp.Compiler.Private", "src\fsharp\FSharp.Compiler.Private\FSharp.Compiler.Private.fsproj", "{2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}" EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharp.VS.FSI", "vsintegration\src\FSharp.VS.FSI\FSharp.VS.FSI.fsproj", "{991DCF75-C2EB-42B6-9A0D-AA1D2409D519}" - ProjectSection(ProjectDependencies) = postProject - {2E4D67B4-522D-4CF7-97E4-BA940F0B18F3} = {2E4D67B4-522D-4CF7-97E4-BA940F0B18F3} - EndProjectSection +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "VisualFSharpFull", "vsintegration\Vsix\VisualFSharpFull\VisualFSharpFull.csproj", "{59ADCE46-9740-4079-834D-9A03A3494EBC}" EndProject Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FSharp.Compiler.Server.Shared", "src\fsharp\FSharp.Compiler.Server.Shared\FSharp.Compiler.Server.Shared.fsproj", "{D5870CF0-ED51-4CBC-B3D7-6F56DA84AC06}" EndProject @@ -65,14 +64,8 @@ EndProject Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FSharp.Compiler.Interactive.Settings", "src\fsharp\FSharp.Compiler.Interactive.Settings\FSharp.Compiler.Interactive.Settings.fsproj", "{649FA588-F02E-457C-9FCF-87E46407481E}" EndProject Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FsiAnyCPU", "src\fsharp\fsiAnyCpu\FsiAnyCPU.fsproj", "{8B3E283D-B5FE-4055-9D80-7E3A32F3967B}" - ProjectSection(ProjectDependencies) = postProject - {649FA588-F02E-457C-9FCF-87E46407481E} = {649FA588-F02E-457C-9FCF-87E46407481E} - EndProjectSection EndProject Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "Fsi", "src\fsharp\fsi\Fsi.fsproj", "{D0E98C0D-490B-4C61-9329-0862F6E87645}" - ProjectSection(ProjectDependencies) = postProject - {649FA588-F02E-457C-9FCF-87E46407481E} = {649FA588-F02E-457C-9FCF-87E46407481E} - EndProjectSection EndProject Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FSharp.Tests.FSharpSuite", "tests\fsharp\FSharp.Tests.FSharpSuite.fsproj", "{C163E892-5BF7-4B59-AA99-B0E8079C67C4}" EndProject @@ -115,10 +108,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TextFile", "vsintegration\I EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XMLFile", "vsintegration\ItemTemplates\XMLFile\XMLFile.csproj", "{1FB1DD07-06AA-45B4-B5AC-20FF5BEE98B6}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Vsix", "Vsix", "{141F6C23-E1B1-4D89-9F10-F0B8AD58E71F}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "VisualFSharpFull", "vsintegration\Vsix\VisualFSharpFull\VisualFSharpFull.csproj", "{59ADCE46-9740-4079-834D-9A03A3494EBC}" -EndProject Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "HostedCompilerServer", "tests\fsharpqa\testenv\src\HostedCompilerServer\HostedCompilerServer.fsproj", "{4239EFEA-E746-446A-BF7A-51FCBAB13946}" EndProject Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "ILComparer", "tests\fsharpqa\testenv\src\ILComparer\ILComparer.fsproj", "{2E60864A-E3FF-4BCC-810F-DC7C34E6B236}" @@ -155,14 +144,6 @@ Global Release|x86 = Release|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Debug|x86.ActiveCfg = Debug|Any CPU - {2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Debug|x86.Build.0 = Debug|Any CPU - {2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Release|Any CPU.Build.0 = Release|Any CPU - {2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Release|x86.ActiveCfg = Release|Any CPU - {2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Release|x86.Build.0 = Release|Any CPU {991DCF75-C2EB-42B6-9A0D-AA1D2409D519}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {991DCF75-C2EB-42B6-9A0D-AA1D2409D519}.Debug|Any CPU.Build.0 = Debug|Any CPU {991DCF75-C2EB-42B6-9A0D-AA1D2409D519}.Debug|x86.ActiveCfg = Debug|Any CPU @@ -171,6 +152,22 @@ Global {991DCF75-C2EB-42B6-9A0D-AA1D2409D519}.Release|Any CPU.Build.0 = Release|Any CPU {991DCF75-C2EB-42B6-9A0D-AA1D2409D519}.Release|x86.ActiveCfg = Release|Any CPU {991DCF75-C2EB-42B6-9A0D-AA1D2409D519}.Release|x86.Build.0 = Release|Any CPU + {2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Debug|x86.ActiveCfg = Debug|Any CPU + {2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Debug|x86.Build.0 = Debug|Any CPU + {2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Release|Any CPU.Build.0 = Release|Any CPU + {2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Release|x86.ActiveCfg = Release|Any CPU + {2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Release|x86.Build.0 = Release|Any CPU + {59ADCE46-9740-4079-834D-9A03A3494EBC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {59ADCE46-9740-4079-834D-9A03A3494EBC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {59ADCE46-9740-4079-834D-9A03A3494EBC}.Debug|x86.ActiveCfg = Debug|Any CPU + {59ADCE46-9740-4079-834D-9A03A3494EBC}.Debug|x86.Build.0 = Debug|Any CPU + {59ADCE46-9740-4079-834D-9A03A3494EBC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {59ADCE46-9740-4079-834D-9A03A3494EBC}.Release|Any CPU.Build.0 = Release|Any CPU + {59ADCE46-9740-4079-834D-9A03A3494EBC}.Release|x86.ActiveCfg = Release|Any CPU + {59ADCE46-9740-4079-834D-9A03A3494EBC}.Release|x86.Build.0 = Release|Any CPU {D5870CF0-ED51-4CBC-B3D7-6F56DA84AC06}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {D5870CF0-ED51-4CBC-B3D7-6F56DA84AC06}.Debug|Any CPU.Build.0 = Debug|Any CPU {D5870CF0-ED51-4CBC-B3D7-6F56DA84AC06}.Debug|x86.ActiveCfg = Debug|Any CPU @@ -483,14 +480,6 @@ Global {1FB1DD07-06AA-45B4-B5AC-20FF5BEE98B6}.Release|Any CPU.Build.0 = Release|Any CPU {1FB1DD07-06AA-45B4-B5AC-20FF5BEE98B6}.Release|x86.ActiveCfg = Release|Any CPU {1FB1DD07-06AA-45B4-B5AC-20FF5BEE98B6}.Release|x86.Build.0 = Release|Any CPU - {59ADCE46-9740-4079-834D-9A03A3494EBC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {59ADCE46-9740-4079-834D-9A03A3494EBC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {59ADCE46-9740-4079-834D-9A03A3494EBC}.Debug|x86.ActiveCfg = Debug|Any CPU - {59ADCE46-9740-4079-834D-9A03A3494EBC}.Debug|x86.Build.0 = Debug|Any CPU - {59ADCE46-9740-4079-834D-9A03A3494EBC}.Release|Any CPU.ActiveCfg = Release|Any CPU - {59ADCE46-9740-4079-834D-9A03A3494EBC}.Release|Any CPU.Build.0 = Release|Any CPU - {59ADCE46-9740-4079-834D-9A03A3494EBC}.Release|x86.ActiveCfg = Release|Any CPU - {59ADCE46-9740-4079-834D-9A03A3494EBC}.Release|x86.Build.0 = Release|Any CPU {4239EFEA-E746-446A-BF7A-51FCBAB13946}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {4239EFEA-E746-446A-BF7A-51FCBAB13946}.Debug|Any CPU.Build.0 = Debug|Any CPU {4239EFEA-E746-446A-BF7A-51FCBAB13946}.Debug|x86.ActiveCfg = Debug|Any CPU @@ -584,8 +573,9 @@ Global HideSolutionNode = FALSE EndGlobalSection GlobalSection(NestedProjects) = preSolution - {2E4D67B4-522D-4CF7-97E4-BA940F0B18F3} = {3881429D-A97A-49EB-B7AE-A82BA5FE9C77} {991DCF75-C2EB-42B6-9A0D-AA1D2409D519} = {4C7B48D7-19AF-4AE7-9D1D-3BB289D5480D} + {2E4D67B4-522D-4CF7-97E4-BA940F0B18F3} = {3881429D-A97A-49EB-B7AE-A82BA5FE9C77} + {59ADCE46-9740-4079-834D-9A03A3494EBC} = {4C7B48D7-19AF-4AE7-9D1D-3BB289D5480D} {D5870CF0-ED51-4CBC-B3D7-6F56DA84AC06} = {B8DDA694-7939-42E3-95E5-265C2217C142} {DED3BBD7-53F4-428A-8C9F-27968E768605} = {3058BC79-8E79-4645-B05D-48CC182FA8A6} {EE85AAB7-CDA0-4C4E-BDA0-A64CCC413E3F} = {4C7B48D7-19AF-4AE7-9D1D-3BB289D5480D} @@ -629,8 +619,6 @@ Global {E3FDD4AC-46B6-4B9F-B672-317D1202CC50} = {F6DAEE9A-8BE1-4C4A-BC83-09215517C7DA} {D11FC318-8F5D-4C8C-9287-AB40A016D13C} = {F6DAEE9A-8BE1-4C4A-BC83-09215517C7DA} {1FB1DD07-06AA-45B4-B5AC-20FF5BEE98B6} = {F6DAEE9A-8BE1-4C4A-BC83-09215517C7DA} - {141F6C23-E1B1-4D89-9F10-F0B8AD58E71F} = {4C7B48D7-19AF-4AE7-9D1D-3BB289D5480D} - {59ADCE46-9740-4079-834D-9A03A3494EBC} = {141F6C23-E1B1-4D89-9F10-F0B8AD58E71F} {4239EFEA-E746-446A-BF7A-51FCBAB13946} = {CFE3259A-2D30-4EB0-80D5-E8B5F3D01449} {2E60864A-E3FF-4BCC-810F-DC7C34E6B236} = {CFE3259A-2D30-4EB0-80D5-E8B5F3D01449} {D086C8C6-D00D-4C3B-9AB2-A4286C9F5922} = {4C7B48D7-19AF-4AE7-9D1D-3BB289D5480D} diff --git a/artifacts/.gitignore b/artifacts/.gitignore deleted file mode 100644 index 72e8ffc0db8..00000000000 --- a/artifacts/.gitignore +++ /dev/null @@ -1 +0,0 @@ -* diff --git a/benchmarks/Benchmarks.sln b/benchmarks/Benchmarks.sln new file mode 100644 index 00000000000..5d339f7a99f --- /dev/null +++ b/benchmarks/Benchmarks.sln @@ -0,0 +1,37 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.28307.136 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "CompilerServiceBenchmarks", "CompilerServiceBenchmarks\CompilerServiceBenchmarks.fsproj", "{9A3C565C-B514-4AE0-8B01-CA80E8453EB0}" +EndProject +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharp.Core", "..\src\fsharp\FSharp.Core\FSharp.Core.fsproj", "{BB9EAE76-194A-49D8-9618-586CBE7031D9}" +EndProject +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharp.Compiler.Private", "..\src\fsharp\FSharp.Compiler.Private\FSharp.Compiler.Private.fsproj", "{F57B02B1-CF26-4D93-9211-8CEB4F1572F0}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {9A3C565C-B514-4AE0-8B01-CA80E8453EB0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9A3C565C-B514-4AE0-8B01-CA80E8453EB0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9A3C565C-B514-4AE0-8B01-CA80E8453EB0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9A3C565C-B514-4AE0-8B01-CA80E8453EB0}.Release|Any CPU.Build.0 = Release|Any CPU + {BB9EAE76-194A-49D8-9618-586CBE7031D9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BB9EAE76-194A-49D8-9618-586CBE7031D9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BB9EAE76-194A-49D8-9618-586CBE7031D9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BB9EAE76-194A-49D8-9618-586CBE7031D9}.Release|Any CPU.Build.0 = Release|Any CPU + {F57B02B1-CF26-4D93-9211-8CEB4F1572F0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F57B02B1-CF26-4D93-9211-8CEB4F1572F0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F57B02B1-CF26-4D93-9211-8CEB4F1572F0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F57B02B1-CF26-4D93-9211-8CEB4F1572F0}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {049A4D02-709F-418C-AD59-7FB0DBE956B1} + EndGlobalSection +EndGlobal diff --git a/benchmarks/CompilerServiceBenchmarks/CompilerServiceBenchmarks.fsproj b/benchmarks/CompilerServiceBenchmarks/CompilerServiceBenchmarks.fsproj new file mode 100644 index 00000000000..fcdd08995e3 --- /dev/null +++ b/benchmarks/CompilerServiceBenchmarks/CompilerServiceBenchmarks.fsproj @@ -0,0 +1,21 @@ + + + + Exe + net472 + + + + + + + + + + + + + + + + diff --git a/benchmarks/CompilerServiceBenchmarks/Program.fs b/benchmarks/CompilerServiceBenchmarks/Program.fs new file mode 100644 index 00000000000..d5e45275775 --- /dev/null +++ b/benchmarks/CompilerServiceBenchmarks/Program.fs @@ -0,0 +1,60 @@ +open System +open System.IO +open BenchmarkDotNet.Attributes +open BenchmarkDotNet.Running +open Microsoft.FSharp.Compiler.ErrorLogger +open Microsoft.FSharp.Compiler.SourceCodeServices +open System.Text + +[] +type CompilerServiceParsing() = + + let mutable checkerOpt = None + + let mutable sourceOpt = None + + let parsingOptions = + { + SourceFiles = [|"TypeChecker.fs"|] + ConditionalCompilationDefines = [] + ErrorSeverityOptions = FSharpErrorSeverityOptions.Default + IsInteractive = false + LightSyntax = None + CompilingFsLib = false + IsExe = false + } + + [] + member __.Setup() = + match checkerOpt with + | None -> checkerOpt <- Some(FSharpChecker.Create()) + | _ -> () + + match sourceOpt with + | None -> + let source = File.ReadAllText("""..\..\..\..\..\src\fsharp\TypeChecker.fs""") + sourceOpt <- Some(source) + | _ -> () + + [] + member __.ParsingSetup() = + match checkerOpt with + | None -> failwith "no checker" + | Some(checker) -> + checker.InvalidateAll() + checker.ClearLanguageServiceRootCachesAndCollectAndFinalizeAllTransients() + checker.ParseFile("dummy.fs", "dummy", parsingOptions) |> Async.RunSynchronously |> ignore + + [] + member __.Parsing() = + match checkerOpt, sourceOpt with + | None, _ -> failwith "no checker" + | _, None -> failwith "no source" + | Some(checker), Some(source) -> + let results = checker.ParseFile("TypeChecker.fs", source, parsingOptions) |> Async.RunSynchronously + if results.ParseHadErrors then failwithf "parse had errors: %A" results.Errors + +[] +let main argv = + let _ = BenchmarkRunner.Run() + 0 diff --git a/build-everything.proj b/build-everything.proj deleted file mode 100644 index caba4fd173e..00000000000 --- a/build-everything.proj +++ /dev/null @@ -1,165 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - true - true - true - true - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - true - - - - - - - - - true - - - - - - - - - - - - - - - - - - - - - true - - - - - - - - - - - - - - AssemblySearchPaths={HintPathFromItem};{TargetFrameworkDirectory};{RawFileName} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/build-nuget-packages.proj b/build-nuget-packages.proj index 2aab5455e93..8b279bd8a19 100644 --- a/build-nuget-packages.proj +++ b/build-nuget-packages.proj @@ -2,20 +2,13 @@ - - + + + - - - - - - - - - - + + diff --git a/build.cmd b/build.cmd index cc4283d19aa..7a7ce4fe0ff 100644 --- a/build.cmd +++ b/build.cmd @@ -1,6 +1,5 @@ rem Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. @if "%_echo%"=="" echo off - setlocal enableDelayedExpansion :ARGUMENTS_VALIDATION @@ -63,9 +62,10 @@ set BUILD_CORECLR=0 set BUILD_FROMSOURCE=0 set BUILD_VS=0 set BUILD_FCS=0 -set BUILD_CONFIG=release +set BUILD_CONFIG=Release set BUILD_DIAG= set BUILD_PUBLICSIGN=0 +set BUILD_FSHARP_PROJ=1 set TEST_NET40_COMPILERUNIT_SUITE=0 set TEST_NET40_COREUNIT_SUITE=0 @@ -76,7 +76,6 @@ set TEST_CORECLR_FSHARP_SUITE=0 set TEST_VS_IDEUNIT_SUITE=0 set TEST_FCS=0 set TEST_END_2_END=0 -set INCLUDE_TEST_SPEC_NUNIT= set INCLUDE_TEST_TAGS= set COPY_FSCOMP_RESOURCE_FOR_BUILD_FROM_SOURCES=0 @@ -163,7 +162,6 @@ if /i "%ARG%" == "net40" ( if /i "%ARG%" == "coreclr" ( set _autoselect=0 - set BUILD_PROTO_WITH_CORECLR_LKG=1 set BUILD_CORECLR=1 set BUILD_FROMSOURCE=1 ) @@ -229,8 +227,8 @@ if /i "%ARG%" == "microbuild" ( set CI=1 REM redirecting TEMP directories - set TEMP=%~dp0%BUILD_CONFIG%\TEMP - set TMP=%~dp0%BUILD_CONFIG%\TEMP + set TEMP=%~dp0artifacts\tmp + set TMP=%~dp0artifacts\tmp ) if /i "%ARG%" == "nuget" ( @@ -238,7 +236,7 @@ if /i "%ARG%" == "nuget" ( set BUILD_PROTO=1 set BUILD_NET40_FSHARP_CORE=1 - set BUILD_PROTO_WITH_CORECLR_LKG=1 + set BUILD_NET40=1 set BUILD_CORECLR=1 set BUILD_NUGET=1 ) @@ -320,11 +318,11 @@ if /i "%ARG%" == "diag" ( ) if /i "%ARG%" == "debug" ( - set BUILD_CONFIG=debug + set BUILD_CONFIG=Debug ) if /i "%ARG%" == "release" ( - set BUILD_CONFIG=release + set BUILD_CONFIG=Release ) if /i "%ARG%" == "test-sign" ( @@ -345,7 +343,6 @@ if /i "%ARG%" == "no-test" ( if /i "%ARG%" == "include" ( set /a counter=!counter!+1 - if "!INCLUDE_TEST_SPEC_NUNIT!" == "" ( set INCLUDE_TEST_SPEC_NUNIT=cat == %ARG2% ) else (set INCLUDE_TEST_SPEC_NUNIT=cat == %ARG2% or !INCLUDE_TEST_SPEC_NUNIT! ) if "!INCLUDE_TEST_TAGS!" == "" ( set INCLUDE_TEST_TAGS=%ARG2% ) else (set INCLUDE_TEST_TAGS=%ARG2%;!INCLUDE_TEST_TAGS! ) ) @@ -465,27 +462,16 @@ if /i "%TEST_NET40_FSHARP_SUITE" == "1" ( ) ) -if /i "%BUILD_PROTO_WITH_CORECLR_LKG%" == "1" ( - set NEEDS_DOTNET_CLI_TOOLS=1 -) - -if /i "%BUILD_CORECLR%" == "1" ( - set NEEDS_DOTNET_CLI_TOOLS=1 -) - -if /i "%BUILD_FROMSOURCE%" == "1" ( - set NEEDS_DOTNET_CLI_TOOLS=1 -) - -if /i "%BUILD_FCS%" == "1" ( - set NEEDS_DOTNET_CLI_TOOLS=1 -) - rem Decide if Proto need building -if NOT EXIST Proto\net40\bin\fsc.exe ( +if NOT EXIST "%~dp0artifacts\bin\fsc\Proto\net46\fsc.exe" ( set BUILD_PROTO=1 ) +rem decide if FSharp.Proj needs building +if "%BUILD_NET40%"=="0" if "%BUILD_NET40_FSHARP_CORE%"=="0" if "%BUILD_CORECLR%"=="0" if "%BUILD_VS%"=="0" if "%BUILD_FCS%"=="0" if "%TEST_NET40_COMPILERUNIT_SUITE%"=="0" if "%TEST_NET40_COREUNIT_SUITE%"=="0" if "%TEST_NET40_FSHARP_SUITE%"=="0" if "%TEST_NET40_FSHARPQA_SUITE%"=="0" if "%TEST_CORECLR_COREUNIT_SUITE%"=="0" if "%TEST_CORECLR_FSHARP_SUITE%"=="0" if "%TEST_VS_IDEUNIT_SUITE%"=="0" if "%TEST_FCS%"=="0" if "%TEST_END_2_END%"=="0" if "%COPY_FSCOMP_RESOURCE_FOR_BUILD_FROM_SOURCES%"=="0" ( + set BUILD_FSHARP_PROJ=0 +) + rem rem This stops the dotnet cli from hunting around and rem finding the highest possible dotnet sdk version to use. @@ -501,7 +487,6 @@ echo BUILD_PROTO_WITH_CORECLR_LKG=%BUILD_PROTO_WITH_CORECLR_LKG% echo BUILD_NET40=%BUILD_NET40% echo BUILD_NET40_FSHARP_CORE=%BUILD_NET40_FSHARP_CORE% echo BUILD_CORECLR=%BUILD_CORECLR% -echo BUILD_FROMSOURCE=%BUILD_FROMSOURCE% echo BUILD_VS=%BUILD_VS% echo BUILD_FCS=%BUILD_FCS% echo BUILD_SETUP=%BUILD_SETUP% @@ -509,6 +494,8 @@ echo BUILD_NUGET=%BUILD_NUGET% echo BUILD_CONFIG=%BUILD_CONFIG% echo BUILD_PUBLICSIGN=%BUILD_PUBLICSIGN% echo BUILD_MICROBUILD=%BUILD_MICROBUILD% +echo BUILD_FROMSOURCE=%BUILD_FROMSOURCE% +echo BUILD_FSHARP_PROJ=%BUILD_FSHARP_PROJ% echo. echo PB_SKIPTESTS=%PB_SKIPTESTS% echo PB_RESTORESOURCE=%PB_RESTORESOURCE% @@ -525,7 +512,6 @@ echo TEST_NET40_FSHARPQA_SUITE=%TEST_NET40_FSHARPQA_SUITE% echo TEST_CORECLR_COREUNIT_SUITE=%TEST_CORECLR_COREUNIT_SUITE% echo TEST_CORECLR_FSHARP_SUITE=%TEST_CORECLR_FSHARP_SUITE% echo TEST_VS_IDEUNIT_SUITE=%TEST_VS_IDEUNIT_SUITE% -echo INCLUDE_TEST_SPEC_NUNIT=%INCLUDE_TEST_SPEC_NUNIT% echo INCLUDE_TEST_TAGS=%INCLUDE_TEST_TAGS% echo TEMP=%TEMP% @@ -562,24 +548,12 @@ set TargetFrameworkSDKToolsDirectory=%WindowsSDK_ExecutablePath_x64% if not "%TargetFrameworkSDKToolsDirectory%" == "" ( goto have_TargetFrameworkSDKToolsDirectory ) set TargetFrameworkSDKToolsDirectory=%WindowsSDK_ExecutablePath_x86% -:have_TargetFrameworkSDKToolsDirectory - -set BuildToolsPackage=Microsoft.VSSDK.BuildTools.15.6.170 -if "%VSSDKInstall%"=="" ( - set VSSDKInstall=%~dp0packages\%BuildToolsPackage%\tools\vssdk -) -if "%VSSDKToolsPath%"=="" ( - set VSSDKToolsPath=%~dp0packages\%BuildToolsPackage%\tools\vssdk\bin -) -if "%VSSDKIncludes%"=="" ( - set VSSDKIncludes=%~dp0packages\%BuildToolsPackage%\tools\vssdk\inc -) +:have_TargetFrameworkSDKToolsDirectory if "%RestorePackages%"=="" ( set RestorePackages=true ) -@echo VSSDKInstall: %VSSDKInstall% @echo VSSDKToolsPath: %VSSDKToolsPath% @echo VSSDKIncludes: %VSSDKIncludes% @echo TargetFrameworkSDKToolsDirectory: %TargetFrameworkSDKToolsDirectory% @@ -611,8 +585,8 @@ if exist "%ProgramFiles%\Microsoft Visual Studio 12.0\common7\ide\devenv.exe" se :vsversionset if "%VisualStudioVersion%" == "" echo Error: Could not find an installation of Visual Studio && goto :failure -if exist "%VS160COMNTOOLS%\..\..\MSBuild\15.0\Bin\MSBuild.exe" ( - set _msbuildexe="%VS160COMNTOOLS%\..\..\MSBuild\15.0\Bin\MSBuild.exe" +if exist "%VS160COMNTOOLS%\..\..\MSBuild\Current\Bin\MSBuild.exe" ( + set _msbuildexe="%VS160COMNTOOLS%\..\..\MSBuild\Current\Bin\MSBuild.exe" goto :havemsbuild ) if exist "%VS150COMNTOOLS%\..\..\MSBuild\15.0\Bin\MSBuild.exe" ( @@ -633,122 +607,37 @@ goto :eof :havemsbuild set _nrswitch=/nr:false -set msbuildflags=%_nrswitch% /nologo -REM set msbuildflags=%_nrswitch% /nologo +set msbuildflags=%_nrswitch% /nologo /clp:Summary /v:minimal set _ngenexe="%SystemRoot%\Microsoft.NET\Framework\v4.0.30319\ngen.exe" if not exist %_ngenexe% echo Error: Could not find ngen.exe. && goto :failure echo ---------------- Done with prepare, starting package restore ---------------- -set _nugetexe="%~dp0.nuget\NuGet.exe" -set _nugetconfig="%~dp0NuGet.Config" - -if "%RestorePackages%" == "true" ( - if "%BUILD_FCS%" == "1" ( - cd fcs - .paket\paket.exe restore - cd.. - @if ERRORLEVEL 1 echo Error: Paket restore failed && goto :failure - ) - - %_ngenexe% install %_nugetexe% /nologo - set _nugetoptions=-PackagesDirectory packages -ConfigFile %_nugetconfig% - if not "%PB_RESTORESOURCE%" == "" ( - set _nugetoptions=!_nugetoptions! -FallbackSource %PB_RESTORESOURCE% - ) - - echo _nugetoptions=!_nugetoptions! - - %_nugetexe% restore packages.config !_nugetoptions! - @if ERRORLEVEL 1 echo Error: Nuget restore failed && goto :failure - - if "%BUILD_SETUP%" == "1" ( - %_nugetexe% restore setup\packages.config !_nugetoptions! - @if ERRORLEVEL 1 echo Error: Nuget restore failed && goto :failure - ) - - if not "%SIGN_TYPE%" == "" ( - set signtoolnugetoptions=-PackagesDirectory "%USERPROFILE%\.nuget\packages" -ConfigFile %_nugetconfig% - if not "%PB_RESTORESOURCE%" == "" set signtoolnugetoptions=!signtoolnugetoptions! -FallbackSource %PB_RESTORESOURCE% - %_nugetexe% restore build\config\packages.config !signtoolnugetoptions! - @if ERRORLEVEL 1 echo Error: Nuget restore failed && goto :failure - ) - - set restore_fsharp_suite=0 - if "%TEST_NET40_FSHARP_SUITE%" == "1" set restore_fsharp_suite=1 - if "%TEST_CORECLR_FSHARP_SUITE%" == "1" set restore_fsharp_suite=1 - - if "!restore_fsharp_suite!" == "1" ( - %_nugetexe% restore tests\fsharp\packages.config !_nugetoptions! - @if ERRORLEVEL 1 echo Error: Nuget restore failed && goto :failure - ) -) - -if "%NEEDS_DOTNET_CLI_TOOLS%" == "1" ( - :: Restore the Tools directory - call "%~dp0init-tools.cmd" -) -set _dotnetcliexe=%~dp0Tools\dotnetcli\dotnet.exe -set _dotnet20exe=%~dp0Tools\dotnet20\dotnet.exe -set NUGET_PACKAGES=%~dp0packages -set path=%~dp0Tools\dotnet20\;%path% - -echo ----------- Done with package restore, starting dependency uptake check ------------- +:: Restore the Tools directory +call "%~dp0init-tools.cmd" +set _dotnetexe=%~dp0artifacts\toolset\dotnet\dotnet.exe +set path=%~dp0artifacts\toolset\dotnet;%path% if not "%PB_PackageVersionPropsUrl%" == "" ( - set dependencyUptakeDir=%~dp0Tools\dependencyUptake - if not exist "!dependencyUptakeDir!" mkdir "!dependencyUptakeDir!" - - :: download package version overrides - echo powershell -noprofile -executionPolicy RemoteSigned -command "Invoke-WebRequest -Uri '%PB_PackageVersionPropsUrl%' -OutFile '!dependencyUptakeDir!\PackageVersions.props'" - powershell -noprofile -executionPolicy RemoteSigned -command "Invoke-WebRequest -Uri '%PB_PackageVersionPropsUrl%' -OutFile '!dependencyUptakeDir!\PackageVersions.props'" - if ERRORLEVEL 1 echo Error downloading package version properties && goto :failure - - :: prepare dependency uptake files - echo %_msbuildexe% %msbuildflags% %~dp0build\projects\PrepareDependencyUptake.proj /t:Build - %_msbuildexe% %msbuildflags% %~dp0build\projects\PrepareDependencyUptake.proj /t:Build - if ERRORLEVEL 1 echo Error building dependency uptake files && goto :failure - - :: restore dependencies - %_nugetexe% restore !dependencyUptakeDir!\packages.config -PackagesDirectory packages -ConfigFile !dependencyUptakeDir!\NuGet.config - if ERRORLEVEL 1 echo Error restoring dependency uptake packages && goto :failure + echo ----------- do dependency uptake check ----------- - :: set DotNetPackageVersionPropsPath - set DotNetPackageVersionPropsPath=!dependencyUptakeDir!\PackageVersions.props -) - -echo ----------- Done with package restore, starting dependency uptake check ------------- - -if not "%PB_PackageVersionPropsUrl%" == "" ( - set dependencyUptakeDir=%~dp0Tools\dependencyUptake + set dependencyUptakeDir=%~dp0artifacts\dependencyUptake if not exist "!dependencyUptakeDir!" mkdir "!dependencyUptakeDir!" :: download package version overrides echo powershell -noprofile -executionPolicy RemoteSigned -command "Invoke-WebRequest -Uri '%PB_PackageVersionPropsUrl%' -OutFile '!dependencyUptakeDir!\PackageVersions.props'" powershell -noprofile -executionPolicy RemoteSigned -command "Invoke-WebRequest -Uri '%PB_PackageVersionPropsUrl%' -OutFile '!dependencyUptakeDir!\PackageVersions.props'" if ERRORLEVEL 1 echo Error downloading package version properties && goto :failure - - :: prepare dependency uptake files - echo %_msbuildexe% %msbuildflags% %~dp0build\projects\PrepareDependencyUptake.proj /t:Build - %_msbuildexe% %msbuildflags% %~dp0build\projects\PrepareDependencyUptake.proj /t:Build - if ERRORLEVEL 1 echo Error building dependency uptake files && goto :failure - - :: restore dependencies - %_nugetexe% restore !dependencyUptakeDir!\packages.config -PackagesDirectory packages -ConfigFile !dependencyUptakeDir!\NuGet.config - if ERRORLEVEL 1 echo Error restoring dependency uptake packages && goto :failure ) -set _dotnetcliexe=%~dp0Tools\dotnetcli\dotnet.exe -set _dotnet20exe=%~dp0Tools\dotnet20\dotnet.exe -set NUGET_PACKAGES=%~dp0Packages -set path=%~dp0Tools\dotnet20\;%path% - -set _fsiexe="packages\FSharp.Compiler.Tools.4.1.27\tools\fsi.exe" -if not exist %_fsiexe% echo Error: Could not find %_fsiexe% && goto :failure -%_ngenexe% install %_fsiexe% /nologo - -if not exist %_nugetexe% echo Error: Could not find %_nugetexe% && goto :failure -%_ngenexe% install %_nugetexe% /nologo +if "%RestorePackages%" == "true" ( + if "%BUILD_FCS%" == "1" ( + cd fcs + .paket\paket.exe restore + cd.. + @if ERRORLEVEL 1 echo Error: Paket restore failed && goto :failure + ) +) echo ---------------- Done with package restore, verify buildfrom source --------------- if "%BUILD_PROTO_WITH_CORECLR_LKG%" == "1" ( @@ -759,51 +648,31 @@ if "%BUILD_PROTO_WITH_CORECLR_LKG%" == "1" ( ) echo ---------------- Done with package restore, starting proto ------------------------ -set logdir=%~dp0%BUILD_CONFIG%\logs +set logdir=%~dp0artifacts\log\%BUILD_CONFIG% if not exist "!logdir!" mkdir "!logdir!" rem Build Proto if "%BUILD_PROTO%" == "1" ( - rmdir /s /q Proto - - if "%BUILD_PROTO_WITH_CORECLR_LKG%" == "1" ( - - echo %_msbuildexe% %msbuildflags% src\fsharp-proto-build.proj /p:BUILD_PROTO_WITH_CORECLR_LKG=%BUILD_PROTO_WITH_CORECLR_LKG% /p:Configuration=Proto /p:DisableLocalization=true /bl:%~dp0%BUILD_CONFIG%\logs\protobuild-coreclr.build.binlog - %_msbuildexe% %msbuildflags% src\fsharp-proto-build.proj /p:BUILD_PROTO_WITH_CORECLR_LKG=%BUILD_PROTO_WITH_CORECLR_LKG% /p:Configuration=Proto /p:DisableLocalization=true /bl:%~dp0%BUILD_CONFIG%\logs\protobuild-coreclr.build.binlog - @if ERRORLEVEL 1 echo Error: compiler proto build failed && goto :failure - ) + rmdir /s /q artifacts/bin/fsc/Proto - if "%BUILD_PROTO_WITH_CORECLR_LKG%" == "0" ( - - echo %_ngenexe% install packages\FSharp.Compiler.Tools.4.1.27\tools\fsc.exe /nologo - %_ngenexe% install packages\FSharp.Compiler.Tools.4.1.27\tools\fsc.exe /nologo - - echo %_msbuildexe% %msbuildflags% src\fsharp-proto-build.proj /p:BUILD_PROTO_WITH_CORECLR_LKG=%BUILD_PROTO_WITH_CORECLR_LKG% /p:Configuration=Proto /p:DisableLocalization=true /bl:%~dp0%BUILD_CONFIG%\logs\protobuild-net40.build.binlog - %_msbuildexe% %msbuildflags% src\fsharp-proto-build.proj /p:BUILD_PROTO_WITH_CORECLR_LKG=%BUILD_PROTO_WITH_CORECLR_LKG% /p:Configuration=Proto /p:DisableLocalization=true /bl:%~dp0%BUILD_CONFIG%\logs\protobuild-net40.build.binlog - @if ERRORLEVEL 1 echo Error: compiler proto build failed && goto :failure - ) - - echo %_ngenexe% install Proto\net40\bin\fsc.exe /nologo - %_ngenexe% install Proto\net40\bin\fsc.exe /nologo - @if ERRORLEVEL 1 echo Error: NGen of proto failed && goto :failure -) + echo %_msbuildexe% proto.proj /t:Restore /bl:%~dp0artifacts\log\Proto\proto.proj.restore.binlog + %_msbuildexe% proto.proj /t:Restore /bl:%~dp0artifacts\log\Proto\proto.proj.restore.binlog + @if ERRORLEVEL 1 echo Error restoring proto failed && goto :failure -if "%NEEDS_DOTNET_CLI_TOOLS%" == "1" ( - echo ---------------- Done with proto, starting SDK restore ------------------------ - :: Restore projects using dotnet CLI tool - echo %_dotnet20exe% restore -v:d build-everything.proj %msbuildflags% %BUILD_DIAG% - %_dotnet20exe% restore -v:d build-everything.proj %msbuildflags% %BUILD_DIAG% + echo %_msbuildexe% proto.proj /t:Build /bl:%~dp0artifacts\log\Proto\proto.proj.build.binlog + %_msbuildexe% proto.proj /t:Build /bl:%~dp0artifacts\log\Proto\proto.proj.build.binlog + @if ERRORLEVEL 1 echo Error building proto failed && goto :failure ) echo ---------------- Done with SDK restore, starting build ------------------------ -if "%BUILD_PHASE%" == "1" ( +if "%BUILD_PHASE%" == "1" if "%BUILD_FSHARP_PROJ%" == "1" ( - echo %_msbuildexe% %msbuildflags% build-everything.proj /t:Restore %BUILD_DIAG% /bl:%~dp0%BUILD_CONFIG%\net40\binmsbuild.build-everything.restore.%BUILD_CONFIG%.binlog - %_msbuildexe% %msbuildflags% build-everything.proj /t:Restore %BUILD_DIAG% /bl:%~dp0%BUILD_CONFIG%\net40\binmsbuild.build-everything.restore.%BUILD_CONFIG%.binlog + echo %_dotnetexe% restore fsharp.proj /p:Configuration=%BUILD_CONFIG% /bl:!logdir!\fsharp.proj.restore.binlog + %_dotnetexe% restore fsharp.proj /p:Configuration=%BUILD_CONFIG% /bl:!logdir!\fsharp.proj.restore.binlog - echo %_msbuildexe% %msbuildflags% build-everything.proj /p:Configuration=%BUILD_CONFIG% %BUILD_DIAG% /p:BUILD_PUBLICSIGN=%BUILD_PUBLICSIGN% /bl:%~dp0%BUILD_CONFIG%\logs\msbuild.build-everything.build.%BUILD_CONFIG%.binlog - %_msbuildexe% %msbuildflags% build-everything.proj /p:Configuration=%BUILD_CONFIG% %BUILD_DIAG% /p:BUILD_PUBLICSIGN=%BUILD_PUBLICSIGN% /bl:%~dp0%BUILD_CONFIG%\logs\msbuild.build-everything.build.%BUILD_CONFIG%.binlog + echo %_msbuildexe% fsharp.proj /t:Build /p:Configuration=%BUILD_CONFIG% /p:BUILD_PUBLICSIGN=%BUILD_PUBLICSIGN% /bl:!logdir!\fsharp.proj.build.binlog + %_msbuildexe% fsharp.proj /t:Build /p:Configuration=%BUILD_CONFIG% /p:BUILD_PUBLICSIGN=%BUILD_PUBLICSIGN% /bl:!logdir!\fsharp.proj.build.binlog @if ERRORLEVEL 1 echo Error build failed && goto :failure ) @@ -812,73 +681,58 @@ echo ---------------- Done with build, starting assembly version checks -------- set asmvercheckpath=%~dp0tests\fsharpqa\testenv\src\AssemblyVersionCheck if "%BUILD_NET40%" == "1" ( - echo "%~dp0%BUILD_CONFIG%\net40\bin\fsi.exe" "%asmvercheckpath%\AssemblyVersionCheck.fsx" -- "%~dp0build\config\AssemblySignToolData.json" "%~dp0%BUILD_CONFIG%" - "%~dp0%BUILD_CONFIG%\net40\bin\fsi.exe" "%asmvercheckpath%\AssemblyVersionCheck.fsx" -- "%~dp0build\config\AssemblySignToolData.json" "%~dp0%BUILD_CONFIG%" + echo #r @"%USERPROFILE%\.nuget\packages\Newtonsoft.Json\9.0.1\lib\net45\Newtonsoft.Json.dll">%asmvercheckpath%\assemblies.fsx + echo "%~dp0artifacts\bin\fsi\%BUILD_CONFIG%\net46\fsi.exe" "%asmvercheckpath%\AssemblyVersionCheck.fsx" -- "%~dp0build\config\AssemblySignToolData.json" "%~dp0artifacts" + "%~dp0artifacts\bin\fsi\%BUILD_CONFIG%\net46\fsi.exe" "%asmvercheckpath%\AssemblyVersionCheck.fsx" -- "%~dp0build\config\AssemblySignToolData.json" "%~dp0artifacts" if ERRORLEVEL 1 echo Error verifying assembly versions and commit hashes. && goto :failure ) echo ---------------- Done with assembly version checks, starting assembly signing --------------- if not "%SIGN_TYPE%" == "" ( - echo build\scripts\run-signtool.cmd -MSBuild %_msbuildexe% -SignType %SIGN_TYPE% -Configuration %BUILD_CONFIG% -ConfigFile build\config\AssemblySignToolData.json - call build\scripts\run-signtool.cmd -MSBuild %_msbuildexe% -SignType %SIGN_TYPE% -Configuration %BUILD_CONFIG% -ConfigFile build\config\AssemblySignToolData.json + echo %_msbuildexe% build\projects\Signing.proj /t:Restore + %_msbuildexe% build\projects\Signing.proj /t:Restore + + echo %_msbuildexe% build\projects\Signing.proj /t:DoSigning /p:SignType=%SIGN_TYPE% /p:Configuration=%BUILD_CONFIG% /p:BinaryBasePath=%~dp0artifacts /p:ConfigFile=%~dp0build\config\AssemblySignToolData.json + %_msbuildexe% build\projects\Signing.proj /t:DoSigning /p:SignType=%SIGN_TYPE% /p:Configuration=%BUILD_CONFIG% /p:BinaryBasePath=%~dp0artifacts /p:ConfigFile=%~dp0build\config\AssemblySignToolData.json + if ERRORLEVEL 1 echo Error running sign tool && goto :failure ) echo ---------------- Done with assembly signing, start package creation --------------- -echo %_msbuildexe% %msbuildflags% build-nuget-packages.proj /p:Configuration=%BUILD_CONFIG% /bl:%~dp0%BUILD_CONFIG%\logs\msbuild.build-nuget-packages.build.%BUILD_CONFIG%.binlog - %_msbuildexe% %msbuildflags% build-nuget-packages.proj /p:Configuration=%BUILD_CONFIG% /bl:%~dp0%BUILD_CONFIG%\logs\msbuild.build-nuget-packages.build.%BUILD_CONFIG%.binlog +echo %_msbuildexe% %msbuildflags% build-nuget-packages.proj /p:Configuration=%BUILD_CONFIG% /t:Pack /bl:!logdir!\msbuild.build-nuget-packages.build.%BUILD_CONFIG%.binlog + %_msbuildexe% %msbuildflags% build-nuget-packages.proj /p:Configuration=%BUILD_CONFIG% /t:Pack /bl:!logdir!\msbuild.build-nuget-packages.build.%BUILD_CONFIG%.binlog if ERRORLEVEL 1 echo Error building NuGet packages && goto :failure if not "%SIGN_TYPE%" == "" ( - echo build\scripts\run-signtool.cmd -MSBuild %_msbuildexe% -SignType %SIGN_TYPE% -Configuration %BUILD_CONFIG% -ConfigFile build\config\PackageSignToolData.json - call build\scripts\run-signtool.cmd -MSBuild %_msbuildexe% -SignType %SIGN_TYPE% -Configuration %BUILD_CONFIG% -ConfigFile build\config\PackageSignToolData.json + echo %_msbuildexe% build\projects\Signing.proj /t:DoSigning /p:SignType=%SIGN_TYPE% /p:Configuration=%BUILD_CONFIG% /p:BinaryBasepath=%~dp0artifacts\packages\%BUILD_CONFIG% /p:ConfigFile=%~dp0build\config\PackageSignToolData.json + %_msbuildexe% build\projects\Signing.proj /t:DoSigning /p:SignType=%SIGN_TYPE% /p:Configuration=%BUILD_CONFIG% /p:BinaryBasepath=%~dp0artifacts\packages\%BUILD_CONFIG% /p:ConfigFile=%~dp0build\config\PackageSignToolData.json if ERRORLEVEL 1 echo Error running sign tool && goto :failure ) if "%BUILD_SETUP%" == "1" ( - echo %_msbuildexe% %msbuildflags% setup\build-insertion.proj /p:Configuration=%BUILD_CONFIG% /bl:%~dp0%BUILD_CONFIG%\logs\msbuild.build-insertion.build.%BUILD_CONFIG%.binlog - %_msbuildexe% %msbuildflags% setup\build-insertion.proj /p:Configuration=%BUILD_CONFIG% /bl:%~dp0%BUILD_CONFIG%\logs\msbuild.build-insertion.build.%BUILD_CONFIG%.binlog + echo %_msbuildexe% %msbuildflags% setup\build-insertion.proj /p:Configuration=%BUILD_CONFIG% /bl:!logdir!\msbuild.build-insertion.build.%BUILD_CONFIG%.binlog + %_msbuildexe% %msbuildflags% setup\build-insertion.proj /p:Configuration=%BUILD_CONFIG% /bl:!logdir!\msbuild.build-insertion.build.%BUILD_CONFIG%.binlog if ERRORLEVEL 1 echo Error building insertion packages && goto :failure ) if not "%SIGN_TYPE%" == "" ( - echo build\scripts\run-signtool.cmd -MSBuild %_msbuildexe% -SignType %SIGN_TYPE% -Configuration %BUILD_CONFIG% -ConfigFile build\config\InsertionSignToolData.json - call build\scripts\run-signtool.cmd -MSBuild %_msbuildexe% -SignType %SIGN_TYPE% -Configuration %BUILD_CONFIG% -ConfigFile build\config\InsertionSignToolData.json + echo %_msbuildexe% build\projects\Signing.proj /t:DoSigning /p:SignType=%SIGN_TYPE% /p:Configuration=%BUILD_CONFIG% /p:BinaryBasepath=%~dp0artifacts\VSSetup\%BUILD_CONFIG%\Insertion /p:ConfigFile=%~dp0build\config\InsertionSignToolData.json + %_msbuildexe% build\projects\Signing.proj /t:DoSigning /p:SignType=%SIGN_TYPE% /p:Configuration=%BUILD_CONFIG% /p:BinaryBasePath=%~dp0artifacts\VSSetup\%BUILD_CONFIG%\Insertion /p:ConfigFile=%~dp0build\config\InsertionSignToolData.json if ERRORLEVEL 1 echo Error running sign tool && goto :failure ) echo ---------------- Done with signing, building insertion files --------------- if "%BUILD_SETUP%" == "1" ( - echo %_msbuildexe% %msbuildflags% setup\Swix\Microsoft.FSharp.vsmanproj /p:Configuration=%BUILD_CONFIG% /bl:%~dp0%BUILD_CONFIG%\logs\msbuild.setup-swix.build.%BUILD_CONFIG%.binlog - %_msbuildexe% %msbuildflags% setup\Swix\Microsoft.FSharp.vsmanproj /p:Configuration=%BUILD_CONFIG% /bl:%~dp0%BUILD_CONFIG%\logs\msbuild.setup-swix.build.%BUILD_CONFIG%.binlog + echo %_msbuildexe% %msbuildflags% setup\Swix\Microsoft.FSharp.vsmanproj /p:Configuration=%BUILD_CONFIG% /bl:!logdir!\msbuild.setup-swix.build.%BUILD_CONFIG%.binlog + %_msbuildexe% %msbuildflags% setup\Swix\Microsoft.FSharp.vsmanproj /p:Configuration=%BUILD_CONFIG% /bl:!logdir!\msbuild.setup-swix.build.%BUILD_CONFIG%.binlog if ERRORLEVEL 1 echo Error building .vsmanproj && goto :failure ) echo ---------------- Done building insertion files, starting pack/update/prepare --------------- -if "%BUILD_NET40_FSHARP_CORE%" == "1" ( - echo ---------------- start update.cmd --------------- - call src\update.cmd %BUILD_CONFIG% -ngen -) - -if "%COPY_FSCOMP_RESOURCE_FOR_BUILD_FROM_SOURCES%" == "1" ( - echo ---------------- copy fscomp resource for build from sources --------------- - copy /y src\fsharp\FSharp.Compiler.Private\obj\%BUILD_CONFIG%\net40\FSComp.* src\buildfromsource\FSharp.Compiler.Private -) - -@echo set NUNITPATH=packages\NUnit.Console.3.0.0\tools\ -set NUNITPATH=packages\NUnit.Console.3.0.0\tools\ -if not exist %NUNITPATH% echo Error: Could not find %NUNITPATH% && goto :failure - -@echo xcopy "%NUNITPATH%*.*" "%~dp0tests\fsharpqa\testenv\bin\nunit\*.*" /S /Q /Y - xcopy "%NUNITPATH%*.*" "%~dp0tests\fsharpqa\testenv\bin\nunit\*.*" /S /Q /Y - -@echo xcopy "%~dp0tests\fsharpqa\testenv\src\nunit*.*" "%~dp0tests\fsharpqa\testenv\bin\nunit\*.*" /S /Q /Y - xcopy "%~dp0tests\fsharpqa\testenv\src\nunit*.*" "%~dp0tests\fsharpqa\testenv\bin\nunit\*.*" /S /Q /Y - set X86_PROGRAMFILES=%ProgramFiles% if "%OSARCH%"=="AMD64" set X86_PROGRAMFILES=%ProgramFiles(x86)% @@ -912,16 +766,10 @@ if "%no_test%" == "1" goto :success echo ---------------- Done with update, starting tests ----------------------- -if NOT "%INCLUDE_TEST_SPEC_NUNIT%" == "" ( - set WHERE_ARG_NUNIT=--where "%INCLUDE_TEST_SPEC_NUNIT%" -) if NOT "%INCLUDE_TEST_TAGS%" == "" ( set TTAGS_ARG_RUNALL=-ttags:%INCLUDE_TEST_TAGS% ) -echo WHERE_ARG_NUNIT=!WHERE_ARG_NUNIT! -set NUNITPATH=%~dp0tests\fsharpqa\testenv\bin\nunit\ -set NUNIT3_CONSOLE=%~dp0packages\NUnit.Console.3.0.0\tools\nunit3-console.exe set link_exe=%~dp0tests\fsharpqa\testenv\bin\link\link.exe if not exist "%link_exe%" ( echo Error: failed to find "%link_exe%" use nuget to restore the VisualCppTools package @@ -930,40 +778,31 @@ if not exist "%link_exe%" ( if /I not "%single_threaded%" == "true" (set PARALLEL_ARG=-procs:%NUMBER_OF_PROCESSORS%) else set PARALLEL_ARG=-procs:0 -set FSCBINPATH=%~dp0%BUILD_CONFIG%\net40\bin -set RESULTSDIR=%~dp0tests\TestResults -if not exist "%RESULTSDIR%" (mkdir "%RESULTSDIR%") +set FSCBINPATH=%~dp0artifacts\bin\fsc\%BUILD_CONFIG%\net46 ECHO FSCBINPATH=%FSCBINPATH% -ECHO RESULTSDIR=%RESULTSDIR% ECHO link_exe=%link_exe% -ECHO NUNIT3_CONSOLE=%NUNIT3_CONSOLE% -ECHO NUNITPATH=%NUNITPATH% REM ---------------- test-net40-fsharp ----------------------- +set TESTLOGDIR=%~dp0artifacts\TestResults\%BUILD_CONFIG% if "%TEST_NET40_FSHARP_SUITE%" == "1" ( - set OUTPUTARG= - set ERRORARG= - set OUTPUTFILE= - set ERRORFILE= - set XMLFILE=!RESULTSDIR!\test-net40-fsharp-results.xml - if "%CI%" == "1" ( - set OUTPUTFILE=!RESULTSDIR!\test-net40-fsharp-output.log - set OUTPUTARG=--output:"!OUTPUTFILE!" - set ERRORFILE=!RESULTSDIR!\test-net40-fsharp-errors.log - set ERRORARG=--err:"!ERRORFILE!" - ) - - echo "!NUNIT3_CONSOLE!" --verbose "!FSCBINPATH!\FSharp.Tests.FSharpSuite.dll" --framework:V4.0 --work:"!FSCBINPATH!" !OUTPUTARG! !ERRORARG! --result:"!XMLFILE!;format=nunit3" !WHERE_ARG_NUNIT! - "!NUNIT3_CONSOLE!" --verbose "!FSCBINPATH!\FSharp.Tests.FSharpSuite.dll" --framework:V4.0 --work:"!FSCBINPATH!" !OUTPUTARG! !ERRORARG! --result:"!XMLFILE!;format=nunit3" !WHERE_ARG_NUNIT! + set LOGFILE=%TESTLOGDIR%\FSharp.Tests.FSharpSuite_net46.trx + echo "%_dotnetexe%" test "%~dp0tests\fsharp\FSharp.Tests.FSharpSuite.fsproj" --no-restore --no-build -c %BUILD_CONFIG% -f net46 -l "trx;LogFileName=!LOGFILE!" + "%_dotnetexe%" test "%~dp0tests\fsharp\FSharp.Tests.FSharpSuite.fsproj" --no-restore --no-build -c %BUILD_CONFIG% -f net46 -l "trx;LogFileName=!LOGFILE!" if errorlevel 1 ( - type "!ERRORFILE!" - echo ----------------------------------------------------------------- - echo Error: Running tests net40-fsharp failed, see log above -- FAILED - echo ----------------------------------------------------------------- + echo -------------------------------------------------------------- + echo Error: Running tests net40-fsharp failed, see file `!LOGFILE!` + echo -------------------------------------------------------------- + goto :failure + ) + + if not exist "!LOGFILE!" ( + echo -------------------------------------------------------- + echo Test results file !LOGFILE! not found, ensure tests ran. + echo -------------------------------------------------------- goto :failure ) ) @@ -972,25 +811,39 @@ REM ---------------- test-fcs ----------------------- if "%TEST_FCS%" == "1" ( - del /q fcs\FSharp.Compiler.Service.Tests\TestResults\*.trx - echo "!_dotnet20exe!" test fcs/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj -c Release --logger:trx - "!_dotnet20exe!" test fcs/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj -c Release --logger:trx + set LOGFILE=%TESTLOGDIR%\FSharp.Compiler.Service.Tests_net46.trx + echo "%_dotnetexe%" test "%~dp0fcs\FSharp.Compiler.Service.Tests\FSharp.Compiler.Service.Tests.fsproj" --no-restore --no-build -c %BUILD_CONFIG% -f net46 -l "trx;LogFileName=!LOGFILE!" + "%_dotnetexe%" test "%~dp0fcs\FSharp.Compiler.Service.Tests\FSharp.Compiler.Service.Tests.fsproj" --no-restore --no-build -c %BUILD_CONFIG% -f net46 -l "trx;LogFileName=!LOGFILE!" if errorlevel 1 ( - type fcs\FSharp.Compiler.Service.Tests\TestResults\*.trx - echo ----------------------------------------------------------------- - echo Error: Running FCS tests failed. See XML logging output above. Search for 'outcome="Failed"' or 'Failed ' - echo . - echo Error: Note that tests were run with both .NET Core and .NET Framework. - echo Error: Try running tests locally and using - echo . - echo dotnet test fcs/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj -c Release --logger:trx - echo . - echo Error: and look for results in - echo . - echo fcs\FSharp.Compiler.Service.Tests\TestResults\*.trx - echo . - echo ----------------------------------------------------------------- + echo -------------------------------------------------------------- + echo Error: Running net40 fcs tests, see file `!LOGFILE!` + echo -------------------------------------------------------------- + goto :failure + ) + + if not exist "!LOGFILE!" ( + echo -------------------------------------------------------- + echo Test results file !LOGFILE! not found, ensure tests ran. + echo -------------------------------------------------------- + goto :failure + ) + + set LOGFILE=%TESTLOGDIR%\FSharp.Compiler.Service.Tests_netcoreapp2.0.trx + echo "%_dotnetexe%" test "%~dp0fcs\FSharp.Compiler.Service.Tests\FSharp.Compiler.Service.Tests.fsproj" --no-restore --no-build -c %BUILD_CONFIG% -f netcoreapp2.0 -l "trx;LogFileName=!LOGFILE!" + "%_dotnetexe%" test "%~dp0fcs\FSharp.Compiler.Service.Tests\FSharp.Compiler.Service.Tests.fsproj" --no-restore --no-build -c %BUILD_CONFIG% -f netcoreapp2.0 -l "trx;LogFileName=!LOGFILE!" + + if errorlevel 1 ( + echo -------------------------------------------------------------- + echo Error: Running coreclr fcs tests, see file `!LOGFILE!` + echo -------------------------------------------------------------- + goto :failure + ) + + if not exist "!LOGFILE!" ( + echo -------------------------------------------------------- + echo Test results file !LOGFILE! not found, ensure tests ran. + echo -------------------------------------------------------- goto :failure ) ) @@ -1021,13 +874,14 @@ set HOSTED_COMPILER=1 if "%TEST_NET40_FSHARPQA_SUITE%" == "1" ( - set CSC_PIPE=%~dp0packages\Microsoft.Net.Compilers.2.7.0\tools\csc.exe + set CSC_PIPE=%USERPROFILE%\.nuget\packages\Microsoft.Net.Compilers\2.7.0\tools\csc.exe set FSC=!FSCBINPATH!\fsc.exe set FSCOREDLLPATH=!FSCBinPath!\FSharp.Core.dll set PATH=!FSCBINPATH!;!PATH! - set perlexe=%~dp0packages\StrawberryPerl64.5.22.2.1\Tools\perl\bin\perl.exe + set perlexe=%USERPROFILE%\.nuget\packages\StrawberryPerl64\5.22.2.1\Tools\perl\bin\perl.exe if not exist !perlexe! (echo Error: perl was not downloaded from check the packages directory: !perlexe! && goto :failure ) + set RESULTSDIR=%~dp0artifacts\TestResults\%BUILD_CONFIG% set OUTPUTFILE=test-net40-fsharpqa-results.log set ERRORFILE=test-net40-fsharpqa-errors.log set FAILENV=test-net40-fsharpqa-errors @@ -1038,9 +892,10 @@ if "%TEST_NET40_FSHARPQA_SUITE%" == "1" ( popd if ERRORLEVEL 1 ( - type "%RESULTSDIR%\!OUTPUTFILE!" echo ----------------------------------------------------------------- - type "%RESULTSDIR%\!ERRORFILE!" + type "!RESULTSDIR!\!OUTPUTFILE!" + echo ----------------------------------------------------------------- + type "!RESULTSDIR!\!ERRORFILE!" echo ----------------------------------------------------------------- echo Error: Running tests net40-fsharpqa failed, see logs above -- FAILED echo ----------------------------------------------------------------- @@ -1052,115 +907,103 @@ REM ---------------- net40-compilerunit ----------------------- if "%TEST_NET40_COMPILERUNIT_SUITE%" == "1" ( - set OUTPUTARG= - set ERRORARG= - set OUTPUTFILE= - set ERRORFILE= - set XMLFILE=!RESULTSDIR!\test-net40-compilerunit-results.xml - if "%CI%" == "1" ( - set OUTPUTFILE=!RESULTSDIR!\test-net40-compilerunit-output.log - set ERRORFILE=!RESULTSDIR!\test-net40-compilerunit-errors.log - set ERRORARG=--err:"!ERRORFILE!" - set OUTPUTARG=--output:"!OUTPUTFILE!" - ) - set ERRORFILE=!RESULTSDIR!\test-net40-compilerunit-errors.log - echo "!NUNIT3_CONSOLE!" --verbose --framework:V4.0 --result:"!XMLFILE!;format=nunit3" !OUTPUTARG! !ERRORARG! --work:"!FSCBINPATH!" "!FSCBINPATH!\..\..\net40\bin\FSharp.Compiler.UnitTests.dll" !WHERE_ARG_NUNIT! - "!NUNIT3_CONSOLE!" --verbose --framework:V4.0 --result:"!XMLFILE!;format=nunit3" !OUTPUTARG! !ERRORARG! --work:"!FSCBINPATH!" "!FSCBINPATH!\..\..\net40\bin\FSharp.Compiler.UnitTests.dll" !WHERE_ARG_NUNIT! + set LOGFILE=%TESTLOGDIR%\FSharp.Compiler.UnitTests_net46.trx + echo "%_dotnetexe%" test "%~dp0tests\FSharp.Compiler.UnitTests\FSharp.Compiler.UnitTests.fsproj" --no-restore --no-build -c %BUILD_CONFIG% -f net46 -l "trx;LogFileName=!LOGFILE!" + "%_dotnetexe%" test "%~dp0tests\FSharp.Compiler.UnitTests\FSharp.Compiler.UnitTests.fsproj" --no-restore --no-build -c %BUILD_CONFIG% -f net46 -l "trx;LogFileName=!LOGFILE!" if errorlevel 1 ( echo ----------------------------------------------------------------- - type "!OUTPUTFILE!" - echo ----------------------------------------------------------------- - type "!ERRORFILE!" - echo ----------------------------------------------------------------- - echo Error: Running tests net40-compilerunit failed, see logs above -- FAILED + echo Error: Running tests net40-compilerunit failed, see file `!LOGFILE!` echo ----------------------------------------------------------------- goto :failure ) - set OUTPUTARG= - set ERRORARG= - set OUTPUTFILE= - set ERRORFILE= - set XMLFILE=!RESULTSDIR!\test-net40-buildunit-results.xml - if "%CI%" == "1" ( - set OUTPUTFILE=!RESULTSDIR!\test-net40-buildunit-output.log - set ERRORFILE=!RESULTSDIR!\test-net40-buildunit-errors.log - set ERRORARG=--err:"!ERRORFILE!" - set OUTPUTARG=--output:"!OUTPUTFILE!" + if not exist "!LOGFILE!" ( + echo -------------------------------------------------------- + echo Test results file !LOGFILE! not found, ensure tests ran. + echo -------------------------------------------------------- + goto :failure ) - set ERRORFILE=!RESULTSDIR!\test-net40-buildunit-errors.log - echo "!NUNIT3_CONSOLE!" --verbose --framework:V4.0 --result:"!XMLFILE!;format=nunit3" !OUTPUTARG! !ERRORARG! --work:"!FSCBINPATH!" "!FSCBINPATH!\FSharp.Build.UnitTests.dll" !WHERE_ARG_NUNIT! - "!NUNIT3_CONSOLE!" --verbose --framework:V4.0 --result:"!XMLFILE!;format=nunit3" !OUTPUTARG! !ERRORARG! --work:"!FSCBINPATH!" "!FSCBINPATH!\FSharp.Build.UnitTests.dll" !WHERE_ARG_NUNIT! + + set LOGFILE=%TESTLOGDIR%\FSharp.Build.UnitTests_net46.trx + echo "%_dotnetexe%" test "%~dp0tests\FSharp.Build.UnitTests\FSharp.Build.UnitTests.fsproj" --no-restore --no-build -c %BUILD_CONFIG% -f net46 -l "trx;LogFileName=!LOGFILE!" + "%_dotnetexe%" test "%~dp0tests\FSharp.Build.UnitTests\FSharp.Build.UnitTests.fsproj" --no-restore --no-build -c %BUILD_CONFIG% -f net46 -l "trx;LogFileName=!LOGFILE!" if errorlevel 1 ( echo ----------------------------------------------------------------- - type "!OUTPUTFILE!" - echo ----------------------------------------------------------------- - type "!ERRORFILE!" - echo ----------------------------------------------------------------- - echo Error: Running tests net40-compilernit failed, see logs above -- FAILED + echo Error: Running tests net40-compilernit failed, see file `!LOGFILE!` echo ----------------------------------------------------------------- goto :failure ) + + if not exist "!LOGFILE!" ( + echo -------------------------------------------------------- + echo Test results file !LOGFILE! not found, ensure tests ran. + echo -------------------------------------------------------- + goto :failure + ) ) REM ---------------- net40-coreunit ----------------------- if "%TEST_NET40_COREUNIT_SUITE%" == "1" ( - set OUTPUTARG= - set ERRORARG= - set OUTPUTFILE= - set ERRORFILE= - set XMLFILE=!RESULTSDIR!\test-net40-coreunit-results.xml - if "%CI%" == "1" ( - set ERRORFILE=!RESULTSDIR!\test-net40-coreunit-errors.log - set OUTPUTFILE=!RESULTSDIR!\test-net40-coreunit-output.log - set ERRORARG=--err:"!ERRORFILE!" - set OUTPUTARG=--output:"!OUTPUTFILE!" - ) - - echo "!NUNIT3_CONSOLE!" --verbose --framework:V4.0 --result:"!XMLFILE!;format=nunit3" !OUTPUTARG! !ERRORARG! --work:"!FSCBINPATH!" "!FSCBINPATH!\FSharp.Core.UnitTests.dll" !WHERE_ARG_NUNIT! - "!NUNIT3_CONSOLE!" --verbose --framework:V4.0 --result:"!XMLFILE!;format=nunit3" !OUTPUTARG! !ERRORARG! --work:"!FSCBINPATH!" "!FSCBINPATH!\FSharp.Core.UnitTests.dll" !WHERE_ARG_NUNIT! + set LOGFILE=%TESTLOGDIR%\FSharp.Core.UnitTests_net46.trx + echo "%_dotnetexe%" test "%~dp0tests\FSharp.Core.UnitTests\FSharp.Core.UnitTests.fsproj" --no-restore --no-build -c %BUILD_CONFIG% -f net46 -l "trx;LogFileName=!LOGFILE!" + "%_dotnetexe%" test "%~dp0tests\FSharp.Core.UnitTests\FSharp.Core.UnitTests.fsproj" --no-restore --no-build -c %BUILD_CONFIG% -f net46 -l "trx;LogFileName=!LOGFILE!" if errorlevel 1 ( echo ----------------------------------------------------------------- - type "!OUTPUTFILE!" - echo ----------------------------------------------------------------- - type "!ERRORFILE!" - echo ----------------------------------------------------------------- - echo Error: Running tests net40-coreunit failed, see logs above -- FAILED + echo Error: Running tests net40-coreunit failed, see file `!LOGFILE!` echo ----------------------------------------------------------------- goto :failure ) + + if not exist "!LOGFILE!" ( + echo -------------------------------------------------------- + echo Test results file !LOGFILE! not found, ensure tests ran. + echo -------------------------------------------------------- + goto :failure + ) ) REM ---------------- coreclr-coreunit ----------------------- if "%TEST_CORECLR_COREUNIT_SUITE%" == "1" ( - set XMLFILE=!RESULTSDIR!\test-coreclr-coreunit-results.xml - set OUTPUTFILE=!RESULTSDIR!\test-coreclr-coreunit-output.log - set ERRORFILE=!RESULTSDIR!\test-coreclr-coreunit-errors.log - - echo "%_dotnetcliexe%" "%~dp0tests\testbin\!BUILD_CONFIG!\coreclr\FSharp.Build.UnitTests\FSharp.Build.UnitTests.dll" !WHERE_ARG_NUNIT! - "%_dotnetcliexe%" "%~dp0tests\testbin\!BUILD_CONFIG!\coreclr\FSharp.Build.UnitTests\FSharp.Build.UnitTests.dll" !WHERE_ARG_NUNIT! + set LOGFILE=%TESTLOGDIR%\FSharp.Build.UnitTests_netcoreapp2.0.trx + echo "%_dotnetexe%" test "%~dp0tests\FSharp.Build.UnitTests\FSharp.Build.UnitTests.fsproj" --no-restore --no-build -c %BUILD_CONFIG% -f netcoreapp2.0 -l "trx;LogFileName=!LOGFILE!" + "%_dotnetexe%" test "%~dp0tests\FSharp.Build.UnitTests\FSharp.Build.UnitTests.fsproj" --no-restore --no-build -c %BUILD_CONFIG% -f netcoreapp2.0 -l "trx;LogFileName=!LOGFILE!" if errorlevel 1 ( echo ----------------------------------------------------------------- - echo Error: Running tests coreclr-coreunit failed, see logs above-- FAILED + echo Error: Running tests coreclr-compilernit failed, see file `!LOGFILE!` echo ----------------------------------------------------------------- goto :failure ) - echo "%_dotnetcliexe%" "%~dp0tests\testbin\!BUILD_CONFIG!\coreclr\FSharp.Core.UnitTests\FSharp.Core.UnitTests.dll" !WHERE_ARG_NUNIT! - "%_dotnetcliexe%" "%~dp0tests\testbin\!BUILD_CONFIG!\coreclr\FSharp.Core.UnitTests\FSharp.Core.UnitTests.dll" !WHERE_ARG_NUNIT! + if not exist "!LOGFILE!" ( + echo -------------------------------------------------------- + echo Test results file !LOGFILE! not found, ensure tests ran. + echo -------------------------------------------------------- + goto :failure + ) + + set LOGFILE=%TESTLOGDIR%\FSharp.Core.UnitTests_netcoreapp2.0.trx + echo "%_dotnetexe%" test "%~dp0tests\FSharp.Core.UnitTests\FSharp.Core.UnitTests.fsproj" --no-restore --no-build -c %BUILD_CONFIG% -f netcoreapp2.0 -l "trx;LogFileName=!LOGFILE!" + "%_dotnetexe%" test "%~dp0tests\FSharp.Core.UnitTests\FSharp.Core.UnitTests.fsproj" --no-restore --no-build -c %BUILD_CONFIG% -f netcoreapp2.0 -l "trx;LogFileName=!LOGFILE!" if errorlevel 1 ( - echo ----------------------------------------------------------------- - echo Error: Running tests coreclr-coreunit failed, see logs above-- FAILED - echo ----------------------------------------------------------------- + echo ------------------------------------------------------------------ + echo Error: Running tests coreclr-coreunit failed, see file `!LOGFILE!` + echo ------------------------------------------------------------------ + goto :failure + ) + + if not exist "!LOGFILE!" ( + echo -------------------------------------------------------- + echo Test results file !LOGFILE! not found, ensure tests ran. + echo -------------------------------------------------------- goto :failure ) ) @@ -1168,22 +1011,21 @@ if "%TEST_CORECLR_COREUNIT_SUITE%" == "1" ( REM ---------------- coreclr-fsharp ----------------------- if "%TEST_CORECLR_FSHARP_SUITE%" == "1" ( - - set single_threaded=true - set permutations=FSC_CORECLR - - set OUTPUTARG= - set ERRORARG= - set OUTPUTFILE= - set ERRORFILE= - set XMLFILE=!RESULTSDIR!\test-coreclr-fsharp-results.xml - echo "%_dotnetcliexe%" "%~dp0tests\testbin\!BUILD_CONFIG!\coreclr\FSharp.Tests.FSharpSuite.DrivingCoreCLR\FSharp.Tests.FSharpSuite.DrivingCoreCLR.dll" !WHERE_ARG_NUNIT! - "%_dotnetcliexe%" "%~dp0tests\testbin\!BUILD_CONFIG!\coreclr\FSharp.Tests.FSharpSuite.DrivingCoreCLR\FSharp.Tests.FSharpSuite.DrivingCoreCLR.dll" !WHERE_ARG_NUNIT! + set LOGFILE=%TESTLOGDIR%\FSharp.Tests.FSharpSuite_netcoreapp2.0.trx + echo "%_dotnetexe%" test "%~dp0tests\fsharp\FSharp.Tests.FSharpSuite.fsproj" --no-restore --no-build -c %BUILD_CONFIG% -f netcoreapp2.0 -l "trx;LogFileName=!LOGFILE!" + "%_dotnetexe%" test "%~dp0tests\fsharp\FSharp.Tests.FSharpSuite.fsproj" --no-restore --no-build -c %BUILD_CONFIG% -f netcoreapp2.0 -l "trx;LogFileName=!LOGFILE!" if errorlevel 1 ( - echo ----------------------------------------------------------------- - echo Error: Running tests coreclr-fsharp failed, see logs above-- FAILED - echo ----------------------------------------------------------------- + echo ---------------------------------------------------------------- + echo Error: Running tests coreclr-fsharp failed, see file `!LOGFILE!` + echo ---------------------------------------------------------------- + goto :failure + ) + + if not exist "!LOGFILE!" ( + echo -------------------------------------------------------- + echo Test results file !LOGFILE! not found, ensure tests ran. + echo -------------------------------------------------------- goto :failure ) ) @@ -1191,45 +1033,38 @@ if "%TEST_CORECLR_FSHARP_SUITE%" == "1" ( REM ---------------- vs-ideunit ----------------------- if "%TEST_VS_IDEUNIT_SUITE%" == "1" ( + set LOGFILE=%TESTLOGDIR%\GetTypesVSUnitTests_net46.trx + echo "%_dotnetexe%" test "%~dp0vsintegration\tests\GetTypesVSUnitTests\GetTypesVSUnitTests.fsproj" --no-restore --no-build -c %BUILD_CONFIG% -f net46 -l "trx;LogFileName=!LOGFILE!" + "%_dotnetexe%" test "%~dp0vsintegration\tests\GetTypesVSUnitTests\GetTypesVSUnitTests.fsproj" --no-restore --no-build -c %BUILD_CONFIG% -f net46 -l "trx;LogFileName=!LOGFILE!" - set OUTPUTARG= - set ERRORARG= - set OUTPUTFILE= - set ERRORFILE= - set XMLFILE=!RESULTSDIR!\test-vs-ideunit-results.xml - if "%CI%" == "1" ( - set OUTPUTFILE=!RESULTSDIR!\test-vs-ideunit-output.log - set ERRORFILE=!RESULTSDIR!\test-vs-ideunit-errors.log - set ERRORARG=--err:"!ERRORFILE!" - set OUTPUTARG=--output:"!OUTPUTFILE!" + if errorlevel 1 ( + echo --------------------------------------------------------------------------- + echo Error: Running tests net40-gettypesvsunittests failed, see file `!LOGFILE!` + echo --------------------------------------------------------------------------- + goto :failure ) - rem Verify that VisualFSharp.UnitTests.dll can be loaded by nunit. Report load errors. - pushd !FSCBINPATH! - echo "!NUNIT3_CONSOLE!" --verbose --x86 --framework:V4.0 --work:"!FSCBINPATH!" --workers=1 --agents=1 --full "!FSCBINPATH!\GetTypesVSUnitTests.dll" !WHERE_ARG_NUNIT! - "!NUNIT3_CONSOLE!" --verbose --x86 --framework:V4.0 --work:"!FSCBINPATH!" --workers=1 --agents=1 --full "!FSCBINPATH!\GetTypesVSUnitTests.dll" !WHERE_ARG_NUNIT! - popd + if not exist "!LOGFILE!" ( + echo -------------------------------------------------------- + echo Test results file !LOGFILE! not found, ensure tests ran. + echo -------------------------------------------------------- + goto :failure + ) + set LOGFILE=%TESTLOGDIR%\VisualFSharp.UnitTests_net46.trx + echo "%_dotnetexe%" test "%~dp0vsintegration\tests\UnitTests\VisualFSharp.UnitTests.fsproj" --no-restore --no-build -c %BUILD_CONFIG% -f net46 -l "trx;LogFileName=!LOGFILE!" + "%_dotnetexe%" test "%~dp0vsintegration\tests\UnitTests\VisualFSharp.UnitTests.fsproj" --no-restore --no-build -c %BUILD_CONFIG% -f net46 -l "trx;LogFileName=!LOGFILE!" if errorlevel 1 ( + echo ------------------------------------------------------------ + echo Error: Running tests vs-ideunit failed, see file `!LOGFILE!` + echo ------------------------------------------------------------ goto :failure ) - pushd !FSCBINPATH! - echo "!NUNIT3_CONSOLE!" --verbose --x86 --framework:V4.0 --result:"!XMLFILE!;format=nunit3" !OUTPUTARG! !ERRORARG! --work:"!FSCBINPATH!" --workers=1 --agents=1 --full "!FSCBINPATH!\VisualFSharp.UnitTests.dll" !WHERE_ARG_NUNIT! - "!NUNIT3_CONSOLE!" --verbose --x86 --framework:V4.0 --result:"!XMLFILE!;format=nunit3" !OUTPUTARG! !ERRORARG! --work:"!FSCBINPATH!" --workers=1 --agents=1 --full "!FSCBINPATH!\VisualFSharp.UnitTests.dll" !WHERE_ARG_NUNIT! - popd - - if errorlevel 1 ( - echo --------begin vs-ide-unit output --------------------- - type "!OUTPUTFILE!" - echo --------end vs-ide-unit output ----------------------- - echo -------begin vs-ide-unit errors ---------------------- - type "!ERRORFILE!" - echo -------end vs-ide-unit errors ------------------------ - echo Error: Running tests vs-ideunit failed, see logs above, search for "Errors and Failures" -- FAILED - echo Command Line for running tests - echo "!NUNIT3_CONSOLE!" --verbose --x86 --framework:V4.0 --result:"!XMLFILE!;format=nunit3" !OUTPUTARG! !ERRORARG! --work:"!FSCBINPATH!" --workers=1 --agents=1 --full "!FSCBINPATH!\VisualFSharp.UnitTests.dll" !WHERE_ARG_NUNIT! - echo ---------------------------------------------------------------------------------------------------- + if not exist "!LOGFILE!" ( + echo -------------------------------------------------------- + echo Test results file !LOGFILE! not found, ensure tests ran. + echo -------------------------------------------------------- goto :failure ) ) @@ -1238,6 +1073,7 @@ goto :success REM ------ exit ------------------------------------- :failure endlocal +@echo exit /b 1 :success diff --git a/build/config/AssemblySignToolData.json b/build/config/AssemblySignToolData.json index 6857a57f0dd..55163cb5b14 100644 --- a/build/config/AssemblySignToolData.json +++ b/build/config/AssemblySignToolData.json @@ -4,55 +4,45 @@ "certificate": "Microsoft", "strongName": "StrongName", "values": [ - "net40\\bin\\FSharp.Core.dll", - "net40\\bin\\*\\FSharp.Core.resources.dll", - "net40\\bin\\FSharp.Build.dll", - "net40\\bin\\*\\FSharp.Build.resources.dll", - "net40\\bin\\FSharp.Compiler.Private.dll", - "net40\\bin\\*\\FSharp.Compiler.Private.resources.dll", - "net40\\bin\\FSharp.Compiler.Server.Shared.dll", - "net40\\bin\\FSharp.Compiler.Interactive.Settings.dll", - "net40\\bin\\*\\FSharp.Compiler.Interactive.Settings.resources.dll", - "net40\\bin\\fsc.exe", - "net40\\bin\\fsi.exe", - "net40\\bin\\fsiAnyCpu.exe", - "net40\\bin\\FSharp.VS.FSI.dll", - "net40\\bin\\*\\FSharp.VS.FSI.resources.dll", - "net40\\bin\\FSharp.LanguageService.Base.dll", - "net40\\bin\\*\\FSharp.LanguageService.Base.resources.dll", - "net40\\bin\\FSharp.LanguageService.dll", - "net40\\bin\\*\\FSharp.LanguageService.resources.dll", - "net40\\bin\\FSharp.UIResources.dll", - "net40\\bin\\*\\FSharp.UIResources.resources.dll", - "net40\\bin\\FSharp.Editor.dll", - "net40\\bin\\*\\FSharp.Editor.resources.dll", - "net40\\bin\\FSharp.ProjectSystem.Base.dll", - "net40\\bin\\*\\FSharp.ProjectSystem.Base.resources.dll", - "net40\\bin\\FSharp.ProjectSystem.PropertyPages.dll", - "net40\\bin\\*\\FSharp.ProjectSystem.PropertyPages.resources.dll", - "net40\\bin\\FSharp.ProjectSystem.FSharp.dll", - "net40\\bin\\*\\FSharp.ProjectSystem.FSharp.resources.dll", - "net40\\bin\\FSharp.PatternMatcher.dll", - "coreclr\\bin\\FSharp.Core.dll", - "coreclr\\bin\\*\\FSharp.Core.resources.dll", - "coreclr\\bin\\FSharp.Build.dll", - "coreclr\\bin\\*\\FSharp.Build.resources.dll", - "coreclr\\bin\\FSharp.Compiler.Private.dll", - "coreclr\\bin\\*\\FSharp.Compiler.Private.resources.dll", - "coreclr\\bin\\FSharp.Compiler.Interactive.Settings.dll", - "coreclr\\bin\\*\\FSharp.Compiler.Interactive.Settings.resources.dll", - "coreclr\\bin\\fsc.exe", - "coreclr\\bin\\fsi.exe" + "bin\\FSharp.Core\\*\\*\\FSharp.Core.dll", + "bin\\FSharp.Core\\*\\*\\*\\FSharp.Core.resources.dll", + "bin\\FSharp.Build\\*\\*\\FSharp.Build.dll", + "bin\\FSharp.Build\\*\\*\\*\\FSharp.Build.resources.dll", + "bin\\FSharp.Compiler.Private\\*\\*\\FSharp.Compiler.Private.dll", + "bin\\FSharp.Compiler.Private\\*\\*\\*\\FSharp.Compiler.Private.resources.dll", + "bin\\FSharp.Compiler.Server.Shared\\*\\*\\FSharp.Compiler.Server.Shared.dll", + "bin\\FSharp.Compiler.Interactive.Settings\\*\\*\\FSharp.Compiler.Interactive.Settings.dll", + "bin\\FSharp.Compiler.Interactive.Settings\\*\\*\\*\\FSharp.Compiler.Interactive.Settings.resources.dll", + "bin\\fsc\\*\\*\\fsc.exe", + "bin\\fsi\\*\\*\\fsi.exe", + "bin\\fsiAnyCpu\\*\\*\\fsiAnyCpu.exe", + "bin\\FSharp.VS.FSI\\*\\*\\FSharp.VS.FSI.dll", + "bin\\FSharp.VS.FSI\\*\\*\\*\\FSharp.VS.FSI.resources.dll", + "bin\\FSharp.LanguageService.Base\\*\\*\\FSharp.LanguageService.Base.dll", + "bin\\FSharp.LanguageService.Base\\*\\*\\*\\FSharp.LanguageService.Base.resources.dll", + "bin\\FSharp.LanguageService\\*\\*\\FSharp.LanguageService.dll", + "bin\\FSharp.LanguageService\\*\\*\\*\\FSharp.LanguageService.resources.dll", + "bin\\FSharp.UIResources\\*\\*\\FSharp.UIResources.dll", + "bin\\FSharp.UIResources\\*\\*\\*\\FSharp.UIResources.resources.dll", + "bin\\FSharp.Editor\\*\\*\\FSharp.Editor.dll", + "bin\\FSharp.Editor\\*\\*\\*\\FSharp.Editor.resources.dll", + "bin\\FSharp.PatternMatcher\\*\\*\\FSharp.PatternMatcher.dll", + "bin\\FSharp.PropertiesPages\\*\\*\\FSharp.ProjectSystem.PropertyPages.dll", + "bin\\FSharp.PropertiesPages\\*\\*\\*\\FSharp.ProjectSystem.PropertyPages.resources.dll", + "bin\\ProjectSystem\\*\\*\\FSharp.ProjectSystem.FSharp.dll", + "bin\\ProjectSystem\\*\\*\\*\\FSharp.ProjectSystem.FSharp.resources.dll", + "bin\\ProjectSystem.Base\\*\\*\\FSharp.ProjectSystem.Base.dll", + "bin\\ProjectSystem.Base\\*\\*\\*\\FSharp.ProjectSystem.Base.resources.dll" ] }, { "certificate": "VsixSHA2", "strongName": null, "values": [ - "net40\\bin\\VisualFSharpFull.vsix", - "net40\\bin\\VisualFSharpTemplate.vsix", - "insertion\\Microsoft.FSharp.Dependencies.vsix", - "insertion\\Microsoft.FSharp.VSIX.Full.Resources.*.vsix" + "bin\\VisualFSharpFull\\*\\*VisualFSharpFull.vsix", + "bin\\VisualFSharpTemplates\\*\\*\\VisualFSharpTemplate.vsix", + "VSSetup\\*\\Insertion\\Microsoft.FSharp.Dependencies.vsix", + "VSSetup\\*\\Insertion\\Microsoft.FSharp.VSIX.Full.Resources.*.vsix" ] } ], diff --git a/build/config/InsertionSignToolData.json b/build/config/InsertionSignToolData.json index ec8432ca9ad..d81579b12c9 100644 --- a/build/config/InsertionSignToolData.json +++ b/build/config/InsertionSignToolData.json @@ -4,11 +4,11 @@ "certificate": "VsixSHA2", "strongName": null, "values": [ - "insertion\\Microsoft.FSharp.Compiler.vsix", - "insertion\\Microsoft.FSharp.Compiler.Resources.*.vsix", - "insertion\\Microsoft.FSharp.Dependencies.vsix", - "insertion\\Microsoft.FSharp.IDE.vsix", - "insertion\\Microsoft.FSharp.SDK.vsix" + "Microsoft.FSharp.Compiler.vsix", + "Microsoft.FSharp.Compiler.Resources.*.vsix", + "Microsoft.FSharp.Dependencies.vsix", + "Microsoft.FSharp.IDE.vsix", + "Microsoft.FSharp.SDK.vsix" ] } ], diff --git a/build/config/PackageSignToolData.json b/build/config/PackageSignToolData.json index 20007f59e36..5bc74386355 100644 --- a/build/config/PackageSignToolData.json +++ b/build/config/PackageSignToolData.json @@ -4,8 +4,7 @@ "certificate": "NuGet", "strongName": null, "values": [ - "artifacts\\*.nupkg", - "artifacts\\*\\*.nupkg" + "*.nupkg" ] } ], diff --git a/build/config/packages.config b/build/config/packages.config deleted file mode 100644 index e131ae53c92..00000000000 --- a/build/config/packages.config +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/build/projects/Directory.Build.props b/build/projects/Directory.Build.props new file mode 100644 index 00000000000..bb8eac309b1 --- /dev/null +++ b/build/projects/Directory.Build.props @@ -0,0 +1,3 @@ + + + diff --git a/build/projects/Directory.Build.targets b/build/projects/Directory.Build.targets new file mode 100644 index 00000000000..ccd47cc0a9a --- /dev/null +++ b/build/projects/Directory.Build.targets @@ -0,0 +1,3 @@ + + + diff --git a/build/projects/PrepareDependencyUptake.proj b/build/projects/PrepareDependencyUptake.proj deleted file mode 100644 index 78ded8de2ad..00000000000 --- a/build/projects/PrepareDependencyUptake.proj +++ /dev/null @@ -1,33 +0,0 @@ - - - - $(MSBuildThisFileDirectory)..\..\Tools\dependencyUptake - $(DependencyUptakeDirectory)\PackageVersions.props - $(DependencyUptakeDirectory)\packages.config - $(DependencyUptakeDirectory)\NuGet.config - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/build/projects/Signing.proj b/build/projects/Signing.proj new file mode 100644 index 00000000000..9e981e135ec --- /dev/null +++ b/build/projects/Signing.proj @@ -0,0 +1,27 @@ + + + + + net46 + $(NuGetPackageRoot)RoslynTools.SignTool\$(RoslynToolsSignToolPackageVersion)\tools\SignTool.exe + -msbuildPath "$(MSBuildBinPath)\msbuild.exe" -nugetPackagesPath "$(NuGetPackageRoot.TrimEnd('\'))" -config "$(ConfigFile)" + -testSign $(SignToolArgs) + -test $(SignToolArgs) + + + + + + + + + + + + + + + + + diff --git a/build/scripts/run-signtool.cmd b/build/scripts/run-signtool.cmd deleted file mode 100644 index 15ae3420693..00000000000 --- a/build/scripts/run-signtool.cmd +++ /dev/null @@ -1,69 +0,0 @@ -@echo off -:: Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. -setlocal enableDelayedExpansion -set scriptdir=%~dp0 -set MSBuild= -set SignType= -set ConfigFile= - -:: -:: Validate arguments -:: - -:parsearg -if "%1" == "" goto doneargs -set arg=%1 -set argv=%2 - -if /i "%arg%" == "/?" goto help -if /i "%arg%" == "-h" goto help -if /i "%arg%" == "--help" goto help -if /i "%arg%" == "-MSBuild" ( - set MSBuild=%argv% - shift -) -if /i "%arg%" == "-SignType" ( - set SignType=%argv% - shift -) -if /i "%arg%" == "-Configuration" ( - set Configuration=%argv% - shift -) -if /i "%arg%" == "-ConfigFile" ( - set ConfigFile=%argv% - shift -) - -shift -goto parsearg - -:doneargs - -if not defined MSBuild echo Location of MSBuild.exe not specified. && goto error -if not defined ConfigFile echo Configuration file not specified. && goto error -if not exist "%MSBuild%" echo The specified MSBuild.exe does not exist. && goto error - -set NUGET_PACKAGES=%USERPROFILE%\.nuget\packages -set _signtoolexe=%NUGET_PACKAGES%\RoslynTools.SignTool\1.0.0-beta2-dev3\tools\SignTool.exe -set SignToolArgs=-msbuildPath %MSBuild% -config "%ConfigFile%" -nugetPackagesPath "%NUGET_PACKAGES%" -if /i "%SignType%" == "real" goto runsigntool -if /i "%SignType%" == "test" set SignToolArgs=%SignToolArgs% -testSign && goto runsigntool -set SignToolArgs=%SignToolArgs% -test - -:runsigntool - -if not exist "%_signtoolexe%" echo The signing tool could not be found at location '%_signtoolexe%' && goto error -set SignToolArgs=%SignToolArgs% "%scriptdir%..\..\%Configuration%" -echo "%_signtoolexe%" %SignToolArgs% - "%_signtoolexe%" %SignToolArgs% -if errorlevel 1 goto error -goto :EOF - -:help -echo Usage: %0 -MSBuild path\to\msbuild.exe -ConfigFile path\to\SignToolData.json [-SignType ^] -goto :EOF - -:error -echo Error running the sign tool. -exit /b 1 diff --git a/build/targets/AssemblyVersions.props b/build/targets/AssemblyVersions.props index 5e82721efa6..b17f940a938 100644 --- a/build/targets/AssemblyVersions.props +++ b/build/targets/AssemblyVersions.props @@ -22,7 +22,7 @@ $(_Build_Year).$(_Build_Month).$(_Build_Day).$(_Build_Number) 4.5 - $(FSCoreMajorVersion).3 + $(FSCoreMajorVersion).5 $(FSCoreMajorVersion).0.0 10.2 @@ -30,22 +30,14 @@ $(FSPackageVersion).0 15 - 8 + 9 $(VSMajorVersion).0 $(VSMajorVersion).$(VSMinorVersion).0.0 - $(FSCoreVersion) - - - $(FSProductVersion) - - - $(VSAssemblyVersion) - + false + + $(IntermediateOutputPath)$(MSBuildProjectName).AssemblyLevelAttributes$(DefaultLanguageSourceExtension) + + + $(NoWarn);2003 + + + - - + + $(FSCoreVersion) + + + $(FSProductVersion) + + + $(VSAssemblyVersion) + $(IntermediateOutputPath)$(MSBuildProjectName).AssemblyVersion$(DefaultLanguageSourceExtension) - <_UseWriteCodeFragmentHack Condition="'$(OS)' == 'Unix' and '$(Language)' == 'F#'">true @@ -60,6 +76,14 @@ + + + + + + + + <_UseWriteCodeFragmentHack Condition="'$(OS)' == 'Unix' and '$(Language)' == 'F#'">true + + + + OutputFile="$(GeneratedFSharpInternalsVisibleToFile)" + Condition="'$(_UseWriteCodeFragmentHack)' != 'true'"> + + + + + <_LinesToWrite Include="// <auto-generated>" /> + <_LinesToWrite Include="namespace FSharp" /> + <_LinesToWrite Include="open System" /> + <_LinesToWrite Include="open System.Reflection" /> + <_LinesToWrite Include="[<assembly: %(_InternalsVisibleToAttribute.Identity)("%(_InternalsVisibleToAttribute._Parameter1)")>]" /> + <_LinesToWrite Include="do()" /> + + + + + + diff --git a/build/targets/NGenOrCrossGen.targets b/build/targets/NGenOrCrossGen.targets new file mode 100644 index 00000000000..33dcaa3a63a --- /dev/null +++ b/build/targets/NGenOrCrossGen.targets @@ -0,0 +1,36 @@ + + + + + $(windir)\Microsoft.NET\Framework64\v4.0.30319\ngen.exe + $(windir)\Microsoft.NET\Framework\v4.0.30319\ngen.exe + + + + + + + + + + + + + + + + true + false + + + + diff --git a/build/targets/PackageVersions.props b/build/targets/PackageVersions.props index 2f68181bd5f..42a2305f6fd 100644 --- a/build/targets/PackageVersions.props +++ b/build/targets/PackageVersions.props @@ -2,15 +2,53 @@ + + + $(RestoreSources); + https://www.myget.org/F/fsharp-daily/api/v3/index.json; + https://dotnet.myget.org/F/roslyn-master-nightly/api/v3/index.json; + https://dotnet.myget.org/F/dotnet-core/api/v3/index.json; + https://dotnet.myget.org/F/dotnet-buildtools/api/v3/index.json; + https://dotnet.myget.org/F/roslyn-tools/api/v3/index.json; + https://api.nuget.org/v3/index.json; + https://dotnet.myget.org/F/roslyn/api/v3/index.json; + https://dotnet.myget.org/F/symreader-converter/api/v3/index.json; + + + + $(PB_RestoreSource);$(RestoreSources) + $(MSBuildThisFileDirectory)..\..\artifacts\dependencyUptake\PackageVersions.props + $([System.IO.File]::ReadAllText('$(MSBuildThisFileDirectory)..\..\RoslynPackageVersion.txt').Trim()) 1.5.0 + 4.3.0 + 4.3.0 + 4.3.0 4.3.0 - 1.5.0 + 4.3.0 + 4.3.0 + 4.5.0 + 4.3.0 + 4.3.0 + 4.3.0 1.6.0 - 4.3.0 + 4.3.0 + 1.5.0 + 4.3.0 + 4.3.0 + 4.3.0 + 4.3.0 + 4.3.0 + 4.3.0 + 4.3.0 + 4.3.0 + 4.3.0 + 4.3.0 + 4.3.0 + 4.4.0 $(RoslynPackageVersion) @@ -25,7 +63,6 @@ $(MicrosoftBuildOverallPackagesVersion) $(MicrosoftBuildOverallPackagesVersion) $(MicrosoftBuildOverallPackagesVersion) - 1.0.1 8.0.1 @@ -74,13 +111,29 @@ 11.0.4 7.0.4 + + 0.2.0 + 1.0.0 + 1.0.147 + 10.1.0 + 1.0.0 + + 3.0.0-alpha3 1.0.30 - 1.1.0-roslyn-62714-01 + 1.1.0-beta1-63314-01 8.0.0-alpha + 2.7.0 + 2.0.3 + 15.8.0 1.0.0 + 4.3.0 9.0.1 - 3.5.0 + 3.10.1 + 3.10.0 + 3.10.1 + 1.0.0-beta2-dev3 + 5.22.2.1 0.2.0-beta-000081 diff --git a/eng/common/CIBuild.cmd b/eng/common/CIBuild.cmd new file mode 100644 index 00000000000..56c2f25ac22 --- /dev/null +++ b/eng/common/CIBuild.cmd @@ -0,0 +1,2 @@ +@echo off +powershell -ExecutionPolicy ByPass -NoProfile -command "& """%~dp0Build.ps1""" -restore -build -test -sign -pack -publish -ci %*" \ No newline at end of file diff --git a/eng/common/PublishBuildAssets.cmd b/eng/common/PublishBuildAssets.cmd new file mode 100644 index 00000000000..3c6e4ff829d --- /dev/null +++ b/eng/common/PublishBuildAssets.cmd @@ -0,0 +1,3 @@ +@echo off +powershell -ExecutionPolicy ByPass -NoProfile -command "& """%~dp0sdk-task.ps1""" -msbuildEngine dotnet -restore -projects PublishBuildAssets.proj -ci %*" +exit /b %ErrorLevel% diff --git a/eng/common/PublishToPackageFeed.proj b/eng/common/PublishToPackageFeed.proj new file mode 100644 index 00000000000..7dc478d981f --- /dev/null +++ b/eng/common/PublishToPackageFeed.proj @@ -0,0 +1,37 @@ + + + + netcoreapp2.1 + + + + + + + + + + + + + + + + + + diff --git a/eng/common/README.md b/eng/common/README.md new file mode 100644 index 00000000000..ff49c371527 --- /dev/null +++ b/eng/common/README.md @@ -0,0 +1,28 @@ +# Don't touch this folder + + uuuuuuuuuuuuuuuuuuuu + u" uuuuuuuuuuuuuuuuuu "u + u" u$$$$$$$$$$$$$$$$$$$$u "u + u" u$$$$$$$$$$$$$$$$$$$$$$$$u "u + u" u$$$$$$$$$$$$$$$$$$$$$$$$$$$$u "u + u" u$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$u "u + u" u$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$u "u + $ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ $ + $ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ $ + $ $$$" ... "$... ...$" ... "$$$ ... "$$$ $ + $ $$$u `"$$$$$$$ $$$ $$$$$ $$ $$$ $$$ $ + $ $$$$$$uu "$$$$ $$$ $$$$$ $$ """ u$$$ $ + $ $$$""$$$ $$$$ $$$u "$$$" u$$ $$$$$$$$ $ + $ $$$$....,$$$$$..$$$$$....,$$$$..$$$$$$$$ $ + $ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ $ + "u "$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$" u" + "u "$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$" u" + "u "$$$$$$$$$$$$$$$$$$$$$$$$$$$$" u" + "u "$$$$$$$$$$$$$$$$$$$$$$$$" u" + "u "$$$$$$$$$$$$$$$$$$$$" u" + "u """""""""""""""""" u" + """""""""""""""""""" + +!!! Changes made in this directory are subject to being overwritten by automation !!! + +The files in this directory are shared by all Arcade repos and managed by automation. If you need to make changes to these files, open an issue or submit a pull request to https://github.com/dotnet/arcade first. diff --git a/eng/common/build.ps1 b/eng/common/build.ps1 new file mode 100644 index 00000000000..8279dc71339 --- /dev/null +++ b/eng/common/build.ps1 @@ -0,0 +1,133 @@ +[CmdletBinding(PositionalBinding=$false)] +Param( + [string][Alias('c')]$configuration = "Debug", + [string] $projects, + [string][Alias('v')]$verbosity = "minimal", + [string] $msbuildEngine = $null, + [bool] $warnAsError = $true, + [bool] $nodeReuse = $true, + [switch][Alias('r')]$restore, + [switch] $deployDeps, + [switch][Alias('b')]$build, + [switch] $rebuild, + [switch] $deploy, + [switch] $test, + [switch] $integrationTest, + [switch] $performanceTest, + [switch] $sign, + [switch] $pack, + [switch] $publish, + [switch][Alias('bl')]$binaryLog, + [switch] $ci, + [switch] $prepareMachine, + [switch] $help, + [Parameter(ValueFromRemainingArguments=$true)][String[]]$properties +) + +. $PSScriptRoot\tools.ps1 + +function Print-Usage() { + Write-Host "Common settings:" + Write-Host " -configuration Build configuration: 'Debug' or 'Release' (short: -c)" + Write-Host " -verbosity Msbuild verbosity: q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic] (short: -v)" + Write-Host " -binaryLog Output binary log (short: -bl)" + Write-Host " -help Print help and exit" + Write-Host "" + + Write-Host "Actions:" + Write-Host " -restore Restore dependencies (short: -r)" + Write-Host " -build Build solution (short: -b)" + Write-Host " -rebuild Rebuild solution" + Write-Host " -deploy Deploy built VSIXes" + Write-Host " -deployDeps Deploy dependencies (e.g. VSIXes for integration tests)" + Write-Host " -test Run all unit tests in the solution" + Write-Host " -pack Package build outputs into NuGet packages and Willow components" + Write-Host " -integrationTest Run all integration tests in the solution" + Write-Host " -performanceTest Run all performance tests in the solution" + Write-Host " -sign Sign build outputs" + Write-Host " -publish Publish artifacts (e.g. symbols)" + Write-Host "" + + Write-Host "Advanced settings:" + Write-Host " -projects Semi-colon delimited list of sln/proj's to build. Globbing is supported (*.sln)" + Write-Host " -ci Set when running on CI server" + Write-Host " -prepareMachine Prepare machine for CI run" + Write-Host " -msbuildEngine Msbuild engine to use to run build ('dotnet', 'vs', or unspecified)." + Write-Host "" + Write-Host "Command line arguments not listed above are passed thru to msbuild." + Write-Host "The above arguments can be shortened as much as to be unambiguous (e.g. -co for configuration, -t for test, etc.)." +} + +function InitializeCustomToolset { + if (-not $restore) { + return + } + + $script = Join-Path $EngRoot "restore-toolset.ps1" + + if (Test-Path $script) { + . $script + } +} + +function Build { + $toolsetBuildProj = InitializeToolset + InitializeCustomToolset + + $bl = if ($binaryLog) { "/bl:" + (Join-Path $LogDir "Build.binlog") } else { "" } + + if ($projects) { + # Re-assign properties to a new variable because PowerShell doesn't let us append properties directly for unclear reasons. + # Explicitly set the type as string[] because otherwise PowerShell would make this char[] if $properties is empty. + [string[]] $msbuildArgs = $properties + $msbuildArgs += "/p:Projects=$projects" + $properties = $msbuildArgs + } + + MSBuild $toolsetBuildProj ` + $bl ` + /p:Configuration=$configuration ` + /p:RepoRoot=$RepoRoot ` + /p:Restore=$restore ` + /p:DeployDeps=$deployDeps ` + /p:Build=$build ` + /p:Rebuild=$rebuild ` + /p:Deploy=$deploy ` + /p:Test=$test ` + /p:Pack=$pack ` + /p:IntegrationTest=$integrationTest ` + /p:PerformanceTest=$performanceTest ` + /p:Sign=$sign ` + /p:Publish=$publish ` + /p:ContinuousIntegrationBuild=$ci ` + @properties +} + +try { + if ($help -or (($properties -ne $null) -and ($properties.Contains("/help") -or $properties.Contains("/?")))) { + Print-Usage + exit 0 + } + + if ($ci) { + $binaryLog = $true + $nodeReuse = $false + } + + # Import custom tools configuration, if present in the repo. + # Note: Import in global scope so that the script set top-level variables without qualification. + $configureToolsetScript = Join-Path $EngRoot "configure-toolset.ps1" + if (Test-Path $configureToolsetScript) { + . $configureToolsetScript + } + + Build +} +catch { + Write-Host $_ + Write-Host $_.Exception + Write-Host $_.ScriptStackTrace + ExitWithExitCode 1 +} + +ExitWithExitCode 0 diff --git a/eng/common/build.sh b/eng/common/build.sh new file mode 100755 index 00000000000..4fe8b41ed70 --- /dev/null +++ b/eng/common/build.sh @@ -0,0 +1,213 @@ +#!/usr/bin/env bash + +# Stop script if unbound variable found (use ${var:-} if intentional) +set -u + +# Stop script if command returns non-zero exit code. +# Prevents hidden errors caused by missing error code propagation. +set -e + +usage() +{ + echo "Common settings:" + echo " --configuration Build configuration: 'Debug' or 'Release' (short: --c)" + echo " --verbosity Msbuild verbosity: q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic] (short: -v)" + echo " --binaryLog Create MSBuild binary log (short: -bl)" + echo "" + echo "Actions:" + echo " --restore Restore dependencies (short: -r)" + echo " --build Build all projects (short: -b)" + echo " --rebuild Rebuild all projects" + echo " --test Run all unit tests (short: -t)" + echo " --sign Sign build outputs" + echo " --publish Publish artifacts (e.g. symbols)" + echo " --pack Package build outputs into NuGet packages and Willow components" + echo " --help Print help and exit (short: -h)" + echo "" + echo "Advanced settings:" + echo " --projects Project or solution file(s) to build" + echo " --ci Set when running on CI server" + echo " --prepareMachine Prepare machine for CI run, clean up processes after build" + echo " --nodeReuse Sets nodereuse msbuild parameter ('true' or 'false')" + echo " --warnAsError Sets warnaserror msbuild parameter ('true' or 'false')" + echo "" + echo "Command line arguments starting with '/p:' are passed through to MSBuild." +} + +source="${BASH_SOURCE[0]}" + +# resolve $source until the file is no longer a symlink +while [[ -h "$source" ]]; do + scriptroot="$( cd -P "$( dirname "$source" )" && pwd )" + source="$(readlink "$source")" + # if $source was a relative symlink, we need to resolve it relative to the path where the + # symlink file was located + [[ $source != /* ]] && source="$scriptroot/$source" +done +scriptroot="$( cd -P "$( dirname "$source" )" && pwd )" + +restore=false +build=false +rebuild=false +test=false +pack=false +publish=false +integration_test=false +performance_test=false +sign=false +public=false +ci=false + +warn_as_error=true +node_reuse=true +binary_log=false + +projects='' +configuration='Debug' +prepare_machine=false +verbosity='minimal' +properties='' + +while [[ $# > 0 ]]; do + opt="$(echo "$1" | awk '{print tolower($0)}')" + case "$opt" in + --help|-h) + usage + exit 0 + ;; + --configuration|-c) + configuration=$2 + shift + ;; + --verbosity|-v) + verbosity=$2 + shift + ;; + --binarylog|-bl) + binary_log=true + ;; + --restore|-r) + restore=true + ;; + --build|-b) + build=true + ;; + --rebuild) + rebuild=true + ;; + --pack) + pack=true + ;; + --test|-t) + test=true + ;; + --integrationtest) + integration_test=true + ;; + --performancetest) + performance_test=true + ;; + --sign) + sign=true + ;; + --publish) + publish=true + ;; + --preparemachine) + prepare_machine=true + ;; + --projects) + projects=$2 + shift + ;; + --ci) + ci=true + ;; + --warnaserror) + warn_as_error=$2 + shift + ;; + --nodereuse) + node_reuse=$2 + shift + ;; + /p:*) + properties="$properties $1" + ;; + /m:*) + properties="$properties $1" + ;; + /bl:*) + properties="$properties $1" + ;; + *) + echo "Invalid argument: $1" + usage + exit 1 + ;; + esac + + shift +done + +if [[ "$ci" == true ]]; then + binary_log=true + node_reuse=false +fi + +. "$scriptroot/tools.sh" + +function InitializeCustomToolset { + local script="$eng_root/restore-toolset.sh" + + if [[ -a "$script" ]]; then + . "$script" + fi +} + +function Build { + InitializeToolset + InitializeCustomToolset + + if [[ ! -z "$projects" ]]; then + properties="$properties /p:Projects=$projects" + fi + + local bl="" + if [[ "$binary_log" == true ]]; then + bl="/bl:\"$log_dir/Build.binlog\"" + fi + + MSBuild $_InitializeToolset \ + $bl \ + /p:Configuration=$configuration \ + /p:RepoRoot="$repo_root" \ + /p:Restore=$restore \ + /p:Build=$build \ + /p:Rebuild=$rebuild \ + /p:Test=$test \ + /p:Pack=$pack \ + /p:IntegrationTest=$integration_test \ + /p:PerformanceTest=$performance_test \ + /p:Sign=$sign \ + /p:Publish=$publish \ + /p:ContinuousIntegrationBuild=$ci \ + $properties + + ExitWithExitCode 0 +} + +# Import custom tools configuration, if present in the repo. +configure_toolset_script="$eng_root/configure-toolset.sh" +if [[ -a "$configure_toolset_script" ]]; then + . "$configure_toolset_script" +fi + +# TODO: https://github.com/dotnet/arcade/issues/1468 +# Temporary workaround to avoid breaking change. +# Remove once repos are updated. +if [[ -n "${useInstalledDotNetCli:-}" ]]; then + use_installed_dotnet_cli="$useInstalledDotNetCli" +fi + +Build diff --git a/eng/common/cibuild.sh b/eng/common/cibuild.sh new file mode 100755 index 00000000000..1a02c0dec8f --- /dev/null +++ b/eng/common/cibuild.sh @@ -0,0 +1,16 @@ +#!/usr/bin/env bash + +source="${BASH_SOURCE[0]}" + +# resolve $SOURCE until the file is no longer a symlink +while [[ -h $source ]]; do + scriptroot="$( cd -P "$( dirname "$source" )" && pwd )" + source="$(readlink "$source")" + + # if $source was a relative symlink, we need to resolve it relative to the path where + # the symlink file was located + [[ $source != /* ]] && source="$scriptroot/$source" +done +scriptroot="$( cd -P "$( dirname "$source" )" && pwd )" + +. "$scriptroot/build.sh" --restore --build --test --pack --publish --ci $@ \ No newline at end of file diff --git a/eng/common/cross/android/arm/toolchain.cmake b/eng/common/cross/android/arm/toolchain.cmake new file mode 100644 index 00000000000..a7e1c73501b --- /dev/null +++ b/eng/common/cross/android/arm/toolchain.cmake @@ -0,0 +1,41 @@ +set(CROSS_NDK_TOOLCHAIN $ENV{ROOTFS_DIR}/../) +set(CROSS_ROOTFS ${CROSS_NDK_TOOLCHAIN}/sysroot) +set(CLR_CMAKE_PLATFORM_ANDROID "Android") + +set(CMAKE_SYSTEM_NAME Linux) +set(CMAKE_SYSTEM_VERSION 1) +set(CMAKE_SYSTEM_PROCESSOR arm) + +## Specify the toolchain +set(TOOLCHAIN "arm-linux-androideabi") +set(CMAKE_PREFIX_PATH ${CROSS_NDK_TOOLCHAIN}) +set(TOOLCHAIN_PREFIX ${TOOLCHAIN}-) + +find_program(CMAKE_C_COMPILER ${TOOLCHAIN_PREFIX}clang) +find_program(CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}clang++) +find_program(CMAKE_ASM_COMPILER ${TOOLCHAIN_PREFIX}clang) +find_program(CMAKE_AR ${TOOLCHAIN_PREFIX}ar) +find_program(CMAKE_LD ${TOOLCHAIN_PREFIX}ar) +find_program(CMAKE_OBJCOPY ${TOOLCHAIN_PREFIX}objcopy) +find_program(CMAKE_OBJDUMP ${TOOLCHAIN_PREFIX}objdump) + +add_compile_options(--sysroot=${CROSS_ROOTFS}) +add_compile_options(-fPIE) +add_compile_options(-mfloat-abi=soft) +include_directories(SYSTEM ${CROSS_NDK_TOOLCHAIN}/include/c++/4.9.x/) +include_directories(SYSTEM ${CROSS_NDK_TOOLCHAIN}/include/c++/4.9.x/arm-linux-androideabi/) + +set(CROSS_LINK_FLAGS "${CROSS_LINK_FLAGS} -B ${CROSS_ROOTFS}/usr/lib/gcc/${TOOLCHAIN}") +set(CROSS_LINK_FLAGS "${CROSS_LINK_FLAGS} -L${CROSS_ROOTFS}/lib/${TOOLCHAIN}") +set(CROSS_LINK_FLAGS "${CROSS_LINK_FLAGS} --sysroot=${CROSS_ROOTFS}") +set(CROSS_LINK_FLAGS "${CROSS_LINK_FLAGS} -fPIE -pie") + +set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${CROSS_LINK_FLAGS}" CACHE STRING "" FORCE) +set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${CROSS_LINK_FLAGS}" CACHE STRING "" FORCE) +set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${CROSS_LINK_FLAGS}" CACHE STRING "" FORCE) + +set(CMAKE_FIND_ROOT_PATH "${CROSS_ROOTFS}") +set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) +set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) +set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) +set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) diff --git a/eng/common/cross/android/arm64/toolchain.cmake b/eng/common/cross/android/arm64/toolchain.cmake new file mode 100644 index 00000000000..29415899c1c --- /dev/null +++ b/eng/common/cross/android/arm64/toolchain.cmake @@ -0,0 +1,42 @@ +set(CROSS_NDK_TOOLCHAIN $ENV{ROOTFS_DIR}/../) +set(CROSS_ROOTFS ${CROSS_NDK_TOOLCHAIN}/sysroot) +set(CLR_CMAKE_PLATFORM_ANDROID "Android") + +set(CMAKE_SYSTEM_NAME Linux) +set(CMAKE_SYSTEM_VERSION 1) +set(CMAKE_SYSTEM_PROCESSOR aarch64) + +## Specify the toolchain +set(TOOLCHAIN "aarch64-linux-android") +set(CMAKE_PREFIX_PATH ${CROSS_NDK_TOOLCHAIN}) +set(TOOLCHAIN_PREFIX ${TOOLCHAIN}-) + +find_program(CMAKE_C_COMPILER ${TOOLCHAIN_PREFIX}clang) +find_program(CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}clang++) +find_program(CMAKE_ASM_COMPILER ${TOOLCHAIN_PREFIX}clang) +find_program(CMAKE_AR ${TOOLCHAIN_PREFIX}ar) +find_program(CMAKE_LD ${TOOLCHAIN_PREFIX}ar) +find_program(CMAKE_OBJCOPY ${TOOLCHAIN_PREFIX}objcopy) +find_program(CMAKE_OBJDUMP ${TOOLCHAIN_PREFIX}objdump) + +add_compile_options(--sysroot=${CROSS_ROOTFS}) +add_compile_options(-fPIE) + +## Needed for Android or bionic specific conditionals +add_compile_options(-D__ANDROID__) +add_compile_options(-D__BIONIC__) + +set(CROSS_LINK_FLAGS "${CROSS_LINK_FLAGS} -B ${CROSS_ROOTFS}/usr/lib/gcc/${TOOLCHAIN}") +set(CROSS_LINK_FLAGS "${CROSS_LINK_FLAGS} -L${CROSS_ROOTFS}/lib/${TOOLCHAIN}") +set(CROSS_LINK_FLAGS "${CROSS_LINK_FLAGS} --sysroot=${CROSS_ROOTFS}") +set(CROSS_LINK_FLAGS "${CROSS_LINK_FLAGS} -fPIE -pie") + +set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${CROSS_LINK_FLAGS}" CACHE STRING "" FORCE) +set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${CROSS_LINK_FLAGS}" CACHE STRING "" FORCE) +set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${CROSS_LINK_FLAGS}" CACHE STRING "" FORCE) + +set(CMAKE_FIND_ROOT_PATH "${CROSS_ROOTFS}") +set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) +set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) +set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) +set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) diff --git a/eng/common/cross/arm/sources.list.bionic b/eng/common/cross/arm/sources.list.bionic new file mode 100644 index 00000000000..21095574095 --- /dev/null +++ b/eng/common/cross/arm/sources.list.bionic @@ -0,0 +1,11 @@ +deb http://ports.ubuntu.com/ubuntu-ports/ bionic main restricted universe +deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic main restricted universe + +deb http://ports.ubuntu.com/ubuntu-ports/ bionic-updates main restricted universe +deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic-updates main restricted universe + +deb http://ports.ubuntu.com/ubuntu-ports/ bionic-backports main restricted +deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic-backports main restricted + +deb http://ports.ubuntu.com/ubuntu-ports/ bionic-security main restricted universe multiverse +deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic-security main restricted universe multiverse diff --git a/eng/common/cross/arm/sources.list.jessie b/eng/common/cross/arm/sources.list.jessie new file mode 100644 index 00000000000..4d142ac9b10 --- /dev/null +++ b/eng/common/cross/arm/sources.list.jessie @@ -0,0 +1,3 @@ +# Debian (sid) # UNSTABLE +deb http://ftp.debian.org/debian/ sid main contrib non-free +deb-src http://ftp.debian.org/debian/ sid main contrib non-free diff --git a/eng/common/cross/arm/sources.list.trusty b/eng/common/cross/arm/sources.list.trusty new file mode 100644 index 00000000000..07d8f88d82e --- /dev/null +++ b/eng/common/cross/arm/sources.list.trusty @@ -0,0 +1,11 @@ +deb http://ports.ubuntu.com/ubuntu-ports/ trusty main restricted universe +deb-src http://ports.ubuntu.com/ubuntu-ports/ trusty main restricted universe + +deb http://ports.ubuntu.com/ubuntu-ports/ trusty-updates main restricted universe +deb-src http://ports.ubuntu.com/ubuntu-ports/ trusty-updates main restricted universe + +deb http://ports.ubuntu.com/ubuntu-ports/ trusty-backports main restricted +deb-src http://ports.ubuntu.com/ubuntu-ports/ trusty-backports main restricted + +deb http://ports.ubuntu.com/ubuntu-ports/ trusty-security main restricted universe multiverse +deb-src http://ports.ubuntu.com/ubuntu-ports/ trusty-security main restricted universe multiverse \ No newline at end of file diff --git a/eng/common/cross/arm/sources.list.vivid b/eng/common/cross/arm/sources.list.vivid new file mode 100644 index 00000000000..0b1215e475a --- /dev/null +++ b/eng/common/cross/arm/sources.list.vivid @@ -0,0 +1,11 @@ +deb http://ports.ubuntu.com/ubuntu-ports/ vivid main restricted universe +deb-src http://ports.ubuntu.com/ubuntu-ports/ vivid main restricted universe + +deb http://ports.ubuntu.com/ubuntu-ports/ vivid-updates main restricted universe +deb-src http://ports.ubuntu.com/ubuntu-ports/ vivid-updates main restricted universe + +deb http://ports.ubuntu.com/ubuntu-ports/ vivid-backports main restricted +deb-src http://ports.ubuntu.com/ubuntu-ports/ vivid-backports main restricted + +deb http://ports.ubuntu.com/ubuntu-ports/ vivid-security main restricted universe multiverse +deb-src http://ports.ubuntu.com/ubuntu-ports/ vivid-security main restricted universe multiverse \ No newline at end of file diff --git a/eng/common/cross/arm/sources.list.wily b/eng/common/cross/arm/sources.list.wily new file mode 100644 index 00000000000..e23d1e02a05 --- /dev/null +++ b/eng/common/cross/arm/sources.list.wily @@ -0,0 +1,11 @@ +deb http://ports.ubuntu.com/ubuntu-ports/ wily main restricted universe +deb-src http://ports.ubuntu.com/ubuntu-ports/ wily main restricted universe + +deb http://ports.ubuntu.com/ubuntu-ports/ wily-updates main restricted universe +deb-src http://ports.ubuntu.com/ubuntu-ports/ wily-updates main restricted universe + +deb http://ports.ubuntu.com/ubuntu-ports/ wily-backports main restricted +deb-src http://ports.ubuntu.com/ubuntu-ports/ wily-backports main restricted + +deb http://ports.ubuntu.com/ubuntu-ports/ wily-security main restricted universe multiverse +deb-src http://ports.ubuntu.com/ubuntu-ports/ wily-security main restricted universe multiverse \ No newline at end of file diff --git a/eng/common/cross/arm/sources.list.xenial b/eng/common/cross/arm/sources.list.xenial new file mode 100644 index 00000000000..eacd86b7df3 --- /dev/null +++ b/eng/common/cross/arm/sources.list.xenial @@ -0,0 +1,11 @@ +deb http://ports.ubuntu.com/ubuntu-ports/ xenial main restricted universe +deb-src http://ports.ubuntu.com/ubuntu-ports/ xenial main restricted universe + +deb http://ports.ubuntu.com/ubuntu-ports/ xenial-updates main restricted universe +deb-src http://ports.ubuntu.com/ubuntu-ports/ xenial-updates main restricted universe + +deb http://ports.ubuntu.com/ubuntu-ports/ xenial-backports main restricted +deb-src http://ports.ubuntu.com/ubuntu-ports/ xenial-backports main restricted + +deb http://ports.ubuntu.com/ubuntu-ports/ xenial-security main restricted universe multiverse +deb-src http://ports.ubuntu.com/ubuntu-ports/ xenial-security main restricted universe multiverse \ No newline at end of file diff --git a/eng/common/cross/arm/sources.list.zesty b/eng/common/cross/arm/sources.list.zesty new file mode 100644 index 00000000000..ea2c14a7874 --- /dev/null +++ b/eng/common/cross/arm/sources.list.zesty @@ -0,0 +1,11 @@ +deb http://ports.ubuntu.com/ubuntu-ports/ zesty main restricted universe +deb-src http://ports.ubuntu.com/ubuntu-ports/ zesty main restricted universe + +deb http://ports.ubuntu.com/ubuntu-ports/ zesty-updates main restricted universe +deb-src http://ports.ubuntu.com/ubuntu-ports/ zesty-updates main restricted universe + +deb http://ports.ubuntu.com/ubuntu-ports/ zesty-backports main restricted +deb-src http://ports.ubuntu.com/ubuntu-ports/ zesty-backports main restricted + +deb http://ports.ubuntu.com/ubuntu-ports/ zesty-security main restricted universe multiverse +deb-src http://ports.ubuntu.com/ubuntu-ports/ zesty-security main restricted universe multiverse diff --git a/eng/common/cross/arm/trusty-lttng-2.4.patch b/eng/common/cross/arm/trusty-lttng-2.4.patch new file mode 100644 index 00000000000..8e4dd7ae719 --- /dev/null +++ b/eng/common/cross/arm/trusty-lttng-2.4.patch @@ -0,0 +1,71 @@ +From e72c9d7ead60e3317bd6d1fade995c07021c947b Mon Sep 17 00:00:00 2001 +From: Mathieu Desnoyers +Date: Thu, 7 May 2015 13:25:04 -0400 +Subject: [PATCH] Fix: building probe providers with C++ compiler + +Robert Daniels wrote: +> > I'm attempting to use lttng userspace tracing with a C++ application +> > on an ARM platform. I'm using GCC 4.8.4 on Linux 3.14 with the 2.6 +> > release of lttng. I've compiled lttng-modules, lttng-ust, and +> > lttng-tools and have been able to get a simple test working with C +> > code. When I attempt to run the hello.cxx test on my target it will +> > segfault. +> +> +> I spent a little time digging into this issue and finally discovered the +> cause of my segfault with ARM C++ tracepoints. +> +> There is a struct called 'lttng_event' in ust-events.h which contains an +> empty union 'u'. This was the cause of my issue. Under C, this empty union +> compiles to a zero byte member while under C++ it compiles to a one byte +> member, and in my case was four-byte aligned which caused my C++ code to +> have the 'cds_list_head node' offset incorrectly by four bytes. This lead +> to an incorrect linked list structure which caused my issue. +> +> Since this union is empty, I simply removed it from the struct and everything +> worked correctly. +> +> I don't know the history or purpose behind this empty union so I'd like to +> know if this is a safe fix. If it is I can submit a patch with the union +> removed. + +That's a very nice catch! + +We do not support building tracepoint probe provider with +g++ yet, as stated in lttng-ust(3): + +"- Note for C++ support: although an application instrumented with + tracepoints can be compiled with g++, tracepoint probes should be + compiled with gcc (only tested with gcc so far)." + +However, if it works fine with this fix, then I'm tempted to take it, +especially because removing the empty union does not appear to affect +the layout of struct lttng_event as seen from liblttng-ust, which must +be compiled with a C compiler, and from probe providers compiled with +a C compiler. So all we are changing is the layout of a probe provider +compiled with a C++ compiler, which is anyway buggy at the moment, +because it is not compatible with the layout expected by liblttng-ust +compiled with a C compiler. + +Reported-by: Robert Daniels +Signed-off-by: Mathieu Desnoyers +--- + include/lttng/ust-events.h | 2 -- + 1 file changed, 2 deletions(-) + +diff --git a/usr/include/lttng/ust-events.h b/usr/include/lttng/ust-events.h +index 328a875..3d7a274 100644 +--- a/usr/include/lttng/ust-events.h ++++ b/usr/include/lttng/ust-events.h +@@ -407,8 +407,6 @@ struct lttng_event { + void *_deprecated1; + struct lttng_ctx *ctx; + enum lttng_ust_instrumentation instrumentation; +- union { +- } u; + struct cds_list_head node; /* Event list in session */ + struct cds_list_head _deprecated2; + void *_deprecated3; +-- +2.7.4 + diff --git a/eng/common/cross/arm/trusty.patch b/eng/common/cross/arm/trusty.patch new file mode 100644 index 00000000000..2f2972f8eb5 --- /dev/null +++ b/eng/common/cross/arm/trusty.patch @@ -0,0 +1,97 @@ +diff -u -r a/usr/include/urcu/uatomic/generic.h b/usr/include/urcu/uatomic/generic.h +--- a/usr/include/urcu/uatomic/generic.h 2014-03-28 06:04:42.000000000 +0900 ++++ b/usr/include/urcu/uatomic/generic.h 2017-02-13 10:35:21.189927116 +0900 +@@ -65,17 +65,17 @@ + switch (len) { + #ifdef UATOMIC_HAS_ATOMIC_BYTE + case 1: +- return __sync_val_compare_and_swap_1(addr, old, _new); ++ return __sync_val_compare_and_swap_1((uint8_t *) addr, old, _new); + #endif + #ifdef UATOMIC_HAS_ATOMIC_SHORT + case 2: +- return __sync_val_compare_and_swap_2(addr, old, _new); ++ return __sync_val_compare_and_swap_2((uint16_t *) addr, old, _new); + #endif + case 4: +- return __sync_val_compare_and_swap_4(addr, old, _new); ++ return __sync_val_compare_and_swap_4((uint32_t *) addr, old, _new); + #if (CAA_BITS_PER_LONG == 64) + case 8: +- return __sync_val_compare_and_swap_8(addr, old, _new); ++ return __sync_val_compare_and_swap_8((uint64_t *) addr, old, _new); + #endif + } + _uatomic_link_error(); +@@ -100,20 +100,20 @@ + switch (len) { + #ifdef UATOMIC_HAS_ATOMIC_BYTE + case 1: +- __sync_and_and_fetch_1(addr, val); ++ __sync_and_and_fetch_1((uint8_t *) addr, val); + return; + #endif + #ifdef UATOMIC_HAS_ATOMIC_SHORT + case 2: +- __sync_and_and_fetch_2(addr, val); ++ __sync_and_and_fetch_2((uint16_t *) addr, val); + return; + #endif + case 4: +- __sync_and_and_fetch_4(addr, val); ++ __sync_and_and_fetch_4((uint32_t *) addr, val); + return; + #if (CAA_BITS_PER_LONG == 64) + case 8: +- __sync_and_and_fetch_8(addr, val); ++ __sync_and_and_fetch_8((uint64_t *) addr, val); + return; + #endif + } +@@ -139,20 +139,20 @@ + switch (len) { + #ifdef UATOMIC_HAS_ATOMIC_BYTE + case 1: +- __sync_or_and_fetch_1(addr, val); ++ __sync_or_and_fetch_1((uint8_t *) addr, val); + return; + #endif + #ifdef UATOMIC_HAS_ATOMIC_SHORT + case 2: +- __sync_or_and_fetch_2(addr, val); ++ __sync_or_and_fetch_2((uint16_t *) addr, val); + return; + #endif + case 4: +- __sync_or_and_fetch_4(addr, val); ++ __sync_or_and_fetch_4((uint32_t *) addr, val); + return; + #if (CAA_BITS_PER_LONG == 64) + case 8: +- __sync_or_and_fetch_8(addr, val); ++ __sync_or_and_fetch_8((uint64_t *) addr, val); + return; + #endif + } +@@ -180,17 +180,17 @@ + switch (len) { + #ifdef UATOMIC_HAS_ATOMIC_BYTE + case 1: +- return __sync_add_and_fetch_1(addr, val); ++ return __sync_add_and_fetch_1((uint8_t *) addr, val); + #endif + #ifdef UATOMIC_HAS_ATOMIC_SHORT + case 2: +- return __sync_add_and_fetch_2(addr, val); ++ return __sync_add_and_fetch_2((uint16_t *) addr, val); + #endif + case 4: +- return __sync_add_and_fetch_4(addr, val); ++ return __sync_add_and_fetch_4((uint32_t *) addr, val); + #if (CAA_BITS_PER_LONG == 64) + case 8: +- return __sync_add_and_fetch_8(addr, val); ++ return __sync_add_and_fetch_8((uint64_t *) addr, val); + #endif + } + _uatomic_link_error(); diff --git a/eng/common/cross/arm64/sources.list.bionic b/eng/common/cross/arm64/sources.list.bionic new file mode 100644 index 00000000000..21095574095 --- /dev/null +++ b/eng/common/cross/arm64/sources.list.bionic @@ -0,0 +1,11 @@ +deb http://ports.ubuntu.com/ubuntu-ports/ bionic main restricted universe +deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic main restricted universe + +deb http://ports.ubuntu.com/ubuntu-ports/ bionic-updates main restricted universe +deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic-updates main restricted universe + +deb http://ports.ubuntu.com/ubuntu-ports/ bionic-backports main restricted +deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic-backports main restricted + +deb http://ports.ubuntu.com/ubuntu-ports/ bionic-security main restricted universe multiverse +deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic-security main restricted universe multiverse diff --git a/eng/common/cross/arm64/sources.list.trusty b/eng/common/cross/arm64/sources.list.trusty new file mode 100644 index 00000000000..07d8f88d82e --- /dev/null +++ b/eng/common/cross/arm64/sources.list.trusty @@ -0,0 +1,11 @@ +deb http://ports.ubuntu.com/ubuntu-ports/ trusty main restricted universe +deb-src http://ports.ubuntu.com/ubuntu-ports/ trusty main restricted universe + +deb http://ports.ubuntu.com/ubuntu-ports/ trusty-updates main restricted universe +deb-src http://ports.ubuntu.com/ubuntu-ports/ trusty-updates main restricted universe + +deb http://ports.ubuntu.com/ubuntu-ports/ trusty-backports main restricted +deb-src http://ports.ubuntu.com/ubuntu-ports/ trusty-backports main restricted + +deb http://ports.ubuntu.com/ubuntu-ports/ trusty-security main restricted universe multiverse +deb-src http://ports.ubuntu.com/ubuntu-ports/ trusty-security main restricted universe multiverse \ No newline at end of file diff --git a/eng/common/cross/arm64/sources.list.vivid b/eng/common/cross/arm64/sources.list.vivid new file mode 100644 index 00000000000..0b1215e475a --- /dev/null +++ b/eng/common/cross/arm64/sources.list.vivid @@ -0,0 +1,11 @@ +deb http://ports.ubuntu.com/ubuntu-ports/ vivid main restricted universe +deb-src http://ports.ubuntu.com/ubuntu-ports/ vivid main restricted universe + +deb http://ports.ubuntu.com/ubuntu-ports/ vivid-updates main restricted universe +deb-src http://ports.ubuntu.com/ubuntu-ports/ vivid-updates main restricted universe + +deb http://ports.ubuntu.com/ubuntu-ports/ vivid-backports main restricted +deb-src http://ports.ubuntu.com/ubuntu-ports/ vivid-backports main restricted + +deb http://ports.ubuntu.com/ubuntu-ports/ vivid-security main restricted universe multiverse +deb-src http://ports.ubuntu.com/ubuntu-ports/ vivid-security main restricted universe multiverse \ No newline at end of file diff --git a/eng/common/cross/arm64/sources.list.wily b/eng/common/cross/arm64/sources.list.wily new file mode 100644 index 00000000000..e23d1e02a05 --- /dev/null +++ b/eng/common/cross/arm64/sources.list.wily @@ -0,0 +1,11 @@ +deb http://ports.ubuntu.com/ubuntu-ports/ wily main restricted universe +deb-src http://ports.ubuntu.com/ubuntu-ports/ wily main restricted universe + +deb http://ports.ubuntu.com/ubuntu-ports/ wily-updates main restricted universe +deb-src http://ports.ubuntu.com/ubuntu-ports/ wily-updates main restricted universe + +deb http://ports.ubuntu.com/ubuntu-ports/ wily-backports main restricted +deb-src http://ports.ubuntu.com/ubuntu-ports/ wily-backports main restricted + +deb http://ports.ubuntu.com/ubuntu-ports/ wily-security main restricted universe multiverse +deb-src http://ports.ubuntu.com/ubuntu-ports/ wily-security main restricted universe multiverse \ No newline at end of file diff --git a/eng/common/cross/arm64/sources.list.xenial b/eng/common/cross/arm64/sources.list.xenial new file mode 100644 index 00000000000..eacd86b7df3 --- /dev/null +++ b/eng/common/cross/arm64/sources.list.xenial @@ -0,0 +1,11 @@ +deb http://ports.ubuntu.com/ubuntu-ports/ xenial main restricted universe +deb-src http://ports.ubuntu.com/ubuntu-ports/ xenial main restricted universe + +deb http://ports.ubuntu.com/ubuntu-ports/ xenial-updates main restricted universe +deb-src http://ports.ubuntu.com/ubuntu-ports/ xenial-updates main restricted universe + +deb http://ports.ubuntu.com/ubuntu-ports/ xenial-backports main restricted +deb-src http://ports.ubuntu.com/ubuntu-ports/ xenial-backports main restricted + +deb http://ports.ubuntu.com/ubuntu-ports/ xenial-security main restricted universe multiverse +deb-src http://ports.ubuntu.com/ubuntu-ports/ xenial-security main restricted universe multiverse \ No newline at end of file diff --git a/eng/common/cross/arm64/sources.list.zesty b/eng/common/cross/arm64/sources.list.zesty new file mode 100644 index 00000000000..ea2c14a7874 --- /dev/null +++ b/eng/common/cross/arm64/sources.list.zesty @@ -0,0 +1,11 @@ +deb http://ports.ubuntu.com/ubuntu-ports/ zesty main restricted universe +deb-src http://ports.ubuntu.com/ubuntu-ports/ zesty main restricted universe + +deb http://ports.ubuntu.com/ubuntu-ports/ zesty-updates main restricted universe +deb-src http://ports.ubuntu.com/ubuntu-ports/ zesty-updates main restricted universe + +deb http://ports.ubuntu.com/ubuntu-ports/ zesty-backports main restricted +deb-src http://ports.ubuntu.com/ubuntu-ports/ zesty-backports main restricted + +deb http://ports.ubuntu.com/ubuntu-ports/ zesty-security main restricted universe multiverse +deb-src http://ports.ubuntu.com/ubuntu-ports/ zesty-security main restricted universe multiverse diff --git a/eng/common/cross/armel/sources.list.jessie b/eng/common/cross/armel/sources.list.jessie new file mode 100644 index 00000000000..3d9c3059d89 --- /dev/null +++ b/eng/common/cross/armel/sources.list.jessie @@ -0,0 +1,3 @@ +# Debian (jessie) # Stable +deb http://ftp.debian.org/debian/ jessie main contrib non-free +deb-src http://ftp.debian.org/debian/ jessie main contrib non-free diff --git a/eng/common/cross/armel/tizen-build-rootfs.sh b/eng/common/cross/armel/tizen-build-rootfs.sh new file mode 100755 index 00000000000..87c48e78fbb --- /dev/null +++ b/eng/common/cross/armel/tizen-build-rootfs.sh @@ -0,0 +1,44 @@ +#!/usr/bin/env bash +set -e + +__ARM_SOFTFP_CrossDir=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) +__TIZEN_CROSSDIR="$__ARM_SOFTFP_CrossDir/tizen" + +if [[ -z "$ROOTFS_DIR" ]]; then + echo "ROOTFS_DIR is not defined." + exit 1; +fi + +# Clean-up (TODO-Cleanup: We may already delete $ROOTFS_DIR at ./cross/build-rootfs.sh.) +# hk0110 +if [ -d "$ROOTFS_DIR" ]; then + umount $ROOTFS_DIR/* + rm -rf $ROOTFS_DIR +fi + +TIZEN_TMP_DIR=$ROOTFS_DIR/tizen_tmp +mkdir -p $TIZEN_TMP_DIR + +# Download files +echo ">>Start downloading files" +VERBOSE=1 $__ARM_SOFTFP_CrossDir/tizen-fetch.sh $TIZEN_TMP_DIR +echo "<>Start constructing Tizen rootfs" +TIZEN_RPM_FILES=`ls $TIZEN_TMP_DIR/*.rpm` +cd $ROOTFS_DIR +for f in $TIZEN_RPM_FILES; do + rpm2cpio $f | cpio -idm --quiet +done +echo "<>Start configuring Tizen rootfs" +rm ./usr/lib/libunwind.so +ln -s libunwind.so.8 ./usr/lib/libunwind.so +ln -sfn asm-arm ./usr/include/asm +patch -p1 < $__TIZEN_CROSSDIR/tizen.patch +echo "</dev/null; then + VERBOSE=0 +fi + +Log() +{ + if [ $VERBOSE -ge $1 ]; then + echo ${@:2} + fi +} + +Inform() +{ + Log 1 -e "\x1B[0;34m$@\x1B[m" +} + +Debug() +{ + Log 2 -e "\x1B[0;32m$@\x1B[m" +} + +Error() +{ + >&2 Log 0 -e "\x1B[0;31m$@\x1B[m" +} + +Fetch() +{ + URL=$1 + FILE=$2 + PROGRESS=$3 + if [ $VERBOSE -ge 1 ] && [ $PROGRESS ]; then + CURL_OPT="--progress-bar" + else + CURL_OPT="--silent" + fi + curl $CURL_OPT $URL > $FILE +} + +hash curl 2> /dev/null || { Error "Require 'curl' Aborting."; exit 1; } +hash xmllint 2> /dev/null || { Error "Require 'xmllint' Aborting."; exit 1; } +hash sha256sum 2> /dev/null || { Error "Require 'sha256sum' Aborting."; exit 1; } + +TMPDIR=$1 +if [ ! -d $TMPDIR ]; then + TMPDIR=./tizen_tmp + Debug "Create temporary directory : $TMPDIR" + mkdir -p $TMPDIR +fi + +TIZEN_URL=http://download.tizen.org/releases/milestone/tizen +BUILD_XML=build.xml +REPOMD_XML=repomd.xml +PRIMARY_XML=primary.xml +TARGET_URL="http://__not_initialized" + +Xpath_get() +{ + XPATH_RESULT='' + XPATH=$1 + XML_FILE=$2 + RESULT=$(xmllint --xpath $XPATH $XML_FILE) + if [[ -z ${RESULT// } ]]; then + Error "Can not find target from $XML_FILE" + Debug "Xpath = $XPATH" + exit 1 + fi + XPATH_RESULT=$RESULT +} + +fetch_tizen_pkgs_init() +{ + TARGET=$1 + PROFILE=$2 + Debug "Initialize TARGET=$TARGET, PROFILE=$PROFILE" + + TMP_PKG_DIR=$TMPDIR/tizen_${PROFILE}_pkgs + if [ -d $TMP_PKG_DIR ]; then rm -rf $TMP_PKG_DIR; fi + mkdir -p $TMP_PKG_DIR + + PKG_URL=$TIZEN_URL/$PROFILE/latest + + BUILD_XML_URL=$PKG_URL/$BUILD_XML + TMP_BUILD=$TMP_PKG_DIR/$BUILD_XML + TMP_REPOMD=$TMP_PKG_DIR/$REPOMD_XML + TMP_PRIMARY=$TMP_PKG_DIR/$PRIMARY_XML + TMP_PRIMARYGZ=${TMP_PRIMARY}.gz + + Fetch $BUILD_XML_URL $TMP_BUILD + + Debug "fetch $BUILD_XML_URL to $TMP_BUILD" + + TARGET_XPATH="//build/buildtargets/buildtarget[@name=\"$TARGET\"]/repo[@type=\"binary\"]/text()" + Xpath_get $TARGET_XPATH $TMP_BUILD + TARGET_PATH=$XPATH_RESULT + TARGET_URL=$PKG_URL/$TARGET_PATH + + REPOMD_URL=$TARGET_URL/repodata/repomd.xml + PRIMARY_XPATH='string(//*[local-name()="data"][@type="primary"]/*[local-name()="location"]/@href)' + + Fetch $REPOMD_URL $TMP_REPOMD + + Debug "fetch $REPOMD_URL to $TMP_REPOMD" + + Xpath_get $PRIMARY_XPATH $TMP_REPOMD + PRIMARY_XML_PATH=$XPATH_RESULT + PRIMARY_URL=$TARGET_URL/$PRIMARY_XML_PATH + + Fetch $PRIMARY_URL $TMP_PRIMARYGZ + + Debug "fetch $PRIMARY_URL to $TMP_PRIMARYGZ" + + gunzip $TMP_PRIMARYGZ + + Debug "unzip $TMP_PRIMARYGZ to $TMP_PRIMARY" +} + +fetch_tizen_pkgs() +{ + ARCH=$1 + PACKAGE_XPATH_TPL='string(//*[local-name()="metadata"]/*[local-name()="package"][*[local-name()="name"][text()="_PKG_"]][*[local-name()="arch"][text()="_ARCH_"]]/*[local-name()="location"]/@href)' + + PACKAGE_CHECKSUM_XPATH_TPL='string(//*[local-name()="metadata"]/*[local-name()="package"][*[local-name()="name"][text()="_PKG_"]][*[local-name()="arch"][text()="_ARCH_"]]/*[local-name()="checksum"]/text())' + + for pkg in ${@:2} + do + Inform "Fetching... $pkg" + XPATH=${PACKAGE_XPATH_TPL/_PKG_/$pkg} + XPATH=${XPATH/_ARCH_/$ARCH} + Xpath_get $XPATH $TMP_PRIMARY + PKG_PATH=$XPATH_RESULT + + XPATH=${PACKAGE_CHECKSUM_XPATH_TPL/_PKG_/$pkg} + XPATH=${XPATH/_ARCH_/$ARCH} + Xpath_get $XPATH $TMP_PRIMARY + CHECKSUM=$XPATH_RESULT + + PKG_URL=$TARGET_URL/$PKG_PATH + PKG_FILE=$(basename $PKG_PATH) + PKG_PATH=$TMPDIR/$PKG_FILE + + Debug "Download $PKG_URL to $PKG_PATH" + Fetch $PKG_URL $PKG_PATH true + + echo "$CHECKSUM $PKG_PATH" | sha256sum -c - > /dev/null + if [ $? -ne 0 ]; then + Error "Fail to fetch $PKG_URL to $PKG_PATH" + Debug "Checksum = $CHECKSUM" + exit 1 + fi + done +} + +Inform "Initialize arm base" +fetch_tizen_pkgs_init standard base +Inform "fetch common packages" +fetch_tizen_pkgs armv7l gcc glibc glibc-devel libicu libicu-devel +fetch_tizen_pkgs noarch linux-glibc-devel +Inform "fetch coreclr packages" +fetch_tizen_pkgs armv7l lldb lldb-devel libgcc libstdc++ libstdc++-devel libunwind libunwind-devel tizen-release lttng-ust-devel lttng-ust userspace-rcu-devel userspace-rcu +Inform "fetch corefx packages" +fetch_tizen_pkgs armv7l libcom_err libcom_err-devel zlib zlib-devel libopenssl libopenssl-devel krb5 krb5-devel libcurl libcurl-devel + +Inform "Initialize standard unified" +fetch_tizen_pkgs_init standard unified +Inform "fetch corefx packages" +fetch_tizen_pkgs armv7l gssdp gssdp-devel + diff --git a/eng/common/cross/armel/tizen/tizen-dotnet.ks b/eng/common/cross/armel/tizen/tizen-dotnet.ks new file mode 100644 index 00000000000..506d455bd4f --- /dev/null +++ b/eng/common/cross/armel/tizen/tizen-dotnet.ks @@ -0,0 +1,50 @@ +lang en_US.UTF-8 +keyboard us +timezone --utc Asia/Seoul + +part / --fstype="ext4" --size=3500 --ondisk=mmcblk0 --label rootfs --fsoptions=defaults,noatime + +rootpw tizen +desktop --autologinuser=root +user --name root --groups audio,video --password 'tizen' + +repo --name=standard --baseurl=http://download.tizen.org/releases/milestone/tizen/unified/latest/repos/standard/packages/ --ssl_verify=no +repo --name=base --baseurl=http://download.tizen.org/releases/milestone/tizen/base/latest/repos/standard/packages/ --ssl_verify=no + +%packages +tar +gzip + +sed +grep +gawk +perl + +binutils +findutils +util-linux +lttng-ust +userspace-rcu +procps-ng +tzdata +ca-certificates + + +### Core FX +libicu +libunwind +iputils +zlib +krb5 +libcurl +libopenssl + +%end + +%post + +### Update /tmp privilege +chmod 777 /tmp +#################################### + +%end diff --git a/eng/common/cross/armel/tizen/tizen.patch b/eng/common/cross/armel/tizen/tizen.patch new file mode 100644 index 00000000000..d223427c978 --- /dev/null +++ b/eng/common/cross/armel/tizen/tizen.patch @@ -0,0 +1,18 @@ +diff -u -r a/usr/lib/libc.so b/usr/lib/libc.so +--- a/usr/lib/libc.so 2016-12-30 23:00:08.284951863 +0900 ++++ b/usr/lib/libc.so 2016-12-30 23:00:32.140951815 +0900 +@@ -2,4 +2,4 @@ + Use the shared library, but some functions are only in + the static library, so try that secondarily. */ + OUTPUT_FORMAT(elf32-littlearm) +-GROUP ( /lib/libc.so.6 /usr/lib/libc_nonshared.a AS_NEEDED ( /lib/ld-linux.so.3 ) ) ++GROUP ( libc.so.6 libc_nonshared.a AS_NEEDED ( ld-linux.so.3 ) ) +diff -u -r a/usr/lib/libpthread.so b/usr/lib/libpthread.so +--- a/usr/lib/libpthread.so 2016-12-30 23:00:19.408951841 +0900 ++++ b/usr/lib/libpthread.so 2016-12-30 23:00:39.068951801 +0900 +@@ -2,4 +2,4 @@ + Use the shared library, but some functions are only in + the static library, so try that secondarily. */ + OUTPUT_FORMAT(elf32-littlearm) +-GROUP ( /lib/libpthread.so.0 /usr/lib/libpthread_nonshared.a ) ++GROUP ( libpthread.so.0 libpthread_nonshared.a ) diff --git a/eng/common/cross/build-android-rootfs.sh b/eng/common/cross/build-android-rootfs.sh new file mode 100755 index 00000000000..adceda877ad --- /dev/null +++ b/eng/common/cross/build-android-rootfs.sh @@ -0,0 +1,137 @@ +#!/usr/bin/env bash +set -e +__NDK_Version=r14 + +usage() +{ + echo "Creates a toolchain and sysroot used for cross-compiling for Android." + echo. + echo "Usage: $0 [BuildArch] [ApiLevel]" + echo. + echo "BuildArch is the target architecture of Android. Currently only arm64 is supported." + echo "ApiLevel is the target Android API level. API levels usually match to Android releases. See https://source.android.com/source/build-numbers.html" + echo. + echo "By default, the toolchain and sysroot will be generated in cross/android-rootfs/toolchain/[BuildArch]. You can change this behavior" + echo "by setting the TOOLCHAIN_DIR environment variable" + echo. + echo "By default, the NDK will be downloaded into the cross/android-rootfs/android-ndk-$__NDK_Version directory. If you already have an NDK installation," + echo "you can set the NDK_DIR environment variable to have this script use that installation of the NDK." + echo "By default, this script will generate a file, android_platform, in the root of the ROOTFS_DIR directory that contains the RID for the supported and tested Android build: android.21-arm64. This file is to replace '/etc/os-release', which is not available for Android." + exit 1 +} + +__ApiLevel=21 # The minimum platform for arm64 is API level 21 +__BuildArch=arm64 +__AndroidArch=aarch64 +__AndroidToolchain=aarch64-linux-android + +for i in "$@" + do + lowerI="$(echo $i | awk '{print tolower($0)}')" + case $lowerI in + -?|-h|--help) + usage + exit 1 + ;; + arm64) + __BuildArch=arm64 + __AndroidArch=aarch64 + __AndroidToolchain=aarch64-linux-android + ;; + arm) + __BuildArch=arm + __AndroidArch=arm + __AndroidToolchain=arm-linux-androideabi + ;; + *[0-9]) + __ApiLevel=$i + ;; + *) + __UnprocessedBuildArgs="$__UnprocessedBuildArgs $i" + ;; + esac +done + +# Obtain the location of the bash script to figure out where the root of the repo is. +__CrossDir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + +__Android_Cross_Dir="$__CrossDir/android-rootfs" +__NDK_Dir="$__Android_Cross_Dir/android-ndk-$__NDK_Version" +__libunwind_Dir="$__Android_Cross_Dir/libunwind" +__lldb_Dir="$__Android_Cross_Dir/lldb" +__ToolchainDir="$__Android_Cross_Dir/toolchain/$__BuildArch" + +if [[ -n "$TOOLCHAIN_DIR" ]]; then + __ToolchainDir=$TOOLCHAIN_DIR +fi + +if [[ -n "$NDK_DIR" ]]; then + __NDK_Dir=$NDK_DIR +fi + +echo "Target API level: $__ApiLevel" +echo "Target architecture: $__BuildArch" +echo "NDK location: $__NDK_Dir" +echo "Target Toolchain location: $__ToolchainDir" + +# Download the NDK if required +if [ ! -d $__NDK_Dir ]; then + echo Downloading the NDK into $__NDK_Dir + mkdir -p $__NDK_Dir + wget -nv -nc --show-progress https://dl.google.com/android/repository/android-ndk-$__NDK_Version-linux-x86_64.zip -O $__Android_Cross_Dir/android-ndk-$__NDK_Version-linux-x86_64.zip + unzip -q $__Android_Cross_Dir/android-ndk-$__NDK_Version-linux-x86_64.zip -d $__Android_Cross_Dir +fi + +if [ ! -d $__lldb_Dir ]; then + mkdir -p $__lldb_Dir + echo Downloading LLDB into $__lldb_Dir + wget -nv -nc --show-progress https://dl.google.com/android/repository/lldb-2.3.3614996-linux-x86_64.zip -O $__Android_Cross_Dir/lldb-2.3.3614996-linux-x86_64.zip + unzip -q $__Android_Cross_Dir/lldb-2.3.3614996-linux-x86_64.zip -d $__lldb_Dir +fi + +# Create the RootFS for both arm64 as well as aarch +rm -rf $__Android_Cross_Dir/toolchain + +echo Generating the $__BuildArch toolchain +$__NDK_Dir/build/tools/make_standalone_toolchain.py --arch $__BuildArch --api $__ApiLevel --install-dir $__ToolchainDir + +# Install the required packages into the toolchain +# TODO: Add logic to get latest pkg version instead of specific version number +rm -rf $__Android_Cross_Dir/deb/ +rm -rf $__Android_Cross_Dir/tmp + +mkdir -p $__Android_Cross_Dir/deb/ +mkdir -p $__Android_Cross_Dir/tmp/$arch/ +wget -nv -nc http://termux.net/dists/stable/main/binary-$__AndroidArch/libicu_60.2_$__AndroidArch.deb -O $__Android_Cross_Dir/deb/libicu_60.2_$__AndroidArch.deb +wget -nv -nc http://termux.net/dists/stable/main/binary-$__AndroidArch/libicu-dev_60.2_$__AndroidArch.deb -O $__Android_Cross_Dir/deb/libicu-dev_60.2_$__AndroidArch.deb + +wget -nv -nc http://termux.net/dists/stable/main/binary-$__AndroidArch/libandroid-glob-dev_0.4_$__AndroidArch.deb -O $__Android_Cross_Dir/deb/libandroid-glob-dev_0.4_$__AndroidArch.deb +wget -nv -nc http://termux.net/dists/stable/main/binary-$__AndroidArch/libandroid-glob_0.4_$__AndroidArch.deb -O $__Android_Cross_Dir/deb/libandroid-glob_0.4_$__AndroidArch.deb +wget -nv -nc http://termux.net/dists/stable/main/binary-$__AndroidArch/libandroid-support-dev_22_$__AndroidArch.deb -O $__Android_Cross_Dir/deb/libandroid-support-dev_22_$__AndroidArch.deb +wget -nv -nc http://termux.net/dists/stable/main/binary-$__AndroidArch/libandroid-support_22_$__AndroidArch.deb -O $__Android_Cross_Dir/deb/libandroid-support_22_$__AndroidArch.deb +wget -nv -nc http://termux.net/dists/stable/main/binary-$__AndroidArch/liblzma-dev_5.2.3_$__AndroidArch.deb -O $__Android_Cross_Dir/deb/liblzma-dev_5.2.3_$__AndroidArch.deb +wget -nv -nc http://termux.net/dists/stable/main/binary-$__AndroidArch/liblzma_5.2.3_$__AndroidArch.deb -O $__Android_Cross_Dir/deb/liblzma_5.2.3_$__AndroidArch.deb +wget -nv -nc http://termux.net/dists/stable/main/binary-$__AndroidArch/libunwind-dev_1.2.20170304_$__AndroidArch.deb -O $__Android_Cross_Dir/deb/libunwind-dev_1.2.20170304_$__AndroidArch.deb +wget -nv -nc http://termux.net/dists/stable/main/binary-$__AndroidArch/libunwind_1.2.20170304_$__AndroidArch.deb -O $__Android_Cross_Dir/deb/libunwind_1.2.20170304_$__AndroidArch.deb + +echo Unpacking Termux packages +dpkg -x $__Android_Cross_Dir/deb/libicu_60.2_$__AndroidArch.deb $__Android_Cross_Dir/tmp/$__AndroidArch/ +dpkg -x $__Android_Cross_Dir/deb/libicu-dev_60.2_$__AndroidArch.deb $__Android_Cross_Dir/tmp/$__AndroidArch/ +dpkg -x $__Android_Cross_Dir/deb/libandroid-glob-dev_0.4_$__AndroidArch.deb $__Android_Cross_Dir/tmp/$__AndroidArch/ +dpkg -x $__Android_Cross_Dir/deb/libandroid-glob_0.4_$__AndroidArch.deb $__Android_Cross_Dir/tmp/$__AndroidArch/ +dpkg -x $__Android_Cross_Dir/deb/libandroid-support-dev_22_$__AndroidArch.deb $__Android_Cross_Dir/tmp/$__AndroidArch/ +dpkg -x $__Android_Cross_Dir/deb/libandroid-support_22_$__AndroidArch.deb $__Android_Cross_Dir/tmp/$__AndroidArch/ +dpkg -x $__Android_Cross_Dir/deb/liblzma-dev_5.2.3_$__AndroidArch.deb $__Android_Cross_Dir/tmp/$__AndroidArch/ +dpkg -x $__Android_Cross_Dir/deb/liblzma_5.2.3_$__AndroidArch.deb $__Android_Cross_Dir/tmp/$__AndroidArch/ +dpkg -x $__Android_Cross_Dir/deb/libunwind-dev_1.2.20170304_$__AndroidArch.deb $__Android_Cross_Dir/tmp/$__AndroidArch/ +dpkg -x $__Android_Cross_Dir/deb/libunwind_1.2.20170304_$__AndroidArch.deb $__Android_Cross_Dir/tmp/$__AndroidArch/ + +cp -R $__Android_Cross_Dir/tmp/$__AndroidArch/data/data/com.termux/files/usr/* $__ToolchainDir/sysroot/usr/ + +# Generate platform file for build.sh script to assign to __DistroRid +echo "Generating platform file..." + +echo "RID=android.21-arm64" > $__ToolchainDir/sysroot/android_platform +echo Now run: +echo CONFIG_DIR=\`realpath cross/android/$__BuildArch\` ROOTFS_DIR=\`realpath $__ToolchainDir/sysroot\` ./build.sh cross $__BuildArch skipgenerateversion skipnuget cmakeargs -DENABLE_LLDBPLUGIN=0 + diff --git a/eng/common/cross/build-rootfs.sh b/eng/common/cross/build-rootfs.sh new file mode 100755 index 00000000000..805948ca83c --- /dev/null +++ b/eng/common/cross/build-rootfs.sh @@ -0,0 +1,210 @@ +#!/usr/bin/env bash + +usage() +{ + echo "Usage: $0 [BuildArch] [LinuxCodeName] [lldbx.y] [--skipunmount]" + echo "BuildArch can be: arm(default), armel, arm64, x86" + echo "LinuxCodeName - optional, Code name for Linux, can be: trusty(default), vivid, wily, xenial, zesty, bionic, alpine. If BuildArch is armel, LinuxCodeName is jessie(default) or tizen." + echo "lldbx.y - optional, LLDB version, can be: lldb3.6(default), lldb3.8, lldb3.9, lldb4.0, no-lldb. Ignored for alpine" + echo "--skipunmount - optional, will skip the unmount of rootfs folder." + exit 1 +} + +__LinuxCodeName=trusty +__CrossDir=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) +__InitialDir=$PWD +__BuildArch=arm +__UbuntuArch=armhf +__UbuntuRepo="http://ports.ubuntu.com/" +__LLDB_Package="lldb-3.6-dev" +__SkipUnmount=0 + +# base development support +__UbuntuPackages="build-essential" + +__AlpinePackages="alpine-base" +__AlpinePackages+=" build-base" +__AlpinePackages+=" linux-headers" +__AlpinePackages+=" lldb-dev" +__AlpinePackages+=" llvm-dev" + +# symlinks fixer +__UbuntuPackages+=" symlinks" + +# CoreCLR and CoreFX dependencies +__UbuntuPackages+=" libicu-dev" +__UbuntuPackages+=" liblttng-ust-dev" +__UbuntuPackages+=" libunwind8-dev" + +__AlpinePackages+=" gettext-dev" +__AlpinePackages+=" icu-dev" +__AlpinePackages+=" libunwind-dev" +__AlpinePackages+=" lttng-ust-dev" + +# CoreFX dependencies +__UbuntuPackages+=" libcurl4-openssl-dev" +__UbuntuPackages+=" libkrb5-dev" +__UbuntuPackages+=" libssl-dev" +__UbuntuPackages+=" zlib1g-dev" + +__AlpinePackages+=" curl-dev" +__AlpinePackages+=" krb5-dev" +__AlpinePackages+=" openssl-dev" +__AlpinePackages+=" zlib-dev" + +__UnprocessedBuildArgs= +for i in "$@" ; do + lowerI="$(echo $i | awk '{print tolower($0)}')" + case $lowerI in + -?|-h|--help) + usage + exit 1 + ;; + arm) + __BuildArch=arm + __UbuntuArch=armhf + __AlpineArch=armhf + __QEMUArch=arm + ;; + arm64) + __BuildArch=arm64 + __UbuntuArch=arm64 + __AlpineArch=aarch64 + __QEMUArch=aarch64 + ;; + armel) + __BuildArch=armel + __UbuntuArch=armel + __UbuntuRepo="http://ftp.debian.org/debian/" + __LinuxCodeName=jessie + ;; + x86) + __BuildArch=x86 + __UbuntuArch=i386 + __UbuntuRepo="http://archive.ubuntu.com/ubuntu/" + ;; + lldb3.6) + __LLDB_Package="lldb-3.6-dev" + ;; + lldb3.8) + __LLDB_Package="lldb-3.8-dev" + ;; + lldb3.9) + __LLDB_Package="liblldb-3.9-dev" + ;; + lldb4.0) + __LLDB_Package="liblldb-4.0-dev" + ;; + no-lldb) + unset __LLDB_Package + ;; + vivid) + if [ "$__LinuxCodeName" != "jessie" ]; then + __LinuxCodeName=vivid + fi + ;; + wily) + if [ "$__LinuxCodeName" != "jessie" ]; then + __LinuxCodeName=wily + fi + ;; + xenial) + if [ "$__LinuxCodeName" != "jessie" ]; then + __LinuxCodeName=xenial + fi + ;; + zesty) + if [ "$__LinuxCodeName" != "jessie" ]; then + __LinuxCodeName=zesty + fi + ;; + bionic) + if [ "$__LinuxCodeName" != "jessie" ]; then + __LinuxCodeName=bionic + fi + ;; + jessie) + __LinuxCodeName=jessie + __UbuntuRepo="http://ftp.debian.org/debian/" + ;; + tizen) + if [ "$__BuildArch" != "armel" ]; then + echo "Tizen is available only for armel." + usage; + exit 1; + fi + __LinuxCodeName= + __UbuntuRepo= + __Tizen=tizen + ;; + alpine) + __LinuxCodeName=alpine + __UbuntuRepo= + ;; + --skipunmount) + __SkipUnmount=1 + ;; + *) + __UnprocessedBuildArgs="$__UnprocessedBuildArgs $i" + ;; + esac +done + +if [ "$__BuildArch" == "armel" ]; then + __LLDB_Package="lldb-3.5-dev" +fi +__UbuntuPackages+=" ${__LLDB_Package:-}" + +__RootfsDir="$__CrossDir/rootfs/$__BuildArch" + +if [[ -n "$ROOTFS_DIR" ]]; then + __RootfsDir=$ROOTFS_DIR +fi + +if [ -d "$__RootfsDir" ]; then + if [ $__SkipUnmount == 0 ]; then + umount $__RootfsDir/* + fi + rm -rf $__RootfsDir +fi + +if [[ "$__LinuxCodeName" == "alpine" ]]; then + __ApkToolsVersion=2.9.1 + __AlpineVersion=3.7 + __ApkToolsDir=$(mktemp -d) + wget https://github.com/alpinelinux/apk-tools/releases/download/v$__ApkToolsVersion/apk-tools-$__ApkToolsVersion-x86_64-linux.tar.gz -P $__ApkToolsDir + tar -xf $__ApkToolsDir/apk-tools-$__ApkToolsVersion-x86_64-linux.tar.gz -C $__ApkToolsDir + mkdir -p $__RootfsDir/usr/bin + cp -v /usr/bin/qemu-$__QEMUArch-static $__RootfsDir/usr/bin + $__ApkToolsDir/apk-tools-$__ApkToolsVersion/apk \ + -X http://dl-cdn.alpinelinux.org/alpine/v$__AlpineVersion/main \ + -X http://dl-cdn.alpinelinux.org/alpine/v$__AlpineVersion/community \ + -X http://dl-cdn.alpinelinux.org/alpine/edge/testing \ + -U --allow-untrusted --root $__RootfsDir --arch $__AlpineArch --initdb \ + add $__AlpinePackages + rm -r $__ApkToolsDir +elif [[ -n $__LinuxCodeName ]]; then + qemu-debootstrap --arch $__UbuntuArch $__LinuxCodeName $__RootfsDir $__UbuntuRepo + cp $__CrossDir/$__BuildArch/sources.list.$__LinuxCodeName $__RootfsDir/etc/apt/sources.list + chroot $__RootfsDir apt-get update + chroot $__RootfsDir apt-get -f -y install + chroot $__RootfsDir apt-get -y install $__UbuntuPackages + chroot $__RootfsDir symlinks -cr /usr + + if [ $__SkipUnmount == 0 ]; then + umount $__RootfsDir/* + fi + + if [[ "$__BuildArch" == "arm" && "$__LinuxCodeName" == "trusty" ]]; then + pushd $__RootfsDir + patch -p1 < $__CrossDir/$__BuildArch/trusty.patch + patch -p1 < $__CrossDir/$__BuildArch/trusty-lttng-2.4.patch + popd + fi +elif [ "$__Tizen" == "tizen" ]; then + ROOTFS_DIR=$__RootfsDir $__CrossDir/$__BuildArch/tizen-build-rootfs.sh +else + echo "Unsupported target platform." + usage; + exit 1 +fi diff --git a/eng/common/cross/toolchain.cmake b/eng/common/cross/toolchain.cmake new file mode 100644 index 00000000000..071d4112419 --- /dev/null +++ b/eng/common/cross/toolchain.cmake @@ -0,0 +1,138 @@ +set(CROSS_ROOTFS $ENV{ROOTFS_DIR}) + +set(TARGET_ARCH_NAME $ENV{TARGET_BUILD_ARCH}) +set(CMAKE_SYSTEM_NAME Linux) +set(CMAKE_SYSTEM_VERSION 1) + +if(TARGET_ARCH_NAME STREQUAL "armel") + set(CMAKE_SYSTEM_PROCESSOR armv7l) + set(TOOLCHAIN "arm-linux-gnueabi") + if("$ENV{__DistroRid}" MATCHES "tizen.*") + set(TIZEN_TOOLCHAIN "armv7l-tizen-linux-gnueabi/6.2.1") + endif() +elseif(TARGET_ARCH_NAME STREQUAL "arm") + set(CMAKE_SYSTEM_PROCESSOR armv7l) + if(EXISTS ${CROSS_ROOTFS}/usr/lib/gcc/armv6-alpine-linux-musleabihf) + set(TOOLCHAIN "armv6-alpine-linux-musleabihf") + else() + set(TOOLCHAIN "arm-linux-gnueabihf") + endif() +elseif(TARGET_ARCH_NAME STREQUAL "arm64") + set(CMAKE_SYSTEM_PROCESSOR aarch64) + if(EXISTS ${CROSS_ROOTFS}/usr/lib/gcc/aarch64-alpine-linux-musl) + set(TOOLCHAIN "aarch64-alpine-linux-musl") + else() + set(TOOLCHAIN "aarch64-linux-gnu") + endif() +elseif(TARGET_ARCH_NAME STREQUAL "x86") + set(CMAKE_SYSTEM_PROCESSOR i686) + set(TOOLCHAIN "i686-linux-gnu") +else() + message(FATAL_ERROR "Arch is ${TARGET_ARCH_NAME}. Only armel, arm, arm64 and x86 are supported!") +endif() + +# Specify include paths +if(TARGET_ARCH_NAME STREQUAL "armel") + if(DEFINED TIZEN_TOOLCHAIN) + include_directories(SYSTEM ${CROSS_ROOTFS}/usr/lib/gcc/${TIZEN_TOOLCHAIN}/include/c++/) + include_directories(SYSTEM ${CROSS_ROOTFS}/usr/lib/gcc/${TIZEN_TOOLCHAIN}/include/c++/armv7l-tizen-linux-gnueabi) + endif() +endif() + +# add_compile_param - adds only new options without duplicates. +# arg0 - list with result options, arg1 - list with new options. +# arg2 - optional argument, quick summary string for optional using CACHE FORCE mode. +macro(add_compile_param) + if(NOT ${ARGC} MATCHES "^(2|3)$") + message(FATAL_ERROR "Wrong using add_compile_param! Two or three parameters must be given! See add_compile_param description.") + endif() + foreach(OPTION ${ARGV1}) + if(NOT ${ARGV0} MATCHES "${OPTION}($| )") + set(${ARGV0} "${${ARGV0}} ${OPTION}") + if(${ARGC} EQUAL "3") # CACHE FORCE mode + set(${ARGV0} "${${ARGV0}}" CACHE STRING "${ARGV2}" FORCE) + endif() + endif() + endforeach() +endmacro() + +# Specify link flags +add_compile_param(CROSS_LINK_FLAGS "--sysroot=${CROSS_ROOTFS}") +add_compile_param(CROSS_LINK_FLAGS "--gcc-toolchain=${CROSS_ROOTFS}/usr") +add_compile_param(CROSS_LINK_FLAGS "--target=${TOOLCHAIN}") +add_compile_param(CROSS_LINK_FLAGS "-fuse-ld=gold") + +if(TARGET_ARCH_NAME STREQUAL "armel") + if(DEFINED TIZEN_TOOLCHAIN) # For Tizen only + add_compile_param(CROSS_LINK_FLAGS "-B${CROSS_ROOTFS}/usr/lib/gcc/${TIZEN_TOOLCHAIN}") + add_compile_param(CROSS_LINK_FLAGS "-L${CROSS_ROOTFS}/lib") + add_compile_param(CROSS_LINK_FLAGS "-L${CROSS_ROOTFS}/usr/lib") + add_compile_param(CROSS_LINK_FLAGS "-L${CROSS_ROOTFS}/usr/lib/gcc/${TIZEN_TOOLCHAIN}") + endif() +elseif(TARGET_ARCH_NAME STREQUAL "x86") + add_compile_param(CROSS_LINK_FLAGS "-m32") +endif() + +add_compile_param(CMAKE_EXE_LINKER_FLAGS "${CROSS_LINK_FLAGS}" "TOOLCHAIN_EXE_LINKER_FLAGS") +add_compile_param(CMAKE_SHARED_LINKER_FLAGS "${CROSS_LINK_FLAGS}" "TOOLCHAIN_EXE_LINKER_FLAGS") +add_compile_param(CMAKE_MODULE_LINKER_FLAGS "${CROSS_LINK_FLAGS}" "TOOLCHAIN_EXE_LINKER_FLAGS") + +# Specify compile options +add_compile_options("--sysroot=${CROSS_ROOTFS}") +add_compile_options("--target=${TOOLCHAIN}") +add_compile_options("--gcc-toolchain=${CROSS_ROOTFS}/usr") + +if(TARGET_ARCH_NAME MATCHES "^(arm|armel|arm64)$") + set(CMAKE_C_COMPILER_TARGET ${TOOLCHAIN}) + set(CMAKE_CXX_COMPILER_TARGET ${TOOLCHAIN}) + set(CMAKE_ASM_COMPILER_TARGET ${TOOLCHAIN}) +endif() + +if(TARGET_ARCH_NAME MATCHES "^(arm|armel)$") + add_compile_options(-mthumb) + add_compile_options(-mfpu=vfpv3) + if(TARGET_ARCH_NAME STREQUAL "armel") + add_compile_options(-mfloat-abi=softfp) + if(DEFINED TIZEN_TOOLCHAIN) + add_compile_options(-Wno-deprecated-declarations) # compile-time option + add_compile_options(-D__extern_always_inline=inline) # compile-time option + endif() + endif() +elseif(TARGET_ARCH_NAME STREQUAL "x86") + add_compile_options(-m32) + add_compile_options(-Wno-error=unused-command-line-argument) +endif() + +# Set LLDB include and library paths +if(TARGET_ARCH_NAME MATCHES "^(arm|armel|x86)$") + if(TARGET_ARCH_NAME STREQUAL "x86") + set(LLVM_CROSS_DIR "$ENV{LLVM_CROSS_HOME}") + else() # arm/armel case + set(LLVM_CROSS_DIR "$ENV{LLVM_ARM_HOME}") + endif() + if(LLVM_CROSS_DIR) + set(WITH_LLDB_LIBS "${LLVM_CROSS_DIR}/lib/" CACHE STRING "") + set(WITH_LLDB_INCLUDES "${LLVM_CROSS_DIR}/include" CACHE STRING "") + set(LLDB_H "${WITH_LLDB_INCLUDES}" CACHE STRING "") + set(LLDB "${LLVM_CROSS_DIR}/lib/liblldb.so" CACHE STRING "") + else() + if(TARGET_ARCH_NAME STREQUAL "x86") + set(WITH_LLDB_LIBS "${CROSS_ROOTFS}/usr/lib/i386-linux-gnu" CACHE STRING "") + set(CHECK_LLVM_DIR "${CROSS_ROOTFS}/usr/lib/llvm-3.8/include") + if(EXISTS "${CHECK_LLVM_DIR}" AND IS_DIRECTORY "${CHECK_LLVM_DIR}") + set(WITH_LLDB_INCLUDES "${CHECK_LLVM_DIR}") + else() + set(WITH_LLDB_INCLUDES "${CROSS_ROOTFS}/usr/lib/llvm-3.6/include") + endif() + else() # arm/armel case + set(WITH_LLDB_LIBS "${CROSS_ROOTFS}/usr/lib/${TOOLCHAIN}" CACHE STRING "") + set(WITH_LLDB_INCLUDES "${CROSS_ROOTFS}/usr/lib/llvm-3.6/include" CACHE STRING "") + endif() + endif() +endif() + +set(CMAKE_FIND_ROOT_PATH "${CROSS_ROOTFS}") +set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) +set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) +set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) +set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) diff --git a/eng/common/cross/x86/sources.list.bionic b/eng/common/cross/x86/sources.list.bionic new file mode 100644 index 00000000000..a71ccadcffa --- /dev/null +++ b/eng/common/cross/x86/sources.list.bionic @@ -0,0 +1,11 @@ +deb http://archive.ubuntu.com/ubuntu/ bionic main restricted universe +deb-src http://archive.ubuntu.com/ubuntu/ bionic main restricted universe + +deb http://archive.ubuntu.com/ubuntu/ bionic-updates main restricted universe +deb-src http://archive.ubuntu.com/ubuntu/ bionic-updates main restricted universe + +deb http://archive.ubuntu.com/ubuntu/ bionic-backports main restricted +deb-src http://archive.ubuntu.com/ubuntu/ bionic-backports main restricted + +deb http://archive.ubuntu.com/ubuntu/ bionic-security main restricted universe multiverse +deb-src http://archive.ubuntu.com/ubuntu/ bionic-security main restricted universe multiverse diff --git a/eng/common/cross/x86/sources.list.trusty b/eng/common/cross/x86/sources.list.trusty new file mode 100644 index 00000000000..9b3085436e9 --- /dev/null +++ b/eng/common/cross/x86/sources.list.trusty @@ -0,0 +1,11 @@ +deb http://archive.ubuntu.com/ubuntu/ trusty main restricted universe +deb-src http://archive.ubuntu.com/ubuntu/ trusty main restricted universe + +deb http://archive.ubuntu.com/ubuntu/ trusty-updates main restricted universe +deb-src http://archive.ubuntu.com/ubuntu/ trusty-updates main restricted universe + +deb http://archive.ubuntu.com/ubuntu/ trusty-backports main restricted +deb-src http://archive.ubuntu.com/ubuntu/ trusty-backports main restricted + +deb http://archive.ubuntu.com/ubuntu/ trusty-security main restricted universe multiverse +deb-src http://archive.ubuntu.com/ubuntu/ trusty-security main restricted universe multiverse diff --git a/eng/common/cross/x86/sources.list.vivid b/eng/common/cross/x86/sources.list.vivid new file mode 100644 index 00000000000..26d37b20fc3 --- /dev/null +++ b/eng/common/cross/x86/sources.list.vivid @@ -0,0 +1,11 @@ +deb http://archive.ubuntu.com/ubuntu/ vivid main restricted universe +deb-src http://archive.ubuntu.com/ubuntu/ vivid main restricted universe + +deb http://archive.ubuntu.com/ubuntu/ vivid-updates main restricted universe +deb-src http://archive.ubuntu.com/ubuntu/ vivid-updates main restricted universe + +deb http://archive.ubuntu.com/ubuntu/ vivid-backports main restricted +deb-src http://archive.ubuntu.com/ubuntu/ vivid-backports main restricted + +deb http://archive.ubuntu.com/ubuntu/ vivid-security main restricted universe multiverse +deb-src http://archive.ubuntu.com/ubuntu/ vivid-security main restricted universe multiverse diff --git a/eng/common/cross/x86/sources.list.wily b/eng/common/cross/x86/sources.list.wily new file mode 100644 index 00000000000..c4b0b442ab6 --- /dev/null +++ b/eng/common/cross/x86/sources.list.wily @@ -0,0 +1,11 @@ +deb http://archive.ubuntu.com/ubuntu/ wily main restricted universe +deb-src http://archive.ubuntu.com/ubuntu/ wily main restricted universe + +deb http://archive.ubuntu.com/ubuntu/ wily-updates main restricted universe +deb-src http://archive.ubuntu.com/ubuntu/ wily-updates main restricted universe + +deb http://archive.ubuntu.com/ubuntu/ wily-backports main restricted +deb-src http://archive.ubuntu.com/ubuntu/ wily-backports main restricted + +deb http://archive.ubuntu.com/ubuntu/ wily-security main restricted universe multiverse +deb-src http://archive.ubuntu.com/ubuntu/ wily-security main restricted universe multiverse diff --git a/eng/common/cross/x86/sources.list.xenial b/eng/common/cross/x86/sources.list.xenial new file mode 100644 index 00000000000..ad9c5a0144e --- /dev/null +++ b/eng/common/cross/x86/sources.list.xenial @@ -0,0 +1,11 @@ +deb http://archive.ubuntu.com/ubuntu/ xenial main restricted universe +deb-src http://archive.ubuntu.com/ubuntu/ xenial main restricted universe + +deb http://archive.ubuntu.com/ubuntu/ xenial-updates main restricted universe +deb-src http://archive.ubuntu.com/ubuntu/ xenial-updates main restricted universe + +deb http://archive.ubuntu.com/ubuntu/ xenial-backports main restricted +deb-src http://archive.ubuntu.com/ubuntu/ xenial-backports main restricted + +deb http://archive.ubuntu.com/ubuntu/ xenial-security main restricted universe multiverse +deb-src http://archive.ubuntu.com/ubuntu/ xenial-security main restricted universe multiverse diff --git a/eng/common/darc-init.ps1 b/eng/common/darc-init.ps1 new file mode 100644 index 00000000000..96cad844ba3 --- /dev/null +++ b/eng/common/darc-init.ps1 @@ -0,0 +1,32 @@ +param ( + $darcVersion = $null +) + +$verbosity = "m" +. $PSScriptRoot\tools.ps1 + +function InstallDarcCli ($darcVersion) { + $darcCliPackageName = "microsoft.dotnet.darc" + + $dotnetRoot = InitializeDotNetCli -install:$true + $dotnet = "$dotnetRoot\dotnet.exe" + $toolList = Invoke-Expression "& `"$dotnet`" tool list -g" + + if ($toolList -like "*$darcCliPackageName*") { + Invoke-Expression "& `"$dotnet`" tool uninstall $darcCliPackageName -g" + } + + # Until we can anonymously query the BAR API for the latest arcade-services + # build applied to the PROD channel, this is hardcoded. + if (-not $darcVersion) { + $darcVersion = '1.1.0-beta.19057.9' + } + + $arcadeServicesSource = 'https://dotnetfeed.blob.core.windows.net/dotnet-arcade/index.json' + + Write-Host "Installing Darc CLI version $darcVersion..." + Write-Host "You may need to restart your command window if this is the first dotnet tool you have installed." + Invoke-Expression "& `"$dotnet`" tool install $darcCliPackageName --version $darcVersion --add-source '$arcadeServicesSource' -v $verbosity -g" +} + +InstallDarcCli $darcVersion diff --git a/eng/common/darc-init.sh b/eng/common/darc-init.sh new file mode 100755 index 00000000000..bad07c3ae61 --- /dev/null +++ b/eng/common/darc-init.sh @@ -0,0 +1,38 @@ +#!/usr/bin/env bash + +source="${BASH_SOURCE[0]}" + +# resolve $source until the file is no longer a symlink +while [[ -h "$source" ]]; do + scriptroot="$( cd -P "$( dirname "$source" )" && pwd )" + source="$(readlink "$source")" + # if $source was a relative symlink, we need to resolve it relative to the path where the + # symlink file was located + [[ $source != /* ]] && source="$scriptroot/$source" +done +scriptroot="$( cd -P "$( dirname "$source" )" && pwd )" +verbosity=m + +. "$scriptroot/tools.sh" + +function InstallDarcCli { + local darc_cli_package_name="microsoft.dotnet.darc" + + InitializeDotNetCli + local dotnet_root=$_InitializeDotNetCli + + local uninstall_command=`$dotnet_root/dotnet tool uninstall $darc_cli_package_name -g` + local tool_list=$($dotnet_root/dotnet tool list -g) + if [[ $tool_list = *$darc_cli_package_name* ]]; then + echo $($dotnet_root/dotnet tool uninstall $darc_cli_package_name -g) + fi + + ReadGlobalVersion "Microsoft.DotNet.Arcade.Sdk" + local toolset_version=$_ReadGlobalVersion + + echo "Installing Darc CLI version $toolset_version..." + echo "You may need to restart your command shell if this is the first dotnet tool you have installed." + echo $($dotnet_root/dotnet tool install $darc_cli_package_name --version $toolset_version -v $verbosity -g) +} + +InstallDarcCli diff --git a/eng/common/helixpublish.proj b/eng/common/helixpublish.proj new file mode 100644 index 00000000000..d7f185856e7 --- /dev/null +++ b/eng/common/helixpublish.proj @@ -0,0 +1,26 @@ + + + + msbuild + + + + + %(Identity) + + + + + + $(WorkItemDirectory) + $(WorkItemCommand) + $(WorkItemTimeout) + + + + + + + + + diff --git a/eng/common/init-tools-native.cmd b/eng/common/init-tools-native.cmd new file mode 100644 index 00000000000..438cd548c45 --- /dev/null +++ b/eng/common/init-tools-native.cmd @@ -0,0 +1,3 @@ +@echo off +powershell -NoProfile -NoLogo -ExecutionPolicy ByPass -command "& """%~dp0init-tools-native.ps1""" %*" +exit /b %ErrorLevel% \ No newline at end of file diff --git a/eng/common/init-tools-native.ps1 b/eng/common/init-tools-native.ps1 new file mode 100644 index 00000000000..e25c60fed42 --- /dev/null +++ b/eng/common/init-tools-native.ps1 @@ -0,0 +1,128 @@ +<# +.SYNOPSIS +Entry point script for installing native tools + +.DESCRIPTION +Reads $RepoRoot\global.json file to determine native assets to install +and executes installers for those tools + +.PARAMETER BaseUri +Base file directory or Url from which to acquire tool archives + +.PARAMETER InstallDirectory +Directory to install native toolset. This is a command-line override for the default +Install directory precedence order: +- InstallDirectory command-line override +- NETCOREENG_INSTALL_DIRECTORY environment variable +- (default) %USERPROFILE%/.netcoreeng/native + +.PARAMETER Clean +Switch specifying to not install anything, but cleanup native asset folders + +.PARAMETER Force +Clean and then install tools + +.PARAMETER DownloadRetries +Total number of retry attempts + +.PARAMETER RetryWaitTimeInSeconds +Wait time between retry attempts in seconds + +.PARAMETER GlobalJsonFile +File path to global.json file + +.NOTES +#> +[CmdletBinding(PositionalBinding=$false)] +Param ( + [string] $BaseUri = "https://netcorenativeassets.blob.core.windows.net/resource-packages/external", + [string] $InstallDirectory, + [switch] $Clean = $False, + [switch] $Force = $False, + [int] $DownloadRetries = 5, + [int] $RetryWaitTimeInSeconds = 30, + [string] $GlobalJsonFile = "$PSScriptRoot\..\..\global.json" +) + +Set-StrictMode -version 2.0 +$ErrorActionPreference="Stop" + +Import-Module -Name (Join-Path $PSScriptRoot "native\CommonLibrary.psm1") + +try { + # Define verbose switch if undefined + $Verbose = $VerbosePreference -Eq "Continue" + + $EngCommonBaseDir = Join-Path $PSScriptRoot "native\" + $NativeBaseDir = $InstallDirectory + if (!$NativeBaseDir) { + $NativeBaseDir = CommonLibrary\Get-NativeInstallDirectory + } + $Env:CommonLibrary_NativeInstallDir = $NativeBaseDir + $InstallBin = Join-Path $NativeBaseDir "bin" + $InstallerPath = Join-Path $EngCommonBaseDir "install-tool.ps1" + + # Process tools list + Write-Host "Processing $GlobalJsonFile" + If (-Not (Test-Path $GlobalJsonFile)) { + Write-Host "Unable to find '$GlobalJsonFile'" + exit 0 + } + $NativeTools = Get-Content($GlobalJsonFile) -Raw | + ConvertFrom-Json | + Select-Object -Expand "native-tools" -ErrorAction SilentlyContinue + if ($NativeTools) { + $NativeTools.PSObject.Properties | ForEach-Object { + $ToolName = $_.Name + $ToolVersion = $_.Value + $LocalInstallerCommand = $InstallerPath + $LocalInstallerCommand += " -ToolName $ToolName" + $LocalInstallerCommand += " -InstallPath $InstallBin" + $LocalInstallerCommand += " -BaseUri $BaseUri" + $LocalInstallerCommand += " -CommonLibraryDirectory $EngCommonBaseDir" + $LocalInstallerCommand += " -Version $ToolVersion" + + if ($Verbose) { + $LocalInstallerCommand += " -Verbose" + } + if (Get-Variable 'Force' -ErrorAction 'SilentlyContinue') { + if($Force) { + $LocalInstallerCommand += " -Force" + } + } + if ($Clean) { + $LocalInstallerCommand += " -Clean" + } + + Write-Verbose "Installing $ToolName version $ToolVersion" + Write-Verbose "Executing '$LocalInstallerCommand'" + Invoke-Expression "$LocalInstallerCommand" + if ($LASTEXITCODE -Ne "0") { + Write-Error "Execution failed" + exit 1 + } + } + } + else { + Write-Host "No native tools defined in global.json" + exit 0 + } + + if ($Clean) { + exit 0 + } + if (Test-Path $InstallBin) { + Write-Host "Native tools are available from" (Convert-Path -Path $InstallBin) + Write-Host "##vso[task.prependpath]$(Convert-Path -Path $InstallBin)" + } + else { + Write-Error "Native tools install directory does not exist, installation failed" + exit 1 + } + exit 0 +} +catch { + Write-Host $_ + Write-Host $_.Exception + exit 1 +} diff --git a/eng/common/init-tools-native.sh b/eng/common/init-tools-native.sh new file mode 100755 index 00000000000..54b70f678ba --- /dev/null +++ b/eng/common/init-tools-native.sh @@ -0,0 +1,145 @@ +#!/usr/bin/env bash + +source="${BASH_SOURCE[0]}" +scriptroot="$( cd -P "$( dirname "$source" )" && pwd )" + +base_uri='https://netcorenativeassets.blob.core.windows.net/resource-packages/external' +install_directory='' +clean=false +force=false +download_retries=5 +retry_wait_time_seconds=30 +global_json_file="${scriptroot}/../../global.json" +declare -A native_assets + +. $scriptroot/native/common-library.sh + +while (($# > 0)); do + lowerI="$(echo $1 | awk '{print tolower($0)}')" + case $lowerI in + --baseuri) + base_uri=$2 + shift 2 + ;; + --installdirectory) + install_directory=$2 + shift 2 + ;; + --clean) + clean=true + shift 1 + ;; + --force) + force=true + shift 1 + ;; + --downloadretries) + download_retries=$2 + shift 2 + ;; + --retrywaittimeseconds) + retry_wait_time_seconds=$2 + shift 2 + ;; + --help) + echo "Common settings:" + echo " --installdirectory Directory to install native toolset." + echo " This is a command-line override for the default" + echo " Install directory precedence order:" + echo " - InstallDirectory command-line override" + echo " - NETCOREENG_INSTALL_DIRECTORY environment variable" + echo " - (default) %USERPROFILE%/.netcoreeng/native" + echo "" + echo " --clean Switch specifying not to install anything, but cleanup native asset folders" + echo " --force Clean and then install tools" + echo " --help Print help and exit" + echo "" + echo "Advanced settings:" + echo " --baseuri Base URI for where to download native tools from" + echo " --downloadretries Number of times a download should be attempted" + echo " --retrywaittimeseconds Wait time between download attempts" + echo "" + exit 0 + ;; + esac +done + +function ReadGlobalJsonNativeTools { + # Get the native-tools section from the global.json. + local native_tools_section=$(cat $global_json_file | awk '/"native-tools"/,/}/') + # Only extract the contents of the object. + local native_tools_list=$(echo $native_tools_section | awk -F"[{}]" '{print $2}') + native_tools_list=${native_tools_list//[\" ]/} + native_tools_list=${native_tools_list//,/$'\n'} + + local old_IFS=$IFS + while read -r line; do + # Lines are of the form: 'tool:version' + IFS=: + while read -r key value; do + native_assets[$key]=$value + done <<< "$line" + done <<< "$native_tools_list" + IFS=$old_IFS + + return 0; +} + +native_base_dir=$install_directory +if [[ -z $install_directory ]]; then + native_base_dir=$(GetNativeInstallDirectory) +fi + +install_bin="${native_base_dir}/bin" + +ReadGlobalJsonNativeTools + +if [[ ${#native_assets[@]} -eq 0 ]]; then + echo "No native tools defined in global.json" + exit 0; +else + native_installer_dir="$scriptroot/native" + for tool in "${!native_assets[@]}" + do + tool_version=${native_assets[$tool]} + installer_name="install-$tool.sh" + installer_command="$native_installer_dir/$installer_name" + installer_command+=" --baseuri $base_uri" + installer_command+=" --installpath $install_bin" + installer_command+=" --version $tool_version" + + if [[ $force = true ]]; then + installer_command+=" --force" + fi + + if [[ $clean = true ]]; then + installer_command+=" --clean" + fi + + echo "Installing $tool version $tool_version" + echo "Executing '$installer_command'" + $installer_command + + if [[ $? != 0 ]]; then + echo "Execution Failed" >&2 + exit 1 + fi + done +fi + +if [[ ! -z $clean ]]; then + exit 0 +fi + +if [[ -d $install_bin ]]; then + echo "Native tools are available from $install_bin" + if [[ !-z BUILD_BUILDNUMBER ]]; then + echo "##vso[task.prependpath]$install_bin" + fi +else + echo "Native tools install directory does not exist, installation failed" >&2 + exit 1 +fi + +exit 0 + diff --git a/eng/common/msbuild.ps1 b/eng/common/msbuild.ps1 new file mode 100644 index 00000000000..b37fd3d5e97 --- /dev/null +++ b/eng/common/msbuild.ps1 @@ -0,0 +1,27 @@ +[CmdletBinding(PositionalBinding=$false)] +Param( + [string] $verbosity = "minimal", + [bool] $warnAsError = $true, + [bool] $nodeReuse = $true, + [switch] $ci, + [switch] $prepareMachine, + [Parameter(ValueFromRemainingArguments=$true)][String[]]$extraArgs +) + +. $PSScriptRoot\tools.ps1 + +try { + if ($ci) { + $nodeReuse = $false + } + + MSBuild @extraArgs +} +catch { + Write-Host $_ + Write-Host $_.Exception + Write-Host $_.ScriptStackTrace + ExitWithExitCode 1 +} + +ExitWithExitCode 0 \ No newline at end of file diff --git a/eng/common/msbuild.sh b/eng/common/msbuild.sh new file mode 100755 index 00000000000..8160cd5a59d --- /dev/null +++ b/eng/common/msbuild.sh @@ -0,0 +1,58 @@ +#!/usr/bin/env bash + +source="${BASH_SOURCE[0]}" + +# resolve $source until the file is no longer a symlink +while [[ -h "$source" ]]; do + scriptroot="$( cd -P "$( dirname "$source" )" && pwd )" + source="$(readlink "$source")" + # if $source was a relative symlink, we need to resolve it relative to the path where the + # symlink file was located + [[ $source != /* ]] && source="$scriptroot/$source" +done +scriptroot="$( cd -P "$( dirname "$source" )" && pwd )" + +verbosity='minimal' +warn_as_error=true +node_reuse=true +prepare_machine=false +extra_args='' + +while (($# > 0)); do + lowerI="$(echo $1 | awk '{print tolower($0)}')" + case $lowerI in + --verbosity) + verbosity=$2 + shift 2 + ;; + --warnaserror) + warn_as_error=$2 + shift 2 + ;; + --nodereuse) + node_reuse=$2 + shift 2 + ;; + --ci) + ci=true + shift 1 + ;; + --preparemachine) + prepare_machine=true + shift 1 + ;; + *) + extra_args="$extra_args $1" + shift 1 + ;; + esac +done + +. "$scriptroot/tools.sh" + +if [[ "$ci" == true ]]; then + node_reuse=false +fi + +MSBuild $extra_args +ExitWithExitCode 0 diff --git a/eng/common/native/CommonLibrary.psm1 b/eng/common/native/CommonLibrary.psm1 new file mode 100644 index 00000000000..f286ae0cde2 --- /dev/null +++ b/eng/common/native/CommonLibrary.psm1 @@ -0,0 +1,358 @@ +<# +.SYNOPSIS +Helper module to install an archive to a directory + +.DESCRIPTION +Helper module to download and extract an archive to a specified directory + +.PARAMETER Uri +Uri of artifact to download + +.PARAMETER InstallDirectory +Directory to extract artifact contents to + +.PARAMETER Force +Force download / extraction if file or contents already exist. Default = False + +.PARAMETER DownloadRetries +Total number of retry attempts. Default = 5 + +.PARAMETER RetryWaitTimeInSeconds +Wait time between retry attempts in seconds. Default = 30 + +.NOTES +Returns False if download or extraction fail, True otherwise +#> +function DownloadAndExtract { + [CmdletBinding(PositionalBinding=$false)] + Param ( + [Parameter(Mandatory=$True)] + [string] $Uri, + [Parameter(Mandatory=$True)] + [string] $InstallDirectory, + [switch] $Force = $False, + [int] $DownloadRetries = 5, + [int] $RetryWaitTimeInSeconds = 30 + ) + # Define verbose switch if undefined + $Verbose = $VerbosePreference -Eq "Continue" + + $TempToolPath = CommonLibrary\Get-TempPathFilename -Path $Uri + + # Download native tool + $DownloadStatus = CommonLibrary\Get-File -Uri $Uri ` + -Path $TempToolPath ` + -DownloadRetries $DownloadRetries ` + -RetryWaitTimeInSeconds $RetryWaitTimeInSeconds ` + -Force:$Force ` + -Verbose:$Verbose + + if ($DownloadStatus -Eq $False) { + Write-Error "Download failed" + return $False + } + + # Extract native tool + $UnzipStatus = CommonLibrary\Expand-Zip -ZipPath $TempToolPath ` + -OutputDirectory $InstallDirectory ` + -Force:$Force ` + -Verbose:$Verbose + + if ($UnzipStatus -Eq $False) { + Write-Error "Unzip failed" + return $False + } + return $True +} + +<# +.SYNOPSIS +Download a file, retry on failure + +.DESCRIPTION +Download specified file and retry if attempt fails + +.PARAMETER Uri +Uri of file to download. If Uri is a local path, the file will be copied instead of downloaded + +.PARAMETER Path +Path to download or copy uri file to + +.PARAMETER Force +Overwrite existing file if present. Default = False + +.PARAMETER DownloadRetries +Total number of retry attempts. Default = 5 + +.PARAMETER RetryWaitTimeInSeconds +Wait time between retry attempts in seconds Default = 30 + +#> +function Get-File { + [CmdletBinding(PositionalBinding=$false)] + Param ( + [Parameter(Mandatory=$True)] + [string] $Uri, + [Parameter(Mandatory=$True)] + [string] $Path, + [int] $DownloadRetries = 5, + [int] $RetryWaitTimeInSeconds = 30, + [switch] $Force = $False + ) + $Attempt = 0 + + if ($Force) { + if (Test-Path $Path) { + Remove-Item $Path -Force + } + } + if (Test-Path $Path) { + Write-Host "File '$Path' already exists, skipping download" + return $True + } + + $DownloadDirectory = Split-Path -ErrorAction Ignore -Path "$Path" -Parent + if (-Not (Test-Path $DownloadDirectory)) { + New-Item -path $DownloadDirectory -force -itemType "Directory" | Out-Null + } + + if (Test-Path -IsValid -Path $Uri) { + Write-Verbose "'$Uri' is a file path, copying file to '$Path'" + Copy-Item -Path $Uri -Destination $Path + return $? + } + else { + Write-Verbose "Downloading $Uri" + while($Attempt -Lt $DownloadRetries) + { + try { + Invoke-WebRequest -UseBasicParsing -Uri $Uri -OutFile $Path + Write-Verbose "Downloaded to '$Path'" + return $True + } + catch { + $Attempt++ + if ($Attempt -Lt $DownloadRetries) { + $AttemptsLeft = $DownloadRetries - $Attempt + Write-Warning "Download failed, $AttemptsLeft attempts remaining, will retry in $RetryWaitTimeInSeconds seconds" + Start-Sleep -Seconds $RetryWaitTimeInSeconds + } + else { + Write-Error $_ + Write-Error $_.Exception + } + } + } + } + + return $False +} + +<# +.SYNOPSIS +Generate a shim for a native tool + +.DESCRIPTION +Creates a wrapper script (shim) that passes arguments forward to native tool assembly + +.PARAMETER ShimName +The name of the shim + +.PARAMETER ShimDirectory +The directory where shims are stored + +.PARAMETER ToolFilePath +Path to file that shim forwards to + +.PARAMETER Force +Replace shim if already present. Default = False + +.NOTES +Returns $True if generating shim succeeds, $False otherwise +#> +function New-ScriptShim { + [CmdletBinding(PositionalBinding=$false)] + Param ( + [Parameter(Mandatory=$True)] + [string] $ShimName, + [Parameter(Mandatory=$True)] + [string] $ShimDirectory, + [Parameter(Mandatory=$True)] + [string] $ToolFilePath, + [Parameter(Mandatory=$True)] + [string] $BaseUri, + [switch] $Force + ) + try { + Write-Verbose "Generating '$ShimName' shim" + + if (-Not (Test-Path $ToolFilePath)){ + Write-Error "Specified tool file path '$ToolFilePath' does not exist" + return $False + } + + # WinShimmer is a small .NET Framework program that creates .exe shims to bootstrapped programs + # Many of the checks for installed programs expect a .exe extension for Windows tools, rather + # than a .bat or .cmd file. + # Source: https://github.com/dotnet/arcade/tree/master/src/WinShimmer + if (-Not (Test-Path "$ShimDirectory\WinShimmer\winshimmer.exe")) { + $InstallStatus = DownloadAndExtract -Uri "$BaseUri/windows/winshimmer/WinShimmer.zip" ` + -InstallDirectory $ShimDirectory\WinShimmer ` + -Force:$Force ` + -DownloadRetries 2 ` + -RetryWaitTimeInSeconds 5 ` + -Verbose:$Verbose + } + + if ((Test-Path (Join-Path $ShimDirectory "$ShimName.exe"))) { + Write-Host "$ShimName.exe already exists; replacing..." + Remove-Item (Join-Path $ShimDirectory "$ShimName.exe") + } + + Invoke-Expression "$ShimDirectory\WinShimmer\winshimmer.exe $ShimName $ToolFilePath $ShimDirectory" + return $True + } + catch { + Write-Host $_ + Write-Host $_.Exception + return $False + } +} + +<# +.SYNOPSIS +Returns the machine architecture of the host machine + +.NOTES +Returns 'x64' on 64 bit machines + Returns 'x86' on 32 bit machines +#> +function Get-MachineArchitecture { + $ProcessorArchitecture = $Env:PROCESSOR_ARCHITECTURE + $ProcessorArchitectureW6432 = $Env:PROCESSOR_ARCHITEW6432 + if($ProcessorArchitecture -Eq "X86") + { + if(($ProcessorArchitectureW6432 -Eq "") -Or + ($ProcessorArchitectureW6432 -Eq "X86")) { + return "x86" + } + $ProcessorArchitecture = $ProcessorArchitectureW6432 + } + if (($ProcessorArchitecture -Eq "AMD64") -Or + ($ProcessorArchitecture -Eq "IA64") -Or + ($ProcessorArchitecture -Eq "ARM64")) { + return "x64" + } + return "x86" +} + +<# +.SYNOPSIS +Get the name of a temporary folder under the native install directory +#> +function Get-TempDirectory { + return Join-Path (Get-NativeInstallDirectory) "temp/" +} + +function Get-TempPathFilename { + [CmdletBinding(PositionalBinding=$false)] + Param ( + [Parameter(Mandatory=$True)] + [string] $Path + ) + $TempDir = CommonLibrary\Get-TempDirectory + $TempFilename = Split-Path $Path -leaf + $TempPath = Join-Path $TempDir $TempFilename + return $TempPath +} + +<# +.SYNOPSIS +Returns the base directory to use for native tool installation + +.NOTES +Returns the value of the NETCOREENG_INSTALL_DIRECTORY if that environment variable +is set, or otherwise returns an install directory under the %USERPROFILE% +#> +function Get-NativeInstallDirectory { + $InstallDir = $Env:NETCOREENG_INSTALL_DIRECTORY + if (!$InstallDir) { + $InstallDir = Join-Path $Env:USERPROFILE ".netcoreeng/native/" + } + return $InstallDir +} + +<# +.SYNOPSIS +Unzip an archive + +.DESCRIPTION +Powershell module to unzip an archive to a specified directory + +.PARAMETER ZipPath (Required) +Path to archive to unzip + +.PARAMETER OutputDirectory (Required) +Output directory for archive contents + +.PARAMETER Force +Overwrite output directory contents if they already exist + +.NOTES +- Returns True and does not perform an extraction if output directory already exists but Overwrite is not True. +- Returns True if unzip operation is successful +- Returns False if Overwrite is True and it is unable to remove contents of OutputDirectory +- Returns False if unable to extract zip archive +#> +function Expand-Zip { + [CmdletBinding(PositionalBinding=$false)] + Param ( + [Parameter(Mandatory=$True)] + [string] $ZipPath, + [Parameter(Mandatory=$True)] + [string] $OutputDirectory, + [switch] $Force + ) + + Write-Verbose "Extracting '$ZipPath' to '$OutputDirectory'" + try { + if ((Test-Path $OutputDirectory) -And (-Not $Force)) { + Write-Host "Directory '$OutputDirectory' already exists, skipping extract" + return $True + } + if (Test-Path $OutputDirectory) { + Write-Verbose "'Force' is 'True', but '$OutputDirectory' exists, removing directory" + Remove-Item $OutputDirectory -Force -Recurse + if ($? -Eq $False) { + Write-Error "Unable to remove '$OutputDirectory'" + return $False + } + } + if (-Not (Test-Path $OutputDirectory)) { + New-Item -path $OutputDirectory -Force -itemType "Directory" | Out-Null + } + + Add-Type -assembly "system.io.compression.filesystem" + [io.compression.zipfile]::ExtractToDirectory("$ZipPath", "$OutputDirectory") + if ($? -Eq $False) { + Write-Error "Unable to extract '$ZipPath'" + return $False + } + } + catch { + Write-Host $_ + Write-Host $_.Exception + + return $False + } + return $True +} + +export-modulemember -function DownloadAndExtract +export-modulemember -function Expand-Zip +export-modulemember -function Get-File +export-modulemember -function Get-MachineArchitecture +export-modulemember -function Get-NativeInstallDirectory +export-modulemember -function Get-TempDirectory +export-modulemember -function Get-TempPathFilename +export-modulemember -function New-ScriptShim diff --git a/eng/common/native/common-library.sh b/eng/common/native/common-library.sh new file mode 100755 index 00000000000..271bddfac5a --- /dev/null +++ b/eng/common/native/common-library.sh @@ -0,0 +1,168 @@ +#!/usr/bin/env bash + +function GetNativeInstallDirectory { + local install_dir + + if [[ -z $NETCOREENG_INSTALL_DIRECTORY ]]; then + install_dir=$HOME/.netcoreeng/native/ + else + install_dir=$NETCOREENG_INSTALL_DIRECTORY + fi + + echo $install_dir + return 0 +} + +function GetTempDirectory { + + echo $(GetNativeInstallDirectory)temp/ + return 0 +} + +function ExpandZip { + local zip_path=$1 + local output_directory=$2 + local force=${3:-false} + + echo "Extracting $zip_path to $output_directory" + if [[ -d $output_directory ]] && [[ $force = false ]]; then + echo "Directory '$output_directory' already exists, skipping extract" + return 0 + fi + + if [[ -d $output_directory ]]; then + echo "'Force flag enabled, but '$output_directory' exists. Removing directory" + rm -rf $output_directory + if [[ $? != 0 ]]; then + echo Unable to remove '$output_directory'>&2 + return 1 + fi + fi + + echo "Creating directory: '$output_directory'" + mkdir -p $output_directory + + echo "Extracting archive" + tar -xf $zip_path -C $output_directory + if [[ $? != 0 ]]; then + echo "Unable to extract '$zip_path'" >&2 + return 1 + fi + + return 0 +} + +function GetCurrentOS { + local unameOut="$(uname -s)" + case $unameOut in + Linux*) echo "Linux";; + Darwin*) echo "MacOS";; + esac + return 0 +} + +function GetFile { + local uri=$1 + local path=$2 + local force=${3:-false} + local download_retries=${4:-5} + local retry_wait_time_seconds=${5:-30} + + if [[ -f $path ]]; then + if [[ $force = false ]]; then + echo "File '$path' already exists. Skipping download" + return 0 + else + rm -rf $path + fi + fi + + if [[ -f $uri ]]; then + echo "'$uri' is a file path, copying file to '$path'" + cp $uri $path + return $? + fi + + echo "Downloading $uri" + # Use curl if available, otherwise use wget + if command -v curl > /dev/null; then + curl "$uri" -sSL --retry $download_retries --retry-delay $retry_wait_time_seconds --create-dirs -o "$path" --fail + else + wget -q -O "$path" "$uri" --tries="$download_retries" + fi + + return $? +} + +function GetTempPathFileName { + local path=$1 + + local temp_dir=$(GetTempDirectory) + local temp_file_name=$(basename $path) + echo $temp_dir$temp_file_name + return 0 +} + +function DownloadAndExtract { + local uri=$1 + local installDir=$2 + local force=${3:-false} + local download_retries=${4:-5} + local retry_wait_time_seconds=${5:-30} + + local temp_tool_path=$(GetTempPathFileName $uri) + + echo "downloading to: $temp_tool_path" + + # Download file + GetFile "$uri" "$temp_tool_path" $force $download_retries $retry_wait_time_seconds + if [[ $? != 0 ]]; then + echo "Failed to download '$uri' to '$temp_tool_path'." >&2 + return 1 + fi + + # Extract File + echo "extracting from $temp_tool_path to $installDir" + ExpandZip "$temp_tool_path" "$installDir" $force $download_retries $retry_wait_time_seconds + if [[ $? != 0 ]]; then + echo "Failed to extract '$temp_tool_path' to '$installDir'." >&2 + return 1 + fi + + return 0 +} + +function NewScriptShim { + local shimpath=$1 + local tool_file_path=$2 + local force=${3:-false} + + echo "Generating '$shimpath' shim" + if [[ -f $shimpath ]]; then + if [[ $force = false ]]; then + echo "File '$shimpath' already exists." >&2 + return 1 + else + rm -rf $shimpath + fi + fi + + if [[ ! -f $tool_file_path ]]; then + echo "Specified tool file path:'$tool_file_path' does not exist" >&2 + return 1 + fi + + local shim_contents=$'#!/usr/bin/env bash\n' + shim_contents+="SHIMARGS="$'$1\n' + shim_contents+="$tool_file_path"$' $SHIMARGS\n' + + # Write shim file + echo "$shim_contents" > $shimpath + + chmod +x $shimpath + + echo "Finished generating shim '$shimpath'" + + return $? +} + diff --git a/eng/common/native/install-cmake.sh b/eng/common/native/install-cmake.sh new file mode 100755 index 00000000000..293af6017df --- /dev/null +++ b/eng/common/native/install-cmake.sh @@ -0,0 +1,117 @@ +#!/usr/bin/env bash + +source="${BASH_SOURCE[0]}" +scriptroot="$( cd -P "$( dirname "$source" )" && pwd )" + +. $scriptroot/common-library.sh + +base_uri= +install_path= +version= +clean=false +force=false +download_retries=5 +retry_wait_time_seconds=30 + +while (($# > 0)); do + lowerI="$(echo $1 | awk '{print tolower($0)}')" + case $lowerI in + --baseuri) + base_uri=$2 + shift 2 + ;; + --installpath) + install_path=$2 + shift 2 + ;; + --version) + version=$2 + shift 2 + ;; + --clean) + clean=true + shift 1 + ;; + --force) + force=true + shift 1 + ;; + --downloadretries) + download_retries=$2 + shift 2 + ;; + --retrywaittimeseconds) + retry_wait_time_seconds=$2 + shift 2 + ;; + --help) + echo "Common settings:" + echo " --baseuri Base file directory or Url wrom which to acquire tool archives" + echo " --installpath Base directory to install native tool to" + echo " --clean Don't install the tool, just clean up the current install of the tool" + echo " --force Force install of tools even if they previously exist" + echo " --help Print help and exit" + echo "" + echo "Advanced settings:" + echo " --downloadretries Total number of retry attempts" + echo " --retrywaittimeseconds Wait time between retry attempts in seconds" + echo "" + exit 0 + ;; + esac +done + +tool_name="cmake" +tool_os=$(GetCurrentOS) +tool_folder=$(echo $tool_os | awk '{print tolower($0)}') +tool_arch="x86_64" +tool_name_moniker="$tool_name-$version-$tool_os-$tool_arch" +tool_install_directory="$install_path/$tool_name/$version" +tool_file_path="$tool_install_directory/$tool_name_moniker/bin/$tool_name" +shim_path="$install_path/$tool_name.sh" +uri="${base_uri}/$tool_folder/cmake/$tool_name_moniker.tar.gz" + +# Clean up tool and installers +if [[ $clean = true ]]; then + echo "Cleaning $tool_install_directory" + if [[ -d $tool_install_directory ]]; then + rm -rf $tool_install_directory + fi + + echo "Cleaning $shim_path" + if [[ -f $shim_path ]]; then + rm -rf $shim_path + fi + + tool_temp_path=$(GetTempPathFileName $uri) + echo "Cleaning $tool_temp_path" + if [[ -f $tool_temp_path ]]; then + rm -rf $tool_temp_path + fi + + exit 0 +fi + +# Install tool +if [[ -f $tool_file_path ]] && [[ $force = false ]]; then + echo "$tool_name ($version) already exists, skipping install" + exit 0 +fi + +DownloadAndExtract $uri $tool_install_directory $force $download_retries $retry_wait_time_seconds + +if [[ $? != 0 ]]; then + echo "Installation failed" >&2 + exit 1 +fi + +# Generate Shim +# Always rewrite shims so that we are referencing the expected version +NewScriptShim $shim_path $tool_file_path true + +if [[ $? != 0 ]]; then + echo "Shim generation failed" >&2 + exit 1 +fi + +exit 0 \ No newline at end of file diff --git a/eng/common/native/install-tool.ps1 b/eng/common/native/install-tool.ps1 new file mode 100644 index 00000000000..635ab3fd414 --- /dev/null +++ b/eng/common/native/install-tool.ps1 @@ -0,0 +1,130 @@ +<# +.SYNOPSIS +Install native tool + +.DESCRIPTION +Install cmake native tool from Azure blob storage + +.PARAMETER InstallPath +Base directory to install native tool to + +.PARAMETER BaseUri +Base file directory or Url from which to acquire tool archives + +.PARAMETER CommonLibraryDirectory +Path to folder containing common library modules + +.PARAMETER Force +Force install of tools even if they previously exist + +.PARAMETER Clean +Don't install the tool, just clean up the current install of the tool + +.PARAMETER DownloadRetries +Total number of retry attempts + +.PARAMETER RetryWaitTimeInSeconds +Wait time between retry attempts in seconds + +.NOTES +Returns 0 if install succeeds, 1 otherwise +#> +[CmdletBinding(PositionalBinding=$false)] +Param ( + [Parameter(Mandatory=$True)] + [string] $ToolName, + [Parameter(Mandatory=$True)] + [string] $InstallPath, + [Parameter(Mandatory=$True)] + [string] $BaseUri, + [Parameter(Mandatory=$True)] + [string] $Version, + [string] $CommonLibraryDirectory = $PSScriptRoot, + [switch] $Force = $False, + [switch] $Clean = $False, + [int] $DownloadRetries = 5, + [int] $RetryWaitTimeInSeconds = 30 +) + +# Import common library modules +Import-Module -Name (Join-Path $CommonLibraryDirectory "CommonLibrary.psm1") + +try { + # Define verbose switch if undefined + $Verbose = $VerbosePreference -Eq "Continue" + + $Arch = CommonLibrary\Get-MachineArchitecture + $ToolOs = "win64" + if($Arch -Eq "x32") { + $ToolOs = "win32" + } + $ToolNameMoniker = "$ToolName-$Version-$ToolOs-$Arch" + $ToolInstallDirectory = Join-Path $InstallPath "$ToolName\$Version\" + $Uri = "$BaseUri/windows/$ToolName/$ToolNameMoniker.zip" + $ShimPath = Join-Path $InstallPath "$ToolName.exe" + + if ($Clean) { + Write-Host "Cleaning $ToolInstallDirectory" + if (Test-Path $ToolInstallDirectory) { + Remove-Item $ToolInstallDirectory -Force -Recurse + } + Write-Host "Cleaning $ShimPath" + if (Test-Path $ShimPath) { + Remove-Item $ShimPath -Force + } + $ToolTempPath = CommonLibrary\Get-TempPathFilename -Path $Uri + Write-Host "Cleaning $ToolTempPath" + if (Test-Path $ToolTempPath) { + Remove-Item $ToolTempPath -Force + } + exit 0 + } + + # Install tool + if ((Test-Path $ToolInstallDirectory) -And (-Not $Force)) { + Write-Verbose "$ToolName ($Version) already exists, skipping install" + } + else { + $InstallStatus = CommonLibrary\DownloadAndExtract -Uri $Uri ` + -InstallDirectory $ToolInstallDirectory ` + -Force:$Force ` + -DownloadRetries $DownloadRetries ` + -RetryWaitTimeInSeconds $RetryWaitTimeInSeconds ` + -Verbose:$Verbose + + if ($InstallStatus -Eq $False) { + Write-Error "Installation failed" + exit 1 + } + } + + $ToolFilePath = Get-ChildItem $ToolInstallDirectory -Recurse -Filter "$ToolName.exe" | % { $_.FullName } + if (@($ToolFilePath).Length -Gt 1) { + Write-Error "There are multiple copies of $ToolName in $($ToolInstallDirectory): `n$(@($ToolFilePath | out-string))" + exit 1 + } elseif (@($ToolFilePath).Length -Lt 1) { + Write-Error "$ToolName was not found in $ToolFilePath." + exit 1 + } + + # Generate shim + # Always rewrite shims so that we are referencing the expected version + $GenerateShimStatus = CommonLibrary\New-ScriptShim -ShimName $ToolName ` + -ShimDirectory $InstallPath ` + -ToolFilePath "$ToolFilePath" ` + -BaseUri $BaseUri ` + -Force:$Force ` + -Verbose:$Verbose + + if ($GenerateShimStatus -Eq $False) { + Write-Error "Generate shim failed" + return 1 + } + + exit 0 +} +catch { + Write-Host $_ + Write-Host $_.Exception + exit 1 +} diff --git a/eng/common/sdk-task.ps1 b/eng/common/sdk-task.ps1 new file mode 100644 index 00000000000..9ba7530122f --- /dev/null +++ b/eng/common/sdk-task.ps1 @@ -0,0 +1,74 @@ +[CmdletBinding(PositionalBinding=$false)] +Param( + [string] $projects = "", + [string][Alias('v')]$verbosity = "minimal", + [string] $msbuildEngine = $null, + [bool] $warnAsError = $true, + [switch][Alias('bl')]$binaryLog, + [switch][Alias('r')]$restore, + [switch] $ci, + [switch] $prepareMachine, + [switch] $help, + [Parameter(ValueFromRemainingArguments=$true)][String[]]$properties +) + +. $PSScriptRoot\tools.ps1 + +function Print-Usage() { + Write-Host "Common settings:" + Write-Host " -v[erbosity] Msbuild verbosity: q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic]" + Write-Host " -[bl|binaryLog] Output binary log (short: -bl)" + Write-Host " -help Print help and exit" + Write-Host "" + + Write-Host "Advanced settings:" + Write-Host " -restore Restore dependencies (short: -r)" + Write-Host " -projects Semi-colon delimited list of sln/proj's from the Arcade sdk to build. Globbing is supported (*.sln)" + Write-Host " -ci Set when running on CI server" + Write-Host " -prepareMachine Prepare machine for CI run" + Write-Host " -msbuildEngine Msbuild engine to use to run build ('dotnet', 'vs', or unspecified)." + Write-Host "" + Write-Host "Command line arguments not listed above are passed thru to msbuild." + Write-Host "The above arguments can be shortened as much as to be unambiguous (e.g. -co for configuration, -t for test, etc.)." +} + +function Build { + $toolsetBuildProj = InitializeToolset + + $toolsetBuildProj = Join-Path (Split-Path $toolsetBuildProj -Parent) "SdkTasks\SdkTask.proj" + $bl = if ($binaryLog) { "/bl:" + (Join-Path $LogDir "SdkTask.binlog") } else { "" } + MSBuild $toolsetBuildProj ` + $bl ` + /p:Projects=$projects ` + /p:Restore=$restore ` + /p:RepoRoot=$RepoRoot ` + /p:ContinuousIntegrationBuild=$ci ` + @properties +} + +try { + if ($help -or (($null -ne $properties) -and ($properties.Contains("/help") -or $properties.Contains("/?")))) { + Print-Usage + exit 0 + } + + if ($projects -eq "") { + Write-Error "Missing required parameter '-projects '" + Print-Usage + ExitWithExitCode 1 + } + + if ($ci) { + $binaryLog = $true + } + + Build +} +catch { + Write-Host $_ + Write-Host $_.Exception + Write-Host $_.ScriptStackTrace + ExitWithExitCode 1 +} + +ExitWithExitCode 0 diff --git a/eng/common/templates/job/job.yml b/eng/common/templates/job/job.yml new file mode 100644 index 00000000000..5e293db35d7 --- /dev/null +++ b/eng/common/templates/job/job.yml @@ -0,0 +1,205 @@ +parameters: +# Job schema parameters - https://docs.microsoft.com/en-us/azure/devops/pipelines/yaml-schema?view=vsts&tabs=schema#job + cancelTimeoutInMinutes: '' + + condition: '' + + continueOnError: false + + container: '' + + dependsOn: '' + + displayName: '' + + steps: [] + + pool: '' + + strategy: '' + + timeoutInMinutes: '' + + variables: [] + + workspace: '' + +# Job base template specific parameters + # Optional: Enable installing Microbuild plugin + # if 'true', these "variables" must be specified in the variables object or as part of the queue matrix + # _TeamName - the name of your team + # _SignType - 'test' or 'real' + enableMicrobuild: false + + # Optional: Include PublishBuildArtifacts task + enablePublishBuildArtifacts: false + + # Optional: Enable publishing to the build asset registry + enablePublishBuildAssets: false + + # Optional: Include PublishTestResults task + enablePublishTestResults: false + + # Optional: enable sending telemetry + # if 'true', these "variables" must be specified in the variables object or as part of the queue matrix + # _HelixBuildConfig - differentiate between Debug, Release, other + # _HelixType - Example: build/product/ + # _HelixSource - Example: official/dotnet/arcade/$(Build.SourceBranch) + enableTelemetry: false + + # Optional: If specified, then automatically derive "_HelixSource" variable for telemetry + helixRepo: '' + + # Optional: Define the type for helix telemetry (must end in '/') + helixType: build/product/ + + # Required: name of the job + name: '' + + # Optional: should run as a public build even in the internal project + # if 'true', the build won't run any of the internal only steps, even if it is running in non-public projects. + runAsPublic: false + +# Internal resources (telemetry, microbuild) can only be accessed from non-public projects, +# and some (Microbuild) should only be applied to non-PR cases for internal builds. + +jobs: +- job: ${{ parameters.name }} + + ${{ if ne(parameters.cancelTimeoutInMinutes, '') }}: + cancelTimeoutInMinutes: ${{ parameters.cancelTimeoutInMinutes }} + + ${{ if ne(parameters.condition, '') }}: + condition: ${{ parameters.condition }} + + ${{ if ne(parameters.container, '') }}: + container: ${{ parameters.container }} + + ${{ if ne(parameters.continueOnError, '') }}: + continueOnError: ${{ parameters.continueOnError }} + + ${{ if ne(parameters.dependsOn, '') }}: + dependsOn: ${{ parameters.dependsOn }} + + ${{ if ne(parameters.displayName, '') }}: + displayName: ${{ parameters.displayName }} + + ${{ if ne(parameters.pool, '') }}: + pool: ${{ parameters.pool }} + + ${{ if ne(parameters.strategy, '') }}: + strategy: ${{ parameters.strategy }} + + ${{ if ne(parameters.timeoutInMinutes, '') }}: + timeoutInMinutes: ${{ parameters.timeoutInMinutes }} + + variables: + - ${{ each variable in parameters.variables }}: + # handle name-value variable syntax + # example: + # - name: [key] + # value: [value] + - ${{ if ne(variable.name, '') }}: + - name: ${{ variable.name }} + value: ${{ variable.value }} + + # handle variable groups + - ${{ if ne(variable.group, '') }}: + - group: ${{ variable.group }} + + # handle key-value variable syntax. + # example: + # - [key]: [value] + - ${{ if and(eq(variable.name, ''), eq(variable.group, '')) }}: + - ${{ each pair in variable }}: + - name: ${{ pair.key }} + value: ${{ pair.value }} + + # Add additional variables + - ${{ if and(ne(parameters.helixRepo, ''), eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notIn(variables['Build.Reason'], 'PullRequest')) }}: + - name: _HelixSource + value: official/${{ parameters.helixRepo }}/$(Build.SourceBranch) + - ${{ if and(ne(parameters.helixRepo, ''), or(ne(parameters.runAsPublic, 'false'), eq(variables['System.TeamProject'], 'public'), in(variables['Build.Reason'], 'PullRequest'))) }}: + - name: _HelixSource + value: pr/${{ parameters.helixRepo }}/$(Build.SourceBranch) + - name: _HelixType + value: ${{ parameters.helixType }} + - name: _HelixBuildConfig + value: $(_BuildConfig) + + ${{ if ne(parameters.workspace, '') }}: + workspace: ${{ parameters.workspace }} + + steps: + - ${{ if eq(parameters.enableTelemetry, 'true') }}: + - template: /eng/common/templates/steps/telemetry-start.yml + parameters: + buildConfig: $(_HelixBuildConfig) + helixSource: $(_HelixSource) + helixType: $(_HelixType) + runAsPublic: ${{ parameters.runAsPublic }} + + - ${{ if eq(parameters.enableMicrobuild, 'true') }}: + - ${{ if and(eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: + - task: MicroBuildSigningPlugin@2 + displayName: Install MicroBuild plugin + inputs: + signType: $(_SignType) + zipSources: false + feedSource: https://dnceng.pkgs.visualstudio.com/_packaging/MicroBuildToolset/nuget/v3/index.json + env: + TeamName: $(_TeamName) + continueOnError: ${{ parameters.continueOnError }} + condition: and(succeeded(), in(variables['_SignType'], 'real', 'test'), eq(variables['Agent.Os'], 'Windows_NT')) + + - ${{ each step in parameters.steps }}: + - ${{ step }} + + - ${{ if eq(parameters.enableMicrobuild, 'true') }}: + - ${{ if and(eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: + - task: MicroBuildCleanup@1 + displayName: Execute Microbuild cleanup tasks + condition: and(always(), in(variables['_SignType'], 'real', 'test'), eq(variables['Agent.Os'], 'Windows_NT')) + continueOnError: ${{ parameters.continueOnError }} + env: + TeamName: $(_TeamName) + + - ${{ if eq(parameters.enableTelemetry, 'true') }}: + - template: /eng/common/templates/steps/telemetry-end.yml + + - ${{ if eq(parameters.enablePublishBuildArtifacts, 'true') }}: + - task: PublishBuildArtifacts@1 + displayName: Publish Logs to VSTS + inputs: + PathtoPublish: '$(Build.SourcesDirectory)/artifacts/log/$(_BuildConfig)' + PublishLocation: Container + ArtifactName: $(Agent.Os)_$(Agent.JobName) + continueOnError: true + condition: always() + + - ${{ if eq(parameters.enablePublishTestResults, 'true') }}: + - task: PublishTestResults@2 + displayName: Publish Test Results + inputs: + testResultsFormat: 'xUnit' + testResultsFiles: '*.xml' + searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig)' + continueOnError: true + condition: always() + + - ${{ if and(eq(parameters.enablePublishBuildAssets, true), eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: + - task: CopyFiles@2 + displayName: Gather Asset Manifests + inputs: + SourceFolder: '$(Build.SourcesDirectory)/artifacts/log/$(_BuildConfig)/AssetManifest' + TargetFolder: '$(Build.StagingDirectory)/AssetManifests' + continueOnError: ${{ parameters.continueOnError }} + condition: and(succeeded(), eq(variables['_DotNetPublishToBlobFeed'], 'true')) + - task: PublishBuildArtifacts@1 + displayName: Push Asset Manifests + inputs: + PathtoPublish: '$(Build.StagingDirectory)/AssetManifests' + PublishLocation: Container + ArtifactName: AssetManifests + continueOnError: ${{ parameters.continueOnError }} + condition: and(succeeded(), eq(variables['_DotNetPublishToBlobFeed'], 'true')) \ No newline at end of file diff --git a/eng/common/templates/job/publish-build-assets.yml b/eng/common/templates/job/publish-build-assets.yml new file mode 100644 index 00000000000..c094658fefc --- /dev/null +++ b/eng/common/templates/job/publish-build-assets.yml @@ -0,0 +1,63 @@ +parameters: + configuration: 'Debug' + + # Optional: condition for the job to run + condition: '' + + # Optional: 'true' if future jobs should run even if this job fails + continueOnError: false + + # Optional: dependencies of the job + dependsOn: '' + + # Optional: Include PublishBuildArtifacts task + enablePublishBuildArtifacts: false + + # Optional: A defined YAML pool - https://docs.microsoft.com/en-us/azure/devops/pipelines/yaml-schema?view=vsts&tabs=schema#pool + pool: {} + + # Optional: should run as a public build even in the internal project + # if 'true', the build won't run any of the internal only steps, even if it is running in non-public projects. + runAsPublic: false + +jobs: +- job: Asset_Registry_Publish + + dependsOn: ${{ parameters.dependsOn }} + + displayName: Publish to Build Asset Registry + + pool: ${{ parameters.pool }} + + variables: + - ${{ if and(eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: + - name: _BuildConfig + value: ${{ parameters.configuration }} + - group: Publish-Build-Assets + + steps: + - ${{ if and(eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: + - task: DownloadBuildArtifacts@0 + displayName: Download artifact + inputs: + artifactName: AssetManifests + downloadPath: '$(Build.StagingDirectory)/Download' + condition: ${{ parameters.condition }} + continueOnError: ${{ parameters.continueOnError }} + - script: eng\common\publishbuildassets.cmd + /p:ManifestsPath='$(Build.StagingDirectory)/Download/AssetManifests' + /p:BuildAssetRegistryToken=$(MaestroAccessToken) + /p:MaestroApiEndpoint=https://maestro-prod.westus2.cloudapp.azure.com + /p:Configuration=$(_BuildConfig) + displayName: Publish Build Assets + condition: ${{ parameters.condition }} + continueOnError: ${{ parameters.continueOnError }} + - ${{ if eq(parameters.enablePublishBuildArtifacts, 'true') }}: + - task: PublishBuildArtifacts@1 + displayName: Publish Logs to VSTS + inputs: + PathtoPublish: '$(Build.SourcesDirectory)/artifacts/log/$(_BuildConfig)' + PublishLocation: Container + ArtifactName: $(Agent.Os)_PublishBuildAssets + continueOnError: true + condition: always() diff --git a/eng/common/templates/jobs/jobs.yml b/eng/common/templates/jobs/jobs.yml new file mode 100644 index 00000000000..c7226b12ed2 --- /dev/null +++ b/eng/common/templates/jobs/jobs.yml @@ -0,0 +1,77 @@ +parameters: + # Optional: 'true' if failures in job.yml job should not fail the job + continueOnError: false + + # Optional: Enable installing Microbuild plugin + # if 'true', these "variables" must be specified in the variables object or as part of the queue matrix + # _TeamName - the name of your team + # _SignType - 'test' or 'real' + enableMicrobuild: false + + # Optional: Include PublishBuildArtifacts task + enablePublishBuildArtifacts: false + + # Optional: Enable publishing to the build asset registry + enablePublishBuildAssets: false + + # Optional: Include PublishTestResults task + enablePublishTestResults: false + + # Optional: enable sending telemetry + # if 'true', these "variables" must be specified in the variables object or as part of the queue matrix + # _HelixBuildConfig - differentiate between Debug, Release, other + # _HelixType - Example: build/product/ + # _HelixSource - Example: official/dotnet/arcade/$(Build.SourceBranch) + enableTelemetry: false + + # Required: A collection of jobs to run - https://docs.microsoft.com/en-us/azure/devops/pipelines/yaml-schema?view=vsts&tabs=schema#job + jobs: [] + + # Optional: If specified, then automatically derive "_HelixSource" variable for telemetry + helixRepo: '' + + # Optional: Define the type for helix telemetry (must end in '/') + helixType: build/product/ + + # Optional: Override automatically derived dependsOn value for "publish build assets" job + publishBuildAssetsDependsOn: '' + + # Optional: should run as a public build even in the internal project + # if 'true', the build won't run any of the internal only steps, even if it is running in non-public projects. + runAsPublic: false + +# Internal resources (telemetry, microbuild) can only be accessed from non-public projects, +# and some (Microbuild) should only be applied to non-PR cases for internal builds. + +jobs: +- ${{ each job in parameters.jobs }}: + - template: ../job/job.yml + parameters: + # pass along parameters + ${{ each parameter in parameters }}: + ${{ if ne(parameter.key, 'jobs') }}: + ${{ parameter.key }}: ${{ parameter.value }} + + # pass along job properties + ${{ each property in job }}: + ${{ if ne(property.key, 'job') }}: + ${{ property.key }}: ${{ property.value }} + + name: ${{ job.job }} + +- ${{ if and(eq(parameters.enablePublishBuildAssets, true), eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: + - template: ../job/publish-build-assets.yml + parameters: + continueOnError: ${{ parameters.continueOnError }} + dependsOn: + - ${{ if ne(parameters.publishBuildAssetsDependsOn, '') }}: + - ${{ each job in parameters.publishBuildAssetsDependsOn }}: + - ${{ job.job }} + - ${{ if eq(parameters.publishBuildAssetsDependsOn, '') }}: + - ${{ each job in parameters.jobs }}: + - ${{ job.job }} + pool: + vmImage: vs2017-win2016 + runAsPublic: ${{ parameters.runAsPublic }} + enablePublishBuildArtifacts: ${{ parameters.enablePublishBuildArtifacts }} + diff --git a/eng/common/templates/phases/base.yml b/eng/common/templates/phases/base.yml new file mode 100644 index 00000000000..0123cf43b16 --- /dev/null +++ b/eng/common/templates/phases/base.yml @@ -0,0 +1,130 @@ +parameters: + # Optional: Clean sources before building + clean: true + + # Optional: Git fetch depth + fetchDepth: '' + + # Optional: name of the phase (not specifying phase name may cause name collisions) + name: '' + # Optional: display name of the phase + displayName: '' + + # Optional: condition for the job to run + condition: '' + + # Optional: dependencies of the phase + dependsOn: '' + + # Required: A defined YAML queue + queue: {} + + # Required: build steps + steps: [] + + # Optional: variables + variables: {} + + # Optional: should run as a public build even in the internal project + # if 'true', the build won't run any of the internal only steps, even if it is running in non-public projects. + runAsPublic: false + + ## Telemetry variables + + # Optional: enable sending telemetry + # if 'true', these "variables" must be specified in the variables object or as part of the queue matrix + # _HelixBuildConfig - differentiate between Debug, Release, other + # _HelixSource - Example: build/product + # _HelixType - Example: official/dotnet/arcade/$(Build.SourceBranch) + enableTelemetry: false + + # Optional: Enable installing Microbuild plugin + # if 'true', these "variables" must be specified in the variables object or as part of the queue matrix + # _TeamName - the name of your team + # _SignType - 'test' or 'real' + enableMicrobuild: false + +# Internal resources (telemetry, microbuild) can only be accessed from non-public projects, +# and some (Microbuild) should only be applied to non-PR cases for internal builds. + +phases: +- phase: ${{ parameters.name }} + + ${{ if ne(parameters.displayName, '') }}: + displayName: ${{ parameters.displayName }} + + ${{ if ne(parameters.condition, '') }}: + condition: ${{ parameters.condition }} + + ${{ if ne(parameters.dependsOn, '') }}: + dependsOn: ${{ parameters.dependsOn }} + + queue: ${{ parameters.queue }} + + ${{ if ne(parameters.variables, '') }}: + variables: + ${{ insert }}: ${{ parameters.variables }} + + steps: + - checkout: self + clean: ${{ parameters.clean }} + ${{ if ne(parameters.fetchDepth, '') }}: + fetchDepth: ${{ parameters.fetchDepth }} + + - ${{ if eq(parameters.enableTelemetry, 'true') }}: + - template: /eng/common/templates/steps/telemetry-start.yml + parameters: + buildConfig: $(_HelixBuildConfig) + helixSource: $(_HelixSource) + helixType: $(_HelixType) + runAsPublic: ${{ parameters.runAsPublic }} + + - ${{ if eq(parameters.enableMicrobuild, 'true') }}: + # Internal only resource, and Microbuild signing shouldn't be applied to PRs. + - ${{ if and(eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: + - task: MicroBuildSigningPlugin@2 + displayName: Install MicroBuild plugin + inputs: + signType: $(_SignType) + zipSources: false + feedSource: https://dnceng.pkgs.visualstudio.com/_packaging/MicroBuildToolset/nuget/v3/index.json + + env: + TeamName: $(_TeamName) + continueOnError: false + condition: and(succeeded(), in(variables['_SignType'], 'real', 'test'), eq(variables['Agent.Os'], 'Windows_NT')) + + # Run provided build steps + - ${{ parameters.steps }} + + - ${{ if eq(parameters.enableMicrobuild, 'true') }}: + # Internal only resources + - ${{ if and(eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: + - task: MicroBuildCleanup@1 + displayName: Execute Microbuild cleanup tasks + condition: and(always(), in(variables['_SignType'], 'real', 'test'), eq(variables['Agent.Os'], 'Windows_NT')) + env: + TeamName: $(_TeamName) + + - ${{ if eq(parameters.enableTelemetry, 'true') }}: + - template: /eng/common/templates/steps/telemetry-end.yml + parameters: + helixSource: $(_HelixSource) + helixType: $(_HelixType) + + - ${{ if and(eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: + - task: CopyFiles@2 + displayName: Gather Asset Manifests + inputs: + SourceFolder: '$(Build.SourcesDirectory)/artifacts/log/$(_BuildConfig)/AssetManifest' + TargetFolder: '$(Build.StagingDirectory)/AssetManifests' + continueOnError: false + condition: and(succeeded(), eq(variables['_DotNetPublishToBlobFeed'], 'true')) + - task: PublishBuildArtifacts@1 + displayName: Push Asset Manifests + inputs: + PathtoPublish: '$(Build.StagingDirectory)/AssetManifests' + PublishLocation: Container + ArtifactName: AssetManifests + continueOnError: false + condition: and(succeeded(), eq(variables['_DotNetPublishToBlobFeed'], 'true')) diff --git a/eng/common/templates/phases/publish-build-assets.yml b/eng/common/templates/phases/publish-build-assets.yml new file mode 100644 index 00000000000..0df6203b506 --- /dev/null +++ b/eng/common/templates/phases/publish-build-assets.yml @@ -0,0 +1,46 @@ +parameters: + dependsOn: '' + queue: {} + configuration: 'Debug' + condition: succeeded() + continueOnError: false + runAsPublic: false +phases: + - phase: Asset_Registry_Publish + displayName: Publish to Build Asset Registry + dependsOn: ${{ parameters.dependsOn }} + queue: ${{ parameters.queue }} + variables: + _BuildConfig: ${{ parameters.configuration }} + steps: + - ${{ if and(eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: + - task: DownloadBuildArtifacts@0 + displayName: Download artifact + inputs: + artifactName: AssetManifests + downloadPath: '$(Build.StagingDirectory)/Download' + condition: ${{ parameters.condition }} + continueOnError: ${{ parameters.continueOnError }} + - task: AzureKeyVault@1 + inputs: + azureSubscription: 'DotNet-Engineering-Services_KeyVault' + KeyVaultName: EngKeyVault + SecretsFilter: 'MaestroAccessToken' + condition: ${{ parameters.condition }} + continueOnError: ${{ parameters.continueOnError }} + - script: eng\common\publishbuildassets.cmd + -configuration $(_BuildConfig) + /p:ManifestsPath='$(Build.StagingDirectory)/Download/AssetManifests' + /p:BuildAssetRegistryToken=$(MaestroAccessToken) + /p:MaestroApiEndpoint=https://maestro-prod.westus2.cloudapp.azure.com + displayName: Publish Build Assets + condition: ${{ parameters.condition }} + continueOnError: ${{ parameters.continueOnError }} + - task: PublishBuildArtifacts@1 + displayName: Publish Logs to VSTS + inputs: + PathtoPublish: '$(Build.SourcesDirectory)/artifacts/log/$(_BuildConfig)' + PublishLocation: Container + ArtifactName: $(Agent.Os)_Asset_Registry_Publish + continueOnError: true + condition: always() diff --git a/eng/common/templates/steps/build-reason.yml b/eng/common/templates/steps/build-reason.yml new file mode 100644 index 00000000000..eba58109b52 --- /dev/null +++ b/eng/common/templates/steps/build-reason.yml @@ -0,0 +1,12 @@ +# build-reason.yml +# Description: runs steps if build.reason condition is valid. conditions is a string of valid build reasons +# to include steps (',' separated). +parameters: + conditions: '' + steps: [] + +steps: + - ${{ if and( not(startsWith(parameters.conditions, 'not')), contains(parameters.conditions, variables['build.reason'])) }}: + - ${{ parameters.steps }} + - ${{ if and( startsWith(parameters.conditions, 'not'), not(contains(parameters.conditions, variables['build.reason']))) }}: + - ${{ parameters.steps }} diff --git a/eng/common/templates/steps/helix-publish.yml b/eng/common/templates/steps/helix-publish.yml new file mode 100644 index 00000000000..470ab65da0c --- /dev/null +++ b/eng/common/templates/steps/helix-publish.yml @@ -0,0 +1,51 @@ +parameters: + HelixSource: 'pr/dotnet-github-anon-kaonashi-bot' + HelixType: ̓'tests/default' + HelixBuild: $(Build.BuildNumber) + HelixTargetQueues: '' + HelixAccessToken: '' + HelixPreCommands: '' + HelixPostCommands: '' + WorkItemDirectory: '' + WorkItemCommand: '' + CorrelationPayloadDirectory: '' + XUnitProjects: '' + XUnitTargetFramework: '' + XUnitRunnerVersion: '' + IncludeDotNetCli: false + DotNetCliPackageType: '' + DotNetCliVersion: '' + EnableXUnitReporter: false + WaitForWorkItemCompletion: true + condition: succeeded() + continueOnError: false + +steps: + - task: DotNetCoreCLI@2 + inputs: + command: custom + projects: eng/common/helixpublish.proj + custom: msbuild + arguments: '/bl:$(Build.SourcesDirectory)/artifacts/log/$(_BuildConfig)/SendToHelix.binlog' + displayName: Send job to Helix + env: + HelixSource: ${{ parameters.HelixSource }} + HelixType: ${{ parameters.HelixType }} + HelixBuild: ${{ parameters.HelixBuild }} + HelixTargetQueues: ${{ parameters.HelixTargetQueues }} + HelixAccessToken: ${{ parameters.HelixAccessToken }} + HelixPreCommands: ${{ parameters.HelixPreCommands }} + HelixPostCommands: ${{ parameters.HelixPostCommands }} + WorkItemDirectory: ${{ parameters.WorkItemDirectory }} + WorkItemCommand: ${{ parameters.WorkItemCommand }} + CorrelationPayloadDirectory: ${{ parameters.CorrelationPayloadDirectory }} + XUnitProjects: ${{ parameters.XUnitProjects }} + XUnitRuntimeTargetFramework: ${{ parameters.XUnitTargetFramework }} + XUnitRunnerVersion: ${{ parameters.XUnitRunnerVersion }} + IncludeDotNetCli: ${{ parameters.IncludeDotNetCli }} + DotNetCliPackageType: ${{ parameters.DotNetCliPackageType }} + DotNetCliVersion: ${{ parameters.DotNetCliVersion }} + EnableXUnitReporter: ${{ parameters.EnableXUnitReporter }} + WaitForWorkItemCompletion: ${{ parameters.WaitForWorkItemCompletion }} + condition: ${{ parameters.condition }} + continueOnError: ${{ parameters.continueOnError }} diff --git a/eng/common/templates/steps/run-on-unix.yml b/eng/common/templates/steps/run-on-unix.yml new file mode 100644 index 00000000000..e1733814f65 --- /dev/null +++ b/eng/common/templates/steps/run-on-unix.yml @@ -0,0 +1,7 @@ +parameters: + agentOs: '' + steps: [] + +steps: +- ${{ if ne(parameters.agentOs, 'Windows_NT') }}: + - ${{ parameters.steps }} diff --git a/eng/common/templates/steps/run-on-windows.yml b/eng/common/templates/steps/run-on-windows.yml new file mode 100644 index 00000000000..73e7e9c275a --- /dev/null +++ b/eng/common/templates/steps/run-on-windows.yml @@ -0,0 +1,7 @@ +parameters: + agentOs: '' + steps: [] + +steps: +- ${{ if eq(parameters.agentOs, 'Windows_NT') }}: + - ${{ parameters.steps }} diff --git a/eng/common/templates/steps/run-script-ifequalelse.yml b/eng/common/templates/steps/run-script-ifequalelse.yml new file mode 100644 index 00000000000..3d1242f5587 --- /dev/null +++ b/eng/common/templates/steps/run-script-ifequalelse.yml @@ -0,0 +1,33 @@ +parameters: + # if parameter1 equals parameter 2, run 'ifScript' command, else run 'elsescript' command + parameter1: '' + parameter2: '' + ifScript: '' + elseScript: '' + + # name of script step + name: Script + + # display name of script step + displayName: If-Equal-Else Script + + # environment + env: {} + + # conditional expression for step execution + condition: '' + +steps: +- ${{ if and(ne(parameters.ifScript, ''), eq(parameters.parameter1, parameters.parameter2)) }}: + - script: ${{ parameters.ifScript }} + name: ${{ parameters.name }} + displayName: ${{ parameters.displayName }} + env: ${{ parameters.env }} + condition: ${{ parameters.condition }} + +- ${{ if and(ne(parameters.elseScript, ''), ne(parameters.parameter1, parameters.parameter2)) }}: + - script: ${{ parameters.elseScript }} + name: ${{ parameters.name }} + displayName: ${{ parameters.displayName }} + env: ${{ parameters.env }} + condition: ${{ parameters.condition }} \ No newline at end of file diff --git a/eng/common/templates/steps/send-to-helix.yml b/eng/common/templates/steps/send-to-helix.yml new file mode 100644 index 00000000000..a5835c0f473 --- /dev/null +++ b/eng/common/templates/steps/send-to-helix.yml @@ -0,0 +1,81 @@ +parameters: + HelixSource: 'pr/default' # required -- sources must start with pr/, official/, prodcon/, or agent/ + HelixType: 'tests/default/' # required -- Helix telemetry which identifies what type of data this is; should include "test" for clarity and must end in '/' + HelixBuild: $(Build.BuildNumber) # required -- the build number Helix will use to identify this -- automatically set to the AzDO build number + HelixTargetQueues: '' # required -- semicolon delimited list of Helix queues to test on; see https://helix.dot.net/api/2018-03-14/info/queues for a list of queues + HelixAccessToken: '' # required -- access token to make Helix API requests; should be provided by the appropriate variable group + HelixPreCommands: '' # optional -- commands to run before Helix work item execution + HelixPostCommands: '' # optional -- commands to run after Helix work item execution + WorkItemDirectory: '' # optional -- a payload directory to zip up and send to Helix; requires WorkItemCommand; incompatible with XUnitProjects + WorkItemCommand: '' # optional -- a command to execute on the payload; requires WorkItemDirectory; incompatible with XUnitProjects + WorkItemTimeout: '' # optional -- a timeout in seconds for the work item command; requires WorkItemDirectory; incompatible with XUnitProjects + CorrelationPayloadDirectory: '' # optional -- a directory to zip up and send to Helix as a correlation payload + XUnitProjects: '' # optional -- semicolon delimited list of XUnitProjects to parse and send to Helix; requires XUnitRuntimeTargetFramework, XUnitPublishTargetFramework, XUnitRunnerVersion, and IncludeDotNetCli=true + XUnitPublishTargetFramework: '' # optional -- framework to use to publish your xUnit projects + XUnitRuntimeTargetFramework: '' # optional -- framework to use for the xUnit console runner + XUnitRunnerVersion: '' # optional -- version of the xUnit nuget package you wish to use on Helix; required for XUnitProjects + IncludeDotNetCli: false # optional -- true will download a version of the .NET CLI onto the Helix machine as a correlation payload; requires DotNetCliPackageType and DotNetCliVersion + DotNetCliPackageType: '' # optional -- either 'sdk' or 'runtime'; determines whether the sdk or runtime will be sent to Helix; see https://raw.githubusercontent.com/dotnet/core/master/release-notes/releases.json + DotNetCliVersion: '' # optional -- version of the CLI to send to Helix; based on this: https://raw.githubusercontent.com/dotnet/core/master/release-notes/releases.json + EnableXUnitReporter: false # optional -- true enables XUnit result reporting to Mission Control + WaitForWorkItemCompletion: true # optional -- true will make the task wait until work items have been completed and fail the build if work items fail. False is "fire and forget." + IsExternal: false # [DEPRECATED] -- doesn't do anything, jobs are external if HelixAccessToken is empty and Creator is set + Creator: '' # optional -- if the build is external, use this to specify who is sending the job + condition: succeeded() # optional -- condition for step to execute; defaults to succeeded() + continueOnError: false # optional -- determines whether to continue the build if the step errors; defaults to false + +steps: + - powershell: 'powershell "$env:BUILD_SOURCESDIRECTORY\eng\common\msbuild.ps1 $env:BUILD_SOURCESDIRECTORY\eng\common\helixpublish.proj /bl:$env:BUILD_SOURCESDIRECTORY\artifacts\log\$env:BuildConfig\SendToHelix.binlog"' + displayName: Send job to Helix (Windows) + env: + BuildConfig: $(_BuildConfig) + HelixSource: ${{ parameters.HelixSource }} + HelixType: ${{ parameters.HelixType }} + HelixBuild: ${{ parameters.HelixBuild }} + HelixTargetQueues: ${{ parameters.HelixTargetQueues }} + HelixAccessToken: ${{ parameters.HelixAccessToken }} + HelixPreCommands: ${{ parameters.HelixPreCommands }} + HelixPostCommands: ${{ parameters.HelixPostCommands }} + WorkItemDirectory: ${{ parameters.WorkItemDirectory }} + WorkItemCommand: ${{ parameters.WorkItemCommand }} + WorkItemTimeout: ${{ parameters.WorkItemTimeout }} + CorrelationPayloadDirectory: ${{ parameters.CorrelationPayloadDirectory }} + XUnitProjects: ${{ parameters.XUnitProjects }} + XUnitPublishTargetFramework: ${{ parameters.XUnitPublishTargetFramework }} + XUnitRuntimeTargetFramework: ${{ parameters.XUnitRuntimeTargetFramework }} + XUnitRunnerVersion: ${{ parameters.XUnitRunnerVersion }} + IncludeDotNetCli: ${{ parameters.IncludeDotNetCli }} + DotNetCliPackageType: ${{ parameters.DotNetCliPackageType }} + DotNetCliVersion: ${{ parameters.DotNetCliVersion }} + EnableXUnitReporter: ${{ parameters.EnableXUnitReporter }} + WaitForWorkItemCompletion: ${{ parameters.WaitForWorkItemCompletion }} + Creator: ${{ parameters.Creator }} + condition: and(${{ parameters.condition }}, eq(variables['Agent.Os'], 'Windows_NT')) + continueOnError: ${{ parameters.continueOnError }} + - script: $BUILD_SOURCESDIRECTORY/eng/common/msbuild.sh $BUILD_SOURCESDIRECTORY/eng/common/helixpublish.proj /bl:$BUILD_SOURCESDIRECTORY/artifacts/log/$BuildConfig/SendToHelix.binlog + displayName: Send job to Helix (Unix) + env: + BuildConfig: $(_BuildConfig) + HelixSource: ${{ parameters.HelixSource }} + HelixType: ${{ parameters.HelixType }} + HelixBuild: ${{ parameters.HelixBuild }} + HelixTargetQueues: ${{ parameters.HelixTargetQueues }} + HelixAccessToken: ${{ parameters.HelixAccessToken }} + HelixPreCommands: ${{ parameters.HelixPreCommands }} + HelixPostCommands: ${{ parameters.HelixPostCommands }} + WorkItemDirectory: ${{ parameters.WorkItemDirectory }} + WorkItemCommand: ${{ parameters.WorkItemCommand }} + WorkItemTimeout: ${{ parameters.WorkItemTimeout }} + CorrelationPayloadDirectory: ${{ parameters.CorrelationPayloadDirectory }} + XUnitProjects: ${{ parameters.XUnitProjects }} + XUnitPublishTargetFramework: ${{ parameters.XUnitPublishTargetFramework }} + XUnitRuntimeTargetFramework: ${{ parameters.XUnitRuntimeTargetFramework }} + XUnitRunnerVersion: ${{ parameters.XUnitRunnerVersion }} + IncludeDotNetCli: ${{ parameters.IncludeDotNetCli }} + DotNetCliPackageType: ${{ parameters.DotNetCliPackageType }} + DotNetCliVersion: ${{ parameters.DotNetCliVersion }} + EnableXUnitReporter: ${{ parameters.EnableXUnitReporter }} + WaitForWorkItemCompletion: ${{ parameters.WaitForWorkItemCompletion }} + Creator: ${{ parameters.Creator }} + condition: and(${{ parameters.condition }}, ne(variables['Agent.Os'], 'Windows_NT')) + continueOnError: ${{ parameters.continueOnError }} diff --git a/eng/common/templates/steps/telemetry-end.yml b/eng/common/templates/steps/telemetry-end.yml new file mode 100644 index 00000000000..9b61481e7e1 --- /dev/null +++ b/eng/common/templates/steps/telemetry-end.yml @@ -0,0 +1,63 @@ +steps: +- bash: | + if [ "$AGENT_JOBSTATUS" = "Succeeded" ] || [ "$AGENT_JOBSTATUS" = "PartiallySucceeded" ]; then + errorCount=0 + else + errorCount=1 + fi + warningCount=0 + + # create a temporary file for curl output + res=`mktemp` + + curlResult=` + curl --verbose --output $res --write-out "%{http_code}"\ + -H 'Content-Type: application/json' \ + -H "X-Helix-Job-Token: $Helix_JobToken" \ + -H 'Content-Length: 0' \ + -X POST -G "https://helix.dot.net/api/2018-03-14/telemetry/job/build/$Helix_WorkItemId/finish" \ + --data-urlencode "errorCount=$errorCount" \ + --data-urlencode "warningCount=$warningCount"` + curlStatus=$? + + if [ $curlStatus -eq 0 ]; then + if [ $curlResult -gt 299 ] || [ $curlResult -lt 200 ]; then + curlStatus=$curlResult + fi + fi + + if [ $curlStatus -ne 0 ]; then + echo "Failed to Send Build Finish information" + vstsLogOutput="vso[task.logissue type=error;sourcepath=templates/steps/telemetry-end.yml;code=1;]Failed to Send Build Finish information: $curlStatus" + echo "##$vstsLogOutput" + exit 1 + fi + displayName: Send Unix Build End Telemetry + env: + # defined via VSTS variables in start-job.sh + Helix_JobToken: $(Helix_JobToken) + Helix_WorkItemId: $(Helix_WorkItemId) + condition: and(always(), ne(variables['Agent.Os'], 'Windows_NT')) +- powershell: | + if (($env:Agent_JobStatus -eq 'Succeeded') -or ($env:Agent_JobStatus -eq 'PartiallySucceeded')) { + $ErrorCount = 0 + } else { + $ErrorCount = 1 + } + $WarningCount = 0 + + try { + Invoke-RestMethod -Uri "https://helix.dot.net/api/2018-03-14/telemetry/job/build/$env:Helix_WorkItemId/finish?errorCount=$ErrorCount&warningCount=$WarningCount" -Method Post -ContentType "application/json" -Body "" ` + -Headers @{ 'X-Helix-Job-Token'=$env:Helix_JobToken } + } + catch { + Write-Error $_ + Write-Error $_.Exception + exit 1 + } + displayName: Send Windows Build End Telemetry + env: + # defined via VSTS variables in start-job.ps1 + Helix_JobToken: $(Helix_JobToken) + Helix_WorkItemId: $(Helix_WorkItemId) + condition: and(always(),eq(variables['Agent.Os'], 'Windows_NT')) diff --git a/eng/common/templates/steps/telemetry-start.yml b/eng/common/templates/steps/telemetry-start.yml new file mode 100644 index 00000000000..79c128c5de8 --- /dev/null +++ b/eng/common/templates/steps/telemetry-start.yml @@ -0,0 +1,154 @@ +parameters: + helixSource: 'undefined_defaulted_in_telemetry.yml' + helixType: 'undefined_defaulted_in_telemetry.yml' + buildConfig: '' + runAsPublic: false + +steps: +- ${{ if and(eq(parameters.runAsPublic, 'false'), not(eq(variables['System.TeamProject'], 'public'))) }}: + - task: AzureKeyVault@1 + inputs: + azureSubscription: 'HelixProd_KeyVault' + KeyVaultName: HelixProdKV + SecretsFilter: 'HelixApiAccessToken' + condition: always() +- bash: | + # create a temporary file + jobInfo=`mktemp` + + # write job info content to temporary file + cat > $jobInfo <' | Set-Content $proj + MSBuild $proj $bl /t:__WriteToolsetLocation /noconsolelogger /p:__ToolsetLocationOutputFile=$toolsetLocationFile + + $path = Get-Content $toolsetLocationFile -TotalCount 1 + if (!(Test-Path $path)) { + throw "Invalid toolset path: $path" + } + + return $global:_ToolsetBuildProj = $path +} + +function ExitWithExitCode([int] $exitCode) { + if ($ci -and $prepareMachine) { + Stop-Processes + } + exit $exitCode +} + +function Stop-Processes() { + Write-Host "Killing running build processes..." + foreach ($processName in $processesToStopOnExit) { + Get-Process -Name $processName -ErrorAction SilentlyContinue | Stop-Process + } +} + +# +# Executes msbuild (or 'dotnet msbuild') with arguments passed to the function. +# The arguments are automatically quoted. +# Terminates the script if the build fails. +# +function MSBuild() { + if ($ci) { + if (!$binaryLog) { + throw "Binary log must be enabled in CI build." + } + + if ($nodeReuse) { + throw "Node reuse must be disabled in CI build." + } + } + + $buildTool = InitializeBuildTool + + $cmdArgs = "$($buildTool.Command) /m /nologo /clp:Summary /v:$verbosity /nr:$nodeReuse" + + if ($warnAsError) { + $cmdArgs += " /warnaserror /p:TreatWarningsAsErrors=true" + } + + foreach ($arg in $args) { + if ($arg -ne $null -and $arg.Trim() -ne "") { + $cmdArgs += " `"$arg`"" + } + } + + $exitCode = Exec-Process $buildTool.Path $cmdArgs + + if ($exitCode -ne 0) { + Write-Host "Build failed." -ForegroundColor Red + + $buildLog = GetMSBuildBinaryLogCommandLineArgument $args + if ($buildLog -ne $null) { + Write-Host "See log: $buildLog" -ForegroundColor DarkGray + } + + ExitWithExitCode $exitCode + } +} + +function GetMSBuildBinaryLogCommandLineArgument($arguments) { + foreach ($argument in $arguments) { + if ($argument -ne $null) { + $arg = $argument.Trim() + if ($arg.StartsWith("/bl:", "OrdinalIgnoreCase")) { + return $arg.Substring("/bl:".Length) + } + + if ($arg.StartsWith("/binaryLogger:", "OrdinalIgnoreCase")) { + return $arg.Substring("/binaryLogger:".Length) + } + } + } + + return $null +} + +$RepoRoot = Resolve-Path (Join-Path $PSScriptRoot "..\..") +$EngRoot = Resolve-Path (Join-Path $PSScriptRoot "..") +$ArtifactsDir = Join-Path $RepoRoot "artifacts" +$ToolsetDir = Join-Path $ArtifactsDir "toolset" +$ToolsDir = Join-Path $RepoRoot ".tools" +$LogDir = Join-Path (Join-Path $ArtifactsDir "log") $configuration +$TempDir = Join-Path (Join-Path $ArtifactsDir "tmp") $configuration +$GlobalJson = Get-Content -Raw -Path (Join-Path $RepoRoot "global.json") | ConvertFrom-Json + +Create-Directory $ToolsetDir +Create-Directory $TempDir +Create-Directory $LogDir + +if ($ci) { + $env:TEMP = $TempDir + $env:TMP = $TempDir +} diff --git a/eng/common/tools.sh b/eng/common/tools.sh new file mode 100755 index 00000000000..8a253bef513 --- /dev/null +++ b/eng/common/tools.sh @@ -0,0 +1,319 @@ +# Initialize variables if they aren't already defined. + +# CI mode - set to true on CI server for PR validation build or official build. +ci=${ci:-false} + +# Build configuration. Common values include 'Debug' and 'Release', but the repository may use other names. +configuration=${configuration:-'Debug'} + +# Set to true to output binary log from msbuild. Note that emitting binary log slows down the build. +# Binary log must be enabled on CI. +binary_log=${binary_log:-$ci} + +# Turns on machine preparation/clean up code that changes the machine state (e.g. kills build processes). +prepare_machine=${prepare_machine:-false} + +# True to restore toolsets and dependencies. +restore=${restore:-true} + +# Adjusts msbuild verbosity level. +verbosity=${verbosity:-'minimal'} + +# Set to true to reuse msbuild nodes. Recommended to not reuse on CI. +if [[ "$ci" == true ]]; then + node_reuse=${node_reuse:-false} +else + node_reuse=${node_reuse:-true} +fi + +# Configures warning treatment in msbuild. +warn_as_error=${warn_as_error:-true} + +# True to attempt using .NET Core already that meets requirements specified in global.json +# installed on the machine instead of downloading one. +use_installed_dotnet_cli=${use_installed_dotnet_cli:-true} + +# True to use global NuGet cache instead of restoring packages to repository-local directory. +if [[ "$ci" == true ]]; then + use_global_nuget_cache=${use_global_nuget_cache:-false} +else + use_global_nuget_cache=${use_global_nuget_cache:-true} +fi + +# Resolve any symlinks in the given path. +function ResolvePath { + local path=$1 + + while [[ -h $path ]]; do + local dir="$( cd -P "$( dirname "$path" )" && pwd )" + path="$(readlink "$path")" + + # if $path was a relative symlink, we need to resolve it relative to the path where the + # symlink file was located + [[ $path != /* ]] && path="$dir/$path" + done + + # return value + _ResolvePath="$path" +} + +# ReadVersionFromJson [json key] +function ReadGlobalVersion { + local key=$1 + + local line=`grep -m 1 "$key" "$global_json_file"` + local pattern="\"$key\" *: *\"(.*)\"" + + if [[ ! $line =~ $pattern ]]; then + echo "Error: Cannot find \"$key\" in $global_json_file" >&2 + ExitWithExitCode 1 + fi + + # return value + _ReadGlobalVersion=${BASH_REMATCH[1]} +} + +function InitializeDotNetCli { + if [[ -n "${_InitializeDotNetCli:-}" ]]; then + return + fi + + local install=$1 + + # Don't resolve runtime, shared framework, or SDK from other locations to ensure build determinism + export DOTNET_MULTILEVEL_LOOKUP=0 + + # Disable first run since we want to control all package sources + export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 + + # Disable telemetry on CI + if [[ $ci == true ]]; then + export DOTNET_CLI_TELEMETRY_OPTOUT=1 + fi + + # LTTNG is the logging infrastructure used by Core CLR. Need this variable set + # so it doesn't output warnings to the console. + export LTTNG_HOME="$HOME" + + # Source Build uses DotNetCoreSdkDir variable + if [[ -n "${DotNetCoreSdkDir:-}" ]]; then + export DOTNET_INSTALL_DIR="$DotNetCoreSdkDir" + fi + + # Find the first path on $PATH that contains the dotnet.exe + if [[ "$use_installed_dotnet_cli" == true && -z "${DOTNET_INSTALL_DIR:-}" ]]; then + local dotnet_path=`command -v dotnet` + if [[ -n "$dotnet_path" ]]; then + ResolvePath "$dotnet_path" + export DOTNET_INSTALL_DIR=`dirname "$_ResolvePath"` + fi + fi + + ReadGlobalVersion "dotnet" + local dotnet_sdk_version=$_ReadGlobalVersion + local dotnet_root="" + + # Use dotnet installation specified in DOTNET_INSTALL_DIR if it contains the required SDK version, + # otherwise install the dotnet CLI and SDK to repo local .dotnet directory to avoid potential permission issues. + if [[ -n "${DOTNET_INSTALL_DIR:-}" && -d "$DOTNET_INSTALL_DIR/sdk/$dotnet_sdk_version" ]]; then + dotnet_root="$DOTNET_INSTALL_DIR" + else + dotnet_root="$repo_root/.dotnet" + export DOTNET_INSTALL_DIR="$dotnet_root" + + if [[ ! -d "$DOTNET_INSTALL_DIR/sdk/$dotnet_sdk_version" ]]; then + if [[ "$install" == true ]]; then + InstallDotNetSdk "$dotnet_root" "$dotnet_sdk_version" + else + echo "Unable to find dotnet with SDK version '$dotnet_sdk_version'" >&2 + ExitWithExitCode 1 + fi + fi + fi + + # Add dotnet to PATH. This prevents any bare invocation of dotnet in custom + # build steps from using anything other than what we've downloaded. + export PATH="$dotnet_root:$PATH" + + if [[ $ci == true ]]; then + # Make Sure that our bootstrapped dotnet cli is avaliable in future steps of the Azure Pipelines build + echo "##vso[task.prependpath]$dotnet_root" + echo "##vso[task.setvariable variable=DOTNET_MULTILEVEL_LOOKUP]0" + echo "##vso[task.setvariable variable=DOTNET_SKIP_FIRST_TIME_EXPERIENCE]1" + fi + + # return value + _InitializeDotNetCli="$dotnet_root" +} + +function InstallDotNetSdk { + local root=$1 + local version=$2 + + GetDotNetInstallScript "$root" + local install_script=$_GetDotNetInstallScript + + bash "$install_script" --version $version --install-dir "$root" || { + local exit_code=$? + echo "Failed to install dotnet SDK (exit code '$exit_code')." >&2 + ExitWithExitCode $exit_code + } +} + +function GetDotNetInstallScript { + local root=$1 + local install_script="$root/dotnet-install.sh" + local install_script_url="https://dot.net/v1/dotnet-install.sh" + + if [[ ! -a "$install_script" ]]; then + mkdir -p "$root" + + echo "Downloading '$install_script_url'" + + # Use curl if available, otherwise use wget + if command -v curl > /dev/null; then + curl "$install_script_url" -sSL --retry 10 --create-dirs -o "$install_script" + else + wget -q -O "$install_script" "$install_script_url" + fi + fi + + # return value + _GetDotNetInstallScript="$install_script" +} + +function InitializeBuildTool { + if [[ -n "${_InitializeBuildTool:-}" ]]; then + return + fi + + InitializeDotNetCli $restore + + # return values + _InitializeBuildTool="$_InitializeDotNetCli/dotnet" + _InitializeBuildToolCommand="msbuild" +} + +function GetNuGetPackageCachePath { + if [[ -z ${NUGET_PACKAGES:-} ]]; then + if [[ "$use_global_nuget_cache" == true ]]; then + export NUGET_PACKAGES="$HOME/.nuget/packages" + else + export NUGET_PACKAGES="$repo_root/.packages" + fi + fi + + # return value + _GetNuGetPackageCachePath=$NUGET_PACKAGES +} + +function InitializeToolset { + if [[ -n "${_InitializeToolset:-}" ]]; then + return + fi + + GetNuGetPackageCachePath + + ReadGlobalVersion "Microsoft.DotNet.Arcade.Sdk" + + local toolset_version=$_ReadGlobalVersion + local toolset_location_file="$toolset_dir/$toolset_version.txt" + + if [[ -a "$toolset_location_file" ]]; then + local path=`cat "$toolset_location_file"` + if [[ -a "$path" ]]; then + # return value + _InitializeToolset="$path" + return + fi + fi + + if [[ "$restore" != true ]]; then + echo "Toolset version $toolsetVersion has not been restored." >&2 + ExitWithExitCode 2 + fi + + local toolset_restore_log="$log_dir/ToolsetRestore.binlog" + local proj="$toolset_dir/restore.proj" + + echo '' > "$proj" + MSBuild "$proj" /t:__WriteToolsetLocation /noconsolelogger /bl:"$toolset_restore_log" /p:__ToolsetLocationOutputFile="$toolset_location_file" + + local toolset_build_proj=`cat "$toolset_location_file"` + + if [[ ! -a "$toolset_build_proj" ]]; then + echo "Invalid toolset path: $toolset_build_proj" >&2 + ExitWithExitCode 3 + fi + + # return value + _InitializeToolset="$toolset_build_proj" +} + +function ExitWithExitCode { + if [[ "$ci" == true && "$prepare_machine" == true ]]; then + StopProcesses + fi + exit $1 +} + +function StopProcesses { + echo "Killing running build processes..." + pkill -9 "dotnet" || true + pkill -9 "vbcscompiler" || true + return 0 +} + +function MSBuild { + if [[ "$ci" == true ]]; then + if [[ "$binary_log" != true ]]; then + echo "Binary log must be enabled in CI build." >&2 + ExitWithExitCode 1 + fi + + if [[ "$node_reuse" == true ]]; then + echo "Node reuse must be disabled in CI build." >&2 + ExitWithExitCode 1 + fi + fi + + InitializeBuildTool + + local warnaserror_switch="" + if [[ $warn_as_error == true ]]; then + warnaserror_switch="/warnaserror" + fi + + "$_InitializeBuildTool" "$_InitializeBuildToolCommand" /m /nologo /clp:Summary /v:$verbosity /nr:$node_reuse $warnaserror_switch /p:TreatWarningsAsErrors=$warn_as_error "$@" || { + local exit_code=$? + echo "Build failed (exit code '$exit_code')." >&2 + ExitWithExitCode $exit_code + } +} + +ResolvePath "${BASH_SOURCE[0]}" +_script_dir=`dirname "$_ResolvePath"` + +eng_root=`cd -P "$_script_dir/.." && pwd` +repo_root=`cd -P "$_script_dir/../.." && pwd` +artifacts_dir="$repo_root/artifacts" +toolset_dir="$artifacts_dir/toolset" +log_dir="$artifacts_dir/log/$configuration" +temp_dir="$artifacts_dir/tmp/$configuration" + +global_json_file="$repo_root/global.json" + +# HOME may not be defined in some scenarios, but it is required by NuGet +if [[ -z $HOME ]]; then + export HOME="$repo_root/artifacts/.home/" + mkdir -p "$HOME" +fi + +mkdir -p "$toolset_dir" +mkdir -p "$temp_dir" +mkdir -p "$log_dir" + +if [[ $ci == true ]]; then + export TEMP="$temp_dir" + export TMP="$temp_dir" +fi diff --git a/fcs/Directory.Build.props b/fcs/Directory.Build.props new file mode 100644 index 00000000000..6535dbd2aea --- /dev/null +++ b/fcs/Directory.Build.props @@ -0,0 +1,25 @@ + + + $(UserProfile)\.nuget\packages\ + $(HOME)/.nuget/packages/ + $(NuGetPackageRoot)\ + $(NuGetPackageRoot)/ + $(MSBuildThisFileDirectory)..\artifacts + $(ArtifactsDir)\bin + $(ArtifactsDir)\obj + $(ArtifactsBinDir)\fcs + $(ArtifactsObjDir)\fcs + + + + + $(ArtifactsBinDir)\FSharp.Build\Proto\net46 + + + + $(ProtoOutputPath)\Microsoft.FSharp.Targets + $(ProtoOutputPath)\Microsoft.FSharp.NetSdk.props + $(ProtoOutputPath)\Microsoft.FSharp.NetSdk.targets + $(ProtoOutputPath)\Microsoft.FSharp.Overrides.NetSdk.targets + + diff --git a/fcs/Directory.Build.targets b/fcs/Directory.Build.targets new file mode 100644 index 00000000000..bb5b23d29d0 --- /dev/null +++ b/fcs/Directory.Build.targets @@ -0,0 +1,3 @@ + + + diff --git a/fcs/FSharp.Compiler.Service.MSBuild.v12/FSharp.Compiler.Service.MSBuild.v12.fsproj b/fcs/FSharp.Compiler.Service.MSBuild.v12/FSharp.Compiler.Service.MSBuild.v12.fsproj index 8128ab15731..1126a60f2b6 100644 --- a/fcs/FSharp.Compiler.Service.MSBuild.v12/FSharp.Compiler.Service.MSBuild.v12.fsproj +++ b/fcs/FSharp.Compiler.Service.MSBuild.v12/FSharp.Compiler.Service.MSBuild.v12.fsproj @@ -7,7 +7,6 @@ net45 true - ..\..\$(Configuration.ToLower())\fcs $(DefineConstants);CROSS_PLATFORM_COMPILER $(DefineConstants);ENABLE_MONO_SUPPORT @@ -29,7 +28,7 @@ - + $(FSharpSourcesRoot)\..\fcs\dependencies\MSBuild.v12.0\Microsoft.Build.Framework.dll @@ -51,18 +50,8 @@ $(FSharpSourcesRoot)\..\fcs\dependencies\MSBuild.v12.0\Microsoft.Build.Tasks.v12.0.dll false - - - $(FSharpSourcesRoot)\..\packages\Microsoft.Portable.FSharp.Core.$(FSharpCoreFrozenPortablePackageVersion)\lib\profiles\net40\FSharp.Core.dll - false - - - FSharp.Compiler.Service - {2e4d67b4-522d-4cf7-97e4-ba940f0b18f3} - True - \ No newline at end of file diff --git a/fcs/FSharp.Compiler.Service.ProjectCracker/FSharp.Compiler.Service.ProjectCracker.fsproj b/fcs/FSharp.Compiler.Service.ProjectCracker/FSharp.Compiler.Service.ProjectCracker.fsproj index 86296dcea04..c132ae80bb1 100644 --- a/fcs/FSharp.Compiler.Service.ProjectCracker/FSharp.Compiler.Service.ProjectCracker.fsproj +++ b/fcs/FSharp.Compiler.Service.ProjectCracker/FSharp.Compiler.Service.ProjectCracker.fsproj @@ -1,13 +1,9 @@  - - $(MSBuildProjectDirectory)\..\..\src - net45 true - ..\..\$(Configuration.ToLower())\fcs Legacy project file cracker for the F# compiler service. @@ -25,13 +21,13 @@ - - + + - + \ No newline at end of file diff --git a/fcs/FSharp.Compiler.Service.ProjectCrackerTool/FSharp.Compiler.Service.ProjectCrackerTool.fsproj b/fcs/FSharp.Compiler.Service.ProjectCrackerTool/FSharp.Compiler.Service.ProjectCrackerTool.fsproj index d7f29459dee..9f690c58ea1 100644 --- a/fcs/FSharp.Compiler.Service.ProjectCrackerTool/FSharp.Compiler.Service.ProjectCrackerTool.fsproj +++ b/fcs/FSharp.Compiler.Service.ProjectCrackerTool/FSharp.Compiler.Service.ProjectCrackerTool.fsproj @@ -13,7 +13,6 @@ $(OtherFlags) --staticlink:FSharp.Core true false - ..\..\$(Configuration.ToLower())\fcs @@ -24,11 +23,7 @@ - - $(FSharpSourcesRoot)\..\packages\Microsoft.Portable.FSharp.Core.$(FSharpCoreFrozenPortablePackageVersion)\lib\profiles\net40\FSharp.Core.dll - false - - + $(FSharpSourcesRoot)\..\fcs\dependencies\MSBuild.v12.0\Microsoft.Build.Framework.dll false diff --git a/fcs/FSharp.Compiler.Service.Tests/CSharp_Analysis/CSharp_Analysis.csproj b/fcs/FSharp.Compiler.Service.Tests/CSharp_Analysis/CSharp_Analysis.csproj index 49585864e4d..fc00709da42 100644 --- a/fcs/FSharp.Compiler.Service.Tests/CSharp_Analysis/CSharp_Analysis.csproj +++ b/fcs/FSharp.Compiler.Service.Tests/CSharp_Analysis/CSharp_Analysis.csproj @@ -3,6 +3,7 @@ net45;netstandard2.0 false + $(NoWarn);0067;1591 diff --git a/fcs/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj b/fcs/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj index 55283b0065d..9c3eb687c20 100644 --- a/fcs/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj +++ b/fcs/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj @@ -66,17 +66,23 @@ TokenizerTests.fs + + ServiceUntypedParseTests.fs + + + TreeVisitorTests.fs + Program.fs - + - + diff --git a/fcs/FSharp.Compiler.Service/FSharp.Compiler.Service.fsproj b/fcs/FSharp.Compiler.Service/FSharp.Compiler.Service.fsproj index 54ca43c2cf4..55a43730801 100644 --- a/fcs/FSharp.Compiler.Service/FSharp.Compiler.Service.fsproj +++ b/fcs/FSharp.Compiler.Service/FSharp.Compiler.Service.fsproj @@ -1,23 +1,23 @@ - + $(MSBuildProjectDirectory)\..\..\src - + + net45;netstandard2.0 true $(DefineConstants);COMPILER_SERVICE_AS_DLL $(DefineConstants);COMPILER $(DefineConstants);ENABLE_MONO_SUPPORT $(DefineConstants);NO_STRONG_NAMES - ..\..\$(Configuration.ToLower())\fcs $(TargetFramework)\ $(TargetFramework)\ $(OtherFlags) /warnon:1182 $(OtherFlags) --times - $(NoWarn);44;62;69;65;54;61;75;62;9;2003; - true + $(NoWarn);44;62;69;65;54;61;75;62;9;2003;NU5125 + true true true @@ -46,12 +46,12 @@ AssemblyInfo/AssemblyInfo.fs - + FSComp.txt - - + + FSIstrings.txt - + FSStrings.resx FSStrings.resources @@ -635,11 +635,12 @@ - + + @@ -655,7 +656,5 @@ $(FSharpSourcesRoot)\..\packages\System.ValueTuple.4.4.0\lib\netstandard1.0\System.ValueTuple.dll - - - + \ No newline at end of file diff --git a/fcs/build.cmd b/fcs/build.cmd index 731fc76abb7..26244446f6c 100644 --- a/fcs/build.cmd +++ b/fcs/build.cmd @@ -14,6 +14,9 @@ if errorlevel 1 ( exit /b %errorlevel% ) +:: don't care if this fails +dotnet build-server shutdown >NUL 2>&1 + packages\FAKE\tools\FAKE.exe build.fsx %* if errorlevel 1 ( endlocal diff --git a/fcs/build.fsx b/fcs/build.fsx index 145d4c88e8f..8549ed86348 100644 --- a/fcs/build.fsx +++ b/fcs/build.fsx @@ -13,8 +13,8 @@ open Fake.ReleaseNotesHelper #if MONO // prevent incorrect output encoding (e.g. https://github.com/fsharp/FAKE/issues/1196) System.Console.OutputEncoding <- System.Text.Encoding.UTF8 -CleanDir (__SOURCE_DIRECTORY__ + "/../tests/TestResults") -File.WriteAllText(__SOURCE_DIRECTORY__ + "/../tests/TestResults/notestsyet.txt","No tests yet") +CleanDir (__SOURCE_DIRECTORY__ + "/../artifacts/TestResults") +File.WriteAllText(__SOURCE_DIRECTORY__ + "/../artifacts/TestResults/notestsyet.txt","No tests yet") let isMono = true #else let isMono = false @@ -24,7 +24,7 @@ let isMono = false // Utilities // -------------------------------------------------------------------------------------- -let dotnetExePath = DotNetCli.InstallDotNetSDK "2.1.201" +let dotnetExePath = DotNetCli.InstallDotNetSDK "2.1.403" let runDotnet workingDir args = let result = @@ -54,7 +54,7 @@ let runCmdIn workDir (exe:string) = Printf.ksprintf (fun (args:string) -> // The rest of the code is standard F# build script // -------------------------------------------------------------------------------------- -let releaseDir = Path.Combine(__SOURCE_DIRECTORY__, "../release/fcs") +let releaseDir = Path.Combine(__SOURCE_DIRECTORY__, "../artifacts/bin/fcs") // Read release notes & version info from RELEASE_NOTES.md let release = LoadReleaseNotes (__SOURCE_DIRECTORY__ + "/RELEASE_NOTES.md") @@ -75,15 +75,8 @@ Target "Clean" (fun _ -> Target "Restore" (fun _ -> // We assume a paket restore has already been run + runDotnet __SOURCE_DIRECTORY__ "restore ../src/buildtools/buildtools.proj -v n" runDotnet __SOURCE_DIRECTORY__ "restore FSharp.Compiler.Service.sln -v n" - for p in [ "../packages.config" ] do - let rec executeProcess count = - let result = ExecProcess (fun info -> - info.FileName <- FullName @"./../.nuget/NuGet.exe" - info.WorkingDirectory <- FullName @"./.." - info.Arguments <- sprintf "restore %s -PackagesDirectory \"%s\" -ConfigFile \"%s\"" (FullName p) (FullName "./../packages") (FullName "./../NuGet.Config")) TimeSpan.MaxValue - if result <> 0 && count > 1 then executeProcess (count - 1) else result - (executeProcess 5) |> assertExitCodeZero ) Target "BuildVersion" (fun _ -> @@ -91,7 +84,8 @@ Target "BuildVersion" (fun _ -> ) Target "Build" (fun _ -> - runDotnet __SOURCE_DIRECTORY__ "build FSharp.Compiler.Service.sln -v n -c Release" + runDotnet __SOURCE_DIRECTORY__ "build ../src/buildtools/buildtools.proj -v n -c Proto" + runDotnet __SOURCE_DIRECTORY__ "build FSharp.Compiler.Service.sln -v n -c release" ) Target "Test" (fun _ -> @@ -100,11 +94,11 @@ Target "Test" (fun _ -> runDotnet __SOURCE_DIRECTORY__ "build ../tests/projects/Sample_NETCoreSDK_FSharp_Library_netstandard2_0/Sample_NETCoreSDK_FSharp_Library_netstandard2_0.fsproj -v n" // Now run the tests - runDotnet __SOURCE_DIRECTORY__ "test FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj -v n -c Release" + runDotnet __SOURCE_DIRECTORY__ "test FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj --no-restore --no-build -v n -c release" ) Target "NuGet" (fun _ -> - runDotnet __SOURCE_DIRECTORY__ "pack FSharp.Compiler.Service.sln -v n -c Release" + runDotnet __SOURCE_DIRECTORY__ "pack FSharp.Compiler.Service.sln -v n -c release" ) Target "GenerateDocsEn" (fun _ -> diff --git a/fcs/docsrc/content/ja/symbols.fsx b/fcs/docsrc/content/ja/symbols.fsx index 2e3f53bdba4..d6abee12332 100644 --- a/fcs/docsrc/content/ja/symbols.fsx +++ b/fcs/docsrc/content/ja/symbols.fsx @@ -175,8 +175,8 @@ argTy1c.TypeDefinition.CompiledName // "Int32" *) let projectContext = checkFileResults.ProjectContext -for ass in projectContext.GetReferencedAssemblies() do - match ass.FileName with +for assembly in projectContext.GetReferencedAssemblies() do + match assembly.FileName with | None -> printfn "コンパイル時にファイルの存在しないアセンブリを参照しました" | Some s -> printfn "コンパイル時にアセンブリ '%s' を参照しました" s diff --git a/fcs/docsrc/content/ja/tokenizer.fsx b/fcs/docsrc/content/ja/tokenizer.fsx index 589061e0b0a..cf5117bfbd0 100644 --- a/fcs/docsrc/content/ja/tokenizer.fsx +++ b/fcs/docsrc/content/ja/tokenizer.fsx @@ -73,7 +73,7 @@ let rec tokenizeLine (tokenizer:FSharpLineTokenizer) state = 必要となるような新しい状態を返します。 初期値としては `0L` を指定します: *) -tokenizeLine tokenizer 0L +tokenizeLine tokenizer FSharpTokenizerLexState.Initial (** この結果は LET WHITESPACE IDENT EQUALS INT32 という トークン名のシーケンスになります。 diff --git a/fcs/docsrc/content/symbols.fsx b/fcs/docsrc/content/symbols.fsx index fb6275fd37c..ac38053a1b8 100644 --- a/fcs/docsrc/content/symbols.fsx +++ b/fcs/docsrc/content/symbols.fsx @@ -168,8 +168,8 @@ used in the compilation, called the `ProjectContext`: *) let projectContext = checkFileResults.ProjectContext -for ass in projectContext.GetReferencedAssemblies() do - match ass.FileName with +for assembly in projectContext.GetReferencedAssemblies() do + match assembly.FileName with | None -> printfn "compilation referenced an assembly without a file" | Some s -> printfn "compilation references assembly '%s'" s diff --git a/fcs/docsrc/content/tokenizer.fsx b/fcs/docsrc/content/tokenizer.fsx index 09d842ba8aa..9ac3d6f34d4 100644 --- a/fcs/docsrc/content/tokenizer.fsx +++ b/fcs/docsrc/content/tokenizer.fsx @@ -65,7 +65,7 @@ let rec tokenizeLine (tokenizer:FSharpLineTokenizer) state = The function returns the new state, which is needed if you need to tokenize multiple lines and an earlier line ends with a multi-line comment. As an initial state, we can use `0L`: *) -tokenizeLine tokenizer 0L +tokenizeLine tokenizer FSharpTokenizerLexState.Initial (** The result is a sequence of tokens with names LET, WHITESPACE, IDENT, EQUALS and INT32. There is a number of interesting properties on `FSharpTokenInfo` including: diff --git a/fcs/fcs.props b/fcs/fcs.props index 470ea0b88da..207d1f8085b 100644 --- a/fcs/fcs.props +++ b/fcs/fcs.props @@ -8,7 +8,7 @@ false - $(FSharpSourcesRoot)\..\packages\FSharp.Compiler.Tools.4.1.27\tools - fsi.exe + $(FSharpSourcesRoot)\..\packages\FSharp.Compiler.Tools.4.1.27\tools + fsi.exe \ No newline at end of file diff --git a/fcs/samples/EditorService/EditorService.fsproj b/fcs/samples/EditorService/EditorService.fsproj index 05847e67f90..447906070f0 100644 --- a/fcs/samples/EditorService/EditorService.fsproj +++ b/fcs/samples/EditorService/EditorService.fsproj @@ -12,7 +12,7 @@ - + diff --git a/fcs/samples/FscExe/FscExe.fsproj b/fcs/samples/FscExe/FscExe.fsproj index c482656827f..b2b146913a1 100644 --- a/fcs/samples/FscExe/FscExe.fsproj +++ b/fcs/samples/FscExe/FscExe.fsproj @@ -14,7 +14,7 @@ - + diff --git a/fcs/samples/FsiExe/FsiExe.fsproj b/fcs/samples/FsiExe/FsiExe.fsproj index 7377f2c2912..aae2ba03182 100644 --- a/fcs/samples/FsiExe/FsiExe.fsproj +++ b/fcs/samples/FsiExe/FsiExe.fsproj @@ -16,7 +16,7 @@ - + diff --git a/fcs/samples/InteractiveService/InteractiveService.fsproj b/fcs/samples/InteractiveService/InteractiveService.fsproj index 7aa42497261..387439fcfdd 100644 --- a/fcs/samples/InteractiveService/InteractiveService.fsproj +++ b/fcs/samples/InteractiveService/InteractiveService.fsproj @@ -12,7 +12,7 @@ - + diff --git a/fcs/samples/Tokenizer/Program.fs b/fcs/samples/Tokenizer/Program.fs index 402fcc30295..9cc79e699f4 100644 --- a/fcs/samples/Tokenizer/Program.fs +++ b/fcs/samples/Tokenizer/Program.fs @@ -3,7 +3,7 @@ let sourceTok = FSharpSourceTokenizer([], Some "C:\\test.fsx") let tokenizeLines (lines:string[]) = - [ let state = ref 0L + [ let state = ref FSharpTokenizerLexState.Initial for n, line in lines |> Seq.zip [ 0 .. lines.Length ] do let tokenizer = sourceTok.CreateLineTokenizer(line) let rec parseLine() = seq { diff --git a/fcs/samples/Tokenizer/Tokenizer.fsproj b/fcs/samples/Tokenizer/Tokenizer.fsproj index 7aa42497261..387439fcfdd 100644 --- a/fcs/samples/Tokenizer/Tokenizer.fsproj +++ b/fcs/samples/Tokenizer/Tokenizer.fsproj @@ -12,7 +12,7 @@ - + diff --git a/fcs/samples/UntypedTree/UntypedTree.fsproj b/fcs/samples/UntypedTree/UntypedTree.fsproj index 7aa42497261..387439fcfdd 100644 --- a/fcs/samples/UntypedTree/UntypedTree.fsproj +++ b/fcs/samples/UntypedTree/UntypedTree.fsproj @@ -12,7 +12,7 @@ - + diff --git a/fsharp.proj b/fsharp.proj new file mode 100644 index 00000000000..92b37d547ee --- /dev/null +++ b/fsharp.proj @@ -0,0 +1,170 @@ + + + + Debug + AssemblySearchPaths={HintPathFromItem};{TargetFrameworkDirectory};{RawFileName} + + + + + true + false + false + false + false + + false + false + false + false + false + + + + + true + true + true + true + true + true + + true + true + true + true + true + true + true + + + + + true + true + + + + + + + + TargetFramework=netstandard1.6 + TargetFramework=net45 + + + TargetFramework=netstandard2.0 + TargetFramework=net46 + + + TargetFramework=netstandard1.6 + TargetFramework=net46 + + + TargetFramework=net46 + + + TargetFramework=netstandard1.6 + TargetFramework=net46 + + + TargetFramework=netcoreapp2.1 + TargetFramework=net46 + + + TargetFramework=netcoreapp2.1 + TargetFramework=net46 + + + TargetFramework=net46 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <_RunningRestore>true + + + + + + + + + + + + + + + + + + + + + diff --git a/global.json b/global.json new file mode 100644 index 00000000000..ac6900880b3 --- /dev/null +++ b/global.json @@ -0,0 +1,9 @@ +{ + "tools": { + "dotnet": "2.1.500" + }, + "msbuild-sdks": { + "Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19069.2", + "Microsoft.DotNet.Helix.Sdk": "2.0.0-beta.19069.2" + } +} diff --git a/init-tools.cmd b/init-tools.cmd index e8aaa61b92f..cbdeb27afef 100644 --- a/init-tools.cmd +++ b/init-tools.cmd @@ -1,113 +1,38 @@ -@if not defined _echo @echo off -setlocal - -set INIT_TOOLS_LOG=%~dp0init-tools.log -set PACKAGES_DIR=%~dp0packages\ -set TOOLRUNTIME_DIR=%~dp0Tools - -set DOTNET_PATH=%TOOLRUNTIME_DIR%\dotnetcli\ -set DOTNET_CMD=%DOTNET_PATH%dotnet.exe - -set DOTNET_TOOLS_PATH=%TOOLRUNTIME_DIR%\dotnet20\ -set DOTNET_TOOLS_CMD=%DOTNET_TOOLS_PATH%dotnet.exe - -if [%BUILDTOOLS_SOURCE%]==[] set BUILDTOOLS_SOURCE=https://dotnet.myget.org/F/dotnet-buildtools/api/v3/index.json -set /P BUILDTOOLS_VERSION=< "%~dp0BuildToolsVersion.txt" -set BUILD_TOOLS_PATH=%PACKAGES_DIR%microsoft.dotnet.buildtools\%BUILDTOOLS_VERSION%\lib\ -set PROJECT_JSON_PATH=%TOOLRUNTIME_DIR%\%BUILDTOOLS_VERSION% -set PROJECT_JSON_FILE=%PROJECT_JSON_PATH%\project.json -set PROJECT_JSON_CONTENTS={ "dependencies": { "Microsoft.DotNet.BuildTools": "%BUILDTOOLS_VERSION%" , "Microsoft.DotNet.BuildTools.Coreclr": "1.0.4-prerelease"}, "frameworks": { "dnxcore50": { } } } -set BUILD_TOOLS_SEMAPHORE=%PROJECT_JSON_PATH%\init-tools.completed0 -set TOOLS_INIT_RETURN_CODE=0 - -:: if force option is specified then clean the tool runtime and build tools package directory to force it to get recreated -if [%1]==[force] ( - if exist "%TOOLRUNTIME_DIR%" rmdir /S /Q "%TOOLRUNTIME_DIR%" - if exist "%PACKAGES_DIR%microsoft.dotnet.buildtools" rmdir /S /Q "%PACKAGES_DIR%microsoft.dotnet.buildtools" -) - -set /p DOTNET_TOOLS_VERSION=< "%~dp0DotnetCLIToolsVersion.txt" -if not exist "%DOTNET_TOOLS_PATH%\sdk\%DOTNET_TOOLS_VERSION%" ( - :: dotnet cli doesn't yet exist, delete the semaphore - del "%BUILD_TOOLS_SEMAPHORE%" >NUL 2>&1 +@echo off +setlocal enabledelayedexpansion + +set /p DOTNET_TOOLS_VERSION=<"%~dp0DotnetCLIToolsVersion.txt" +set DOTNET_TOOLS_PATH=%~dp0artifacts\toolset\dotnet +set dotnetexe=%DOTNET_TOOLS_PATH%\dotnet.exe +set sdksentinel=%DOTNET_TOOLS_PATH%\sdk-version.txt + +:: remove an old copy of the SDK +set cleanup_existing= +if exist "%sdksentinel%" ( + set /p INSTALLED_SDK_VERSION=<"%sdksentinel%" + if not "%DOTNET_TOOLS_VERSION%" == "!INSTALLED_SDK_VERSION!" ( + :: wrong version installed, clean it up + set cleanup_existing=1 + + ) else ( + echo Found up-to-date SDK. + ) +) else ( + set cleanup_existing=1 +) + +if "!cleanup_existing!" == "1" ( + echo Removing stale SDK. + rmdir /s /q "%DOTNET_TOOLS_PATH%" +) + +:: download and install install SDK +if not exist "%dotnetexe%" ( + echo powershell -ExecutionPolicy unrestricted -NoProfile -Command ".\scripts\dotnet-install.ps1 -InstallDir %DOTNET_TOOLS_PATH% -Architecture x64 -Version %DOTNET_TOOLS_VERSION% -NoPath true; exit $LastExitCode;" + powershell -ExecutionPolicy unrestricted -NoProfile -Command ".\scripts\dotnet-install.ps1 -InstallDir %DOTNET_TOOLS_PATH% -Architecture x64 -Version %DOTNET_TOOLS_VERSION% -NoPath true; exit $LastExitCode;" + if errorlevel 1 ( + echo ERROR: Could not install dotnet cli correctly. + exit /b 1 + ) + echo %DOTNET_TOOLS_VERSION%>"%sdksentinel%" ) - -:: If sempahore exists do nothing -if exist "%BUILD_TOOLS_SEMAPHORE%" ( - echo Tools are already initialized. - goto :DONE -) - -if exist "%TOOLRUNTIME_DIR%" rmdir /S /Q "%TOOLRUNTIME_DIR%" - -:: Download Nuget.exe -if NOT exist "%PACKAGES_DIR%NuGet.exe" ( - if NOT exist "%PACKAGES_DIR%" mkdir "%PACKAGES_DIR%" - powershell -NoProfile -ExecutionPolicy unrestricted -Command "$wc = New-Object System.Net.WebClient; $wc.Proxy = [System.Net.WebRequest]::DefaultWebProxy; $wc.Proxy.Credentials = [System.Net.CredentialCache]::DefaultNetworkCredentials; $wc.DownloadFile('https://www.nuget.org/nuget.exe', '%PACKAGES_DIR%NuGet.exe') -) - -if NOT exist "%PROJECT_JSON_PATH%" mkdir "%PROJECT_JSON_PATH%" -echo %PROJECT_JSON_CONTENTS% > "%PROJECT_JSON_FILE%" -echo Running %0 > "%INIT_TOOLS_LOG%" - -if exist "%DOTNET_TOOLS_PATH%" goto :afterdotnettoolsrestore - -echo Installing dotnet OLD VERSION OF THE cli... -echo ========================================== -echo This is temporary until we build using the new dotnetcli -echo The dotnet cli is a large file it may take a few minutes ... -echo powershell -ExecutionPolicy unrestricted -NoProfile -Command ".\scripts\dotnet-install.ps1 -InstallDir %DOTNET_TOOLS_PATH% -Architecture x64 -Version %DOTNET_TOOLS_VERSION% -NoPath true; exit $LastExitCode;" -powershell -ExecutionPolicy unrestricted -NoProfile -Command ".\scripts\dotnet-install.ps1 -InstallDir %DOTNET_TOOLS_PATH% -Architecture x64 -Version %DOTNET_TOOLS_VERSION% -NoPath true; exit $LastExitCode;" -if errorlevel 1 ( - echo ERROR: Could not install dotnet cli correctly. - set TOOLS_INIT_RETURN_CODE=1 - goto :DONE -) -:afterdotnettoolsrestore - -set /p DOTNET_VERSION=< "%~dp0DotnetCLIVersion.txt" -if exist "%DOTNET_CMD%" goto :afterdotnetrestore - -echo Installing dotnet cli... -echo The dotnet cli is a large file it may take a few minutes ... -echo powershell -ExecutionPolicy unrestricted -NoProfile -Command ".\scripts\dotnet-install.ps1 -InstallDir %DOTNET_PATH% -Architecture x64 -Version %DOTNET_VERSION% -NoPath true; exit $LastExitCode;" -powershell -ExecutionPolicy unrestricted -NoProfile -Command ".\scripts\dotnet-install.ps1 -InstallDir %DOTNET_PATH% -Architecture x64 -Version %DOTNET_VERSION% -NoPath true; exit $LastExitCode;" -if errorlevel 1 ( - echo ERROR: Could not install dotnet cli correctly. - set TOOLS_INIT_RETURN_CODE=1 - goto :DONE -) -:afterdotnetrestore - -if exist "%BUILD_TOOLS_PATH%" goto :afterbuildtoolsrestore -echo Restoring BuildTools version %BUILDTOOLS_VERSION%... -echo Running: "%DOTNET_CMD%" restore "%PROJECT_JSON_FILE%" --packages "%PACKAGES_DIR% " --source "%BUILDTOOLS_SOURCE%" >> "%INIT_TOOLS_LOG%" -call "%DOTNET_CMD%" restore "%PROJECT_JSON_FILE%" --packages "%PACKAGES_DIR% " --source "%BUILDTOOLS_SOURCE%" >> "%INIT_TOOLS_LOG%" -if NOT exist "%BUILD_TOOLS_PATH%init-tools.cmd" ( - echo ERROR: Could not restore build tools correctly. See '%INIT_TOOLS_LOG%' for more details. - set TOOLS_INIT_RETURN_CODE=1 - goto :DONE -) - -:afterbuildtoolsrestore - -echo Initializing BuildTools ... -echo Running: "%BUILD_TOOLS_PATH%init-tools.cmd" "%~dp0" "%DOTNET_CMD%" "%TOOLRUNTIME_DIR%" >> "%INIT_TOOLS_LOG%" -call "%BUILD_TOOLS_PATH%init-tools.cmd" "%~dp0" "%DOTNET_CMD%" "%TOOLRUNTIME_DIR%" >> "%INIT_TOOLS_LOG%" - -echo Updating CLI NuGet Frameworks map... -robocopy "%TOOLRUNTIME_DIR%" "%DOTNET_PATH%\sdk\%DOTNET_VERSION%" NuGet.Frameworks.dll /XO >> "%INIT_TOOLS_LOG%" -set UPDATE_CLI_ERRORLEVEL=%ERRORLEVEL% -if %UPDATE_CLI_ERRORLEVEL% GTR 1 ( - echo ERROR: Failed to update Nuget for CLI {Error level %UPDATE_CLI_ERRORLEVEL%}. Please check '%INIT_TOOLS_LOG%' for more details. 1>&2 - exit /b %UPDATE_CLI_ERRORLEVEL% -) - -:: Create sempahore file -echo Done initializing tools. -echo Init-Tools.cmd completed for BuildTools Version: %BUILDTOOLS_VERSION% > "%BUILD_TOOLS_SEMAPHORE%" - -:DONE - -exit /b %TOOLS_INIT_RETURN_CODE% - diff --git a/mono/cibuild.sh b/mono/cibuild.sh index e91b33e7839..9a5ea5af571 100755 --- a/mono/cibuild.sh +++ b/mono/cibuild.sh @@ -1,7 +1,7 @@ #!/bin/bash # note: expects to run from top directory -./mono/latest-mono-stable.sh +#./mono/latest-mono-stable.sh make Configuration=$@ #sudo make install Configuration=$@ #./mono/test-mono.sh \ No newline at end of file diff --git a/packages.config b/packages.config index 0f658bb45ee..709d225851d 100644 --- a/packages.config +++ b/packages.config @@ -1,89 +1,4 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + diff --git a/proto.proj b/proto.proj new file mode 100644 index 00000000000..0974580af5a --- /dev/null +++ b/proto.proj @@ -0,0 +1,36 @@ + + + + Proto + AssemblySearchPaths={HintPathFromItem};{TargetFrameworkDirectory};{RawFileName} + + + + + + TargetFramework=net46 + TargetFramework=netcoreapp2.1 + + + TargetFramework=net46 + TargetFramework=netcoreapp2.1 + + + + + + + + + + + + + + + + + + + + diff --git a/release-notes.md b/release-notes.md index 87135456997..790efce1005 100644 --- a/release-notes.md +++ b/release-notes.md @@ -1,7 +1,46 @@ - Copyright (c) Microsoft Corporation. All Rights Reserved. - See License.txt in the project root for license information. + +## About the release notes + +We deliver F# and F# tools for Visual Studio and .NET Core releases. These can include bug fixes, new tooling features, new compiler features, performance improvements, infrastructure improvements, and new language versions. The most recent release of F# or any F# component will be at the top of this document. + +## Visual Studio 15.9 + +You can find all tracked VS 15.9 items in the [15.9 milestone](https://github.com/Microsoft/visualfsharp/milestone/24). + +### F# Compiler + +* Fix (#4637) - Can't debug FCS when compiled with portable pdb debug symbols, by [Jason Imison](https://github.com/nosami). +* Fix (#5355) - We fixed a bug where extension methods that take `byref` values could mutate an immutable value. +* Fix (#5446) - We improved the compile error information for overloads on `byref`/`inref`/`outref`, rather than displaying the previously obscure error. +* Fix (#5354) - Optional Type Extensions on `byref`s are now disallowed entirely. They could be declared previously, but were unusable, resulting in a confusing user experience. +* Fix (#5294) - We fixed a bug where `CompareTo` on a struct tuple and causing a type equivalence with an aliased struct tuple would result in a runtime exception. +* Fix (#5621) - We fixed a bug where use of `System.Void` in the context of authoring a Type Provider for .NET Standard could fail to find the `System.Void` type at design-time. +* Fix (#5468) - We fixed a bug where an internal error could occur when a partially applied Discriminated Union constructor is mismatched with an annotated or inferred type for the Discriminated Union. +* Fix (#5540) - We modified the compiler error message when attempting to take an address of an expression (such as accessing a property) to make it more clear that it violates scoping rules for `byref` types. +* Fix (#5536) - We fixed a bug where your program could crash at runtime when partially applying a `byref` type to a method or function. An error message will now display. +* Fix (#5459) - We fixed an issue where an invalid combination of a `byref` and a reference type (such as `byref option`) would fail at runtime and not emit an error message. We now emit an error message. + +### F# Tools for Visual Studio + +* Fix (#5657) - We resolved an issue where metadata for F# assemblies built with the .NET Core SDK was not shown in file properties on Windows. You can now see this metadata by right-clicking an assembly on Windows and selecting **Properties**. +* Fix (#5615) - We fixed a bug where use of `module global` in F# source could cause Visual Studio to become unresponsive. +* Fix (#5515) - We fixed a bug where extension methods using `inref<'T>` would not show in completion lists. +* Fix (#5514) - We fixed a bug where the TargetFramework dropdown in Project Properties for .NET Framework F# projects was empty. +* Fix (#5507) - We fixed a bug where File | New Project on a .NET Framework 4.0 project would fail. + +### F# OSS Build + +* Feature (#5027) - Set VisualFSharpFull as the default startup project, by [Robert Jeppesen](https://github.com/rojepp). + +## Visual Studio 15.8.5 + +* Fix (#5504) - Internal MSBuild Error when building non-.NET SDK projects with MSBuild parallelism +* Fix (#5518) - Visual Studio-deployed components are not NGEN'd +* Fix ([Devcom 322883](https://developercommunity.visualstudio.com/content/problem/322883/all-net-framework-f-projects-build-to-4500-regardl.html)) - FSharp.Core 4.5.0.0 binary is deployed to FSharp.Core 4.4.3.0 location + +All other closed issues for the VS 15.8 release can be found [here](https://github.com/Microsoft/visualfsharp/milestone/14). ## F# 4.5 diff --git a/scripts/dotnet-install.ps1 b/scripts/dotnet-install.ps1 index 93d964540f5..9da0947d958 100644 --- a/scripts/dotnet-install.ps1 +++ b/scripts/dotnet-install.ps1 @@ -188,7 +188,7 @@ function GetHTTPResponse([Uri] $Uri) } # Default timeout for HttpClient is 100s. For a 50 MB download this assumes 500 KB/s average, any less will time out # 10 minutes allows it to work over much slower connections. - $HttpClient.Timeout = New-TimeSpan -Minutes 10 + $HttpClient.Timeout = New-TimeSpan -Minutes 20 $Response = $HttpClient.GetAsync($Uri).Result if (($Response -eq $null) -or (-not ($Response.IsSuccessStatusCode))) { diff --git a/scripts/dotnet-install.sh b/scripts/dotnet-install.sh index 451525269ee..0d43070726d 100755 --- a/scripts/dotnet-install.sh +++ b/scripts/dotnet-install.sh @@ -22,7 +22,7 @@ exec 3>&1 # Setup some colors to use. These need to work in fairly limited shells, like the Ubuntu Docker container where there are only 8 colors. # See if stdout is a terminal -if [ -t 1 ]; then +if [ -t 1 ] && command -v tput > /dev/null; then # see if it supports colors ncolors=$(tput colors) if [ -n "$ncolors" ] && [ $ncolors -ge 8 ]; then @@ -39,6 +39,10 @@ if [ -t 1 ]; then fi fi +say_warning() { + printf "%b\n" "${yellow:-}dotnet_install: Warning: $1${normal:-}" +} + say_err() { printf "%b\n" "${red:-}dotnet_install: Error: $1${normal:-}" >&2 } @@ -55,7 +59,10 @@ say_verbose() { fi } -get_os_download_name_from_platform() { +# This platform list is finite - if the SDK/Runtime has supported Linux distribution-specific assets, +# then and only then should the Linux distribution appear in this list. +# Adding a Linux distribution to this list does not imply distribution-specific support. +get_legacy_os_name_from_platform() { eval $invocation platform="$1" @@ -68,6 +75,10 @@ get_os_download_name_from_platform() { echo "debian" return 0 ;; + "debian.9") + echo "debian.9" + return 0 + ;; "fedora.23") echo "fedora.23" return 0 @@ -76,6 +87,14 @@ get_os_download_name_from_platform() { echo "fedora.24" return 0 ;; + "fedora.27") + echo "fedora.27" + return 0 + ;; + "fedora.28") + echo "fedora.28" + return 0 + ;; "opensuse.13.2") echo "opensuse.13.2" return 0 @@ -84,6 +103,10 @@ get_os_download_name_from_platform() { echo "opensuse.42.1" return 0 ;; + "opensuse.42.3") + echo "opensuse.42.3" + return 0 + ;; "rhel.7"*) echo "rhel" return 0 @@ -100,6 +123,10 @@ get_os_download_name_from_platform() { echo "ubuntu.16.10" return 0 ;; + "ubuntu.18.04") + echo "ubuntu.18.04" + return 0 + ;; "alpine.3.4.3") echo "alpine" return 0 @@ -108,6 +135,30 @@ get_os_download_name_from_platform() { return 1 } +get_linux_platform_name() { + eval $invocation + + if [ -n "$runtime_id" ]; then + echo "${runtime_id%-*}" + return 0 + else + if [ -e /etc/os-release ]; then + . /etc/os-release + echo "$ID.$VERSION_ID" + return 0 + elif [ -e /etc/redhat-release ]; then + local redhatRelease=$(/dev/null | grep libunwind)" ] && say_warning "Unable to locate libunwind. Probable prerequisite missing; please install libunwind." + [ -z "$($LDCONFIG_COMMAND 2>/dev/null | grep libssl)" ] && say_warning "Unable to locate libssl. Probable prerequisite missing; please install libssl." + [ -z "$($LDCONFIG_COMMAND 2>/dev/null | grep libicu)" ] && say_warning "Unable to locate libicu. Probable prerequisite missing; please install libicu." + [ -z "$($LDCONFIG_COMMAND 2>/dev/null | grep -F libcurl.so)" ] && say_warning "Unable to locate libcurl. Probable prerequisite missing; please install libcurl." fi - + return 0 } @@ -207,7 +265,7 @@ check_pre_reqs() { # input - $1 to_lowercase() { #eval $invocation - + echo "$1" | tr '[:upper:]' '[:lower:]' return 0 } @@ -216,8 +274,8 @@ to_lowercase() { # input - $1 remove_trailing_slash() { #eval $invocation - - local input=${1:-} + + local input="${1:-}" echo "${input%/}" return 0 } @@ -226,8 +284,8 @@ remove_trailing_slash() { # input - $1 remove_beginning_slash() { #eval $invocation - - local input=${1:-} + + local input="${1:-}" echo "${input#/}" return 0 } @@ -237,15 +295,15 @@ remove_beginning_slash() { # child_path - $2 - this parameter can be empty combine_paths() { eval $invocation - + # TODO: Consider making it work with any number of paths. For now: if [ ! -z "${3:-}" ]; then say_err "combine_paths: Function takes two parameters." return 1 fi - - local root_path=$(remove_trailing_slash $1) - local child_path=$(remove_beginning_slash ${2:-}) + + local root_path="$(remove_trailing_slash "$1")" + local child_path="$(remove_beginning_slash "${2:-}")" say_verbose "combine_paths: root_path=$root_path" say_verbose "combine_paths: child_path=$child_path" echo "$root_path/$child_path" @@ -254,8 +312,22 @@ combine_paths() { get_machine_architecture() { eval $invocation - - # Currently the only one supported + + if command -v uname > /dev/null; then + CPUName=$(uname -m) + case $CPUName in + armv7l) + echo "arm" + return 0 + ;; + aarch64) + echo "arm64" + return 0 + ;; + esac + fi + + # Always default to 'x64' echo "x64" return 0 } @@ -264,23 +336,27 @@ get_machine_architecture() { # architecture - $1 get_normalized_architecture_from_architecture() { eval $invocation - - local architecture=$(to_lowercase $1) - case $architecture in + + local architecture="$(to_lowercase "$1")" + case "$architecture" in \) - echo "$(get_normalized_architecture_from_architecture $(get_machine_architecture))" + echo "$(get_normalized_architecture_from_architecture "$(get_machine_architecture)")" return 0 ;; amd64|x64) echo "x64" return 0 ;; - x86) - say_err "Architecture \`x86\` currently not supported" - return 1 + arm) + echo "arm" + return 0 + ;; + arm64) + echo "arm64" + return 0 ;; esac - + say_err "Architecture \`$architecture\` not supported. If you think this is a bug, please report it at https://github.com/dotnet/cli/issues" return 1 } @@ -294,8 +370,8 @@ get_normalized_architecture_from_architecture() { # version_text - stdin get_version_from_version_info() { eval $invocation - - cat | tail -n 1 + + cat | tail -n 1 | sed 's/\r$//' return 0 } @@ -303,8 +379,8 @@ get_version_from_version_info() { # version_text - stdin get_commit_hash_from_version_info() { eval $invocation - - cat | head -n 1 + + cat | head -n 1 | sed 's/\r$//' return 0 } @@ -314,14 +390,14 @@ get_commit_hash_from_version_info() { # specific_version - $3 is_dotnet_package_installed() { eval $invocation - - local install_root=$1 - local relative_path_to_package=$2 - local specific_version=${3//[$'\t\r\n']} - - local dotnet_package_path=$(combine_paths $(combine_paths $install_root $relative_path_to_package) $specific_version) + + local install_root="$1" + local relative_path_to_package="$2" + local specific_version="${3//[$'\t\r\n']}" + + local dotnet_package_path="$(combine_paths "$(combine_paths "$install_root" "$relative_path_to_package")" "$specific_version")" say_verbose "is_dotnet_package_installed: dotnet_package_path=$dotnet_package_path" - + if [ -d "$dotnet_package_path" ]; then return 0 else @@ -333,27 +409,33 @@ is_dotnet_package_installed() { # azure_feed - $1 # channel - $2 # normalized_architecture - $3 +# coherent - $4 get_latest_version_info() { eval $invocation - - local azure_feed=$1 - local channel=$2 - local normalized_architecture=$3 - local coherent=$4 + + local azure_feed="$1" + local channel="$2" + local normalized_architecture="$3" + local coherent="$4" local version_file_url=null - if [ "$shared_runtime" = true ]; then + if [[ "$runtime" == "dotnet" ]]; then version_file_url="$uncached_feed/Runtime/$channel/latest.version" - else + elif [[ "$runtime" == "aspnetcore" ]]; then + version_file_url="$uncached_feed/aspnetcore/Runtime/$channel/latest.version" + elif [ -z "$runtime" ]; then if [ "$coherent" = true ]; then version_file_url="$uncached_feed/Sdk/$channel/latest.coherent.version" else version_file_url="$uncached_feed/Sdk/$channel/latest.version" fi + else + say_err "Invalid value for \$runtime" + return 1 fi say_verbose "get_latest_version_info: latest url: $version_file_url" - - download $version_file_url + + download "$version_file_url" return $? } @@ -364,29 +446,29 @@ get_latest_version_info() { # version - $4 get_specific_version_from_version() { eval $invocation - - local azure_feed=$1 - local channel=$2 - local normalized_architecture=$3 - local version=$(to_lowercase $4) - case $version in + local azure_feed="$1" + local channel="$2" + local normalized_architecture="$3" + local version="$(to_lowercase "$4")" + + case "$version" in latest) local version_info - version_info="$(get_latest_version_info $azure_feed $channel $normalized_architecture false)" || return 1 + version_info="$(get_latest_version_info "$azure_feed" "$channel" "$normalized_architecture" false)" || return 1 say_verbose "get_specific_version_from_version: version_info=$version_info" echo "$version_info" | get_version_from_version_info return 0 ;; coherent) local version_info - version_info="$(get_latest_version_info $azure_feed $channel $normalized_architecture true)" || return 1 + version_info="$(get_latest_version_info "$azure_feed" "$channel" "$normalized_architecture" true)" || return 1 say_verbose "get_specific_version_from_version: version_info=$version_info" echo "$version_info" | get_version_from_version_info return 0 ;; *) - echo $version + echo "$version" return 0 ;; esac @@ -399,22 +481,26 @@ get_specific_version_from_version() { # specific_version - $4 construct_download_link() { eval $invocation - - local azure_feed=$1 - local channel=$2 - local normalized_architecture=$3 - local specific_version=${4//[$'\t\r\n']} - + + local azure_feed="$1" + local channel="$2" + local normalized_architecture="$3" + local specific_version="${4//[$'\t\r\n']}" + local osname - osname=$(get_current_os_name) || return 1 + osname="$(get_current_os_name)" || return 1 local download_link=null - if [ "$shared_runtime" = true ]; then + if [[ "$runtime" == "dotnet" ]]; then download_link="$azure_feed/Runtime/$specific_version/dotnet-runtime-$specific_version-$osname-$normalized_architecture.tar.gz" - else + elif [[ "$runtime" == "aspnetcore" ]]; then + download_link="$azure_feed/aspnetcore/Runtime/$specific_version/aspnetcore-runtime-$specific_version-$osname-$normalized_architecture.tar.gz" + elif [ -z "$runtime" ]; then download_link="$azure_feed/Sdk/$specific_version/dotnet-sdk-$specific_version-$osname-$normalized_architecture.tar.gz" + else + return 1 fi - + echo "$download_link" return 0 } @@ -426,20 +512,22 @@ construct_download_link() { # specific_version - $4 construct_legacy_download_link() { eval $invocation - - local azure_feed=$1 - local channel=$2 - local normalized_architecture=$3 - local specific_version=${4//[$'\t\r\n']} + + local azure_feed="$1" + local channel="$2" + local normalized_architecture="$3" + local specific_version="${4//[$'\t\r\n']}" local distro_specific_osname - distro_specific_osname=$(get_distro_specific_os_name) || return 1 + distro_specific_osname="$(get_legacy_os_name)" || return 1 local legacy_download_link=null - if [ "$shared_runtime" = true ]; then + if [[ "$runtime" == "dotnet" ]]; then legacy_download_link="$azure_feed/Runtime/$specific_version/dotnet-$distro_specific_osname-$normalized_architecture.$specific_version.tar.gz" - else + elif [ -z "$runtime" ]; then legacy_download_link="$azure_feed/Sdk/$specific_version/dotnet-dev-$distro_specific_osname-$normalized_architecture.$specific_version.tar.gz" + else + return 1 fi echo "$legacy_download_link" @@ -448,9 +536,9 @@ construct_legacy_download_link() { get_user_install_path() { eval $invocation - + if [ ! -z "${DOTNET_INSTALL_DIR:-}" ]; then - echo $DOTNET_INSTALL_DIR + echo "$DOTNET_INSTALL_DIR" else echo "$HOME/.dotnet" fi @@ -461,15 +549,15 @@ get_user_install_path() { # install_dir - $1 resolve_installation_path() { eval $invocation - + local install_dir=$1 if [ "$install_dir" = "" ]; then - local user_install_path=$(get_user_install_path) + local user_install_path="$(get_user_install_path)" say_verbose "resolve_installation_path: user_install_path=$user_install_path" echo "$user_install_path" return 0 fi - + echo "$install_dir" return 0 } @@ -478,16 +566,16 @@ resolve_installation_path() { # install_root - $1 get_installed_version_info() { eval $invocation - - local install_root=$1 - local version_file=$(combine_paths "$install_root" "$local_version_file_relative_path") + + local install_root="$1" + local version_file="$(combine_paths "$install_root" "$local_version_file_relative_path")" say_verbose "Local version file: $version_file" if [ ! -z "$version_file" ] | [ -r "$version_file" ]; then - local version_info="$(cat $version_file)" + local version_info="$(cat "$version_file")" echo "$version_info" return 0 fi - + say_verbose "Local version file not found." return 0 } @@ -496,9 +584,9 @@ get_installed_version_info() { # relative_or_absolute_path - $1 get_absolute_path() { eval $invocation - + local relative_or_absolute_path=$1 - echo $(cd $(dirname "$1") && pwd -P)/$(basename "$1") + echo "$(cd "$(dirname "$1")" && pwd -P)/$(basename "$1")" return 0 } @@ -510,17 +598,25 @@ get_absolute_path() { copy_files_or_dirs_from_list() { eval $invocation - local root_path=$(remove_trailing_slash $1) - local out_path=$(remove_trailing_slash $2) - local override=$3 - local override_switch=$(if [ "$override" = false ]; then printf -- "-n"; fi) - + local root_path="$(remove_trailing_slash "$1")" + local out_path="$(remove_trailing_slash "$2")" + local override="$3" + local osname="$(get_current_os_name)" + local override_switch=$( + if [ "$override" = false ]; then + if [[ "$osname" == "linux-musl" ]]; then + printf -- "-u"; + else + printf -- "-n"; + fi + fi) + cat | uniq | while read -r file_path; do - local path=$(remove_beginning_slash ${file_path#$root_path}) - local target=$out_path/$path + local path="$(remove_beginning_slash "${file_path#$root_path}")" + local target="$out_path/$path" if [ "$override" = true ] || (! ([ -d "$target" ] || [ -e "$target" ])); then - mkdir -p $out_path/$(dirname $path) - cp -R $override_switch $root_path/$path $target + mkdir -p "$out_path/$(dirname "$path")" + cp -R $override_switch "$root_path/$path" "$target" fi done } @@ -530,21 +626,21 @@ copy_files_or_dirs_from_list() { # out_path - $2 extract_dotnet_package() { eval $invocation - - local zip_path=$1 - local out_path=$2 - - local temp_out_path=$(mktemp -d $temporary_file_template) - + + local zip_path="$1" + local out_path="$2" + + local temp_out_path="$(mktemp -d "$temporary_file_template")" + local failed=false tar -xzf "$zip_path" -C "$temp_out_path" > /dev/null || failed=true - + local folders_with_version_regex='^.*/[0-9]+\.[0-9]+[^/]+/' - find $temp_out_path -type f | grep -Eo $folders_with_version_regex | copy_files_or_dirs_from_list $temp_out_path $out_path false - find $temp_out_path -type f | grep -Ev $folders_with_version_regex | copy_files_or_dirs_from_list $temp_out_path $out_path true - - rm -rf $temp_out_path - + find "$temp_out_path" -type f | grep -Eo "$folders_with_version_regex" | sort | copy_files_or_dirs_from_list "$temp_out_path" "$out_path" false + find "$temp_out_path" -type f | grep -Ev "$folders_with_version_regex" | copy_files_or_dirs_from_list "$temp_out_path" "$out_path" "$override_non_versioned_files" + + rm -rf "$temp_out_path" + if [ "$failed" = true ]; then say_err "Extraction failed" return 1 @@ -557,14 +653,19 @@ extract_dotnet_package() { download() { eval $invocation - local remote_path=$1 - local out_path=${2:-} + local remote_path="$1" + local out_path="${2:-}" + + if [[ "$remote_path" != "http"* ]]; then + cp "$remote_path" "$out_path" + return $? + fi local failed=false if machine_has "curl"; then - downloadcurl $remote_path $out_path || failed=true + downloadcurl "$remote_path" "$out_path" || failed=true elif machine_has "wget"; then - downloadwget $remote_path $out_path || failed=true + downloadwget "$remote_path" "$out_path" || failed=true else failed=true fi @@ -577,14 +678,17 @@ download() { downloadcurl() { eval $invocation - local remote_path=$1 - local out_path=${2:-} + local remote_path="$1" + local out_path="${2:-}" + + # Append feed_credential as late as possible before calling curl to avoid logging feed_credential + remote_path="${remote_path}${feed_credential}" local failed=false if [ -z "$out_path" ]; then - curl --retry 10 -sSL -f --create-dirs $remote_path || failed=true + curl --retry 10 -sSL -f --create-dirs "$remote_path" || failed=true else - curl --retry 10 -sSL -f --create-dirs -o $out_path $remote_path || failed=true + curl --retry 10 -sSL -f --create-dirs -o "$out_path" "$remote_path" || failed=true fi if [ "$failed" = true ]; then say_verbose "Curl download failed" @@ -595,14 +699,17 @@ downloadcurl() { downloadwget() { eval $invocation - local remote_path=$1 - local out_path=${2:-} + local remote_path="$1" + local out_path="${2:-}" + + # Append feed_credential as late as possible before calling wget to avoid logging feed_credential + remote_path="${remote_path}${feed_credential}" local failed=false if [ -z "$out_path" ]; then - wget -q --tries 10 $remote_path || failed=true + wget -q --tries 10 -O - "$remote_path" || failed=true else - wget -v --tries 10 -O $out_path $remote_path || failed=true + wget --tries 10 -O "$out_path" "$remote_path" || failed=true fi if [ "$failed" = true ]; then say_verbose "Wget download failed" @@ -615,20 +722,20 @@ calculate_vars() { eval $invocation valid_legacy_download_link=true - normalized_architecture=$(get_normalized_architecture_from_architecture "$architecture") + normalized_architecture="$(get_normalized_architecture_from_architecture "$architecture")" say_verbose "normalized_architecture=$normalized_architecture" - - specific_version=$(get_specific_version_from_version $azure_feed $channel $normalized_architecture $version) + + specific_version="$(get_specific_version_from_version "$azure_feed" "$channel" "$normalized_architecture" "$version")" say_verbose "specific_version=$specific_version" if [ -z "$specific_version" ]; then say_err "Could not get version information." return 1 fi - - download_link=$(construct_download_link $azure_feed $channel $normalized_architecture $specific_version) + + download_link="$(construct_download_link "$azure_feed" "$channel" "$normalized_architecture" "$specific_version")" say_verbose "download_link=$download_link" - legacy_download_link=$(construct_legacy_download_link $azure_feed $channel $normalized_architecture $specific_version) || valid_legacy_download_link=false + legacy_download_link="$(construct_legacy_download_link "$azure_feed" "$channel" "$normalized_architecture" "$specific_version")" || valid_legacy_download_link=false if [ "$valid_legacy_download_link" = true ]; then say_verbose "legacy_download_link=$legacy_download_link" @@ -636,39 +743,74 @@ calculate_vars() { say_verbose "Cound not construct a legacy_download_link; omitting..." fi - install_root=$(resolve_installation_path $install_dir) + install_root="$(resolve_installation_path "$install_dir")" say_verbose "install_root=$install_root" } install_dotnet() { eval $invocation local download_failed=false + local asset_name='' + local asset_relative_path='' + + if [[ "$runtime" == "dotnet" ]]; then + asset_relative_path="shared/Microsoft.NETCore.App" + asset_name=".NET Core Runtime" + elif [[ "$runtime" == "aspnetcore" ]]; then + asset_relative_path="shared/Microsoft.AspNetCore.App" + asset_name="ASP.NET Core Runtime" + elif [ -z "$runtime" ]; then + asset_relative_path="sdk" + asset_name=".NET Core SDK" + else + say_err "Invalid value for \$runtime" + return 1 + fi - if is_dotnet_package_installed $install_root "sdk" $specific_version; then - say ".NET SDK version $specific_version is already installed." + # Check if the SDK version is already installed. + if is_dotnet_package_installed "$install_root" "$asset_relative_path" "$specific_version"; then + say "$asset_name version $specific_version is already installed." return 0 fi - - mkdir -p $install_root - zip_path=$(mktemp $temporary_file_template) + + mkdir -p "$install_root" + zip_path="$(mktemp "$temporary_file_template")" say_verbose "Zip path: $zip_path" say "Downloading link: $download_link" - download "$download_link" $zip_path || download_failed=true + + # Failures are normal in the non-legacy case for ultimately legacy downloads. + # Do not output to stderr, since output to stderr is considered an error. + download "$download_link" "$zip_path" 2>&1 || download_failed=true # if the download fails, download the legacy_download_link - if [ "$download_failed" = true ] && [ "$valid_legacy_download_link" = true ]; then + if [ "$download_failed" = true ]; then say "Cannot download: $download_link" - download_link=$legacy_download_link - zip_path=$(mktemp $temporary_file_template) - say_verbose "Legacy zip path: $zip_path" - say "Downloading legacy link: $download_link" - download "$download_link" $zip_path + + if [ "$valid_legacy_download_link" = true ]; then + download_failed=false + download_link="$legacy_download_link" + zip_path="$(mktemp "$temporary_file_template")" + say_verbose "Legacy zip path: $zip_path" + say "Downloading legacy link: $download_link" + download "$download_link" "$zip_path" 2>&1 || download_failed=true + fi fi - + + if [ "$download_failed" = true ]; then + say_err "Could not download $asset_name version $specific_version" + return 1 + fi + say "Extracting zip from $download_link" - extract_dotnet_package $zip_path $install_root - + extract_dotnet_package "$zip_path" "$install_root" + + # Check if the SDK version is now installed; if not, fail the installation. + if ! is_dotnet_package_installed "$install_root" "$asset_relative_path" "$specific_version"; then + say_err "$asset_name version $specific_version failed to install with an unknown error." + return 1 + fi + return 0 } @@ -682,19 +824,22 @@ install_dir="" architecture="" dry_run=false no_path=false +no_cdn=false azure_feed="https://dotnetcli.azureedge.net/dotnet" uncached_feed="https://dotnetcli.blob.core.windows.net/dotnet" +feed_credential="" verbose=false -shared_runtime=false +runtime="" runtime_id="" +override_non_versioned_files=true while [ $# -ne 0 ] do - name=$1 - case $name in + name="$1" + case "$name" in -c|--channel|-[Cc]hannel) shift - channel=$1 + channel="$1" ;; -v|--version|-[Vv]ersion) shift @@ -709,7 +854,18 @@ do architecture="$1" ;; --shared-runtime|-[Ss]hared[Rr]untime) - shared_runtime=true + say_warning "The --shared-runtime flag is obsolete and may be removed in a future version of this script. The recommended usage is to specify '--runtime dotnet'." + if [ -z "$runtime" ]; then + runtime="dotnet" + fi + ;; + --runtime|-[Rr]untime) + shift + runtime="$1" + if [[ "$runtime" != "dotnet" ]] && [[ "$runtime" != "aspnetcore" ]]; then + say_err "Unsupported value for --runtime: '$1'. Valid values are 'dotnet' and 'aspnetcore'." + exit 1 + fi ;; --dry-run|-[Dd]ry[Rr]un) dry_run=true @@ -720,6 +876,9 @@ do --verbose|-[Vv]erbose) verbose=true ;; + --no-cdn|-[Nn]o[Cc]dn) + no_cdn=true + ;; --azure-feed|-[Aa]zure[Ff]eed) shift azure_feed="$1" @@ -728,12 +887,19 @@ do shift uncached_feed="$1" ;; + --feed-credential|-[Ff]eed[Cc]redential) + shift + feed_credential="$1" + ;; --runtime-id|-[Rr]untime[Ii]d) shift runtime_id="$1" ;; + --skip-non-versioned-files|-[Ss]kip[Nn]on[Vv]ersioned[Ff]iles) + override_non_versioned_files=false + ;; -?|--?|-h|--help|-[Hh]elp) - script_name="$(basename $0)" + script_name="$(basename "$0")" echo ".NET Tools Installer" echo "Usage: $script_name [-c|--channel ] [-v|--version ] [-p|--prefix ]" echo " $script_name -h|-?|--help" @@ -741,7 +907,7 @@ do echo "$script_name is a simple command line interface for obtaining dotnet cli." echo "" echo "Options:" - echo " -c,--channel Download from the CHANNEL specified, Defaults to \`$channel\`." + echo " -c,--channel Download from the channel specified, Defaults to \`$channel\`." echo " -Channel" echo " Possible values:" echo " - Current - most current release" @@ -758,20 +924,32 @@ do echo " coherent applies only to SDK downloads" echo " - 3-part version in a format A.B.C - represents specific version of build" echo " examples: 2.0.0-preview2-006120; 1.1.0" - echo " -i,--install-dir Install under specified location (see Install Location below)" + echo " -i,--install-dir Install under specified location (see Install Location below)" echo " -InstallDir" - echo " --architecture Architecture of .NET Tools. Currently only x64 is supported." + echo " --architecture Architecture of dotnet binaries to be installed, Defaults to \`$architecture\`." echo " --arch,-Architecture,-Arch" - echo " --shared-runtime Installs just the shared runtime bits, not the entire SDK." - echo " -SharedRuntime" - echo " --dry-run,-DryRun Do not perform installation. Display download link." - echo " --no-path, -NoPath Do not set PATH for the current process." - echo " --verbose,-Verbose Display diagnostics information." - echo " --azure-feed,-AzureFeed Azure feed location. Defaults to $azure_feed, This parameter typically is not changed by the user." - echo " --uncached-feed,-UncachedFeed Uncached feed location. This parameter typically is not changed by the user." - echo " --runtime-id Installs the .NET Tools for the given platform (use linux-x64 for portable linux)." + echo " Possible values: x64, arm, and arm64" + echo " --runtime Installs a shared runtime only, without the SDK." + echo " -Runtime" + echo " Possible values:" + echo " - dotnet - the Microsoft.NETCore.App shared runtime" + echo " - aspnetcore - the Microsoft.AspNetCore.App shared runtime" + echo " --skip-non-versioned-files Skips non-versioned files if they already exist, such as the dotnet executable." + echo " -SkipNonVersionedFiles" + echo " --dry-run,-DryRun Do not perform installation. Display download link." + echo " --no-path, -NoPath Do not set PATH for the current process." + echo " --verbose,-Verbose Display diagnostics information." + echo " --azure-feed,-AzureFeed Azure feed location. Defaults to $azure_feed, This parameter typically is not changed by the user." + echo " --uncached-feed,-UncachedFeed Uncached feed location. This parameter typically is not changed by the user." + echo " --no-cdn,-NoCdn Disable downloading from the Azure CDN, and use the uncached feed directly." + echo " --feed-credential,-FeedCredential Azure feed shared access token. This parameter typically is not specified." + echo " --runtime-id Installs the .NET Tools for the given platform (use linux-x64 for portable linux)." echo " -RuntimeId" - echo " -?,--?,-h,--help,-Help Shows this help message" + echo " -?,--?,-h,--help,-Help Shows this help message" + echo "" + echo "Obsolete parameters:" + echo " --shared-runtime The recommended alternative is '--runtime dotnet'." + echo " -SharedRuntime Installs just the shared runtime bits, not the entire SDK." echo "" echo "Install Location:" echo " Location is chosen in following order:" @@ -789,6 +967,10 @@ do shift done +if [ "$no_cdn" = true ]; then + azure_feed="$uncached_feed" +fi + check_min_reqs calculate_vars @@ -797,17 +979,17 @@ if [ "$dry_run" = true ]; then if [ "$valid_legacy_download_link" = true ]; then say "Legacy payload URL: $legacy_download_link" fi - say "Repeatable invocation: ./$(basename $0) --version $specific_version --channel $channel --install-dir $install_dir" + say "Repeatable invocation: ./$(basename "$0") --version $specific_version --channel $channel --install-dir $install_dir" exit 0 fi check_pre_reqs install_dotnet -bin_path=$(get_absolute_path $(combine_paths $install_root $bin_folder_relative_path)) +bin_path="$(get_absolute_path "$(combine_paths "$install_root" "$bin_folder_relative_path")")" if [ "$no_path" = false ]; then say "Adding to current process PATH: \`$bin_path\`. Note: This change will be visible only when sourcing script." - export PATH=$bin_path:$PATH + export PATH="$bin_path":"$PATH" else say "Binaries of dotnet can be found in $bin_path" fi diff --git a/setup/Directory.Build.props b/setup/Directory.Build.props new file mode 100644 index 00000000000..bd233e75785 --- /dev/null +++ b/setup/Directory.Build.props @@ -0,0 +1,21 @@ + + + + + + + true + false + $(MSBuildThisFileDirectory) + $(SetupRootFolder)resources + $(SetupRootFolder)..\artifacts\bin + $(ArtifactsDir)\VSSetup\$(Configuration) + $(ArtifactsDir)\VSSetup.obj\$(Configuration)\$(MSBuildProjectName) + $(SetupRootFolder)..\artifacts\VSSetup\$(Configuration) + $(SetupRootFolder)..\artifacts\VSSetup\$(Configuration)\Insertion + + + $(VSMajorVersion).$(VSMinorVersion).$(BUILD_BUILDNUMBER) + + + diff --git a/setup/Directory.Build.targets b/setup/Directory.Build.targets new file mode 100644 index 00000000000..ccd47cc0a9a --- /dev/null +++ b/setup/Directory.Build.targets @@ -0,0 +1,3 @@ + + + diff --git a/setup/FSharp.Setup.props b/setup/FSharp.Setup.props deleted file mode 100644 index 899f78e6baa..00000000000 --- a/setup/FSharp.Setup.props +++ /dev/null @@ -1,150 +0,0 @@ - - - - - 2.0 - 3.10 - 3.10.0.1503 - $(MSBuildThisFileDirectory) - $(SetupRootFolder)\..\packages\WiX.Toolset.2015.$(WiXToolset2015Version)\tools\wix - $(SetupRootFolder)\..\packages - - - - - - - $(VSMajorVersion).$(VSMinorVersion).$(BUILD_BUILDNUMBER) - - - - net40 - Debug - AnyCPU - - - - $(SetupRootFolder)\..\$(Configuration) - $(BinariesDir)\$(TargetDotnetProfile)\bin\ - $(BinariesDir)\insertion - obj\$(Configuration)\ - $(BinariesDir)\setup - $(BinariesDir)\setup\$(Lang) - - - - - ENU - 1033 - 9 - en - en-US - false - - - CHT - 1028 - 31748 - zh-Hant - zh-TW - true - - - CSY - 1029 - 5 - cs - cs-CZ - true - - - DEU - 1031 - 7 - de - de-DE - true - - - FRA - 1036 - 12 - fr - fr-FR - true - - - ITA - 1040 - 16 - it - it-IT - true - - - JPN - 1041 - 17 - ja - ja-JP - true - - - KOR - 1042 - 18 - ko - ko-KR - true - - - PLK - 1045 - 21 - pl - pl-PL - true - - - PTB - 1046 - 1046 - pt-BR - pt-BR - true - - - RUS - 1049 - 25 - ru - ru-RU - true - - - TRK - 1055 - 31 - tr - tr-TR - true - - - CHS - 2052 - 4 - zh-Hans - zh-CN - true - - - ESN - 3082 - 10 - es - es-ES - true - - - - diff --git a/setup/Localization.props b/setup/Localization.props new file mode 100644 index 00000000000..37c13afcd2c --- /dev/null +++ b/setup/Localization.props @@ -0,0 +1,120 @@ + + + + + + + ENU + 1033 + 9 + en + en-US + false + + + CHT + 1028 + 31748 + zh-Hant + zh-TW + true + + + CSY + 1029 + 5 + cs + cs-CZ + true + + + DEU + 1031 + 7 + de + de-DE + true + + + FRA + 1036 + 12 + fr + fr-FR + true + + + ITA + 1040 + 16 + it + it-IT + true + + + JPN + 1041 + 17 + ja + ja-JP + true + + + KOR + 1042 + 18 + ko + ko-KR + true + + + PLK + 1045 + 21 + pl + pl-PL + true + + + PTB + 1046 + 1046 + pt-BR + pt-BR + true + + + RUS + 1049 + 25 + ru + ru-RU + true + + + TRK + 1055 + 31 + tr + tr-TR + true + + + CHS + 2052 + 4 + zh-Hans + zh-CN + true + + + ESN + 3082 + 10 + es + es-ES + true + + + + diff --git a/setup/Swix/Directory.Build.props b/setup/Swix/Directory.Build.props new file mode 100644 index 00000000000..f64df1d29de --- /dev/null +++ b/setup/Swix/Directory.Build.props @@ -0,0 +1,14 @@ + + + + + + Debug + neutral + false + vsix + true + $(ArtifactsBinDir) + + + diff --git a/setup/Swix/Directory.Build.targets b/setup/Swix/Directory.Build.targets new file mode 100644 index 00000000000..974c6da4f1b --- /dev/null +++ b/setup/Swix/Directory.Build.targets @@ -0,0 +1,10 @@ + + + + + $(ArtifactsDir)\VSSetup\$(Configuration)\Insertion\$(OutputName).vsix + + + + + diff --git a/setup/Swix/Microsoft.FSharp.Compiler.Resources/Files.swr b/setup/Swix/Microsoft.FSharp.Compiler.Resources/Files.swr index 464fdd774ee..f3f60d490b9 100644 --- a/setup/Swix/Microsoft.FSharp.Compiler.Resources/Files.swr +++ b/setup/Swix/Microsoft.FSharp.Compiler.Resources/Files.swr @@ -5,7 +5,7 @@ package name=Microsoft.FSharp.Compiler.Resources vs.package.language=$(LocaleSpecificCulture) folder "InstallDir:Common7\IDE\CommonExtensions\Microsoft\FSharpCompiler\$(LocaleParentCulture)" - file source="$(BinariesFolder)\net40\bin\$(LocaleParentCulture)\FSharp.Build.resources.dll" - file source="$(BinariesFolder)\net40\bin\$(LocaleParentCulture)\FSharp.Compiler.Interactive.Settings.resources.dll" - file source="$(BinariesFolder)\net40\bin\$(LocaleParentCulture)\FSharp.Compiler.Private.resources.dll" - file source="$(BinariesFolder)\net40\bin\$(LocaleParentCulture)\FSharp.Core.resources.dll" + file source="$(BinariesFolder)\FSharp.Build\$(Configuration)\net46\$(LocaleParentCulture)\FSharp.Build.resources.dll" + file source="$(BinariesFolder)\FSharp.Compiler.Interactive.Settings\$(Configuration)\net46\$(LocaleParentCulture)\FSharp.Compiler.Interactive.Settings.resources.dll" + file source="$(BinariesFolder)\FSharp.Compiler.Private\$(Configuration)\net46\$(LocaleParentCulture)\FSharp.Compiler.Private.resources.dll" + file source="$(BinariesFolder)\FSharp.Core\$(Configuration)\net45\$(LocaleParentCulture)\FSharp.Core.resources.dll" diff --git a/setup/Swix/Microsoft.FSharp.Compiler.Resources/Microsoft.FSharp.Compiler.Resources.swixproj b/setup/Swix/Microsoft.FSharp.Compiler.Resources/Microsoft.FSharp.Compiler.Resources.swixproj index d722fb0293e..ac8e74d4854 100644 --- a/setup/Swix/Microsoft.FSharp.Compiler.Resources/Microsoft.FSharp.Compiler.Resources.swixproj +++ b/setup/Swix/Microsoft.FSharp.Compiler.Resources/Microsoft.FSharp.Compiler.Resources.swixproj @@ -1,23 +1,16 @@ - + + + + - ..\..\..\src - neutral - false - vsix - true - Debug - $(FSharpSourcesRoot)\..\$(Configuration) - $(BinariesFolder)\insertion Microsoft.FSharp.Compiler.Resources.$(LocaleCode) - $(MSBuildThisFileDirectory)obj - - $(PackagePreprocessorDefinitions);BinariesFolder=$(BinariesFolder) + $(PackagePreprocessorDefinitions);Configuration=$(Configuration) $(PackagePreprocessorDefinitions);FSharpPackageVersion=$(FSharpPackageVersion) $(PackagePreprocessorDefinitions);LocaleParentCulture=$(LocaleParentCulture) $(PackagePreprocessorDefinitions);LocaleSpecificCulture=$(LocaleSpecificCulture) @@ -35,7 +28,6 @@ - - - + + diff --git a/setup/Swix/Microsoft.FSharp.Compiler/Files.swr b/setup/Swix/Microsoft.FSharp.Compiler/Files.swr index e546ffe0b30..b56667d2465 100644 --- a/setup/Swix/Microsoft.FSharp.Compiler/Files.swr +++ b/setup/Swix/Microsoft.FSharp.Compiler/Files.swr @@ -5,35 +5,35 @@ package name=Microsoft.FSharp.Compiler folder "InstallDir:Common7\IDE\CommonExtensions\Microsoft\FSharp" - file source=$(BinariesFolder)\net40\bin\fsc.exe vs.file.ngen=yes vs.file.ngenArchitecture=All vs.file.ngenPriority=2 vs.file.ngenApplication="[installDir]\Common7\IDE\CommonExtensions\Microsoft\FSharp\fsc.exe" - file source="$(BinariesFolder)\net40\bin\fsc.exe.config" - - file source=$(BinariesFolder)\net40\bin\fsi.exe vs.file.ngen=yes vs.file.ngenArchitecture=X86 vs.file.ngenPriority=2 vs.file.ngenApplication="[installDir]\Common7\IDE\CommonExtensions\Microsoft\FSharp\fsi.exe" - file source="$(BinariesFolder)\net40\bin\fsi.exe.config" - - file source="$(BinariesFolder)\net40\bin\fsiAnyCpu.exe" vs.file.ngen=yes vs.file.ngenArchitecture=X64 vs.file.ngenPriority=2 vs.file.ngenApplication="[installDir]\Common7\IDE\CommonExtensions\Microsoft\FSharp\fsiAnyCpu.exe" - file source="$(BinariesFolder)\net40\bin\fsiAnyCpu.exe.config" - - file source="$(BinariesFolder)\net40\bin\FSharp.Compiler.Interactive.Settings.dll" vs.file.ngen=yes vs.file.ngenArchitecture=All vs.file.ngenPriority=2 - file source="$(BinariesFolder)\net40\bin\FSharp.Compiler.Private.dll" vs.file.ngen=yes vs.file.ngenArchitecture=All vs.file.ngenPriority=2 - file source="$(BinariesFolder)\net40\bin\FSharp.Compiler.Server.Shared.dll" vs.file.ngen=yes vs.file.ngenArchitecture=All vs.file.ngenPriority=2 - - file source="$(BinariesFolder)\net40\bin\FSharp.Core.dll" vs.file.ngen=yes vs.file.ngenArchitecture=All vs.file.ngenPriority=2 - file source="$(BinariesFolder)\net40\bin\FSharp.Core.optdata" - file source="$(BinariesFolder)\net40\bin\FSharp.Core.sigdata" - - file source="$(BinariesFolder)\net40\bin\FSharp.Build.dll" vs.file.ngen=yes vs.file.ngenArchitecture=All vs.file.ngenPriority=2 - - file source="$(PackagesFolder)\Microsoft.VisualFSharp.Type.Providers.Redist.$(MicrosoftVisualFSharpTypeProvidersRedistPackageVersion)\content\4.3.0.0\FSharp.Data.TypeProviders.dll" - file source="$(BinariesFolder)\net40\bin\Microsoft.Build.dll" - file source="$(BinariesFolder)\net40\bin\Microsoft.Build.Framework.dll" - file source="$(BinariesFolder)\net40\bin\Microsoft.Build.Tasks.Core.dll" - file source="$(BinariesFolder)\net40\bin\Microsoft.Build.Utilities.Core.dll" - file source="$(BinariesFolder)\net40\bin\Microsoft.Portable.FSharp.Targets" - file source="$(BinariesFolder)\net40\bin\System.Collections.Immutable.dll" - file source="$(BinariesFolder)\net40\bin\System.Reflection.Metadata.dll" - file source="$(BinariesFolder)\net40\bin\System.ValueTuple.dll" - file source="$(BinariesFolder)\net40\bin\Microsoft.FSharp.NetSdk.props" - file source="$(BinariesFolder)\net40\bin\Microsoft.FSharp.NetSdk.targets" - file source="$(BinariesFolder)\net40\bin\Microsoft.FSharp.Overrides.NetSdk.targets" - file source="$(BinariesFolder)\net40\bin\Microsoft.FSharp.Targets" + file source=$(BinariesFolder)\fsc\$(Configuration)\net46\fsc.exe vs.file.ngen=yes vs.file.ngenArchitecture=All vs.file.ngenPriority=2 vs.file.ngenApplication="[installDir]\Common7\IDE\CommonExtensions\Microsoft\FSharp\fsc.exe" + file source="$(BinariesFolder)\fsc\$(Configuration)\net46\fsc.exe.config" + + file source=$(BinariesFolder)\fsi\$(Configuration)\net46\fsi.exe vs.file.ngen=yes vs.file.ngenArchitecture=X86 vs.file.ngenPriority=2 vs.file.ngenApplication="[installDir]\Common7\IDE\CommonExtensions\Microsoft\FSharp\fsi.exe" + file source="$(BinariesFolder)\fsi\$(Configuration)\net46\fsi.exe.config" + + file source="$(BinariesFolder)\fsiAnyCpu\$(Configuration)\net46\fsiAnyCpu.exe" vs.file.ngen=yes vs.file.ngenArchitecture=X64 vs.file.ngenPriority=2 vs.file.ngenApplication="[installDir]\Common7\IDE\CommonExtensions\Microsoft\FSharp\fsiAnyCpu.exe" + file source="$(BinariesFolder)\fsiAnyCpu\$(Configuration)\net46\fsiAnyCpu.exe.config" + + file source="$(BinariesFolder)\FSharp.Compiler.Interactive.Settings\$(Configuration)\net46\FSharp.Compiler.Interactive.Settings.dll" vs.file.ngen=yes vs.file.ngenArchitecture=All vs.file.ngenPriority=2 + file source="$(BinariesFolder)\FSharp.Compiler.Private\$(Configuration)\net46\FSharp.Compiler.Private.dll" vs.file.ngen=yes vs.file.ngenArchitecture=All vs.file.ngenPriority=2 + file source="$(BinariesFolder)\FSharp.Compiler.Server.Shared\$(Configuration)\net46\FSharp.Compiler.Server.Shared.dll" vs.file.ngen=yes vs.file.ngenArchitecture=All vs.file.ngenPriority=2 + + file source="$(BinariesFolder)\FSharp.Core\$(Configuration)\net45\FSharp.Core.dll" vs.file.ngen=yes vs.file.ngenArchitecture=All vs.file.ngenPriority=2 + file source="$(BinariesFolder)\FSharp.Core\$(Configuration)\net45\FSharp.Core.optdata" + file source="$(BinariesFolder)\FSharp.Core\$(Configuration)\net45\FSharp.Core.sigdata" + + file source="$(BinariesFolder)\FSharp.Build\$(Configuration)\net46\FSharp.Build.dll" vs.file.ngen=yes vs.file.ngenArchitecture=All vs.file.ngenPriority=2 + + file source="$(PackagesFolder)\Microsoft.VisualFSharp.Type.Providers.Redist\$(MicrosoftVisualFSharpTypeProvidersRedistPackageVersion)\content\4.3.0.0\FSharp.Data.TypeProviders.dll" + file source="$(BinariesFolder)\FSharp.Build\$(Configuration)\net46\Microsoft.Build.dll" + file source="$(BinariesFolder)\FSharp.Build\$(Configuration)\net46\Microsoft.Build.Framework.dll" + file source="$(BinariesFolder)\FSharp.Build\$(Configuration)\net46\Microsoft.Build.Tasks.Core.dll" + file source="$(BinariesFolder)\FSharp.Build\$(Configuration)\net46\Microsoft.Build.Utilities.Core.dll" + file source="$(BinariesFolder)\FSharp.Build\$(Configuration)\net46\Microsoft.Portable.FSharp.Targets" + file source="$(BinariesFolder)\FSharp.Build\$(Configuration)\net46\System.Collections.Immutable.dll" + file source="$(BinariesFolder)\FSharp.Compiler.Private\$(Configuration)\net46\System.Reflection.Metadata.dll" + file source="$(BinariesFolder)\FSharp.Compiler.Private\$(Configuration)\net46\System.ValueTuple.dll" + file source="$(BinariesFolder)\FSharp.Build\$(Configuration)\net46\Microsoft.FSharp.NetSdk.props" + file source="$(BinariesFolder)\FSharp.Build\$(Configuration)\net46\Microsoft.FSharp.NetSdk.targets" + file source="$(BinariesFolder)\FSharp.Build\$(Configuration)\net46\Microsoft.FSharp.Overrides.NetSdk.targets" + file source="$(BinariesFolder)\FSharp.Build\$(Configuration)\net46\Microsoft.FSharp.Targets" diff --git a/setup/Swix/Microsoft.FSharp.Compiler/Microsoft.FSharp.Compiler.swixproj b/setup/Swix/Microsoft.FSharp.Compiler/Microsoft.FSharp.Compiler.swixproj index d748087bfcc..f256dd46779 100644 --- a/setup/Swix/Microsoft.FSharp.Compiler/Microsoft.FSharp.Compiler.swixproj +++ b/setup/Swix/Microsoft.FSharp.Compiler/Microsoft.FSharp.Compiler.swixproj @@ -1,27 +1,17 @@ - + + + + - $(MSBuildThisFileDirectory)..\..\..\src - $(FSharpSourcesRoot)\.. - neutral - false - vsix - true - Debug - $(FSharpSourcesRoot)\..\$(Configuration) - $(FSharpSourcesRoot)\..\packages - $(BinariesFolder)\insertion Microsoft.FSharp.Compiler - $(MSBuildThisFileDirectory)obj - - - $(PackagePreprocessorDefinitions);BinariesFolder=$(BinariesFolder) - $(PackagePreprocessorDefinitions);PackagesFolder=$(PackagesFolder) + $(PackagePreprocessorDefinitions);Configuration=$(Configuration) + $(PackagePreprocessorDefinitions);PackagesFolder=$(NuGetPackageRoot) $(PackagePreprocessorDefinitions);FSharpTreeRoot=$(FSharpTreeRoot) $(PackagePreprocessorDefinitions);FSharpPackageVersion=$(FSharpPackageVersion) $(PackagePreprocessorDefinitions);MicrosoftVisualFSharpTypeProvidersRedistPackageVersion=$(MicrosoftVisualFSharpTypeProvidersRedistPackageVersion) @@ -36,7 +26,6 @@ - - - + + diff --git a/setup/Swix/Microsoft.FSharp.Dependencies/Files.swr b/setup/Swix/Microsoft.FSharp.Dependencies/Files.swr index 29a77d01c79..f927497e193 100644 --- a/setup/Swix/Microsoft.FSharp.Dependencies/Files.swr +++ b/setup/Swix/Microsoft.FSharp.Dependencies/Files.swr @@ -4,16 +4,11 @@ package name=Microsoft.FSharp.Dependencies version=$(FSharpPackageVersion) folder "InstallDir:MSBuild\Microsoft\VisualStudio\v$(VSGeneralVersion)\FSharp" - file "Microsoft.FSharp.targets" source="$(BinariesFolder)\setup\resources\Microsoft.FSharp.Shim.targets" - file "Microsoft.Portable.FSharp.targets" source="$(BinariesFolder)\setup\resources\Microsoft.Portable.FSharp.Shim.targets" - file "Microsoft.FSharp.NetSdk.targets" source="$(BinariesFolder)\setup\resources\Microsoft.FSharp.NetSdk.Shim.targets" - file "Microsoft.FSharp.Overrides.NetSdk.targets" source="$(BinariesFolder)\setup\resources\Microsoft.FSharp.Overrides.NetSdk.Shim.targets" - file "Microsoft.FSharp.NetSdk.props" source="$(BinariesFolder)\setup\resources\Microsoft.FSharp.NetSdk.Shim.props" - -folder "InstallDir:Common7\IDE\PublicAssemblies" - file source="$(BinariesFolder)\net40\bin\FSharp.Core.dll" vs.file.ngen=yes - file source="$(BinariesFolder)\net40\bin\FSharp.Core.optdata" - file source="$(BinariesFolder)\net40\bin\FSharp.Core.sigdata" + file "Microsoft.FSharp.targets" source="$(SetupShimsDir)\Microsoft.FSharp.Shim.targets" + file "Microsoft.Portable.FSharp.targets" source="$(SetupShimsDir)\Microsoft.Portable.FSharp.Shim.targets" + file "Microsoft.FSharp.NetSdk.targets" source="$(SetupShimsDir)\Microsoft.FSharp.NetSdk.Shim.targets" + file "Microsoft.FSharp.Overrides.NetSdk.targets" source="$(SetupShimsDir)\Microsoft.FSharp.Overrides.NetSdk.Shim.targets" + file "Microsoft.FSharp.NetSdk.props" source="$(SetupShimsDir)\Microsoft.FSharp.NetSdk.Shim.props" folder "InstallDir:Common7\Tools\VsDevCmd\Ext" file source="fsharp.bat" diff --git a/setup/Swix/Microsoft.FSharp.Dependencies/Microsoft.FSharp.Dependencies.swixproj b/setup/Swix/Microsoft.FSharp.Dependencies/Microsoft.FSharp.Dependencies.swixproj index 06d75f70f72..e30eaaf0fe1 100644 --- a/setup/Swix/Microsoft.FSharp.Dependencies/Microsoft.FSharp.Dependencies.swixproj +++ b/setup/Swix/Microsoft.FSharp.Dependencies/Microsoft.FSharp.Dependencies.swixproj @@ -1,26 +1,19 @@ - + + + + - ..\..\..\src - neutral - false - vsix - true - Debug - $(FSharpSourcesRoot)\..\$(Configuration) - $(FSharpSourcesRoot)\..\packages - $(BinariesFolder)\insertion Microsoft.FSharp.Dependencies - $(MSBuildThisFileDirectory)obj - - $(PackagePreprocessorDefinitions);BinariesFolder=$(BinariesFolder) - $(PackagePreprocessorDefinitions);PackagesFolder=$(PackagesFolder) + $(PackagePreprocessorDefinitions);Configuration=$(Configuration) $(PackagePreprocessorDefinitions);FSharpPackageVersion=$(FSharpPackageVersion) + $(PackagePreprocessorDefinitions);SetupShimsDir=$(MSBuildThisFileDirectory)..\..\shims + $(PackagePreprocessorDefinitions);TargetFramework=$(TargetFramework) $(PackagePreprocessorDefinitions);VSGeneralVersion=$(VSGeneralVersion) @@ -31,10 +24,10 @@ + - - - + + diff --git a/setup/Swix/Microsoft.FSharp.IDE/Files.swr b/setup/Swix/Microsoft.FSharp.IDE/Files.swr index bf544b4be14..2e0ee2bcf3b 100644 --- a/setup/Swix/Microsoft.FSharp.IDE/Files.swr +++ b/setup/Swix/Microsoft.FSharp.IDE/Files.swr @@ -4,10 +4,10 @@ package name=Microsoft.FSharp.IDE version=$(FSharpPackageVersion) folder "InstallDir:Common7\IDE\NewScriptItems" - file source="$(BinariesFolder)\setup\resources\NewFileDialog\Script\NewFSharpScriptItems.vsdir" - file source="$(BinariesFolder)\setup\resources\NewFileDialog\Script\Script.fsx" + file source="$(SetupResourcesDir)\NewFileDialog\Script\NewFSharpScriptItems.vsdir" + file source="$(SetupResourcesDir)\NewFileDialog\Script\Script.fsx" folder "InstallDir:Common7\IDE\NewFileItems" - file source="$(BinariesFolder)\setup\resources\NewFileDialog\General\NewFSharpFileItems.vsdir" - file source="$(BinariesFolder)\setup\resources\NewFileDialog\General\File.fs" - file source="$(BinariesFolder)\setup\resources\NewFileDialog\General\Script.fsx" + file source="$(SetupResourcesDir)\NewFileDialog\General\NewFSharpFileItems.vsdir" + file source="$(SetupResourcesDir)\NewFileDialog\General\File.fs" + file source="$(SetupResourcesDir)\NewFileDialog\General\Script.fsx" diff --git a/setup/Swix/Microsoft.FSharp.IDE/Microsoft.FSharp.IDE.swixproj b/setup/Swix/Microsoft.FSharp.IDE/Microsoft.FSharp.IDE.swixproj index 47c00dd88fe..223a7262fcb 100644 --- a/setup/Swix/Microsoft.FSharp.IDE/Microsoft.FSharp.IDE.swixproj +++ b/setup/Swix/Microsoft.FSharp.IDE/Microsoft.FSharp.IDE.swixproj @@ -1,26 +1,17 @@ - + + + + - $(MSBuildThisFileDirectory)..\..\..\src - neutral - false - vsix - true - Debug - $(FSharpSourcesRoot)\..\$(Configuration) - $(FSharpSourcesRoot)\..\packages - $(BinariesFolder)\insertion Microsoft.FSharp.IDE - $(MSBuildThisFileDirectory)obj - - - $(PackagePreprocessorDefinitions);BinariesFolder=$(BinariesFolder) - $(PackagePreprocessorDefinitions);PackagesFolder=$(PackagesFolder) $(PackagePreprocessorDefinitions);FSharpPackageVersion=$(FSharpPackageVersion) + $(PackagePreprocessorDefinitions);SetupResourcesDir=$(MSBuildThisFileDirectory)..\..\resources + $(PackagePreprocessorDefinitions);TargetFramework=$(TargetFramework) @@ -30,9 +21,9 @@ + - - - + + diff --git a/setup/Swix/Microsoft.FSharp.SDK/Files.swr b/setup/Swix/Microsoft.FSharp.SDK/Files.swr index 228bc933437..cffd90ed366 100644 --- a/setup/Swix/Microsoft.FSharp.SDK/Files.swr +++ b/setup/Swix/Microsoft.FSharp.SDK/Files.swr @@ -7,96 +7,96 @@ folder "InstallDir:Common7\IDE\CommonExtensions\Microsoft\FSharpSdk" folder ".NETCore" folder "3.3.1.0" - file source="$(PackagesFolder)\Microsoft.VisualFSharp.Core.Redist.1.0.0\content\.NETCore\3.3.1.0\FSharp.Core.dll" - file source="$(PackagesFolder)\Microsoft.VisualFSharp.Core.Redist.1.0.0\content\.NETCore\3.3.1.0\FSharp.Core.optdata" - file source="$(PackagesFolder)\Microsoft.VisualFSharp.Core.Redist.1.0.0\content\.NETCore\3.3.1.0\FSharp.Core.sigdata" - file source="$(PackagesFolder)\Microsoft.VisualFSharp.Core.Redist.1.0.0\content\.NETCore\3.3.1.0\FSharp.Core.xml" + file source="$(PackagesFolder)\Microsoft.VisualFSharp.Core.Redist\1.0.0\content\.NETCore\3.3.1.0\FSharp.Core.dll" + file source="$(PackagesFolder)\Microsoft.VisualFSharp.Core.Redist\1.0.0\content\.NETCore\3.3.1.0\FSharp.Core.optdata" + file source="$(PackagesFolder)\Microsoft.VisualFSharp.Core.Redist\1.0.0\content\.NETCore\3.3.1.0\FSharp.Core.sigdata" + file source="$(PackagesFolder)\Microsoft.VisualFSharp.Core.Redist\1.0.0\content\.NETCore\3.3.1.0\FSharp.Core.xml" folder "3.7.4.0" - file source="$(PackagesFolder)\Microsoft.VisualFSharp.Core.Redist.1.0.0\content\.NETCore\3.7.4.0\FSharp.Core.dll" - file source="$(PackagesFolder)\Microsoft.VisualFSharp.Core.Redist.1.0.0\content\.NETCore\3.7.4.0\FSharp.Core.optdata" - file source="$(PackagesFolder)\Microsoft.VisualFSharp.Core.Redist.1.0.0\content\.NETCore\3.7.4.0\FSharp.Core.sigdata" - file source="$(PackagesFolder)\Microsoft.VisualFSharp.Core.Redist.1.0.0\content\.NETCore\3.7.4.0\FSharp.Core.xml" + file source="$(PackagesFolder)\Microsoft.VisualFSharp.Core.Redist\1.0.0\content\.NETCore\3.7.4.0\FSharp.Core.dll" + file source="$(PackagesFolder)\Microsoft.VisualFSharp.Core.Redist\1.0.0\content\.NETCore\3.7.4.0\FSharp.Core.optdata" + file source="$(PackagesFolder)\Microsoft.VisualFSharp.Core.Redist\1.0.0\content\.NETCore\3.7.4.0\FSharp.Core.sigdata" + file source="$(PackagesFolder)\Microsoft.VisualFSharp.Core.Redist\1.0.0\content\.NETCore\3.7.4.0\FSharp.Core.xml" folder "3.7.41.0" - file source="$(PackagesFolder)\Microsoft.Portable.FSharp.Core.10.1.0\lib\profiles\portable-net45+netcore45\FSharp.Core.dll" - file source="$(PackagesFolder)\Microsoft.Portable.FSharp.Core.10.1.0\lib\profiles\portable-net45+netcore45\FSharp.Core.optdata" - file source="$(PackagesFolder)\Microsoft.Portable.FSharp.Core.10.1.0\lib\profiles\portable-net45+netcore45\FSharp.Core.sigdata" - file source="$(PackagesFolder)\Microsoft.Portable.FSharp.Core.10.1.0\lib\profiles\portable-net45+netcore45\FSharp.Core.xml" + file source="$(PackagesFolder)\Microsoft.Portable.FSharp.Core\10.1.0\lib\profiles\portable-net45+netcore45\FSharp.Core.dll" + file source="$(PackagesFolder)\Microsoft.Portable.FSharp.Core\10.1.0\lib\profiles\portable-net45+netcore45\FSharp.Core.optdata" + file source="$(PackagesFolder)\Microsoft.Portable.FSharp.Core\10.1.0\lib\profiles\portable-net45+netcore45\FSharp.Core.sigdata" + file source="$(PackagesFolder)\Microsoft.Portable.FSharp.Core\10.1.0\lib\profiles\portable-net45+netcore45\FSharp.Core.xml" folder "3.78.3.1" - file source="$(PackagesFolder)\Microsoft.VisualFSharp.Core.Redist.1.0.0\content\.NETCore\3.78.3.1\FSharp.Core.dll" - file source="$(PackagesFolder)\Microsoft.VisualFSharp.Core.Redist.1.0.0\content\.NETCore\3.78.3.1\FSharp.Core.optdata" - file source="$(PackagesFolder)\Microsoft.VisualFSharp.Core.Redist.1.0.0\content\.NETCore\3.78.3.1\FSharp.Core.sigdata" - file source="$(PackagesFolder)\Microsoft.VisualFSharp.Core.Redist.1.0.0\content\.NETCore\3.78.3.1\FSharp.Core.xml" + file source="$(PackagesFolder)\Microsoft.VisualFSharp.Core.Redist\1.0.0\content\.NETCore\3.78.3.1\FSharp.Core.dll" + file source="$(PackagesFolder)\Microsoft.VisualFSharp.Core.Redist\1.0.0\content\.NETCore\3.78.3.1\FSharp.Core.optdata" + file source="$(PackagesFolder)\Microsoft.VisualFSharp.Core.Redist\1.0.0\content\.NETCore\3.78.3.1\FSharp.Core.sigdata" + file source="$(PackagesFolder)\Microsoft.VisualFSharp.Core.Redist\1.0.0\content\.NETCore\3.78.3.1\FSharp.Core.xml" folder "3.78.4.0" - file source="$(PackagesFolder)\Microsoft.VisualFSharp.Core.Redist.1.0.0\content\.NETCore\3.78.4.0\FSharp.Core.dll" - file source="$(PackagesFolder)\Microsoft.VisualFSharp.Core.Redist.1.0.0\content\.NETCore\3.78.4.0\FSharp.Core.optdata" - file source="$(PackagesFolder)\Microsoft.VisualFSharp.Core.Redist.1.0.0\content\.NETCore\3.78.4.0\FSharp.Core.sigdata" - file source="$(PackagesFolder)\Microsoft.VisualFSharp.Core.Redist.1.0.0\content\.NETCore\3.78.4.0\FSharp.Core.xml" + file source="$(PackagesFolder)\Microsoft.VisualFSharp.Core.Redist\1.0.0\content\.NETCore\3.78.4.0\FSharp.Core.dll" + file source="$(PackagesFolder)\Microsoft.VisualFSharp.Core.Redist\1.0.0\content\.NETCore\3.78.4.0\FSharp.Core.optdata" + file source="$(PackagesFolder)\Microsoft.VisualFSharp.Core.Redist\1.0.0\content\.NETCore\3.78.4.0\FSharp.Core.sigdata" + file source="$(PackagesFolder)\Microsoft.VisualFSharp.Core.Redist\1.0.0\content\.NETCore\3.78.4.0\FSharp.Core.xml" folder "3.78.41.0" - file source="$(PackagesFolder)\Microsoft.Portable.FSharp.Core.10.1.0\lib\profiles\portable-net45+netcore45+wp8\FSharp.Core.dll" - file source="$(PackagesFolder)\Microsoft.Portable.FSharp.Core.10.1.0\lib\profiles\portable-net45+netcore45+wp8\FSharp.Core.optdata" - file source="$(PackagesFolder)\Microsoft.Portable.FSharp.Core.10.1.0\lib\profiles\portable-net45+netcore45+wp8\FSharp.Core.sigdata" - file source="$(PackagesFolder)\Microsoft.Portable.FSharp.Core.10.1.0\lib\profiles\portable-net45+netcore45+wp8\FSharp.Core.xml" + file source="$(PackagesFolder)\Microsoft.Portable.FSharp.Core\10.1.0\lib\profiles\portable-net45+netcore45+wp8\FSharp.Core.dll" + file source="$(PackagesFolder)\Microsoft.Portable.FSharp.Core\10.1.0\lib\profiles\portable-net45+netcore45+wp8\FSharp.Core.optdata" + file source="$(PackagesFolder)\Microsoft.Portable.FSharp.Core\10.1.0\lib\profiles\portable-net45+netcore45+wp8\FSharp.Core.sigdata" + file source="$(PackagesFolder)\Microsoft.Portable.FSharp.Core\10.1.0\lib\profiles\portable-net45+netcore45+wp8\FSharp.Core.xml" folder "3.259.3.1" - file source="$(PackagesFolder)\Microsoft.VisualFSharp.Core.Redist.1.0.0\content\.NETCore\3.259.3.1\FSharp.Core.dll" - file source="$(PackagesFolder)\Microsoft.VisualFSharp.Core.Redist.1.0.0\content\.NETCore\3.259.3.1\FSharp.Core.optdata" - file source="$(PackagesFolder)\Microsoft.VisualFSharp.Core.Redist.1.0.0\content\.NETCore\3.259.3.1\FSharp.Core.sigdata" - file source="$(PackagesFolder)\Microsoft.VisualFSharp.Core.Redist.1.0.0\content\.NETCore\3.259.3.1\FSharp.Core.xml" + file source="$(PackagesFolder)\Microsoft.VisualFSharp.Core.Redist\1.0.0\content\.NETCore\3.259.3.1\FSharp.Core.dll" + file source="$(PackagesFolder)\Microsoft.VisualFSharp.Core.Redist\1.0.0\content\.NETCore\3.259.3.1\FSharp.Core.optdata" + file source="$(PackagesFolder)\Microsoft.VisualFSharp.Core.Redist\1.0.0\content\.NETCore\3.259.3.1\FSharp.Core.sigdata" + file source="$(PackagesFolder)\Microsoft.VisualFSharp.Core.Redist\1.0.0\content\.NETCore\3.259.3.1\FSharp.Core.xml" folder "3.259.4.0" - file source="$(PackagesFolder)\Microsoft.VisualFSharp.Core.Redist.1.0.0\content\.NETCore\3.259.4.0\FSharp.Core.dll" - file source="$(PackagesFolder)\Microsoft.VisualFSharp.Core.Redist.1.0.0\content\.NETCore\3.259.4.0\FSharp.Core.optdata" - file source="$(PackagesFolder)\Microsoft.VisualFSharp.Core.Redist.1.0.0\content\.NETCore\3.259.4.0\FSharp.Core.sigdata" - file source="$(PackagesFolder)\Microsoft.VisualFSharp.Core.Redist.1.0.0\content\.NETCore\3.259.4.0\FSharp.Core.xml" + file source="$(PackagesFolder)\Microsoft.VisualFSharp.Core.Redist\1.0.0\content\.NETCore\3.259.4.0\FSharp.Core.dll" + file source="$(PackagesFolder)\Microsoft.VisualFSharp.Core.Redist\1.0.0\content\.NETCore\3.259.4.0\FSharp.Core.optdata" + file source="$(PackagesFolder)\Microsoft.VisualFSharp.Core.Redist\1.0.0\content\.NETCore\3.259.4.0\FSharp.Core.sigdata" + file source="$(PackagesFolder)\Microsoft.VisualFSharp.Core.Redist\1.0.0\content\.NETCore\3.259.4.0\FSharp.Core.xml" folder "3.259.41.0" - file source="$(PackagesFolder)\Microsoft.Portable.FSharp.Core.10.1.0\lib\profiles\portable-net45+netcore45+wpa81+wp8\FSharp.Core.dll" - file source="$(PackagesFolder)\Microsoft.Portable.FSharp.Core.10.1.0\lib\profiles\portable-net45+netcore45+wpa81+wp8\FSharp.Core.optdata" - file source="$(PackagesFolder)\Microsoft.Portable.FSharp.Core.10.1.0\lib\profiles\portable-net45+netcore45+wpa81+wp8\FSharp.Core.sigdata" - file source="$(PackagesFolder)\Microsoft.Portable.FSharp.Core.10.1.0\lib\profiles\portable-net45+netcore45+wpa81+wp8\FSharp.Core.xml" + file source="$(PackagesFolder)\Microsoft.Portable.FSharp.Core\10.1.0\lib\profiles\portable-net45+netcore45+wpa81+wp8\FSharp.Core.dll" + file source="$(PackagesFolder)\Microsoft.Portable.FSharp.Core\10.1.0\lib\profiles\portable-net45+netcore45+wpa81+wp8\FSharp.Core.optdata" + file source="$(PackagesFolder)\Microsoft.Portable.FSharp.Core\10.1.0\lib\profiles\portable-net45+netcore45+wpa81+wp8\FSharp.Core.sigdata" + file source="$(PackagesFolder)\Microsoft.Portable.FSharp.Core\10.1.0\lib\profiles\portable-net45+netcore45+wpa81+wp8\FSharp.Core.xml" folder ".NETFramework\v4.0" folder "4.3.0.0" - file source="$(PackagesFolder)\Microsoft.VisualFSharp.Core.Redist.1.0.0\content\.NETFramework\v4.0\4.3.0.0\FSharp.Core.dll" - file source="$(PackagesFolder)\Microsoft.VisualFSharp.Core.Redist.1.0.0\content\.NETFramework\v4.0\4.3.0.0\FSharp.Core.optdata" - file source="$(PackagesFolder)\Microsoft.VisualFSharp.Core.Redist.1.0.0\content\.NETFramework\v4.0\4.3.0.0\FSharp.Core.sigdata" - file source="$(PackagesFolder)\Microsoft.VisualFSharp.Core.Redist.1.0.0\content\.NETFramework\v4.0\4.3.0.0\FSharp.Core.xml" + file source="$(PackagesFolder)\Microsoft.VisualFSharp.Core.Redist\1.0.0\content\.NETFramework\v4.0\4.3.0.0\FSharp.Core.dll" + file source="$(PackagesFolder)\Microsoft.VisualFSharp.Core.Redist\1.0.0\content\.NETFramework\v4.0\4.3.0.0\FSharp.Core.optdata" + file source="$(PackagesFolder)\Microsoft.VisualFSharp.Core.Redist\1.0.0\content\.NETFramework\v4.0\4.3.0.0\FSharp.Core.sigdata" + file source="$(PackagesFolder)\Microsoft.VisualFSharp.Core.Redist\1.0.0\content\.NETFramework\v4.0\4.3.0.0\FSharp.Core.xml" folder "4.3.1.0" - file source="$(PackagesFolder)\Microsoft.VisualFSharp.Core.Redist.1.0.0\content\.NETFramework\v4.0\4.3.1.0\FSharp.Core.dll" - file source="$(PackagesFolder)\Microsoft.VisualFSharp.Core.Redist.1.0.0\content\.NETFramework\v4.0\4.3.1.0\FSharp.Core.optdata" - file source="$(PackagesFolder)\Microsoft.VisualFSharp.Core.Redist.1.0.0\content\.NETFramework\v4.0\4.3.1.0\FSharp.Core.sigdata" - file source="$(PackagesFolder)\Microsoft.VisualFSharp.Core.Redist.1.0.0\content\.NETFramework\v4.0\4.3.1.0\FSharp.Core.xml" + file source="$(PackagesFolder)\Microsoft.VisualFSharp.Core.Redist\1.0.0\content\.NETFramework\v4.0\4.3.1.0\FSharp.Core.dll" + file source="$(PackagesFolder)\Microsoft.VisualFSharp.Core.Redist\1.0.0\content\.NETFramework\v4.0\4.3.1.0\FSharp.Core.optdata" + file source="$(PackagesFolder)\Microsoft.VisualFSharp.Core.Redist\1.0.0\content\.NETFramework\v4.0\4.3.1.0\FSharp.Core.sigdata" + file source="$(PackagesFolder)\Microsoft.VisualFSharp.Core.Redist\1.0.0\content\.NETFramework\v4.0\4.3.1.0\FSharp.Core.xml" folder "4.4.0.0" - file source="$(PackagesFolder)\Microsoft.VisualFSharp.Core.Redist.1.0.0\content\.NETFramework\v4.0\4.4.0.0\FSharp.Core.dll" - file source="$(PackagesFolder)\Microsoft.VisualFSharp.Core.Redist.1.0.0\content\.NETFramework\v4.0\4.4.0.0\FSharp.Core.optdata" - file source="$(PackagesFolder)\Microsoft.VisualFSharp.Core.Redist.1.0.0\content\.NETFramework\v4.0\4.4.0.0\FSharp.Core.sigdata" - file source="$(PackagesFolder)\Microsoft.VisualFSharp.Core.Redist.1.0.0\content\.NETFramework\v4.0\4.4.0.0\FSharp.Core.xml" + file source="$(PackagesFolder)\Microsoft.VisualFSharp.Core.Redist\1.0.0\content\.NETFramework\v4.0\4.4.0.0\FSharp.Core.dll" + file source="$(PackagesFolder)\Microsoft.VisualFSharp.Core.Redist\1.0.0\content\.NETFramework\v4.0\4.4.0.0\FSharp.Core.optdata" + file source="$(PackagesFolder)\Microsoft.VisualFSharp.Core.Redist\1.0.0\content\.NETFramework\v4.0\4.4.0.0\FSharp.Core.sigdata" + file source="$(PackagesFolder)\Microsoft.VisualFSharp.Core.Redist\1.0.0\content\.NETFramework\v4.0\4.4.0.0\FSharp.Core.xml" folder "4.4.1.0" - file source="$(PackagesFolder)\Microsoft.Portable.FSharp.Core.10.1.0\lib\versions\4.4.1.0\FSharp.Core.dll" - file source="$(PackagesFolder)\Microsoft.Portable.FSharp.Core.10.1.0\lib\versions\4.4.1.0\FSharp.Core.optdata" - file source="$(PackagesFolder)\Microsoft.Portable.FSharp.Core.10.1.0\lib\versions\4.4.1.0\FSharp.Core.sigdata" - file source="$(PackagesFolder)\Microsoft.Portable.FSharp.Core.10.1.0\lib\versions\4.4.1.0\FSharp.Core.xml" + file source="$(PackagesFolder)\Microsoft.Portable.FSharp.Core\10.1.0\lib\versions\4.4.1.0\FSharp.Core.dll" + file source="$(PackagesFolder)\Microsoft.Portable.FSharp.Core\10.1.0\lib\versions\4.4.1.0\FSharp.Core.optdata" + file source="$(PackagesFolder)\Microsoft.Portable.FSharp.Core\10.1.0\lib\versions\4.4.1.0\FSharp.Core.sigdata" + file source="$(PackagesFolder)\Microsoft.Portable.FSharp.Core\10.1.0\lib\versions\4.4.1.0\FSharp.Core.xml" folder "4.4.3.0" - file source="$(PackagesFolder)\FSharp.Core.4.3.4\lib\net45\FSharp.Core.dll" - file source="$(PackagesFolder)\FSharp.Core.4.3.4\lib\net45\FSharp.Core.optdata" - file source="$(PackagesFolder)\FSharp.Core.4.3.4\lib\net45\FSharp.Core.sigdata" - file source="$(PackagesFolder)\FSharp.Core.4.3.4\lib\net45\FSharp.Core.xml" + file source="$(PackagesFolder)\FSharp.Core\4.3.4\lib\net45\FSharp.Core.dll" + file source="$(PackagesFolder)\FSharp.Core\4.3.4\lib\net45\FSharp.Core.optdata" + file source="$(PackagesFolder)\FSharp.Core\4.3.4\lib\net45\FSharp.Core.sigdata" + file source="$(PackagesFolder)\FSharp.Core\4.3.4\lib\net45\FSharp.Core.xml" folder ".NETPortable" folder "2.3.5.0" - file source="$(PackagesFolder)\Microsoft.VisualFSharp.Core.Redist.1.0.0\content\.NETPortable\2.3.5.0\FSharp.Core.dll" - file source="$(PackagesFolder)\Microsoft.VisualFSharp.Core.Redist.1.0.0\content\.NETPortable\2.3.5.0\FSharp.Core.optdata" - file source="$(PackagesFolder)\Microsoft.VisualFSharp.Core.Redist.1.0.0\content\.NETPortable\2.3.5.0\FSharp.Core.sigdata" - file source="$(PackagesFolder)\Microsoft.VisualFSharp.Core.Redist.1.0.0\content\.NETPortable\2.3.5.0\FSharp.Core.xml" + file source="$(PackagesFolder)\Microsoft.VisualFSharp.Core.Redist\1.0.0\content\.NETPortable\2.3.5.0\FSharp.Core.dll" + file source="$(PackagesFolder)\Microsoft.VisualFSharp.Core.Redist\1.0.0\content\.NETPortable\2.3.5.0\FSharp.Core.optdata" + file source="$(PackagesFolder)\Microsoft.VisualFSharp.Core.Redist\1.0.0\content\.NETPortable\2.3.5.0\FSharp.Core.sigdata" + file source="$(PackagesFolder)\Microsoft.VisualFSharp.Core.Redist\1.0.0\content\.NETPortable\2.3.5.0\FSharp.Core.xml" folder "2.3.5.1" - file source="$(PackagesFolder)\Microsoft.VisualFSharp.Core.Redist.1.0.0\content\.NETPortable\2.3.5.1\FSharp.Core.dll" - file source="$(PackagesFolder)\Microsoft.VisualFSharp.Core.Redist.1.0.0\content\.NETPortable\2.3.5.1\FSharp.Core.optdata" - file source="$(PackagesFolder)\Microsoft.VisualFSharp.Core.Redist.1.0.0\content\.NETPortable\2.3.5.1\FSharp.Core.sigdata" - file source="$(PackagesFolder)\Microsoft.VisualFSharp.Core.Redist.1.0.0\content\.NETPortable\2.3.5.1\FSharp.Core.xml" + file source="$(PackagesFolder)\Microsoft.VisualFSharp.Core.Redist\1.0.0\content\.NETPortable\2.3.5.1\FSharp.Core.dll" + file source="$(PackagesFolder)\Microsoft.VisualFSharp.Core.Redist\1.0.0\content\.NETPortable\2.3.5.1\FSharp.Core.optdata" + file source="$(PackagesFolder)\Microsoft.VisualFSharp.Core.Redist\1.0.0\content\.NETPortable\2.3.5.1\FSharp.Core.sigdata" + file source="$(PackagesFolder)\Microsoft.VisualFSharp.Core.Redist\1.0.0\content\.NETPortable\2.3.5.1\FSharp.Core.xml" folder "3.47.4.0" - file source="$(PackagesFolder)\Microsoft.VisualFSharp.Core.Redist.1.0.0\content\.NETPortable\3.47.4.0\FSharp.Core.dll" - file source="$(PackagesFolder)\Microsoft.VisualFSharp.Core.Redist.1.0.0\content\.NETPortable\3.47.4.0\FSharp.Core.optdata" - file source="$(PackagesFolder)\Microsoft.VisualFSharp.Core.Redist.1.0.0\content\.NETPortable\3.47.4.0\FSharp.Core.sigdata" - file source="$(PackagesFolder)\Microsoft.VisualFSharp.Core.Redist.1.0.0\content\.NETPortable\3.47.4.0\FSharp.Core.xml" + file source="$(PackagesFolder)\Microsoft.VisualFSharp.Core.Redist\1.0.0\content\.NETPortable\3.47.4.0\FSharp.Core.dll" + file source="$(PackagesFolder)\Microsoft.VisualFSharp.Core.Redist\1.0.0\content\.NETPortable\3.47.4.0\FSharp.Core.optdata" + file source="$(PackagesFolder)\Microsoft.VisualFSharp.Core.Redist\1.0.0\content\.NETPortable\3.47.4.0\FSharp.Core.sigdata" + file source="$(PackagesFolder)\Microsoft.VisualFSharp.Core.Redist\1.0.0\content\.NETPortable\3.47.4.0\FSharp.Core.xml" folder "3.47.41.0" - file source="$(PackagesFolder)\Microsoft.Portable.FSharp.Core.10.1.0\lib\profiles\portable-net45+sl5+netcore45\FSharp.Core.dll" - file source="$(PackagesFolder)\Microsoft.Portable.FSharp.Core.10.1.0\lib\profiles\portable-net45+sl5+netcore45\FSharp.Core.optdata" - file source="$(PackagesFolder)\Microsoft.Portable.FSharp.Core.10.1.0\lib\profiles\portable-net45+sl5+netcore45\FSharp.Core.sigdata" - file source="$(PackagesFolder)\Microsoft.Portable.FSharp.Core.10.1.0\lib\profiles\portable-net45+sl5+netcore45\FSharp.Core.xml" + file source="$(PackagesFolder)\Microsoft.Portable.FSharp.Core\10.1.0\lib\profiles\portable-net45+sl5+netcore45\FSharp.Core.dll" + file source="$(PackagesFolder)\Microsoft.Portable.FSharp.Core\10.1.0\lib\profiles\portable-net45+sl5+netcore45\FSharp.Core.optdata" + file source="$(PackagesFolder)\Microsoft.Portable.FSharp.Core\10.1.0\lib\profiles\portable-net45+sl5+netcore45\FSharp.Core.sigdata" + file source="$(PackagesFolder)\Microsoft.Portable.FSharp.Core\10.1.0\lib\profiles\portable-net45+sl5+netcore45\FSharp.Core.xml" diff --git a/setup/Swix/Microsoft.FSharp.SDK/Microsoft.FSharp.SDK.swixproj b/setup/Swix/Microsoft.FSharp.SDK/Microsoft.FSharp.SDK.swixproj index 9256eadc32f..aac26eaaa0d 100644 --- a/setup/Swix/Microsoft.FSharp.SDK/Microsoft.FSharp.SDK.swixproj +++ b/setup/Swix/Microsoft.FSharp.SDK/Microsoft.FSharp.SDK.swixproj @@ -1,24 +1,15 @@ - + + + + - ..\..\..\src - neutral - false - vsix Microsoft.FSharp.SDK - true - Debug - $(FSharpSourcesRoot)\..\$(Configuration) - $(FSharpSourcesRoot)\..\packages - $(BinariesFolder)\insertion - $(MSBuildThisFileDirectory)obj - - - $(PackagePreprocessorDefinitions);PackagesFolder=$(PackagesFolder) + $(PackagePreprocessorDefinitions);PackagesFolder=$(NuGetPackageRoot) $(PackagePreprocessorDefinitions);FSharpPackageVersion=$(FSharpPackageVersion) @@ -30,7 +21,6 @@ - - - + + diff --git a/setup/Swix/Microsoft.FSharp.Vsix.Resources/Files.swr b/setup/Swix/Microsoft.FSharp.Vsix.Resources/Files.swr index a8c5becc80e..f3b95d49900 100644 --- a/setup/Swix/Microsoft.FSharp.Vsix.Resources/Files.swr +++ b/setup/Swix/Microsoft.FSharp.Vsix.Resources/Files.swr @@ -5,16 +5,16 @@ package name=Microsoft.FSharp.VSIX.Full.Resources vs.package.language=$(LocaleSpecificCulture) folder "InstallDir:Common7\IDE\PublicAssemblies\$(LocaleParentCulture)" - file source="$(BinariesFolder)\net40\bin\$(LocaleParentCulture)\FSharp.Core.resources.dll" vs.file.ngen=yes + file source="$(BinariesFolder)\FSharp.Core\$(Configuration)\net45\$(LocaleParentCulture)\FSharp.Core.resources.dll" vs.file.ngen=yes folder "InstallDir:Common7\IDE\CommonExtensions\Microsoft\FSharp\$(LocaleParentCulture)" - file source="$(BinariesFolder)\net40\bin\$(LocaleParentCulture)\FSharp.Compiler.Private.resources.dll" vs.file.ngen=yes - file source="$(BinariesFolder)\net40\bin\$(LocaleParentCulture)\FSharp.Core.resources.dll" vs.file.ngen=yes - file source="$(BinariesFolder)\net40\bin\$(LocaleParentCulture)\FSharp.Editor.resources.dll" vs.file.ngen=yes - file source="$(BinariesFolder)\net40\bin\$(LocaleParentCulture)\FSharp.LanguageService.Base.resources.dll" vs.file.ngen=yes - file source="$(BinariesFolder)\net40\bin\$(LocaleParentCulture)\FSharp.LanguageService.resources.dll" vs.file.ngen=yes - file source="$(BinariesFolder)\net40\bin\$(LocaleParentCulture)\FSharp.ProjectSystem.Base.resources.dll" vs.file.ngen=yes - file source="$(BinariesFolder)\net40\bin\$(LocaleParentCulture)\FSharp.ProjectSystem.FSharp.resources.dll" vs.file.ngen=yes - file source="$(BinariesFolder)\net40\bin\$(LocaleParentCulture)\FSharp.ProjectSystem.PropertyPages.resources.dll" vs.file.ngen=yes - file source="$(BinariesFolder)\net40\bin\$(LocaleParentCulture)\FSharp.UIResources.resources.dll" vs.file.ngen=yes - file source="$(BinariesFolder)\net40\bin\$(LocaleParentCulture)\FSharp.VS.FSI.resources.dll" vs.file.ngen=yes + file source="$(BinariesFolder)\FSharp.Compiler.Private\$(Configuration)\net46\$(LocaleParentCulture)\FSharp.Compiler.Private.resources.dll" vs.file.ngen=yes + file source="$(BinariesFolder)\FSharp.Core\$(Configuration)\net45\$(LocaleParentCulture)\FSharp.Core.resources.dll" vs.file.ngen=yes + file source="$(BinariesFolder)\FSharp.Editor\$(Configuration)\net46\$(LocaleParentCulture)\FSharp.Editor.resources.dll" vs.file.ngen=yes + file source="$(BinariesFolder)\FSharp.LanguageService.Base\$(Configuration)\net46\$(LocaleParentCulture)\FSharp.LanguageService.Base.resources.dll" vs.file.ngen=yes + file source="$(BinariesFolder)\FSharp.LanguageService\$(Configuration)\net46\$(LocaleParentCulture)\FSharp.LanguageService.resources.dll" vs.file.ngen=yes + file source="$(BinariesFolder)\ProjectSystem.Base\$(Configuration)\net46\$(LocaleParentCulture)\FSharp.ProjectSystem.Base.resources.dll" vs.file.ngen=yes + file source="$(BinariesFolder)\ProjectSystem\$(Configuration)\net46\$(LocaleParentCulture)\FSharp.ProjectSystem.FSharp.resources.dll" vs.file.ngen=yes + file source="$(BinariesFolder)\FSharp.PropertiesPages\$(Configuration)\net46\$(LocaleParentCulture)\FSharp.ProjectSystem.PropertyPages.resources.dll" vs.file.ngen=yes + file source="$(BinariesFolder)\FSharp.UIResources\$(Configuration)\net46\$(LocaleParentCulture)\FSharp.UIResources.resources.dll" vs.file.ngen=yes + file source="$(BinariesFolder)\FSharp.VS.FSI\$(Configuration)\net46\$(LocaleParentCulture)\FSharp.VS.FSI.resources.dll" vs.file.ngen=yes diff --git a/setup/Swix/Microsoft.FSharp.Vsix.Resources/Microsoft.FSharp.Vsix.Resources.swixproj b/setup/Swix/Microsoft.FSharp.Vsix.Resources/Microsoft.FSharp.Vsix.Resources.swixproj index 2277444e075..d8952b40fe7 100644 --- a/setup/Swix/Microsoft.FSharp.Vsix.Resources/Microsoft.FSharp.Vsix.Resources.swixproj +++ b/setup/Swix/Microsoft.FSharp.Vsix.Resources/Microsoft.FSharp.Vsix.Resources.swixproj @@ -1,22 +1,15 @@ - + + + + - ..\..\..\src - neutral - false - true - Debug - $(FSharpSourcesRoot)\..\$(Configuration) - $(BinariesFolder)\insertion Microsoft.FSharp.VSIX.Full.Resources.$(LocaleCode) - $(MSBuildThisFileDirectory)obj - vsix - - + $(PackagePreprocessorDefinitions);Configuration=$(Configuration) $(PackagePreprocessorDefinitions);BinariesFolder=$(BinariesFolder) $(PackagePreprocessorDefinitions);FSharpPackageVersion=$(FSharpPackageVersion) $(PackagePreprocessorDefinitions);LocaleCode=$(LocaleCode) @@ -26,15 +19,16 @@ $(PackagePreprocessorDefinitions);LocaleSpecificCulture=$(LocaleSpecificCulture) $(PackagePreprocessorDefinitions);IsLangPack=$(IsLangPack) - + - + + @@ -45,7 +39,6 @@ - - - + + diff --git a/setup/Swix/Microsoft.FSharp.Vsix.Resources/Templates.swr b/setup/Swix/Microsoft.FSharp.Vsix.Resources/Templates.swr index 770d904e226..5de89f0cadd 100644 --- a/setup/Swix/Microsoft.FSharp.Vsix.Resources/Templates.swr +++ b/setup/Swix/Microsoft.FSharp.Vsix.Resources/Templates.swr @@ -6,8 +6,8 @@ package name=Microsoft.FSharp.VSIX.Full.Resources folder "InstallDir:Common7\IDE\ProjectTemplates\FSharp\$(LocaleId)" folder "ConsoleApplication" - file source="$(BinariesFolder)\net40\bin\ProjectTemplates\FSharp\$(LocaleParentId)\ConsoleApplication.zip" + file source="$(BinariesFolder)\ConsoleProject\$(Configuration)\$(LocaleParentId)\ConsoleApplication.zip" folder "Library" - file source="$(BinariesFolder)\net40\bin\ProjectTemplates\FSharp\$(LocaleParentId)\Library.zip" + file source="$(BinariesFolder)\LibraryProject\$(Configuration)\$(LocaleParentId)\Library.zip" folder "Tutorial" - file source="$(BinariesFolder)\net40\bin\ProjectTemplates\FSharp\$(LocaleParentId)\Tutorial.zip" + file source="$(BinariesFolder)\TutorialProject\$(Configuration)\$(LocaleParentId)\Tutorial.zip" diff --git a/setup/Swix/Microsoft.FSharp.vsmanproj b/setup/Swix/Microsoft.FSharp.vsmanproj index f89afddafa0..6e6f7d4e7e9 100644 --- a/setup/Swix/Microsoft.FSharp.vsmanproj +++ b/setup/Swix/Microsoft.FSharp.vsmanproj @@ -1,44 +1,43 @@ - - - - - - ..\..\src - true - true - true - $(FSharpSourcesRoot)\..\$(Configuration)\insertion - $(OutputPath) - $(FSharpPackageVersion) - - + + + + + + true + true + $(ArtifactsDir)\VSSetup\$(Configuration)\Insertion + $(OutputPath) + $(FSharpPackageVersion) + + + + + + + + + + + + + + - - - - - - - + + - - - + - - - - + + - + + + + + - - + - - - - - - \ No newline at end of file + diff --git a/setup/build-insertion.proj b/setup/build-insertion.proj index 35496258dee..b132d3edfea 100644 --- a/setup/build-insertion.proj +++ b/setup/build-insertion.proj @@ -1,47 +1,47 @@ - - - - + + + + + + . + Debug + + + + + + Swix\Microsoft.FSharp.SDK\Microsoft.FSharp.SDK.swixproj + + + Swix\Microsoft.FSharp.Compiler\Microsoft.FSharp.Compiler.swixproj + + + + + + + + + - . - net40 - Debug + AssemblySearchPaths={HintPathFromItem};{TargetFrameworkDirectory};{RawFileName} + + + + + + + + + + + + - - - - - - Swix\Microsoft.FSharp.SDK\Microsoft.FSharp.SDK.swixproj - - - Swix\Microsoft.FSharp.Compiler\Microsoft.FSharp.Compiler.swixproj - - - - - - - - - - - AssemblySearchPaths={HintPathFromItem};{TargetFrameworkDirectory};{RawFileName} - - - - - - - - - - - diff --git a/setup/fsharp-setup-build.csproj b/setup/fsharp-setup-build.csproj new file mode 100644 index 00000000000..7968f56c51b --- /dev/null +++ b/setup/fsharp-setup-build.csproj @@ -0,0 +1,70 @@ + + + + + + net46 + + + + + + + + + + + + + + + + + + + ..\vsintegration\Vsix\VisualFSharpFull\VisualFSharpFull.csproj + + + ..\vsintegration\Vsix\VisualFSharpTemplates\VisualFSharpTemplates.csproj + + + + + + + + + + Swix\Microsoft.FSharp.Dependencies\Microsoft.FSharp.Dependencies.swixproj + + + Swix\Microsoft.FSharp.IDE\Microsoft.FSharp.IDE.swixproj + + + + + + + + + + + + + + + AssemblySearchPaths={HintPathFromItem};{TargetFrameworkDirectory};{RawFileName} + + + + + + diff --git a/setup/fsharp-setup-build.proj b/setup/fsharp-setup-build.proj deleted file mode 100644 index e56e3191bd1..00000000000 --- a/setup/fsharp-setup-build.proj +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - - . - net40 - Debug - - - - - - - - ..\vsintegration\Vsix\VisualFSharpFull\VisualFSharpFull.csproj - - - ..\vsintegration\Vsix\VisualFSharpTemplates\VisualFSharpTemplates.csproj - - - - - - - - - - Swix\Microsoft.FSharp.Dependencies\Microsoft.FSharp.Dependencies.swixproj - - - Swix\Microsoft.FSharp.IDE\Microsoft.FSharp.IDE.swixproj - - - - - - - AssemblySearchPaths={HintPathFromItem};{TargetFrameworkDirectory};{RawFileName} - - - - - - - - - - - - - diff --git a/setup/packages.config b/setup/packages.config deleted file mode 100644 index f6caa5c2da4..00000000000 --- a/setup/packages.config +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/setup/publish-assets.ps1 b/setup/publish-assets.ps1 index 29604698b4c..bfa905bbad9 100644 --- a/setup/publish-assets.ps1 +++ b/setup/publish-assets.ps1 @@ -16,7 +16,8 @@ The API key used to authenticate with MyGet. Param( [string]$binariesPath = $null, [string]$branchName = $null, - [string]$apiKey = $null + [string]$apiKey = $null, + [string]$configuration = $null ) Set-StrictMode -Version 2.0 @@ -40,7 +41,7 @@ try { } $branchName = $branchName.Replace("/", "_") # can't have slashes in the branch name - $vsix = Join-Path $binariesPath "net40\bin\VisualFSharpFull.vsix" + $vsix = Join-Path $binariesPath "VisualFSharpFull\$configuration\net46\VisualFSharpFull.vsix" Write-Host " Uploading '$vsix' to '$requestUrl'." diff --git a/setup/resources/Microsoft.FSharp.NetSdk.Shim.props b/setup/shims/Microsoft.FSharp.NetSdk.Shim.props similarity index 100% rename from setup/resources/Microsoft.FSharp.NetSdk.Shim.props rename to setup/shims/Microsoft.FSharp.NetSdk.Shim.props diff --git a/setup/resources/Microsoft.FSharp.NetSdk.Shim.targets b/setup/shims/Microsoft.FSharp.NetSdk.Shim.targets similarity index 100% rename from setup/resources/Microsoft.FSharp.NetSdk.Shim.targets rename to setup/shims/Microsoft.FSharp.NetSdk.Shim.targets diff --git a/setup/resources/Microsoft.FSharp.Overrides.NetSdk.Shim.targets b/setup/shims/Microsoft.FSharp.Overrides.NetSdk.Shim.targets similarity index 100% rename from setup/resources/Microsoft.FSharp.Overrides.NetSdk.Shim.targets rename to setup/shims/Microsoft.FSharp.Overrides.NetSdk.Shim.targets diff --git a/setup/resources/Microsoft.FSharp.Shim.targets b/setup/shims/Microsoft.FSharp.Shim.targets similarity index 100% rename from setup/resources/Microsoft.FSharp.Shim.targets rename to setup/shims/Microsoft.FSharp.Shim.targets diff --git a/setup/resources/Microsoft.Portable.FSharp.Shim.targets b/setup/shims/Microsoft.Portable.FSharp.Shim.targets similarity index 100% rename from setup/resources/Microsoft.Portable.FSharp.Shim.targets rename to setup/shims/Microsoft.Portable.FSharp.Shim.targets diff --git a/src/Directory.Build.props b/src/Directory.Build.props new file mode 100644 index 00000000000..bb8eac309b1 --- /dev/null +++ b/src/Directory.Build.props @@ -0,0 +1,3 @@ + + + diff --git a/src/Directory.Build.targets b/src/Directory.Build.targets new file mode 100644 index 00000000000..ccd47cc0a9a --- /dev/null +++ b/src/Directory.Build.targets @@ -0,0 +1,3 @@ + + + diff --git a/src/FSharpSource.Profiles.targets b/src/FSharpSource.Profiles.targets deleted file mode 100644 index 9069ebdb955..00000000000 --- a/src/FSharpSource.Profiles.targets +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - $(DefineConstants);CROSS_PLATFORM_COMPILER - $(DefineConstants);ENABLE_MONO_SUPPORT - $(DefineConstants);BE_SECURITY_TRANSPARENT - $(DefineConstants);FX_LCIDFROMCODEPAGE - - - - - - - $(DefineConstants);NETSTANDARD1_6 - $(DefineConstants);FX_NO_APP_DOMAINS - $(DefineConstants);FX_NO_ARRAY_LONG_LENGTH - $(DefineConstants);FX_NO_BEGINEND_READWRITE - $(DefineConstants);FX_NO_BINARY_SERIALIZATION - $(DefineConstants);FX_NO_CONVERTER - $(DefineConstants);FX_NO_DEFAULT_DEPENDENCY_TYPE - $(DefineConstants);FX_NO_CORHOST_SIGNER - $(DefineConstants);FX_NO_EVENTWAITHANDLE_IDISPOSABLE - $(DefineConstants);FX_NO_EXIT_CONTEXT_FLAGS - $(DefineConstants);FX_NO_HEAPTERMINATION - $(DefineConstants);FX_NO_LINKEDRESOURCES - $(DefineConstants);FX_NO_LOADER_OPTIMIZATION - $(DefineConstants);FX_NO_PARAMETERIZED_THREAD_START - $(DefineConstants);FX_NO_PDB_READER - $(DefineConstants);FX_NO_PDB_WRITER - $(DefineConstants);FX_NO_REFLECTION_MODULE_HANDLES - $(DefineConstants);FX_NO_REFLECTION_ONLY - $(DefineConstants);FX_NO_RUNTIMEENVIRONMENT - $(DefineConstants);FX_NO_SECURITY_PERMISSIONS - $(DefineConstants);FX_NO_SERVERCODEPAGES - $(DefineConstants);FX_NO_SYMBOLSTORE - $(DefineConstants);FX_NO_SYSTEM_CONFIGURATION - $(DefineConstants);FX_NO_THREAD - $(DefineConstants);FX_NO_THREADABORT - $(DefineConstants);FX_NO_WAITONE_MILLISECONDS - $(DefineConstants);FX_NO_WEB_CLIENT - $(DefineConstants);FX_NO_WIN_REGISTRY - $(DefineConstants);FX_NO_WINFORMS - $(DefineConstants);FX_NO_INDENTED_TEXT_WRITER - $(DefineConstants);FX_REDUCED_EXCEPTIONS - $(DefineConstants);FX_REDUCED_CONSOLE - $(DefineConstants);FX_RESHAPED_REFEMIT - $(DefineConstants);FX_RESHAPED_GLOBALIZATION - $(DefineConstants);FX_RESHAPED_REFLECTION - $(DefineConstants);FX_RESHAPED_MSBUILD - $(OtherFlags) --simpleresolution - netstandard1.6 - - - diff --git a/src/FSharpSource.Settings.targets b/src/FSharpSource.Settings.targets deleted file mode 100644 index 3f0d657a9b5..00000000000 --- a/src/FSharpSource.Settings.targets +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - Debug - $(ConfigurationGroup) - $(TargetGroup)_$(Configuration) - $(OSGroup)_$(Configuration) - - - - Debug - Release - Debug - - - - - - - - true - net40 - - - net40 - FSharp - true - true - true - - - - obj\$(Configuration)\$(TargetDotnetProfile)\ - obj\$(Configuration)\$(TargetDotnetProfile)\$(PortableProfileBeingReferenced)\ - - - obj\$(Configuration)\$(TargetDotnetProfile)\ - obj\$(Configuration)\$(TargetDotnetProfile)\$(PortableProfileBeingReferenced)\ - - - 10.1.0 - 10.2.0 - 10.2 - - - 3.5.0 - 3.5.0.0 - $(FSharpSourcesRoot)\..\packages\NUnit.$(NUnitVersion)\lib\net45 - - true - - $(MSBuildThisFileDirectory)..\Tools\dependencyUptake\PackageVersions.props - - - true - true - 0.2.0-beta-000081 - - - - - - - - false - true - true - $(FSharpSourcesRoot)\fsharp\msft.pubkey - true - true - - - - - true - false - true - $(MSBuildThisFileDirectory)..\packages\Microsoft.VSSDK.BuildTools.$(MicrosoftVSSDKBuildToolsPackageVersion)\tools\vssdk - $(MSBuildThisFileDirectory)..\packages\Microsoft.VSSDK.BuildTools.$(MicrosoftVSSDKBuildToolsPackageVersion)\tools\vssdk\bin - $(MSBuildThisFileDirectory)..\packages\Microsoft.VSSDK.BuildTools.$(MicrosoftVSSDKBuildToolsPackageVersion)\tools\vssdk\Microsoft.VsSDK.targets - $(MSBuildThisFileDirectory)..\packages\Microsoft.VSSDK.BuildTools.$(MicrosoftVSSDKBuildToolsPackageVersion)\tools\vssdk\inc - $(MSBuildThisFileDirectory)..\packages\Microsoft.VSSDK.BuildTools.$(MicrosoftVSSDKBuildToolsPackageVersion)\tools\vssdk\schemas\VSIXManifestSchema.xsd - - - - - $(OtherFlags) --times - $(NoWarn);69;65;54;61;75 - - - - - full - portable - - false - prompt - $(OtherFlags) --no-jit-optimize - true - DEBUG;TRACE;CODE_ANALYSIS;$(DefineConstants) - DEBUG=True,TRACE=True,CODE_ANALYSIS=True,$(DefineConstants) - - - - - pdbonly - portable - - true - false - prompt - TRACE;$(DefineConstants) - TRACE=True,$(DefineConstants) - - - - - full - portable - true - DEBUG;NO_STRONG_NAMES;$(DefineConstants) - - - - - bin\$(Configuration) - 3 - - - - - $([System.DateTime]::Now.ToString(`yyMMdd`)) - 1.0.0 - $(NuGetReleaseVersion)-rc - $(NuGetPreReleaseVersion)-$(BuildRevision.Trim()) - $(MSBuildThisFileDirectory)..\packages - $(NUGET_PACKAGES) - - - - - $(FSharpSourcesRoot)\..\packages\FsLexYacc.7.0.6\build - $(FSharpSourcesRoot)\..\packages\FsLexYacc.7.0.6\build - fsi.exe - fslex.exe - fsyacc.exe - - - - $(FSharpSourcesRoot)\..\packages\FSharp.Compiler.Tools.4.1.27\tools - - - - 14.0.0.0 - - - - - - - - en;$(XlfLanguages) - - - - - - - diff --git a/src/FSharpSource.targets b/src/FSharpSource.targets deleted file mode 100644 index 1d513b81e87..00000000000 --- a/src/FSharpSource.targets +++ /dev/null @@ -1,383 +0,0 @@ - - - - - - $(MSBuildThisFileDirectory)..\ - - - - fs - - - - - - true - false - false - NO_STRONG_NAMES;$(DefineConstants) - - - - - $(FSharpSourcesRoot)\fsharp\test.snk - false - STRONG_NAME_FSHARP_COMPILER_WITH_TEST_KEY;$(DefineConstants) - - - - - $(FSCoreVersion) - $(OtherFlags) --version:"$(MicroBuildAssemblyVersion)" - - - - $(IntermediateOutputPath)source_link.json - - - - - MSBUILD_AT_LEAST_14;$(DefineConstants) - - - - - false - - - - $(FSharpSourcesRoot)\..\packages - 3.0.0-alpha3 - 3.0.0.0 - $(FSharpSourcesRoot)\..\packages\FsCheck.$(FsCheckVersion)\lib\ - - - - - - v4.6 - - - - - - netcore - - v5.0 - false - .NETStandard,Version=v1.6 - true - - - - bin\$(Configuration)\netcoreapp1.0 - true - true - win7-x64 - $(FSharpSourcesRoot)\..\tests\testbin\$(Configuration)\coreclr\$(AssemblyName) - Exe - .dll - - - - true - $(FSharpSourcesRoot)\..\tests\testbin\$(Configuration)\coreclr\FSC - true - $(FSharpSourcesRoot)\..\tests\testbin\$(Configuration)\coreclr\FSC - - - - - $(TargetDotnetProfile) - fsharp30\$(TargetDotnetProfile) - fsharp31\$(TargetDotnetProfile) - fsharp40\$(TargetDotnetProfile) - $(TargetDotnetProfile) - obj\$(Configuration)\$(TargetFrameworkOutputDirectory)\ - - - - - - $(FSharpSourcesRoot)\..\$(Configuration)\$(ProtoFlavour)\bin - - $([System.IO.File]::ReadAllText('$(MSBuildThisFileDirectory)..\DotnetCLIToolsVersion.txt').Trim()) - $(MSBuildThisFileDirectory)..\Tools\dotnet20\sdk\$(DotnetSdkVersion)\FSharp - - - ..\packages\FSharp.Compiler.Tools.4.1.27\tools\Microsoft.FSharp.Targets - - - $(FSharpSourcesRoot)\..\Tools\dotnet20 - dotnet.exe - dotnet - $(FSharpNetCoreLkgPath)\fsc.exe - - - - - - $(FSharpSourcesRoot)\..\$(Configuration)\$(ProtoFlavour)\bin - ..\packages\FSharp.Compiler.Tools.4.1.27\tools\Microsoft.FSharp.Targets - - - - - - $(FSharpSourcesRoot)\..\$(Configuration)\$(TargetFrameworkOutputDirectory)\bin - $(FSharpSourcesRoot)\..\Proto\$(ProtoFlavour)\bin - fsc.exe - ..\Proto\$(ProtoFlavour)\bin\Microsoft.Portable.FSharp.targets - - - - - - $(FSharpSourcesRoot)\..\$(Configuration)\$(TargetFrameworkOutputDirectory)\bin - $(FSharpSourcesRoot)\..\Proto\$(ProtoFlavour)\bin - fsc.exe - ..\Proto\$(ProtoFlavour)\bin\Microsoft.FSharp.Targets - - - - - - ValidateBuildTools;$(CompileDependsOn) - - - - - - - - - - - - - - - - - - - - - - - - - - $(NUGET_PACKAGES) - - $(FSharpSourcesRoot)\..\.nuget\ - -ConfigFile "$(NuGetConfigFile)" - "$(NuGetToolPath)NuGet.exe install -OutputDirectory "$(PackagesDir)" -Config "$(NuGetToolPath)..\NuGet.Config" - "$(NuGetToolPath)NuGet.exe" restore -OutputDirectory "$(PackagesDir)" -Config "$(NuGetToolPath)..\NuGet.Config" - - - true - - - - - - $(OutputPath)$(AssemblyName).xml - - - - https://github.com/Microsoft/visualfsharp/blob/master/License.txt - https://github.com/Microsoft/visualfsharp - $(NuGetPerBuildPreReleaseVersion) - Microsoft - Visual F# Compiler FSharp coreclr functional programming - - - - - $(CompileDependsOn);CopyAndSubstituteTextFiles - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - $([System.IO.Directory]::GetParent($(MSBuildThisFileDirectory.TrimEnd("\")))) - $(SrcRootDirectory.Replace("\", "\\")) - - - - - - - - - - - - - - $([System.IO.Path]::GetDirectoryName($(BuildVersionFilePath))) - - - - - - - - $([System.IO.Path]::GetDirectoryName($(BuildVersionFilePath))) - $(NuGetPerBuildPreReleaseVersion) - $([MSBuild]::Add($(PackageVersionMinor), 1)) - 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/Microbuild.Settings.targets b/src/Microbuild.Settings.targets deleted file mode 100644 index 6e11e3f2206..00000000000 --- a/src/Microbuild.Settings.targets +++ /dev/null @@ -1,13 +0,0 @@ - - - - - 0.2.0 - - - - - - - - diff --git a/src/absil/il.fs b/src/absil/il.fs index c2314418fe4..61c5a33a845 100644 --- a/src/absil/il.fs +++ b/src/absil/il.fs @@ -154,12 +154,11 @@ let unsplitTypeName (ns, n) = | [] -> String.concat "." ns + "." + n | _ -> n -let splitTypeNameRightAux nm = - if String.contains nm '.' then - let idx = String.rindex nm '.' - let s1, s2 = splitNameAt nm idx - Some s1, s2 - else None, nm +let splitTypeNameRightAux (nm:string) = + let idx = nm.LastIndexOf '.' + if idx = -1 then None, nm else + let s1, s2 = splitNameAt nm idx + Some s1, s2 let splitTypeNameRight nm = memoizeNamespaceRightTable.GetOrAdd(nm, splitTypeNameRightAux) @@ -310,8 +309,12 @@ module SHA1 = let (_h0, _h1, _h2, h3, h4) = sha1Hash { stream = s; pos = 0; eof = false } // the result of the SHA algorithm is stored in registers 3 and 4 Array.map byte [| b0 h4; b1 h4; b2 h4; b3 h4; b0 h3; b1 h3; b2 h3; b3 h3; |] + let sha1HashInt64 s = + let (_h0,_h1,_h2,h3,h4) = sha1Hash { stream = s; pos = 0; eof = false } // the result of the SHA algorithm is stored in registers 3 and 4 + (int64 h3 <<< 32) ||| int64 h4 let sha1HashBytes s = SHA1.sha1HashBytes s +let sha1HashInt64 s = SHA1.sha1HashInt64 s // -------------------------------------------------------------------- // @@ -947,11 +950,25 @@ type ILAttribElem = type ILAttributeNamedArg = (string * ILType * bool * ILAttribElem) -[] -type ILAttribute = - { Method: ILMethodSpec - Data: byte[] - Elements: ILAttribElem list } +[] +type ILAttribute = + | Encoded of method: ILMethodSpec * data: byte[] * elements: ILAttribElem list + | Decoded of method: ILMethodSpec * fixedArgs: ILAttribElem list * namedArgs: ILAttributeNamedArg list + + member x.Method = + match x with + | Encoded (method, _, _) + | Decoded (method, _, _) -> method + + member x.Elements = + match x with + | Encoded (_, _, elements) -> elements + | Decoded (_, fixedArgs, namedArgs) -> fixedArgs @ (namedArgs |> List.map (fun (_, _, _, e) -> e)) + + member x.WithMethod(method: ILMethodSpec) = + match x with + | Encoded (_, data, elements) -> Encoded (method, data, elements) + | Decoded (_, fixedArgs, namedArgs) -> Decoded (method, fixedArgs, namedArgs) /// For debugging [] @@ -2313,7 +2330,7 @@ let mkILNonGenericValueTy tref = mkILNamedTy AsValue tref [] let mkILNonGenericBoxedTy tref = mkILNamedTy AsObject tref [] -let mkSimpleAssRef n = +let mkSimpleAssemblyRef n = ILAssemblyRef.Create(n, None, None, false, None, None) let mkSimpleModRef n = @@ -3174,9 +3191,9 @@ let destTypeDefsWithGlobalFunctionsFirst ilg (tdefs: ILTypeDefs) = let top2 = if isNil top then [ mkILTypeDefForGlobalFunctions ilg (emptyILMethods, emptyILFields) ] else top top2@nontop -let mkILSimpleModule assname modname dll subsystemVersion useHighEntropyVA tdefs hashalg locale flags exportedTypes metadataVersion = +let mkILSimpleModule assemblyName modname dll subsystemVersion useHighEntropyVA tdefs hashalg locale flags exportedTypes metadataVersion = let manifest = - { Name=assname + { Name=assemblyName AuxModuleHashAlgorithm= match hashalg with | Some(alg) -> alg | _ -> 0x8004 // SHA1 SecurityDeclsStored=emptyILSecurityDeclsStored PublicKey= None @@ -3572,21 +3589,30 @@ let encodeCustomAttrNamedArg ilg (nm, ty, prop, elem) = yield! encodeCustomAttrString nm yield! encodeCustomAttrValue ilg ty elem |] -let mkILCustomAttribMethRef (ilg: ILGlobals) (mspec:ILMethodSpec, fixedArgs: list<_>, namedArgs: list<_>) = +let encodeCustomAttrArgs (ilg: ILGlobals) (mspec:ILMethodSpec) (fixedArgs: list<_>) (namedArgs: list<_>) = let argtys = mspec.MethodRef.ArgTypes - let args = - [| yield! [| 0x01uy; 0x00uy; |] - for (argty, fixedArg) in Seq.zip argtys fixedArgs do - yield! encodeCustomAttrValue ilg argty fixedArg - yield! u16AsBytes (uint16 namedArgs.Length) - for namedArg in namedArgs do - yield! encodeCustomAttrNamedArg ilg namedArg |] - { Method = mspec - Data = args - Elements = fixedArgs @ (namedArgs |> List.map(fun (_, _, _, e) -> e)) } - -let mkILCustomAttribute ilg (tref, argtys, argvs, propvs) = - mkILCustomAttribMethRef ilg (mkILNonGenericCtorMethSpec (tref, argtys), argvs, propvs) + [| yield! [| 0x01uy; 0x00uy; |] + for (argty, fixedArg) in Seq.zip argtys fixedArgs do + yield! encodeCustomAttrValue ilg argty fixedArg + yield! u16AsBytes (uint16 namedArgs.Length) + for namedArg in namedArgs do + yield! encodeCustomAttrNamedArg ilg namedArg |] + +let encodeCustomAttr (ilg: ILGlobals) (mspec:ILMethodSpec, fixedArgs: list<_>, namedArgs: list<_>) = + let args = encodeCustomAttrArgs ilg mspec fixedArgs namedArgs + ILAttribute.Encoded (mspec, args, fixedArgs @ (namedArgs |> List.map (fun (_, _, _, e) -> e))) + +let mkILCustomAttribMethRef (ilg: ILGlobals) (mspec:ILMethodSpec, fixedArgs: list<_>, namedArgs: list<_>) = + encodeCustomAttr ilg (mspec, fixedArgs, namedArgs) + +let mkILCustomAttribute ilg (tref, argtys, argvs, propvs) = + encodeCustomAttr ilg (mkILNonGenericCtorMethSpec (tref, argtys), argvs, propvs) + +let getCustomAttrData (ilg: ILGlobals) cattr = + match cattr with + | ILAttribute.Encoded (_, data, _) -> data + | ILAttribute.Decoded (mspec, fixedArgs, namedArgs) -> + encodeCustomAttrArgs ilg mspec fixedArgs namedArgs let MscorlibScopeRef = ILScopeRef.Assembly (ILAssemblyRef.Create("mscorlib", None, Some ecmaPublicKey, true, None, None)) let EcmaMscorlibILGlobals = mkILGlobals MscorlibScopeRef @@ -3755,7 +3781,10 @@ type ILTypeSigParser(tstring : string) = ILAttribElem.Type(Some(ilty)) let decodeILAttribData (ilg: ILGlobals) (ca: ILAttribute) = - let bytes = ca.Data + match ca with + | ILAttribute.Decoded (_, fixedArgs, namedArgs) -> fixedArgs, namedArgs + | ILAttribute.Encoded (_, bytes, _) -> + let sigptr = 0 let bb0, sigptr = sigptr_get_byte bytes sigptr let bb1, sigptr = sigptr_get_byte bytes sigptr @@ -3892,13 +3921,13 @@ let emptyILRefs = ModuleReferences = [] } (* Now find references. *) -let refs_of_assref (s:ILReferencesAccumulator) x = s.refsA.Add x |> ignore +let refs_of_assemblyRef (s:ILReferencesAccumulator) x = s.refsA.Add x |> ignore let refs_of_modref (s:ILReferencesAccumulator) x = s.refsM.Add x |> ignore let refs_of_scoref s x = match x with | ILScopeRef.Local -> () - | ILScopeRef.Assembly assref -> refs_of_assref s assref + | ILScopeRef.Assembly assemblyRef -> refs_of_assemblyRef s assemblyRef | ILScopeRef.Module modref -> refs_of_modref s modref let refs_of_tref s (x:ILTypeRef) = refs_of_scoref s x.Scope @@ -3944,9 +3973,9 @@ and refs_of_token s x = | ILToken.ILMethod mr -> refs_of_mspec s mr | ILToken.ILField fr -> refs_of_fspec s fr -and refs_of_custom_attr s x = refs_of_mspec s x.Method +and refs_of_custom_attr s (cattr: ILAttribute) = refs_of_mspec s cattr.Method -and refs_of_custom_attrs s (cas : ILAttributes) = List.iter (refs_of_custom_attr s) cas.AsList +and refs_of_custom_attrs s (cas : ILAttributes) = Array.iter (refs_of_custom_attr s) cas.AsArray and refs_of_varargs s tyso = Option.iter (refs_of_tys s) tyso and refs_of_instr s x = match x with @@ -4070,7 +4099,7 @@ and refs_of_resource_where s x = | ILResourceLocation.LocalIn _ -> () | ILResourceLocation.LocalOut _ -> () | ILResourceLocation.File (mref, _) -> refs_of_modref s mref - | ILResourceLocation.Assembly aref -> refs_of_assref s aref + | ILResourceLocation.Assembly aref -> refs_of_assemblyRef s aref and refs_of_resource s x = refs_of_resource_where s x.Location @@ -4189,23 +4218,6 @@ let resolveILMethodRef td mref = resolveILMethodRefWithRescope id td mref let mkRefToILModule m = ILModuleRef.Create(m.Name, true, None) - -let ungenericizeTypeName n = - let sym = '`' - if - String.contains n sym && - (* check what comes after the symbol is a number *) - (let m = String.rindex n sym - let res = ref (m < n.Length - 1) - for i = m + 1 to n.Length - 1 do - res := !res && n.[i] >= '0' && n.[i] <= '9' - !res) - then - let pos = String.rindex n sym - String.sub n 0 pos - else n - - type ILEventRef = { erA: ILTypeRef; erB: string } static member Create(a, b) = {erA=a;erB=b} diff --git a/src/absil/il.fsi b/src/absil/il.fsi index 6ed4d42aa33..668459088fd 100644 --- a/src/absil/il.fsi +++ b/src/absil/il.fsi @@ -752,12 +752,22 @@ type ILAttribElem = /// Named args: values and flags indicating if they are fields or properties. type ILAttributeNamedArg = string * ILType * bool * ILAttribElem -/// Custom attributes. See 'decodeILAttribData' for a helper to parse the byte[] -/// to ILAttribElem's as best as possible. +/// Custom attribute. type ILAttribute = - { Method: ILMethodSpec - Data: byte[] - Elements: ILAttribElem list} + /// Attribute with args encoded to a binary blob according to ECMA-335 II.21 and II.23.3. + /// 'decodeILAttribData' is used to parse the byte[] blob to ILAttribElem's as best as possible. + | Encoded of method: ILMethodSpec * data: byte[] * elements: ILAttribElem list + + /// Attribute with args in decoded form. + | Decoded of method: ILMethodSpec * fixedArgs: ILAttribElem list * namedArgs: ILAttributeNamedArg list + + /// Attribute instance constructor. + member Method: ILMethodSpec + + /// Decoded arguments. May be empty in encoded attribute form. + member Elements: ILAttribElem list + + member WithMethod: method: ILMethodSpec -> ILAttribute [] type ILAttributes = @@ -1540,9 +1550,6 @@ val typeNameForGlobalFunctions: string val isTypeNameForGlobalFunctions: string -> bool -val ungenericizeTypeName: string -> string (* e.g. List`1 --> List *) - - // ==================================================================== // PART 2 // @@ -1598,7 +1605,7 @@ val decodeILAttribData: ILAttributeNamedArg list (* named args: values and flags indicating if they are fields or properties *) /// Generate simple references to assemblies and modules. -val mkSimpleAssRef: string -> ILAssemblyRef +val mkSimpleAssemblyRef: string -> ILAssemblyRef val mkSimpleModRef: string -> ILModuleRef @@ -1682,6 +1689,8 @@ val mkILCustomAttribute: ILAttributeNamedArg list (* named args: values and flags indicating if they are fields or properties *) -> ILAttribute +val getCustomAttrData: ILGlobals -> ILAttribute -> byte[] + val mkPermissionSet: ILGlobals -> ILSecurityAction * (ILTypeRef * (string * ILType * ILAttribElem) list) list -> ILSecurityDecl /// Making code. @@ -1946,6 +1955,7 @@ val isILTypedReferenceTy: ILType -> bool val isILDoubleTy: ILType -> bool val isILSingleTy: ILType -> bool +val sha1HashInt64 : byte[] -> int64 /// Get a public key token from a public key. val sha1HashBytes: byte[] -> byte[] (* SHA1 hash *) diff --git a/src/absil/illib.fs b/src/absil/illib.fs index b2fd979a55e..44261606387 100644 --- a/src/absil/illib.fs +++ b/src/absil/illib.fs @@ -41,6 +41,10 @@ let inline isNonNull x = not (isNull x) let inline nonNull msg x = if isNull x then failwith ("null: " + msg) else x let inline (===) x y = LanguagePrimitives.PhysicalEquality x y +/// Per the docs the threshold for the Large Object Heap is 85000 bytes: https://docs.microsoft.com/en-us/dotnet/standard/garbage-collection/large-object-heap#how-an-object-ends-up-on-the-large-object-heap-and-how-gc-handles-them +/// We set the limit to slightly under that to allow for some 'slop' +let LOH_SIZE_THRESHOLD_BYTES = 84_900 + //--------------------------------------------------------------------- // Library: ReportTime //--------------------------------------------------------------------- @@ -91,7 +95,7 @@ module Order = let toFunction (pxOrder: IComparer<'U>) x y = pxOrder.Compare(x,y) //------------------------------------------------------------------------- -// Library: arrays,lists,options +// Library: arrays,lists,options,resizearrays //------------------------------------------------------------------------- module Array = @@ -432,18 +436,57 @@ module List = let existsSquared f xss = xss |> List.exists (fun xs -> xs |> List.exists (fun x -> f x)) let mapiFoldSquared f z xss = mapFoldSquared f z (xss |> mapiSquared (fun i j x -> (i,j,x))) -[] -type ValueOption<'T> = - | ValueSome of 'T - | ValueNone - member x.IsSome = match x with ValueSome _ -> true | ValueNone -> false - member x.IsNone = match x with ValueSome _ -> false | ValueNone -> true - member x.Value = match x with ValueSome r -> r | ValueNone -> failwith "ValueOption.Value: value is None" +module ResizeArray = -[] -module ValueOption = + /// Split a ResizeArray into an array of smaller chunks. + /// This requires `items/chunkSize` Array copies of length `chunkSize` if `items/chunkSize % 0 = 0`, + /// otherwise `items/chunkSize + 1` Array copies. + let chunkBySize chunkSize f (items: ResizeArray<'t>) = + // we could use Seq.chunkBySize here, but that would involve many enumerator.MoveNext() calls that we can sidestep with a bit of math + let itemCount = items.Count + if itemCount = 0 + then [||] + else + let chunksCount = + match itemCount / chunkSize with + | n when itemCount % chunkSize = 0 -> n + | n -> n + 1 // any remainder means we need an additional chunk to store it + + [| for index in 0..chunksCount-1 do + let startIndex = index * chunkSize + let takeCount = min (itemCount - startIndex) chunkSize + + let holder = Array.zeroCreate takeCount + // we take a bounds-check hit here on each access. + // other alternatives here include + // * iterating across an IEnumerator (incurs MoveNext penalty) + // * doing a block copy using `List.CopyTo(index, array, index, count)` (requires more copies to do the mapping) + // none are significantly better. + for i in 0 .. takeCount - 1 do + holder.[i] <- f items.[i] + yield holder |] + + /// Split a large ResizeArray into a series of array chunks that are each under the Large Object Heap limit. + /// This is done to help prevent a stop-the-world collection of the single large array, instead allowing for a greater + /// probability of smaller collections. Stop-the-world is still possible, just less likely. + let mapToSmallArrayChunks f (inp: ResizeArray<'t>) = + let itemSizeBytes = sizeof<'t> + // rounding down here is good because it ensures we don't go over + let maxArrayItemCount = LOH_SIZE_THRESHOLD_BYTES / itemSizeBytes + + /// chunk the provided input into arrays that are smaller than the LOH limit + /// in order to prevent long-term storage of those values + chunkBySize maxArrayItemCount f inp + + +/// Because FSharp.Compiler.Service is a library that will target FSharp.Core 4.5.2 for the forseeable future, +/// we need to stick these functions in this module rather than using the module functions for ValueOption +/// that come after FSharp.Core 4.5.2. +module ValueOptionInternal = let inline ofOption x = match x with Some x -> ValueSome x | None -> ValueNone let inline bind f x = match x with ValueSome x -> f x | ValueNone -> ValueNone + let inline isSome x = match x with ValueSome _ -> true | ValueNone -> false + let inline isNone x = match x with ValueSome _ -> false | ValueNone -> true type String with member inline x.StartsWithOrdinal(value) = @@ -452,25 +495,14 @@ type String with member inline x.EndsWithOrdinal(value) = x.EndsWith(value, StringComparison.Ordinal) -module String = - let indexNotFound() = raise (new KeyNotFoundException("An index for the character was not found in the string")) - +module String = let make (n: int) (c: char) : string = new String(c, n) let get (str:string) i = str.[i] let sub (s:string) (start:int) (len:int) = s.Substring(start,len) - let index (s:string) (c:char) = - let r = s.IndexOf(c) - if r = -1 then indexNotFound() else r - - let rindex (s:string) (c:char) = - let r = s.LastIndexOf(c) - if r = -1 then indexNotFound() else r - - let contains (s:string) (c:char) = - s.IndexOf(c,0,String.length s) <> -1 + let contains (s:string) (c:char) = s.IndexOf(c) <> -1 let order = LanguagePrimitives.FastGenericComparer @@ -1134,7 +1166,7 @@ module NameMap = [] module NameMultiMap = let existsInRange f (m: NameMultiMap<'T>) = NameMap.exists (fun _ l -> List.exists f l) m - let find v (m: NameMultiMap<'T>) = match Map.tryFind v m with None -> [] | Some r -> r + let find v (m: NameMultiMap<'T>) = match m.TryGetValue v with true, r -> r | _ -> [] let add v x (m: NameMultiMap<'T>) = NameMap.add v (x :: find v m) m let range (m: NameMultiMap<'T>) = Map.foldBack (fun _ x sofar -> x @ sofar) m [] let rangeReversingEachBucket (m: NameMultiMap<'T>) = Map.foldBack (fun _ x sofar -> List.rev x @ sofar) m [] @@ -1148,7 +1180,7 @@ module NameMultiMap = [] module MultiMap = let existsInRange f (m: MultiMap<_,_>) = Map.exists (fun _ l -> List.exists f l) m - let find v (m: MultiMap<_,_>) = match Map.tryFind v m with None -> [] | Some r -> r + let find v (m: MultiMap<_,_>) = match m.TryGetValue v with true, r -> r | _ -> [] let add v x (m: MultiMap<_,_>) = Map.add v (x :: find v m) m let range (m: MultiMap<_,_>) = Map.foldBack (fun _ x sofar -> x @ sofar) m [] let empty : MultiMap<_,_> = Map.empty @@ -1159,11 +1191,6 @@ type LayeredMap<'Key,'Value when 'Key : comparison> = Map<'Key,'Value> type Map<'Key,'Value when 'Key : comparison> with static member Empty : Map<'Key,'Value> = Map.empty - member m.TryGetValue (key,res:byref<'Value>) = - match m.TryFind key with - | None -> false - | Some r -> res <- r; true - member x.Values = [ for (KeyValue(_,v)) in x -> v ] member x.AddAndMarkAsCollapsible (kvs: _[]) = (x,kvs) ||> Array.fold (fun x (KeyValue(k,v)) -> x.Add(k,v)) member x.LinearTryModifyThenLaterFlatten (key, f: 'Value option -> 'Value) = x.Add (key, f (x.TryFind key)) @@ -1173,12 +1200,13 @@ type Map<'Key,'Value when 'Key : comparison> with [] type LayeredMultiMap<'Key,'Value when 'Key : equality and 'Key : comparison>(contents : LayeredMap<'Key,'Value list>) = member x.Add (k,v) = LayeredMultiMap(contents.Add(k,v :: x.[k])) - member x.Item with get k = match contents.TryFind k with None -> [] | Some l -> l + member x.Item with get k = match contents.TryGetValue k with true, l -> l | _ -> [] member x.AddAndMarkAsCollapsible (kvs: _[]) = let x = (x,kvs) ||> Array.fold (fun x (KeyValue(k,v)) -> x.Add(k,v)) x.MarkAsCollapsible() member x.MarkAsCollapsible() = LayeredMultiMap(contents.MarkAsCollapsible()) member x.TryFind k = contents.TryFind k + member x.TryGetValue k = contents.TryGetValue k member x.Values = contents.Values |> List.concat static member Empty : LayeredMultiMap<'Key,'Value> = LayeredMultiMap LayeredMap.Empty diff --git a/src/absil/ilmorph.fs b/src/absil/ilmorph.fs index c6d009cd4d3..d5398099e0d 100644 --- a/src/absil/ilmorph.fs +++ b/src/absil/ilmorph.fs @@ -136,7 +136,7 @@ let rec celem_ty2ty f celem = let cnamedarg_ty2ty f ((nm, ty, isProp, elem) : ILAttributeNamedArg) = (nm, f ty, isProp, celem_ty2ty f elem) -let cattr_ty2ty ilg f c = +let cattr_ty2ty ilg f (c: ILAttribute) = let meth = mspec_ty2ty (f, (fun _ -> f)) c.Method // dev11 M3 defensive coding: if anything goes wrong with attribute decoding or encoding, then back out. if morphCustomAttributeData then @@ -144,11 +144,11 @@ let cattr_ty2ty ilg f c = let elems,namedArgs = IL.decodeILAttribData ilg c let elems = elems |> List.map (celem_ty2ty f) let namedArgs = namedArgs |> List.map (cnamedarg_ty2ty f) - IL.mkILCustomAttribMethRef ilg (meth, elems, namedArgs) - with _ -> - { c with Method = meth } + mkILCustomAttribMethRef ilg (meth, elems, namedArgs) + with _ -> + c.WithMethod(meth) else - { c with Method = meth } + c.WithMethod(meth) let cattrs_ty2ty ilg f (cs: ILAttributes) = diff --git a/src/absil/ilprint.fs b/src/absil/ilprint.fs index f11524bc8d1..58c13ba1482 100644 --- a/src/absil/ilprint.fs +++ b/src/absil/ilprint.fs @@ -30,13 +30,14 @@ let tyvar_generator = // Carry an environment because the way we print method variables // depends on the gparams of the current scope. type ppenv = - { ppenvClassFormals: int; + { ilGlobals: ILGlobals + ppenvClassFormals: int; ppenvMethodFormals: int } let ppenv_enter_method mgparams env = {env with ppenvMethodFormals=mgparams} let ppenv_enter_tdef gparams env = {env with ppenvClassFormals=List.length gparams; ppenvMethodFormals=0} -let mk_ppenv = { ppenvClassFormals=0; ppenvMethodFormals=0 } +let mk_ppenv ilg = { ilGlobals = ilg; ppenvClassFormals = 0; ppenvMethodFormals = 0 } let debug_ppenv = mk_ppenv let ppenv_enter_modul env = { env with ppenvClassFormals=0; ppenvMethodFormals=0 } @@ -97,6 +98,13 @@ let output_seq sep f os (a:seq<_>) = output_string os sep; f os e.Current +let output_array sep f os (a:_ []) = + if not (Array.isEmpty a) then + for i in 0..a.Length-2 do + f os a.[i] + output_string os sep + f os (a.[a.Length - 1]) + let output_parens f os a = output_string os "("; f os a; output_string os ")" let output_angled f os a = output_string os "<"; f os a; output_string os ">" let output_bracks f os a = output_string os "["; f os a; output_string os "]" @@ -436,12 +444,12 @@ let output_option f os = function None -> () | Some x -> f os x let goutput_alternative_ref env os (alt: IlxUnionAlternative) = output_id os alt.Name; - alt.FieldDefs |> Array.toList |> output_parens (output_seq "," (fun os fdef -> goutput_typ env os fdef.Type)) os + alt.FieldDefs |> output_parens (output_array "," (fun os fdef -> goutput_typ env os fdef.Type)) os let goutput_curef env os (IlxUnionRef(_,tref,alts,_,_)) = output_string os " .classunion import "; goutput_tref env os tref; - output_parens (output_seq "," (goutput_alternative_ref env)) os (Array.toList alts) + output_parens (output_array "," (goutput_alternative_ref env)) os alts let goutput_cuspec env os (IlxUnionSpec(IlxUnionRef(_,tref,_,_,_),i)) = output_string os "class /* classunion */ "; @@ -469,13 +477,14 @@ let output_basic_type os x = let output_custom_attr_data os data = output_string os " = "; output_parens output_bytes os data -let goutput_custom_attr env os attr = +let goutput_custom_attr env os (attr: ILAttribute) = output_string os " .custom " goutput_mspec env os attr.Method - output_custom_attr_data os attr.Data + let data = getCustomAttrData env.ilGlobals attr + output_custom_attr_data os data let goutput_custom_attrs env os (attrs : ILAttributes) = - List.iter (fun attr -> goutput_custom_attr env os attr; output_string os "\n" ) attrs.AsList + Array.iter (fun attr -> goutput_custom_attr env os attr; output_string os "\n" ) attrs.AsArray let goutput_fdef _tref env os (fd: ILFieldDef) = output_string os " .field " @@ -702,7 +711,7 @@ let rec goutput_instr env os inst = goutput_dlocref env os (mkILArrTy(typ,shape)); output_string os ".ctor"; let rank = shape.Rank - output_parens (output_seq "," (goutput_typ env)) os (Array.toList (Array.create ( rank) EcmaMscorlibILGlobals.typ_Int32)) + output_parens (output_array "," (goutput_typ env)) os (Array.create ( rank) EcmaMscorlibILGlobals.typ_Int32) | I_stelem_any (shape,dt) -> if shape = ILArrayShape.SingleDimensional then output_string os "stelem.any "; goutput_typ env os dt @@ -711,7 +720,9 @@ let rec goutput_instr env os inst = goutput_dlocref env os (mkILArrTy(dt,shape)); output_string os "Set"; let rank = shape.Rank - output_parens (output_seq "," (goutput_typ env)) os (Array.toList (Array.create ( rank) EcmaMscorlibILGlobals.typ_Int32) @ [dt]) + let arr = Array.create (rank + 1) EcmaMscorlibILGlobals.typ_Int32 + arr.[rank] <- dt + output_parens (output_array "," (goutput_typ env)) os arr | I_ldelem_any (shape,tok) -> if shape = ILArrayShape.SingleDimensional then output_string os "ldelem.any "; goutput_typ env os tok @@ -722,7 +733,7 @@ let rec goutput_instr env os inst = goutput_dlocref env os (mkILArrTy(tok,shape)); output_string os "Get"; let rank = shape.Rank - output_parens (output_seq "," (goutput_typ env)) os (Array.toList (Array.create ( rank) EcmaMscorlibILGlobals.typ_Int32)) + output_parens (output_array "," (goutput_typ env)) os (Array.create ( rank) EcmaMscorlibILGlobals.typ_Int32) | I_ldelema (ro,_,shape,tok) -> if ro = ReadonlyAddress then output_string os "readonly. "; if shape = ILArrayShape.SingleDimensional then @@ -734,7 +745,7 @@ let rec goutput_instr env os inst = goutput_dlocref env os (mkILArrTy(tok,shape)); output_string os "Address"; let rank = shape.Rank - output_parens (output_seq "," (goutput_typ env)) os (Array.toList (Array.create ( rank) EcmaMscorlibILGlobals.typ_Int32)) + output_parens (output_array "," (goutput_typ env)) os (Array.create ( rank) EcmaMscorlibILGlobals.typ_Int32) | I_box tok -> output_string os "box "; goutput_typ env os tok | I_unbox tok -> output_string os "unbox "; goutput_typ env os tok @@ -888,7 +899,7 @@ let splitTypeLayout = function let goutput_fdefs tref env os (fdefs: ILFieldDefs) = List.iter (fun f -> (goutput_fdef tref env) os f; output_string os "\n" ) fdefs.AsList let goutput_mdefs env os (mdefs: ILMethodDefs) = - List.iter (fun f -> (goutput_mdef env) os f; output_string os "\n" ) mdefs.AsList + Array.iter (fun f -> (goutput_mdef env) os f; output_string os "\n" ) mdefs.AsArray let goutput_pdefs env os (pdefs: ILPropertyDefs) = List.iter (fun f -> (goutput_pdef env) os f; output_string os "\n" ) pdefs.AsList @@ -975,7 +986,7 @@ let output_publickeyinfo os = function | PublicKey k -> output_publickey os k | PublicKeyToken k -> output_publickeytoken os k -let output_assref os (aref:ILAssemblyRef) = +let output_assemblyRef os (aref:ILAssemblyRef) = output_string os " .assembly extern "; output_sqstring os aref.Name; if aref.Retargetable then output_string os " retargetable "; @@ -1029,9 +1040,9 @@ let goutput_manifest env os m = output_string os " } \n" -let output_module_fragment_aux _refs os modul = +let output_module_fragment_aux _refs os (ilg: ILGlobals) modul = try - let env = mk_ppenv + let env = mk_ppenv ilg let env = ppenv_enter_modul env goutput_tdefs false ([]) env os modul.TypeDefs; goutput_tdefs true ([]) env os modul.TypeDefs; @@ -1039,13 +1050,13 @@ let output_module_fragment_aux _refs os modul = output_string os "*** Error during printing : "; output_string os (e.ToString()); os.Flush(); reraise() -let output_module_fragment os modul = +let output_module_fragment os (ilg: ILGlobals) modul = let refs = computeILRefs modul - output_module_fragment_aux refs os modul; + output_module_fragment_aux refs os ilg modul refs let output_module_refs os refs = - List.iter (fun x -> output_assref os x; output_string os "\n") refs.AssemblyReferences; + List.iter (fun x -> output_assemblyRef os x; output_string os "\n") refs.AssemblyReferences; List.iter (fun x -> output_modref os x; output_string os "\n") refs.ModuleReferences let goutput_module_manifest env os modul = @@ -1059,14 +1070,14 @@ let goutput_module_manifest env os modul = output_string os "\n"; (output_option (goutput_manifest env)) os modul.Manifest -let output_module os modul = +let output_module os (ilg: ILGlobals) modul = try let refs = computeILRefs modul - let env = mk_ppenv + let env = mk_ppenv ilg let env = ppenv_enter_modul env output_module_refs os refs; goutput_module_manifest env os modul; - output_module_fragment_aux refs os modul; + output_module_fragment_aux refs os ilg modul; with e -> output_string os "*** Error during printing : "; output_string os (e.ToString()); os.Flush(); raise e diff --git a/src/absil/ilprint.fsi b/src/absil/ilprint.fsi index 55e768ab686..5f7ebe4f11d 100644 --- a/src/absil/ilprint.fsi +++ b/src/absil/ilprint.fsi @@ -9,6 +9,6 @@ open Microsoft.FSharp.Compiler.AbstractIL.Internal open System.IO #if DEBUG -val public output_module : TextWriter -> ILModuleDef -> unit +val public output_module: TextWriter -> ilg: ILGlobals -> ILModuleDef -> unit #endif diff --git a/src/absil/ilread.fs b/src/absil/ilread.fs index 5d94041dae1..c2c10e9479b 100644 --- a/src/absil/ilread.fs +++ b/src/absil/ilread.fs @@ -2101,7 +2101,7 @@ and sigptrGetTy (ctxt: ILMetadataReader) numtypars bytes sigptr = let dim i = (if i < numLoBounded then Some (List.item i lobounds) else None), (if i < numSized then Some (List.item i sizes) else None) - ILArrayShape (Array.toList (Array.init rank dim)) + ILArrayShape (List.init rank dim) mkILArrTy (ty, shape), sigptr elif b0 = et_VOID then ILType.Void, sigptr @@ -2567,12 +2567,13 @@ and seekReadCustomAttr ctxt (TaggedIndex(cat, idx), b) = and seekReadCustomAttrUncached ctxtH (CustomAttrIdx (cat, idx, valIdx)) = let ctxt = getHole ctxtH - { Method=seekReadCustomAttrType ctxt (TaggedIndex(cat, idx)) - Data= + let method = seekReadCustomAttrType ctxt (TaggedIndex(cat, idx)) + let data = match readBlobHeapOption ctxt valIdx with | Some bytes -> bytes - | None -> Bytes.ofInt32Array [| |] - Elements = [] } + | None -> Bytes.ofInt32Array [| |] + let elements = [] + ILAttribute.Encoded (method, data, elements) and securityDeclsReader ctxtH tag = mkILSecurityDeclsReader diff --git a/src/absil/ilreflect.fs b/src/absil/ilreflect.fs index 96ca8efe04c..5e15cbbd37b 100644 --- a/src/absil/ilreflect.fs +++ b/src/absil/ilreflect.fs @@ -289,6 +289,7 @@ module Zmap = let equalTypes (s:Type) (t:Type) = s.Equals(t) let equalTypeLists ss tt = List.lengthsEqAndForall2 equalTypes ss tt +let equalTypeArrays ss tt = Array.lengthsEqAndForall2 equalTypes ss tt let getGenericArgumentsOfType (typT : Type) = if typT.IsGenericType then typT.GetGenericArguments() else [| |] @@ -1414,16 +1415,16 @@ let emitMethodBody cenv modB emEnv ilG _name (mbody: ILLazyMethodBody) = | MethodBody.Native -> failwith "emitMethodBody: native" | MethodBody.NotAvailable -> failwith "emitMethodBody: metadata only" -let convCustomAttr cenv emEnv cattr = +let convCustomAttr cenv emEnv (cattr: ILAttribute) = let methInfo = match convConstructorSpec cenv emEnv cattr.Method with | null -> failwithf "convCustomAttr: %+A" cattr.Method | res -> res - let data = cattr.Data + let data = getCustomAttrData cenv.ilg cattr (methInfo, data) let emitCustomAttr cenv emEnv add cattr = add (convCustomAttr cenv emEnv cattr) -let emitCustomAttrs cenv emEnv add (cattrs : ILAttributes) = List.iter (emitCustomAttr cenv emEnv add) cattrs.AsList +let emitCustomAttrs cenv emEnv add (cattrs : ILAttributes) = Array.iter (emitCustomAttr cenv emEnv add) cattrs.AsArray //---------------------------------------------------------------------------- // buildGenParams @@ -1597,9 +1598,7 @@ let rec buildMethodPass3 cenv tref modB (typB:TypeBuilder) emEnv (mdef : ILMetho (getGenericArgumentsOfType (typB.AsType())) (getGenericArgumentsOfMethod methB)) - match mdef.Return.CustomAttrs.AsList with - | [] -> () - | _ -> + if not (Array.isEmpty mdef.Return.CustomAttrs.AsArray) then let retB = methB.DefineParameterAndLog(0, System.Reflection.ParameterAttributes.Retval, null) emitCustomAttrs cenv emEnv (wrapCustomAttr retB.SetCustomAttribute) mdef.Return.CustomAttrs @@ -1825,7 +1824,7 @@ let rec buildTypeDefPass2 cenv nesting emEnv (tdef : ILTypeDef) = // add interface impls tdef.Implements |> convTypes cenv emEnv |> List.iter (fun implT -> typB.AddInterfaceImplementationAndLog(implT)); // add methods, properties - let emEnv = List.fold (buildMethodPass2 cenv tref typB) emEnv tdef.Methods.AsList + let emEnv = Array.fold (buildMethodPass2 cenv tref typB) emEnv tdef.Methods.AsArray let emEnv = List.fold (buildFieldPass2 cenv tref typB) emEnv tdef.Fields.AsList let emEnv = List.fold (buildPropertyPass2 cenv tref typB) emEnv tdef.Properties.AsList let emEnv = envPopTyvars emEnv @@ -1942,7 +1941,7 @@ let createTypeRef (visited : Dictionary<_, _>, created : Dictionary<_, _>) emEnv traverseType CollectTypes.All cx if verbose2 then dprintf "buildTypeDefPass4: Doing method constraints of %s\n" tdef.Name - for md in tdef.Methods.AsList do + for md in tdef.Methods.AsArray do for gp in md.GenericParams do for cx in gp.Constraints do traverseType CollectTypes.All cx diff --git a/src/absil/ilwrite.fs b/src/absil/ilwrite.fs index d28348bf860..12541d5089e 100644 --- a/src/absil/ilwrite.fs +++ b/src/absil/ilwrite.fs @@ -1382,8 +1382,9 @@ and GetMethodRefAsCustomAttribType cenv (mref:ILMethodRef) = let rec GetCustomAttrDataAsBlobIdx cenv (data:byte[]) = if data.Length = 0 then 0 else GetBytesAsBlobIdx cenv data -and GetCustomAttrRow cenv hca attr = +and GetCustomAttrRow cenv hca (attr: ILAttribute) = let cat = GetMethodRefAsCustomAttribType cenv attr.Method.MethodRef + let data = getCustomAttrData cenv.ilg attr for element in attr.Elements do match element with | ILAttribElem.Type (Some ty) when ty.IsNominal -> GetTypeRefAsTypeRefIdx cenv ty.TypeRef |> ignore @@ -1393,14 +1394,14 @@ and GetCustomAttrRow cenv hca attr = UnsharedRow [| HasCustomAttribute (fst hca, snd hca); CustomAttributeType (fst cat, snd cat); - Blob (GetCustomAttrDataAsBlobIdx cenv attr.Data) + Blob (GetCustomAttrDataAsBlobIdx cenv data) |] and GenCustomAttrPass3Or4 cenv hca attr = AddUnsharedRow cenv TableNames.CustomAttribute (GetCustomAttrRow cenv hca attr) |> ignore and GenCustomAttrsPass3Or4 cenv hca (attrs: ILAttributes) = - attrs.AsList |> List.iter (GenCustomAttrPass3Or4 cenv hca) + attrs.AsArray |> Array.iter (GenCustomAttrPass3Or4 cenv hca) // -------------------------------------------------------------------- // ILSecurityDecl --> DeclSecurity rows @@ -2462,7 +2463,7 @@ let GenReturnAsParamRow (returnv : ILReturn) = StringE 0 |] let GenReturnPass3 cenv (returnv: ILReturn) = - if Option.isSome returnv.Marshal || not (isNil returnv.CustomAttrs.AsList) then + if Option.isSome returnv.Marshal || not (Array.isEmpty returnv.CustomAttrs.AsArray) then let pidx = AddUnsharedRow cenv TableNames.Param (GenReturnAsParamRow returnv) GenCustomAttrsPass3Or4 cenv (hca_ParamDef, pidx) returnv.CustomAttrs match returnv.Marshal with diff --git a/src/buildfromsource/BuildFromSource.targets b/src/buildfromsource/BuildFromSource.targets index bfcd3d48e82..223415a1a9b 100644 --- a/src/buildfromsource/BuildFromSource.targets +++ b/src/buildfromsource/BuildFromSource.targets @@ -34,7 +34,6 @@ net40 - diff --git a/src/buildfromsource/Directory.Build.targets b/src/buildfromsource/Directory.Build.targets new file mode 100644 index 00000000000..ea0ce741b15 --- /dev/null +++ b/src/buildfromsource/Directory.Build.targets @@ -0,0 +1,5 @@ + + + + + diff --git a/src/buildfromsource/FSharp.Compiler.Private/FSComp.fs b/src/buildfromsource/FSharp.Compiler.Private/FSComp.fs index f6fc5a409ea..c6ff96cb901 100644 --- a/src/buildfromsource/FSharp.Compiler.Private/FSComp.fs +++ b/src/buildfromsource/FSharp.Compiler.Private/FSComp.fs @@ -1429,2934 +1429,2976 @@ type internal SR private() = /// Unmatched '{' /// (Originally from ..\FSComp.txt:442) static member parsUnmatchedBrace() = (604, GetStringFunc("parsUnmatchedBrace",",,,") ) - /// Field bindings must have the form 'id = expr;' + /// Unmatched '{|' /// (Originally from ..\FSComp.txt:443) + static member parsUnmatchedBraceBar() = (605, GetStringFunc("parsUnmatchedBraceBar",",,,") ) + /// Field bindings must have the form 'id = expr;' + /// (Originally from ..\FSComp.txt:444) static member parsFieldBinding() = (609, GetStringFunc("parsFieldBinding",",,,") ) /// This member is not permitted in an object implementation - /// (Originally from ..\FSComp.txt:444) + /// (Originally from ..\FSComp.txt:445) static member parsMemberIllegalInObjectImplementation() = (610, GetStringFunc("parsMemberIllegalInObjectImplementation",",,,") ) /// Missing function body - /// (Originally from ..\FSComp.txt:445) + /// (Originally from ..\FSComp.txt:446) static member parsMissingFunctionBody() = (611, GetStringFunc("parsMissingFunctionBody",",,,") ) /// Syntax error in labelled type argument - /// (Originally from ..\FSComp.txt:446) + /// (Originally from ..\FSComp.txt:447) static member parsSyntaxErrorInLabeledType() = (613, GetStringFunc("parsSyntaxErrorInLabeledType",",,,") ) /// Unexpected infix operator in type expression - /// (Originally from ..\FSComp.txt:447) + /// (Originally from ..\FSComp.txt:448) static member parsUnexpectedInfixOperator() = (615, GetStringFunc("parsUnexpectedInfixOperator",",,,") ) /// The syntax '(typ,...,typ) ident' is not used in F# code. Consider using 'ident' instead - /// (Originally from ..\FSComp.txt:448) + /// (Originally from ..\FSComp.txt:449) static member parsMultiArgumentGenericTypeFormDeprecated() = (GetStringFunc("parsMultiArgumentGenericTypeFormDeprecated",",,,") ) /// Invalid literal in type - /// (Originally from ..\FSComp.txt:449) + /// (Originally from ..\FSComp.txt:450) static member parsInvalidLiteralInType() = (618, GetStringFunc("parsInvalidLiteralInType",",,,") ) /// Unexpected infix operator in unit-of-measure expression. Legal operators are '*', '/' and '^'. - /// (Originally from ..\FSComp.txt:450) + /// (Originally from ..\FSComp.txt:451) static member parsUnexpectedOperatorForUnitOfMeasure() = (619, GetStringFunc("parsUnexpectedOperatorForUnitOfMeasure",",,,") ) /// Unexpected integer literal in unit-of-measure expression - /// (Originally from ..\FSComp.txt:451) + /// (Originally from ..\FSComp.txt:452) static member parsUnexpectedIntegerLiteralForUnitOfMeasure() = (620, GetStringFunc("parsUnexpectedIntegerLiteralForUnitOfMeasure",",,,") ) /// Syntax error: unexpected type parameter specification - /// (Originally from ..\FSComp.txt:452) + /// (Originally from ..\FSComp.txt:453) static member parsUnexpectedTypeParameter() = (621, GetStringFunc("parsUnexpectedTypeParameter",",,,") ) /// Mismatched quotation operator name, beginning with '%s' - /// (Originally from ..\FSComp.txt:453) + /// (Originally from ..\FSComp.txt:454) static member parsMismatchedQuotationName(a0 : System.String) = (622, GetStringFunc("parsMismatchedQuotationName",",,,%s,,,") a0) /// Active pattern case identifiers must begin with an uppercase letter - /// (Originally from ..\FSComp.txt:454) + /// (Originally from ..\FSComp.txt:455) static member parsActivePatternCaseMustBeginWithUpperCase() = (623, GetStringFunc("parsActivePatternCaseMustBeginWithUpperCase",",,,") ) /// The '|' character is not permitted in active pattern case identifiers - /// (Originally from ..\FSComp.txt:455) + /// (Originally from ..\FSComp.txt:456) static member parsActivePatternCaseContainsPipe() = (624, GetStringFunc("parsActivePatternCaseContainsPipe",",,,") ) /// Denominator must not be 0 in unit-of-measure exponent - /// (Originally from ..\FSComp.txt:456) + /// (Originally from ..\FSComp.txt:457) static member parsIllegalDenominatorForMeasureExponent() = (625, GetStringFunc("parsIllegalDenominatorForMeasureExponent",",,,") ) /// No '=' symbol should follow a 'namespace' declaration - /// (Originally from ..\FSComp.txt:457) + /// (Originally from ..\FSComp.txt:458) static member parsNoEqualShouldFollowNamespace() = (GetStringFunc("parsNoEqualShouldFollowNamespace",",,,") ) /// The syntax 'module ... = struct .. end' is not used in F# code. Consider using 'module ... = begin .. end' - /// (Originally from ..\FSComp.txt:458) + /// (Originally from ..\FSComp.txt:459) static member parsSyntaxModuleStructEndDeprecated() = (GetStringFunc("parsSyntaxModuleStructEndDeprecated",",,,") ) /// The syntax 'module ... : sig .. end' is not used in F# code. Consider using 'module ... = begin .. end' - /// (Originally from ..\FSComp.txt:459) + /// (Originally from ..\FSComp.txt:460) static member parsSyntaxModuleSigEndDeprecated() = (GetStringFunc("parsSyntaxModuleSigEndDeprecated",",,,") ) /// A static field was used where an instance field is expected - /// (Originally from ..\FSComp.txt:460) + /// (Originally from ..\FSComp.txt:461) static member tcStaticFieldUsedWhenInstanceFieldExpected() = (627, GetStringFunc("tcStaticFieldUsedWhenInstanceFieldExpected",",,,") ) /// Method '%s' is not accessible from this code location - /// (Originally from ..\FSComp.txt:461) + /// (Originally from ..\FSComp.txt:462) static member tcMethodNotAccessible(a0 : System.String) = (629, GetStringFunc("tcMethodNotAccessible",",,,%s,,,") a0) /// Implicit product of measures following / - /// (Originally from ..\FSComp.txt:463) + /// (Originally from ..\FSComp.txt:464) static member tcImplicitMeasureFollowingSlash() = (632, GetStringFunc("tcImplicitMeasureFollowingSlash",",,,") ) /// Unexpected SynMeasure.Anon - /// (Originally from ..\FSComp.txt:464) + /// (Originally from ..\FSComp.txt:465) static member tcUnexpectedMeasureAnon() = (633, GetStringFunc("tcUnexpectedMeasureAnon",",,,") ) /// Non-zero constants cannot have generic units. For generic zero, write 0.0<_>. - /// (Originally from ..\FSComp.txt:465) + /// (Originally from ..\FSComp.txt:466) static member tcNonZeroConstantCannotHaveGenericUnit() = (634, GetStringFunc("tcNonZeroConstantCannotHaveGenericUnit",",,,") ) /// In sequence expressions, results are generated using 'yield' - /// (Originally from ..\FSComp.txt:466) + /// (Originally from ..\FSComp.txt:467) static member tcSeqResultsUseYield() = (635, GetStringFunc("tcSeqResultsUseYield",",,,") ) /// Unexpected big rational constant - /// (Originally from ..\FSComp.txt:467) + /// (Originally from ..\FSComp.txt:468) static member tcUnexpectedBigRationalConstant() = (GetStringFunc("tcUnexpectedBigRationalConstant",",,,") ) /// Units-of-measure supported only on float, float32, decimal and signed integer types - /// (Originally from ..\FSComp.txt:468) + /// (Originally from ..\FSComp.txt:469) static member tcInvalidTypeForUnitsOfMeasure() = (636, GetStringFunc("tcInvalidTypeForUnitsOfMeasure",",,,") ) /// Unexpected Const_uint16array - /// (Originally from ..\FSComp.txt:469) + /// (Originally from ..\FSComp.txt:470) static member tcUnexpectedConstUint16Array() = (GetStringFunc("tcUnexpectedConstUint16Array",",,,") ) /// Unexpected Const_bytearray - /// (Originally from ..\FSComp.txt:470) + /// (Originally from ..\FSComp.txt:471) static member tcUnexpectedConstByteArray() = (GetStringFunc("tcUnexpectedConstByteArray",",,,") ) /// A parameter with attributes must also be given a name, e.g. '[] Name : Type' - /// (Originally from ..\FSComp.txt:471) + /// (Originally from ..\FSComp.txt:472) static member tcParameterRequiresName() = (640, GetStringFunc("tcParameterRequiresName",",,,") ) /// Return values cannot have names - /// (Originally from ..\FSComp.txt:472) + /// (Originally from ..\FSComp.txt:473) static member tcReturnValuesCannotHaveNames() = (641, GetStringFunc("tcReturnValuesCannotHaveNames",",,,") ) /// MemberKind.PropertyGetSet only expected in parse trees - /// (Originally from ..\FSComp.txt:473) + /// (Originally from ..\FSComp.txt:474) static member tcMemberKindPropertyGetSetNotExpected() = (GetStringFunc("tcMemberKindPropertyGetSetNotExpected",",,,") ) /// Namespaces cannot contain values. Consider using a module to hold your value declarations. - /// (Originally from ..\FSComp.txt:474) + /// (Originally from ..\FSComp.txt:475) static member tcNamespaceCannotContainValues() = (201, GetStringFunc("tcNamespaceCannotContainValues",",,,") ) /// Namespaces cannot contain extension members except in the same file and namespace declaration group where the type is defined. Consider using a module to hold declarations of extension members. - /// (Originally from ..\FSComp.txt:475) + /// (Originally from ..\FSComp.txt:476) static member tcNamespaceCannotContainExtensionMembers() = (644, GetStringFunc("tcNamespaceCannotContainExtensionMembers",",,,") ) /// Multiple visibility attributes have been specified for this identifier - /// (Originally from ..\FSComp.txt:476) + /// (Originally from ..\FSComp.txt:477) static member tcMultipleVisibilityAttributes() = (645, GetStringFunc("tcMultipleVisibilityAttributes",",,,") ) /// Multiple visibility attributes have been specified for this identifier. 'let' bindings in classes are always private, as are any 'let' bindings inside expressions. - /// (Originally from ..\FSComp.txt:477) + /// (Originally from ..\FSComp.txt:478) static member tcMultipleVisibilityAttributesWithLet() = (646, GetStringFunc("tcMultipleVisibilityAttributesWithLet",",,,") ) /// The name '(%s)' should not be used as a member name. To define comparison semantics for a type, implement the 'System.IComparable' interface. If defining a static member for use from other CLI languages then use the name '%s' instead. - /// (Originally from ..\FSComp.txt:478) + /// (Originally from ..\FSComp.txt:479) static member tcInvalidMethodNameForRelationalOperator(a0 : System.String, a1 : System.String) = (GetStringFunc("tcInvalidMethodNameForRelationalOperator",",,,%s,,,%s,,,") a0 a1) /// The name '(%s)' should not be used as a member name. To define equality semantics for a type, override the 'Object.Equals' member. If defining a static member for use from other CLI languages then use the name '%s' instead. - /// (Originally from ..\FSComp.txt:479) + /// (Originally from ..\FSComp.txt:480) static member tcInvalidMethodNameForEquality(a0 : System.String, a1 : System.String) = (GetStringFunc("tcInvalidMethodNameForEquality",",,,%s,,,%s,,,") a0 a1) /// The name '(%s)' should not be used as a member name. If defining a static member for use from other CLI languages then use the name '%s' instead. - /// (Originally from ..\FSComp.txt:480) + /// (Originally from ..\FSComp.txt:481) static member tcInvalidMemberName(a0 : System.String, a1 : System.String) = (GetStringFunc("tcInvalidMemberName",",,,%s,,,%s,,,") a0 a1) /// The name '(%s)' should not be used as a member name because it is given a standard definition in the F# library over fixed types - /// (Originally from ..\FSComp.txt:481) + /// (Originally from ..\FSComp.txt:482) static member tcInvalidMemberNameFixedTypes(a0 : System.String) = (GetStringFunc("tcInvalidMemberNameFixedTypes",",,,%s,,,") a0) /// The '%s' operator should not normally be redefined. To define overloaded comparison semantics for a particular type, implement the 'System.IComparable' interface in the definition of that type. - /// (Originally from ..\FSComp.txt:482) + /// (Originally from ..\FSComp.txt:483) static member tcInvalidOperatorDefinitionRelational(a0 : System.String) = (GetStringFunc("tcInvalidOperatorDefinitionRelational",",,,%s,,,") a0) /// The '%s' operator should not normally be redefined. To define equality semantics for a type, override the 'Object.Equals' member in the definition of that type. - /// (Originally from ..\FSComp.txt:483) + /// (Originally from ..\FSComp.txt:484) static member tcInvalidOperatorDefinitionEquality(a0 : System.String) = (GetStringFunc("tcInvalidOperatorDefinitionEquality",",,,%s,,,") a0) /// The '%s' operator should not normally be redefined. Consider using a different operator name - /// (Originally from ..\FSComp.txt:484) + /// (Originally from ..\FSComp.txt:485) static member tcInvalidOperatorDefinition(a0 : System.String) = (GetStringFunc("tcInvalidOperatorDefinition",",,,%s,,,") a0) /// The '%s' operator cannot be redefined. Consider using a different operator name - /// (Originally from ..\FSComp.txt:485) + /// (Originally from ..\FSComp.txt:486) static member tcInvalidIndexOperatorDefinition(a0 : System.String) = (GetStringFunc("tcInvalidIndexOperatorDefinition",",,,%s,,,") a0) /// Expected module or namespace parent %s - /// (Originally from ..\FSComp.txt:486) + /// (Originally from ..\FSComp.txt:487) static member tcExpectModuleOrNamespaceParent(a0 : System.String) = (GetStringFunc("tcExpectModuleOrNamespaceParent",",,,%s,,,") a0) /// The struct, record or union type '%s' implements the interface 'System.IComparable' explicitly. You must apply the 'CustomComparison' attribute to the type. - /// (Originally from ..\FSComp.txt:487) + /// (Originally from ..\FSComp.txt:488) static member tcImplementsIComparableExplicitly(a0 : System.String) = (647, GetStringFunc("tcImplementsIComparableExplicitly",",,,%s,,,") a0) /// The struct, record or union type '%s' implements the interface 'System.IComparable<_>' explicitly. You must apply the 'CustomComparison' attribute to the type, and should also provide a consistent implementation of the non-generic interface System.IComparable. - /// (Originally from ..\FSComp.txt:488) + /// (Originally from ..\FSComp.txt:489) static member tcImplementsGenericIComparableExplicitly(a0 : System.String) = (648, GetStringFunc("tcImplementsGenericIComparableExplicitly",",,,%s,,,") a0) /// The struct, record or union type '%s' implements the interface 'System.IStructuralComparable' explicitly. Apply the 'CustomComparison' attribute to the type. - /// (Originally from ..\FSComp.txt:489) + /// (Originally from ..\FSComp.txt:490) static member tcImplementsIStructuralComparableExplicitly(a0 : System.String) = (649, GetStringFunc("tcImplementsIStructuralComparableExplicitly",",,,%s,,,") a0) /// This record contains fields from inconsistent types - /// (Originally from ..\FSComp.txt:490) + /// (Originally from ..\FSComp.txt:491) static member tcRecordFieldInconsistentTypes() = (656, GetStringFunc("tcRecordFieldInconsistentTypes",",,,") ) /// DLLImport stubs cannot be inlined - /// (Originally from ..\FSComp.txt:491) + /// (Originally from ..\FSComp.txt:492) static member tcDllImportStubsCannotBeInlined() = (657, GetStringFunc("tcDllImportStubsCannotBeInlined",",,,") ) /// Structs may only bind a 'this' parameter at member declarations - /// (Originally from ..\FSComp.txt:492) + /// (Originally from ..\FSComp.txt:493) static member tcStructsCanOnlyBindThisAtMemberDeclaration() = (658, GetStringFunc("tcStructsCanOnlyBindThisAtMemberDeclaration",",,,") ) /// Unexpected expression at recursive inference point - /// (Originally from ..\FSComp.txt:493) + /// (Originally from ..\FSComp.txt:494) static member tcUnexpectedExprAtRecInfPoint() = (659, GetStringFunc("tcUnexpectedExprAtRecInfPoint",",,,") ) /// This code is less generic than required by its annotations because the explicit type variable '%s' could not be generalized. It was constrained to be '%s'. - /// (Originally from ..\FSComp.txt:494) + /// (Originally from ..\FSComp.txt:495) static member tcLessGenericBecauseOfAnnotation(a0 : System.String, a1 : System.String) = (660, GetStringFunc("tcLessGenericBecauseOfAnnotation",",,,%s,,,%s,,,") a0 a1) /// One or more of the explicit class or function type variables for this binding could not be generalized, because they were constrained to other types - /// (Originally from ..\FSComp.txt:495) + /// (Originally from ..\FSComp.txt:496) static member tcConstrainedTypeVariableCannotBeGeneralized() = (661, GetStringFunc("tcConstrainedTypeVariableCannotBeGeneralized",",,,") ) /// A generic type parameter has been used in a way that constrains it to always be '%s' - /// (Originally from ..\FSComp.txt:496) + /// (Originally from ..\FSComp.txt:497) static member tcGenericParameterHasBeenConstrained(a0 : System.String) = (662, GetStringFunc("tcGenericParameterHasBeenConstrained",",,,%s,,,") a0) /// This type parameter has been used in a way that constrains it to always be '%s' - /// (Originally from ..\FSComp.txt:497) + /// (Originally from ..\FSComp.txt:498) static member tcTypeParameterHasBeenConstrained(a0 : System.String) = (663, GetStringFunc("tcTypeParameterHasBeenConstrained",",,,%s,,,") a0) /// The type parameters inferred for this value are not stable under the erasure of type abbreviations. This is due to the use of type abbreviations which drop or reorder type parameters, e.g. \n\ttype taggedInt<'a> = int or\n\ttype swap<'a,'b> = 'b * 'a.\nConsider declaring the type parameters for this value explicitly, e.g.\n\tlet f<'a,'b> ((x,y) : swap<'b,'a>) : swap<'a,'b> = (y,x). - /// (Originally from ..\FSComp.txt:498) + /// (Originally from ..\FSComp.txt:499) static member tcTypeParametersInferredAreNotStable() = (664, GetStringFunc("tcTypeParametersInferredAreNotStable",",,,") ) /// Explicit type parameters may only be used on module or member bindings - /// (Originally from ..\FSComp.txt:499) + /// (Originally from ..\FSComp.txt:500) static member tcExplicitTypeParameterInvalid() = (665, GetStringFunc("tcExplicitTypeParameterInvalid",",,,") ) /// You must explicitly declare either all or no type parameters when overriding a generic abstract method - /// (Originally from ..\FSComp.txt:500) + /// (Originally from ..\FSComp.txt:501) static member tcOverridingMethodRequiresAllOrNoTypeParameters() = (666, GetStringFunc("tcOverridingMethodRequiresAllOrNoTypeParameters",",,,") ) /// The field labels and expected type of this record expression or pattern do not uniquely determine a corresponding record type - /// (Originally from ..\FSComp.txt:501) + /// (Originally from ..\FSComp.txt:502) static member tcFieldsDoNotDetermineUniqueRecordType() = (667, GetStringFunc("tcFieldsDoNotDetermineUniqueRecordType",",,,") ) /// The field '%s' appears twice in this record expression or pattern - /// (Originally from ..\FSComp.txt:502) + /// (Originally from ..\FSComp.txt:503) static member tcFieldAppearsTwiceInRecord(a0 : System.String) = (668, GetStringFunc("tcFieldAppearsTwiceInRecord",",,,%s,,,") a0) /// Unknown union case - /// (Originally from ..\FSComp.txt:503) + /// (Originally from ..\FSComp.txt:504) static member tcUnknownUnion() = (669, GetStringFunc("tcUnknownUnion",",,,") ) /// This code is not sufficiently generic. The type variable %s could not be generalized because it would escape its scope. - /// (Originally from ..\FSComp.txt:504) + /// (Originally from ..\FSComp.txt:505) static member tcNotSufficientlyGenericBecauseOfScope(a0 : System.String) = (670, GetStringFunc("tcNotSufficientlyGenericBecauseOfScope",",,,%s,,,") a0) /// A property cannot have explicit type parameters. Consider using a method instead. - /// (Originally from ..\FSComp.txt:505) + /// (Originally from ..\FSComp.txt:506) static member tcPropertyRequiresExplicitTypeParameters() = (671, GetStringFunc("tcPropertyRequiresExplicitTypeParameters",",,,") ) /// A constructor cannot have explicit type parameters. Consider using a static construction method instead. - /// (Originally from ..\FSComp.txt:506) + /// (Originally from ..\FSComp.txt:507) static member tcConstructorCannotHaveTypeParameters() = (672, GetStringFunc("tcConstructorCannotHaveTypeParameters",",,,") ) /// This instance member needs a parameter to represent the object being invoked. Make the member static or use the notation 'member x.Member(args) = ...'. - /// (Originally from ..\FSComp.txt:507) + /// (Originally from ..\FSComp.txt:508) static member tcInstanceMemberRequiresTarget() = (673, GetStringFunc("tcInstanceMemberRequiresTarget",",,,") ) /// Unexpected source-level property specification in syntax tree - /// (Originally from ..\FSComp.txt:508) + /// (Originally from ..\FSComp.txt:509) static member tcUnexpectedPropertyInSyntaxTree() = (674, GetStringFunc("tcUnexpectedPropertyInSyntaxTree",",,,") ) /// A static initializer requires an argument - /// (Originally from ..\FSComp.txt:509) + /// (Originally from ..\FSComp.txt:510) static member tcStaticInitializerRequiresArgument() = (675, GetStringFunc("tcStaticInitializerRequiresArgument",",,,") ) /// An object constructor requires an argument - /// (Originally from ..\FSComp.txt:510) + /// (Originally from ..\FSComp.txt:511) static member tcObjectConstructorRequiresArgument() = (676, GetStringFunc("tcObjectConstructorRequiresArgument",",,,") ) /// This static member should not have a 'this' parameter. Consider using the notation 'member Member(args) = ...'. - /// (Originally from ..\FSComp.txt:511) + /// (Originally from ..\FSComp.txt:512) static member tcStaticMemberShouldNotHaveThis() = (677, GetStringFunc("tcStaticMemberShouldNotHaveThis",",,,") ) /// An explicit static initializer should use the syntax 'static new(args) = expr' - /// (Originally from ..\FSComp.txt:512) + /// (Originally from ..\FSComp.txt:513) static member tcExplicitStaticInitializerSyntax() = (678, GetStringFunc("tcExplicitStaticInitializerSyntax",",,,") ) /// An explicit object constructor should use the syntax 'new(args) = expr' - /// (Originally from ..\FSComp.txt:513) + /// (Originally from ..\FSComp.txt:514) static member tcExplicitObjectConstructorSyntax() = (679, GetStringFunc("tcExplicitObjectConstructorSyntax",",,,") ) /// Unexpected source-level property specification - /// (Originally from ..\FSComp.txt:514) + /// (Originally from ..\FSComp.txt:515) static member tcUnexpectedPropertySpec() = (680, GetStringFunc("tcUnexpectedPropertySpec",",,,") ) /// This form of object expression is not used in F#. Use 'member this.MemberName ... = ...' to define member implementations in object expressions. - /// (Originally from ..\FSComp.txt:515) + /// (Originally from ..\FSComp.txt:516) static member tcObjectExpressionFormDeprecated() = (GetStringFunc("tcObjectExpressionFormDeprecated",",,,") ) /// Invalid declaration - /// (Originally from ..\FSComp.txt:516) + /// (Originally from ..\FSComp.txt:517) static member tcInvalidDeclaration() = (682, GetStringFunc("tcInvalidDeclaration",",,,") ) /// Attributes are not allowed within patterns - /// (Originally from ..\FSComp.txt:517) + /// (Originally from ..\FSComp.txt:518) static member tcAttributesInvalidInPatterns() = (683, GetStringFunc("tcAttributesInvalidInPatterns",",,,") ) /// The generic function '%s' must be given explicit type argument(s) - /// (Originally from ..\FSComp.txt:518) + /// (Originally from ..\FSComp.txt:519) static member tcFunctionRequiresExplicitTypeArguments(a0 : System.String) = (685, GetStringFunc("tcFunctionRequiresExplicitTypeArguments",",,,%s,,,") a0) /// The method or function '%s' should not be given explicit type argument(s) because it does not declare its type parameters explicitly - /// (Originally from ..\FSComp.txt:519) + /// (Originally from ..\FSComp.txt:520) static member tcDoesNotAllowExplicitTypeArguments(a0 : System.String) = (686, GetStringFunc("tcDoesNotAllowExplicitTypeArguments",",,,%s,,,") a0) /// This value, type or method expects %d type parameter(s) but was given %d - /// (Originally from ..\FSComp.txt:520) + /// (Originally from ..\FSComp.txt:521) static member tcTypeParameterArityMismatch(a0 : System.Int32, a1 : System.Int32) = (687, GetStringFunc("tcTypeParameterArityMismatch",",,,%d,,,%d,,,") a0 a1) /// The default, zero-initializing constructor of a struct type may only be used if all the fields of the struct type admit default initialization - /// (Originally from ..\FSComp.txt:521) + /// (Originally from ..\FSComp.txt:522) static member tcDefaultStructConstructorCall() = (688, GetStringFunc("tcDefaultStructConstructorCall",",,,") ) /// Couldn't find Dispose on IDisposable, or it was overloaded - /// (Originally from ..\FSComp.txt:522) + /// (Originally from ..\FSComp.txt:523) static member tcCouldNotFindIDisposable() = (GetStringFunc("tcCouldNotFindIDisposable",",,,") ) /// This value is not a literal and cannot be used in a pattern - /// (Originally from ..\FSComp.txt:523) + /// (Originally from ..\FSComp.txt:524) static member tcNonLiteralCannotBeUsedInPattern() = (689, GetStringFunc("tcNonLiteralCannotBeUsedInPattern",",,,") ) /// This field is readonly - /// (Originally from ..\FSComp.txt:524) + /// (Originally from ..\FSComp.txt:525) static member tcFieldIsReadonly() = (690, GetStringFunc("tcFieldIsReadonly",",,,") ) /// Named arguments must appear after all other arguments - /// (Originally from ..\FSComp.txt:525) + /// (Originally from ..\FSComp.txt:526) static member tcNameArgumentsMustAppearLast() = (691, GetStringFunc("tcNameArgumentsMustAppearLast",",,,") ) /// This function value is being used to construct a delegate type whose signature includes a byref argument. You must use an explicit lambda expression taking %d arguments. - /// (Originally from ..\FSComp.txt:526) + /// (Originally from ..\FSComp.txt:527) static member tcFunctionRequiresExplicitLambda(a0 : System.Int32) = (692, GetStringFunc("tcFunctionRequiresExplicitLambda",",,,%d,,,") a0) /// The type '%s' is not a type whose values can be enumerated with this syntax, i.e. is not compatible with either seq<_>, IEnumerable<_> or IEnumerable and does not have a GetEnumerator method - /// (Originally from ..\FSComp.txt:527) + /// (Originally from ..\FSComp.txt:528) static member tcTypeCannotBeEnumerated(a0 : System.String) = (693, GetStringFunc("tcTypeCannotBeEnumerated",",,,%s,,,") a0) /// This recursive binding uses an invalid mixture of recursive forms - /// (Originally from ..\FSComp.txt:528) + /// (Originally from ..\FSComp.txt:529) static member tcInvalidMixtureOfRecursiveForms() = (695, GetStringFunc("tcInvalidMixtureOfRecursiveForms",",,,") ) /// This is not a valid object construction expression. Explicit object constructors must either call an alternate constructor or initialize all fields of the object and specify a call to a super class constructor. - /// (Originally from ..\FSComp.txt:529) + /// (Originally from ..\FSComp.txt:530) static member tcInvalidObjectConstructionExpression() = (696, GetStringFunc("tcInvalidObjectConstructionExpression",",,,") ) /// Invalid constraint - /// (Originally from ..\FSComp.txt:530) + /// (Originally from ..\FSComp.txt:531) static member tcInvalidConstraint() = (697, GetStringFunc("tcInvalidConstraint",",,,") ) /// Invalid constraint: the type used for the constraint is sealed, which means the constraint could only be satisfied by at most one solution - /// (Originally from ..\FSComp.txt:531) + /// (Originally from ..\FSComp.txt:532) static member tcInvalidConstraintTypeSealed() = (698, GetStringFunc("tcInvalidConstraintTypeSealed",",,,") ) /// An 'enum' constraint must be of the form 'enum' - /// (Originally from ..\FSComp.txt:532) + /// (Originally from ..\FSComp.txt:533) static member tcInvalidEnumConstraint() = (699, GetStringFunc("tcInvalidEnumConstraint",",,,") ) /// 'new' constraints must take one argument of type 'unit' and return the constructed type - /// (Originally from ..\FSComp.txt:533) + /// (Originally from ..\FSComp.txt:534) static member tcInvalidNewConstraint() = (700, GetStringFunc("tcInvalidNewConstraint",",,,") ) /// This property has an invalid type. Properties taking multiple indexer arguments should have types of the form 'ty1 * ty2 -> ty3'. Properties returning functions should have types of the form '(ty1 -> ty2)'. - /// (Originally from ..\FSComp.txt:534) + /// (Originally from ..\FSComp.txt:535) static member tcInvalidPropertyType() = (701, GetStringFunc("tcInvalidPropertyType",",,,") ) /// Expected unit-of-measure parameter, not type parameter. Explicit unit-of-measure parameters must be marked with the [] attribute. - /// (Originally from ..\FSComp.txt:535) + /// (Originally from ..\FSComp.txt:536) static member tcExpectedUnitOfMeasureMarkWithAttribute() = (702, GetStringFunc("tcExpectedUnitOfMeasureMarkWithAttribute",",,,") ) /// Expected type parameter, not unit-of-measure parameter - /// (Originally from ..\FSComp.txt:536) + /// (Originally from ..\FSComp.txt:537) static member tcExpectedTypeParameter() = (703, GetStringFunc("tcExpectedTypeParameter",",,,") ) /// Expected type, not unit-of-measure - /// (Originally from ..\FSComp.txt:537) + /// (Originally from ..\FSComp.txt:538) static member tcExpectedTypeNotUnitOfMeasure() = (704, GetStringFunc("tcExpectedTypeNotUnitOfMeasure",",,,") ) /// Expected unit-of-measure, not type - /// (Originally from ..\FSComp.txt:538) + /// (Originally from ..\FSComp.txt:539) static member tcExpectedUnitOfMeasureNotType() = (705, GetStringFunc("tcExpectedUnitOfMeasureNotType",",,,") ) /// Units-of-measure cannot be used as prefix arguments to a type. Rewrite as postfix arguments in angle brackets. - /// (Originally from ..\FSComp.txt:539) + /// (Originally from ..\FSComp.txt:540) static member tcInvalidUnitsOfMeasurePrefix() = (706, GetStringFunc("tcInvalidUnitsOfMeasurePrefix",",,,") ) /// Unit-of-measure cannot be used in type constructor application - /// (Originally from ..\FSComp.txt:540) + /// (Originally from ..\FSComp.txt:541) static member tcUnitsOfMeasureInvalidInTypeConstructor() = (707, GetStringFunc("tcUnitsOfMeasureInvalidInTypeConstructor",",,,") ) /// This control construct may only be used if the computation expression builder defines a '%s' method - /// (Originally from ..\FSComp.txt:541) + /// (Originally from ..\FSComp.txt:542) static member tcRequireBuilderMethod(a0 : System.String) = (708, GetStringFunc("tcRequireBuilderMethod",",,,%s,,,") a0) /// This type has no nested types - /// (Originally from ..\FSComp.txt:542) + /// (Originally from ..\FSComp.txt:543) static member tcTypeHasNoNestedTypes() = (709, GetStringFunc("tcTypeHasNoNestedTypes",",,,") ) /// Unexpected %s in type expression - /// (Originally from ..\FSComp.txt:543) + /// (Originally from ..\FSComp.txt:544) static member tcUnexpectedSymbolInTypeExpression(a0 : System.String) = (711, GetStringFunc("tcUnexpectedSymbolInTypeExpression",",,,%s,,,") a0) /// Type parameter cannot be used as type constructor - /// (Originally from ..\FSComp.txt:544) + /// (Originally from ..\FSComp.txt:545) static member tcTypeParameterInvalidAsTypeConstructor() = (712, GetStringFunc("tcTypeParameterInvalidAsTypeConstructor",",,,") ) /// Illegal syntax in type expression - /// (Originally from ..\FSComp.txt:545) + /// (Originally from ..\FSComp.txt:546) static member tcIllegalSyntaxInTypeExpression() = (713, GetStringFunc("tcIllegalSyntaxInTypeExpression",",,,") ) /// Anonymous unit-of-measure cannot be nested inside another unit-of-measure expression - /// (Originally from ..\FSComp.txt:546) + /// (Originally from ..\FSComp.txt:547) static member tcAnonymousUnitsOfMeasureCannotBeNested() = (714, GetStringFunc("tcAnonymousUnitsOfMeasureCannotBeNested",",,,") ) /// Anonymous type variables are not permitted in this declaration - /// (Originally from ..\FSComp.txt:547) + /// (Originally from ..\FSComp.txt:548) static member tcAnonymousTypeInvalidInDeclaration() = (715, GetStringFunc("tcAnonymousTypeInvalidInDeclaration",",,,") ) /// Unexpected / in type - /// (Originally from ..\FSComp.txt:548) + /// (Originally from ..\FSComp.txt:549) static member tcUnexpectedSlashInType() = (716, GetStringFunc("tcUnexpectedSlashInType",",,,") ) /// Unexpected type arguments - /// (Originally from ..\FSComp.txt:549) + /// (Originally from ..\FSComp.txt:550) static member tcUnexpectedTypeArguments() = (717, GetStringFunc("tcUnexpectedTypeArguments",",,,") ) /// Optional arguments are only permitted on type members - /// (Originally from ..\FSComp.txt:550) + /// (Originally from ..\FSComp.txt:551) static member tcOptionalArgsOnlyOnMembers() = (718, GetStringFunc("tcOptionalArgsOnlyOnMembers",",,,") ) /// Name '%s' not bound in pattern context - /// (Originally from ..\FSComp.txt:551) + /// (Originally from ..\FSComp.txt:552) static member tcNameNotBoundInPattern(a0 : System.String) = (719, GetStringFunc("tcNameNotBoundInPattern",",,,%s,,,") a0) /// Non-primitive numeric literal constants cannot be used in pattern matches because they can be mapped to multiple different types through the use of a NumericLiteral module. Consider using replacing with a variable, and use 'when = ' at the end of the match clause. - /// (Originally from ..\FSComp.txt:552) + /// (Originally from ..\FSComp.txt:553) static member tcInvalidNonPrimitiveLiteralInPatternMatch() = (720, GetStringFunc("tcInvalidNonPrimitiveLiteralInPatternMatch",",,,") ) /// Type arguments cannot be specified here - /// (Originally from ..\FSComp.txt:553) + /// (Originally from ..\FSComp.txt:554) static member tcInvalidTypeArgumentUsage() = (721, GetStringFunc("tcInvalidTypeArgumentUsage",",,,") ) /// Only active patterns returning exactly one result may accept arguments - /// (Originally from ..\FSComp.txt:554) + /// (Originally from ..\FSComp.txt:555) static member tcRequireActivePatternWithOneResult() = (722, GetStringFunc("tcRequireActivePatternWithOneResult",",,,") ) /// Invalid argument to parameterized pattern label - /// (Originally from ..\FSComp.txt:555) + /// (Originally from ..\FSComp.txt:556) static member tcInvalidArgForParameterizedPattern() = (723, GetStringFunc("tcInvalidArgForParameterizedPattern",",,,") ) /// Internal error. Invalid index into active pattern array - /// (Originally from ..\FSComp.txt:556) + /// (Originally from ..\FSComp.txt:557) static member tcInvalidIndexIntoActivePatternArray() = (724, GetStringFunc("tcInvalidIndexIntoActivePatternArray",",,,") ) /// This union case does not take arguments - /// (Originally from ..\FSComp.txt:557) + /// (Originally from ..\FSComp.txt:558) static member tcUnionCaseDoesNotTakeArguments() = (725, GetStringFunc("tcUnionCaseDoesNotTakeArguments",",,,") ) /// This union case takes one argument - /// (Originally from ..\FSComp.txt:558) + /// (Originally from ..\FSComp.txt:559) static member tcUnionCaseRequiresOneArgument() = (726, GetStringFunc("tcUnionCaseRequiresOneArgument",",,,") ) /// This union case expects %d arguments in tupled form - /// (Originally from ..\FSComp.txt:559) + /// (Originally from ..\FSComp.txt:560) static member tcUnionCaseExpectsTupledArguments(a0 : System.Int32) = (727, GetStringFunc("tcUnionCaseExpectsTupledArguments",",,,%d,,,") a0) /// Field '%s' is not static - /// (Originally from ..\FSComp.txt:560) + /// (Originally from ..\FSComp.txt:561) static member tcFieldIsNotStatic(a0 : System.String) = (728, GetStringFunc("tcFieldIsNotStatic",",,,%s,,,") a0) /// This field is not a literal and cannot be used in a pattern - /// (Originally from ..\FSComp.txt:561) + /// (Originally from ..\FSComp.txt:562) static member tcFieldNotLiteralCannotBeUsedInPattern() = (729, GetStringFunc("tcFieldNotLiteralCannotBeUsedInPattern",",,,") ) /// This is not a variable, constant, active recognizer or literal - /// (Originally from ..\FSComp.txt:562) + /// (Originally from ..\FSComp.txt:563) static member tcRequireVarConstRecogOrLiteral() = (730, GetStringFunc("tcRequireVarConstRecogOrLiteral",",,,") ) /// This is not a valid pattern - /// (Originally from ..\FSComp.txt:563) + /// (Originally from ..\FSComp.txt:564) static member tcInvalidPattern() = (731, GetStringFunc("tcInvalidPattern",",,,") ) /// Character range matches have been removed in F#. Consider using a 'when' pattern guard instead. - /// (Originally from ..\FSComp.txt:564) + /// (Originally from ..\FSComp.txt:565) static member tcUseWhenPatternGuard() = (GetStringFunc("tcUseWhenPatternGuard",",,,") ) /// Illegal pattern - /// (Originally from ..\FSComp.txt:565) + /// (Originally from ..\FSComp.txt:566) static member tcIllegalPattern() = (733, GetStringFunc("tcIllegalPattern",",,,") ) /// Syntax error - unexpected '?' symbol - /// (Originally from ..\FSComp.txt:566) + /// (Originally from ..\FSComp.txt:567) static member tcSyntaxErrorUnexpectedQMark() = (734, GetStringFunc("tcSyntaxErrorUnexpectedQMark",",,,") ) /// Expected %d expressions, got %d - /// (Originally from ..\FSComp.txt:567) + /// (Originally from ..\FSComp.txt:568) static member tcExpressionCountMisMatch(a0 : System.Int32, a1 : System.Int32) = (735, GetStringFunc("tcExpressionCountMisMatch",",,,%d,,,%d,,,") a0 a1) /// TcExprUndelayed: delayed - /// (Originally from ..\FSComp.txt:568) + /// (Originally from ..\FSComp.txt:569) static member tcExprUndelayed() = (736, GetStringFunc("tcExprUndelayed",",,,") ) /// This expression form may only be used in sequence and computation expressions - /// (Originally from ..\FSComp.txt:569) + /// (Originally from ..\FSComp.txt:570) static member tcExpressionRequiresSequence() = (737, GetStringFunc("tcExpressionRequiresSequence",",,,") ) /// Invalid object expression. Objects without overrides or interfaces should use the expression form 'new Type(args)' without braces. - /// (Originally from ..\FSComp.txt:570) + /// (Originally from ..\FSComp.txt:571) static member tcInvalidObjectExpressionSyntaxForm() = (738, GetStringFunc("tcInvalidObjectExpressionSyntaxForm",",,,") ) /// Invalid object, sequence or record expression - /// (Originally from ..\FSComp.txt:571) + /// (Originally from ..\FSComp.txt:572) static member tcInvalidObjectSequenceOrRecordExpression() = (739, GetStringFunc("tcInvalidObjectSequenceOrRecordExpression",",,,") ) /// Invalid record, sequence or computation expression. Sequence expressions should be of the form 'seq { ... }' - /// (Originally from ..\FSComp.txt:572) + /// (Originally from ..\FSComp.txt:573) static member tcInvalidSequenceExpressionSyntaxForm() = (740, GetStringFunc("tcInvalidSequenceExpressionSyntaxForm",",,,") ) /// This list or array expression includes an element of the form 'if ... then ... else'. Parenthesize this expression to indicate it is an individual element of the list or array, to disambiguate this from a list generated using a sequence expression - /// (Originally from ..\FSComp.txt:573) + /// (Originally from ..\FSComp.txt:574) static member tcExpressionWithIfRequiresParenthesis() = (GetStringFunc("tcExpressionWithIfRequiresParenthesis",",,,") ) /// Unable to parse format string '%s' - /// (Originally from ..\FSComp.txt:574) + /// (Originally from ..\FSComp.txt:575) static member tcUnableToParseFormatString(a0 : System.String) = (741, GetStringFunc("tcUnableToParseFormatString",",,,%s,,,") a0) /// This list expression exceeds the maximum size for list literals. Use an array for larger literals and call Array.ToList. - /// (Originally from ..\FSComp.txt:575) + /// (Originally from ..\FSComp.txt:576) static member tcListLiteralMaxSize() = (742, GetStringFunc("tcListLiteralMaxSize",",,,") ) /// The expression form 'expr then expr' may only be used as part of an explicit object constructor - /// (Originally from ..\FSComp.txt:576) + /// (Originally from ..\FSComp.txt:577) static member tcExpressionFormRequiresObjectConstructor() = (743, GetStringFunc("tcExpressionFormRequiresObjectConstructor",",,,") ) /// Named arguments cannot be given to member trait calls - /// (Originally from ..\FSComp.txt:577) + /// (Originally from ..\FSComp.txt:578) static member tcNamedArgumentsCannotBeUsedInMemberTraits() = (744, GetStringFunc("tcNamedArgumentsCannotBeUsedInMemberTraits",",,,") ) /// This is not a valid name for an enumeration case - /// (Originally from ..\FSComp.txt:578) + /// (Originally from ..\FSComp.txt:579) static member tcNotValidEnumCaseName() = (745, GetStringFunc("tcNotValidEnumCaseName",",,,") ) /// This field is not mutable - /// (Originally from ..\FSComp.txt:579) + /// (Originally from ..\FSComp.txt:580) static member tcFieldIsNotMutable() = (746, GetStringFunc("tcFieldIsNotMutable",",,,") ) /// This construct may only be used within list, array and sequence expressions, e.g. expressions of the form 'seq { ... }', '[ ... ]' or '[| ... |]'. These use the syntax 'for ... in ... do ... yield...' to generate elements - /// (Originally from ..\FSComp.txt:580) + /// (Originally from ..\FSComp.txt:581) static member tcConstructRequiresListArrayOrSequence() = (747, GetStringFunc("tcConstructRequiresListArrayOrSequence",",,,") ) /// This construct may only be used within computation expressions. To return a value from an ordinary function simply write the expression without 'return'. - /// (Originally from ..\FSComp.txt:581) + /// (Originally from ..\FSComp.txt:582) static member tcConstructRequiresComputationExpressions() = (748, GetStringFunc("tcConstructRequiresComputationExpressions",",,,") ) /// This construct may only be used within sequence or computation expressions - /// (Originally from ..\FSComp.txt:582) + /// (Originally from ..\FSComp.txt:583) static member tcConstructRequiresSequenceOrComputations() = (749, GetStringFunc("tcConstructRequiresSequenceOrComputations",",,,") ) /// This construct may only be used within computation expressions - /// (Originally from ..\FSComp.txt:583) + /// (Originally from ..\FSComp.txt:584) static member tcConstructRequiresComputationExpression() = (750, GetStringFunc("tcConstructRequiresComputationExpression",",,,") ) /// Invalid indexer expression - /// (Originally from ..\FSComp.txt:584) + /// (Originally from ..\FSComp.txt:585) static member tcInvalidIndexerExpression() = (751, GetStringFunc("tcInvalidIndexerExpression",",,,") ) /// The operator 'expr.[idx]' has been used on an object of indeterminate type based on information prior to this program point. Consider adding further type constraints - /// (Originally from ..\FSComp.txt:585) + /// (Originally from ..\FSComp.txt:586) static member tcObjectOfIndeterminateTypeUsedRequireTypeConstraint() = (752, GetStringFunc("tcObjectOfIndeterminateTypeUsedRequireTypeConstraint",",,,") ) /// Cannot inherit from a variable type - /// (Originally from ..\FSComp.txt:586) + /// (Originally from ..\FSComp.txt:587) static member tcCannotInheritFromVariableType() = (753, GetStringFunc("tcCannotInheritFromVariableType",",,,") ) /// Calls to object constructors on type parameters cannot be given arguments - /// (Originally from ..\FSComp.txt:587) + /// (Originally from ..\FSComp.txt:588) static member tcObjectConstructorsOnTypeParametersCannotTakeArguments() = (754, GetStringFunc("tcObjectConstructorsOnTypeParametersCannotTakeArguments",",,,") ) /// The 'CompiledName' attribute cannot be used with this language element - /// (Originally from ..\FSComp.txt:588) + /// (Originally from ..\FSComp.txt:589) static member tcCompiledNameAttributeMisused() = (755, GetStringFunc("tcCompiledNameAttributeMisused",",,,") ) /// '%s' may only be used with named types - /// (Originally from ..\FSComp.txt:589) + /// (Originally from ..\FSComp.txt:590) static member tcNamedTypeRequired(a0 : System.String) = (756, GetStringFunc("tcNamedTypeRequired",",,,%s,,,") a0) /// 'inherit' cannot be used on interface types. Consider implementing the interface by using 'interface ... with ... end' instead. - /// (Originally from ..\FSComp.txt:590) + /// (Originally from ..\FSComp.txt:591) static member tcInheritCannotBeUsedOnInterfaceType() = (757, GetStringFunc("tcInheritCannotBeUsedOnInterfaceType",",,,") ) /// 'new' cannot be used on interface types. Consider using an object expression '{ new ... with ... }' instead. - /// (Originally from ..\FSComp.txt:591) + /// (Originally from ..\FSComp.txt:592) static member tcNewCannotBeUsedOnInterfaceType() = (758, GetStringFunc("tcNewCannotBeUsedOnInterfaceType",",,,") ) /// Instances of this type cannot be created since it has been marked abstract or not all methods have been given implementations. Consider using an object expression '{ new ... with ... }' instead. - /// (Originally from ..\FSComp.txt:592) + /// (Originally from ..\FSComp.txt:593) static member tcAbstractTypeCannotBeInstantiated() = (759, GetStringFunc("tcAbstractTypeCannotBeInstantiated",",,,") ) /// It is recommended that objects supporting the IDisposable interface are created using the syntax 'new Type(args)', rather than 'Type(args)' or 'Type' as a function value representing the constructor, to indicate that resources may be owned by the generated value - /// (Originally from ..\FSComp.txt:593) + /// (Originally from ..\FSComp.txt:594) static member tcIDisposableTypeShouldUseNew() = (760, GetStringFunc("tcIDisposableTypeShouldUseNew",",,,") ) /// '%s' may only be used to construct object types - /// (Originally from ..\FSComp.txt:594) + /// (Originally from ..\FSComp.txt:595) static member tcSyntaxCanOnlyBeUsedToCreateObjectTypes(a0 : System.String) = (761, GetStringFunc("tcSyntaxCanOnlyBeUsedToCreateObjectTypes",",,,%s,,,") a0) /// Constructors for the type '%s' must directly or indirectly call its implicit object constructor. Use a call to the implicit object constructor instead of a record expression. - /// (Originally from ..\FSComp.txt:595) + /// (Originally from ..\FSComp.txt:596) static member tcConstructorRequiresCall(a0 : System.String) = (762, GetStringFunc("tcConstructorRequiresCall",",,,%s,,,") a0) /// The field '%s' has been given a value, but is not present in the type '%s' - /// (Originally from ..\FSComp.txt:596) + /// (Originally from ..\FSComp.txt:597) static member tcUndefinedField(a0 : System.String, a1 : System.String) = (763, GetStringFunc("tcUndefinedField",",,,%s,,,%s,,,") a0 a1) /// No assignment given for field '%s' of type '%s' - /// (Originally from ..\FSComp.txt:597) + /// (Originally from ..\FSComp.txt:598) static member tcFieldRequiresAssignment(a0 : System.String, a1 : System.String) = (764, GetStringFunc("tcFieldRequiresAssignment",",,,%s,,,%s,,,") a0 a1) /// Extraneous fields have been given values - /// (Originally from ..\FSComp.txt:598) + /// (Originally from ..\FSComp.txt:599) static member tcExtraneousFieldsGivenValues() = (765, GetStringFunc("tcExtraneousFieldsGivenValues",",,,") ) /// Only overrides of abstract and virtual members may be specified in object expressions - /// (Originally from ..\FSComp.txt:599) + /// (Originally from ..\FSComp.txt:600) static member tcObjectExpressionsCanOnlyOverrideAbstractOrVirtual() = (766, GetStringFunc("tcObjectExpressionsCanOnlyOverrideAbstractOrVirtual",",,,") ) /// The member '%s' does not correspond to any abstract or virtual method available to override or implement. - /// (Originally from ..\FSComp.txt:600) + /// (Originally from ..\FSComp.txt:601) static member tcNoAbstractOrVirtualMemberFound(a0 : System.String) = (767, GetStringFunc("tcNoAbstractOrVirtualMemberFound",",,,%s,,,") a0) /// The type %s contains the member '%s' but it is not a virtual or abstract method that is available to override or implement. - /// (Originally from ..\FSComp.txt:601) + /// (Originally from ..\FSComp.txt:602) static member tcMemberFoundIsNotAbstractOrVirtual(a0 : System.String, a1 : System.String) = (767, GetStringFunc("tcMemberFoundIsNotAbstractOrVirtual",",,,%s,,,%s,,,") a0 a1) /// The member '%s' does not accept the correct number of arguments. %d argument(s) are expected, but %d were given. The required signature is '%s'.%s - /// (Originally from ..\FSComp.txt:602) + /// (Originally from ..\FSComp.txt:603) static member tcArgumentArityMismatch(a0 : System.String, a1 : System.Int32, a2 : System.Int32, a3 : System.String, a4 : System.String) = (768, GetStringFunc("tcArgumentArityMismatch",",,,%s,,,%d,,,%d,,,%s,,,%s,,,") a0 a1 a2 a3 a4) /// The member '%s' does not accept the correct number of arguments. One overload accepts %d arguments, but %d were given. The required signature is '%s'.%s - /// (Originally from ..\FSComp.txt:603) + /// (Originally from ..\FSComp.txt:604) static member tcArgumentArityMismatchOneOverload(a0 : System.String, a1 : System.Int32, a2 : System.Int32, a3 : System.String, a4 : System.String) = (769, GetStringFunc("tcArgumentArityMismatchOneOverload",",,,%s,,,%d,,,%d,,,%s,,,%s,,,") a0 a1 a2 a3 a4) /// A simple method name is required here - /// (Originally from ..\FSComp.txt:604) + /// (Originally from ..\FSComp.txt:605) static member tcSimpleMethodNameRequired() = (770, GetStringFunc("tcSimpleMethodNameRequired",",,,") ) /// The types System.ValueType, System.Enum, System.Delegate, System.MulticastDelegate and System.Array cannot be used as super types in an object expression or class - /// (Originally from ..\FSComp.txt:605) + /// (Originally from ..\FSComp.txt:606) static member tcPredefinedTypeCannotBeUsedAsSuperType() = (771, GetStringFunc("tcPredefinedTypeCannotBeUsedAsSuperType",",,,") ) /// 'new' must be used with a named type - /// (Originally from ..\FSComp.txt:606) + /// (Originally from ..\FSComp.txt:607) static member tcNewMustBeUsedWithNamedType() = (772, GetStringFunc("tcNewMustBeUsedWithNamedType",",,,") ) /// Cannot create an extension of a sealed type - /// (Originally from ..\FSComp.txt:607) + /// (Originally from ..\FSComp.txt:608) static member tcCannotCreateExtensionOfSealedType() = (773, GetStringFunc("tcCannotCreateExtensionOfSealedType",",,,") ) /// No arguments may be given when constructing a record value - /// (Originally from ..\FSComp.txt:608) + /// (Originally from ..\FSComp.txt:609) static member tcNoArgumentsForRecordValue() = (774, GetStringFunc("tcNoArgumentsForRecordValue",",,,") ) /// Interface implementations cannot be given on construction expressions - /// (Originally from ..\FSComp.txt:609) + /// (Originally from ..\FSComp.txt:610) static member tcNoInterfaceImplementationForConstructionExpression() = (775, GetStringFunc("tcNoInterfaceImplementationForConstructionExpression",",,,") ) /// Object construction expressions may only be used to implement constructors in class types - /// (Originally from ..\FSComp.txt:610) + /// (Originally from ..\FSComp.txt:611) static member tcObjectConstructionCanOnlyBeUsedInClassTypes() = (776, GetStringFunc("tcObjectConstructionCanOnlyBeUsedInClassTypes",",,,") ) /// Only simple bindings of the form 'id = expr' can be used in construction expressions - /// (Originally from ..\FSComp.txt:611) + /// (Originally from ..\FSComp.txt:612) static member tcOnlySimpleBindingsCanBeUsedInConstructionExpressions() = (777, GetStringFunc("tcOnlySimpleBindingsCanBeUsedInConstructionExpressions",",,,") ) /// Objects must be initialized by an object construction expression that calls an inherited object constructor and assigns a value to each field - /// (Originally from ..\FSComp.txt:612) + /// (Originally from ..\FSComp.txt:613) static member tcObjectsMustBeInitializedWithObjectExpression() = (778, GetStringFunc("tcObjectsMustBeInitializedWithObjectExpression",",,,") ) /// Expected an interface type - /// (Originally from ..\FSComp.txt:613) + /// (Originally from ..\FSComp.txt:614) static member tcExpectedInterfaceType() = (779, GetStringFunc("tcExpectedInterfaceType",",,,") ) /// Constructor expressions for interfaces do not take arguments - /// (Originally from ..\FSComp.txt:614) + /// (Originally from ..\FSComp.txt:615) static member tcConstructorForInterfacesDoNotTakeArguments() = (780, GetStringFunc("tcConstructorForInterfacesDoNotTakeArguments",",,,") ) /// This object constructor requires arguments - /// (Originally from ..\FSComp.txt:615) + /// (Originally from ..\FSComp.txt:616) static member tcConstructorRequiresArguments() = (781, GetStringFunc("tcConstructorRequiresArguments",",,,") ) /// 'new' may only be used with object constructors - /// (Originally from ..\FSComp.txt:616) + /// (Originally from ..\FSComp.txt:617) static member tcNewRequiresObjectConstructor() = (782, GetStringFunc("tcNewRequiresObjectConstructor",",,,") ) /// At least one override did not correctly implement its corresponding abstract member - /// (Originally from ..\FSComp.txt:617) + /// (Originally from ..\FSComp.txt:618) static member tcAtLeastOneOverrideIsInvalid() = (783, GetStringFunc("tcAtLeastOneOverrideIsInvalid",",,,") ) /// This numeric literal requires that a module '%s' defining functions FromZero, FromOne, FromInt32, FromInt64 and FromString be in scope - /// (Originally from ..\FSComp.txt:618) + /// (Originally from ..\FSComp.txt:619) static member tcNumericLiteralRequiresModule(a0 : System.String) = (784, GetStringFunc("tcNumericLiteralRequiresModule",",,,%s,,,") a0) /// Invalid record construction - /// (Originally from ..\FSComp.txt:619) + /// (Originally from ..\FSComp.txt:620) static member tcInvalidRecordConstruction() = (785, GetStringFunc("tcInvalidRecordConstruction",",,,") ) /// The expression form { expr with ... } may only be used with record types. To build object types use { new Type(...) with ... } - /// (Originally from ..\FSComp.txt:620) + /// (Originally from ..\FSComp.txt:621) static member tcExpressionFormRequiresRecordTypes() = (786, GetStringFunc("tcExpressionFormRequiresRecordTypes",",,,") ) /// The inherited type is not an object model type - /// (Originally from ..\FSComp.txt:621) + /// (Originally from ..\FSComp.txt:622) static member tcInheritedTypeIsNotObjectModelType() = (787, GetStringFunc("tcInheritedTypeIsNotObjectModelType",",,,") ) /// Object construction expressions (i.e. record expressions with inheritance specifications) may only be used to implement constructors in object model types. Use 'new ObjectType(args)' to construct instances of object model types outside of constructors - /// (Originally from ..\FSComp.txt:622) + /// (Originally from ..\FSComp.txt:623) static member tcObjectConstructionExpressionCanOnlyImplementConstructorsInObjectModelTypes() = (788, GetStringFunc("tcObjectConstructionExpressionCanOnlyImplementConstructorsInObjectModelTypes",",,,") ) /// '{ }' is not a valid expression. Records must include at least one field. Empty sequences are specified by using Seq.empty or an empty list '[]'. - /// (Originally from ..\FSComp.txt:623) + /// (Originally from ..\FSComp.txt:624) static member tcEmptyRecordInvalid() = (789, GetStringFunc("tcEmptyRecordInvalid",",,,") ) /// This type is not a record type. Values of class and struct types must be created using calls to object constructors. - /// (Originally from ..\FSComp.txt:624) + /// (Originally from ..\FSComp.txt:625) static member tcTypeIsNotARecordTypeNeedConstructor() = (790, GetStringFunc("tcTypeIsNotARecordTypeNeedConstructor",",,,") ) /// This type is not a record type - /// (Originally from ..\FSComp.txt:625) + /// (Originally from ..\FSComp.txt:626) static member tcTypeIsNotARecordType() = (791, GetStringFunc("tcTypeIsNotARecordType",",,,") ) /// This construct is ambiguous as part of a computation expression. Nested expressions may be written using 'let _ = (...)' and nested computations using 'let! res = builder { ... }'. - /// (Originally from ..\FSComp.txt:626) + /// (Originally from ..\FSComp.txt:627) static member tcConstructIsAmbiguousInComputationExpression() = (792, GetStringFunc("tcConstructIsAmbiguousInComputationExpression",",,,") ) /// This construct is ambiguous as part of a sequence expression. Nested expressions may be written using 'let _ = (...)' and nested sequences using 'yield! seq {... }'. - /// (Originally from ..\FSComp.txt:627) + /// (Originally from ..\FSComp.txt:628) static member tcConstructIsAmbiguousInSequenceExpression() = (793, GetStringFunc("tcConstructIsAmbiguousInSequenceExpression",",,,") ) /// 'do!' cannot be used within sequence expressions - /// (Originally from ..\FSComp.txt:628) + /// (Originally from ..\FSComp.txt:629) static member tcDoBangIllegalInSequenceExpression() = (794, GetStringFunc("tcDoBangIllegalInSequenceExpression",",,,") ) /// The use of 'let! x = coll' in sequence expressions is not permitted. Use 'for x in coll' instead. - /// (Originally from ..\FSComp.txt:629) + /// (Originally from ..\FSComp.txt:630) static member tcUseForInSequenceExpression() = (795, GetStringFunc("tcUseForInSequenceExpression",",,,") ) /// 'try'/'with' cannot be used within sequence expressions - /// (Originally from ..\FSComp.txt:630) + /// (Originally from ..\FSComp.txt:631) static member tcTryIllegalInSequenceExpression() = (796, GetStringFunc("tcTryIllegalInSequenceExpression",",,,") ) /// In sequence expressions, multiple results are generated using 'yield!' - /// (Originally from ..\FSComp.txt:631) + /// (Originally from ..\FSComp.txt:632) static member tcUseYieldBangForMultipleResults() = (797, GetStringFunc("tcUseYieldBangForMultipleResults",",,,") ) /// Invalid assignment - /// (Originally from ..\FSComp.txt:632) + /// (Originally from ..\FSComp.txt:633) static member tcInvalidAssignment() = (799, GetStringFunc("tcInvalidAssignment",",,,") ) /// Invalid use of a type name - /// (Originally from ..\FSComp.txt:633) + /// (Originally from ..\FSComp.txt:634) static member tcInvalidUseOfTypeName() = (800, GetStringFunc("tcInvalidUseOfTypeName",",,,") ) /// This type has no accessible object constructors - /// (Originally from ..\FSComp.txt:634) + /// (Originally from ..\FSComp.txt:635) static member tcTypeHasNoAccessibleConstructor() = (801, GetStringFunc("tcTypeHasNoAccessibleConstructor",",,,") ) /// Invalid use of an interface type - /// (Originally from ..\FSComp.txt:637) + /// (Originally from ..\FSComp.txt:638) static member tcInvalidUseOfInterfaceType() = (804, GetStringFunc("tcInvalidUseOfInterfaceType",",,,") ) /// Invalid use of a delegate constructor. Use the syntax 'new Type(args)' or just 'Type(args)'. - /// (Originally from ..\FSComp.txt:638) + /// (Originally from ..\FSComp.txt:639) static member tcInvalidUseOfDelegate() = (805, GetStringFunc("tcInvalidUseOfDelegate",",,,") ) /// Property '%s' is not static - /// (Originally from ..\FSComp.txt:639) + /// (Originally from ..\FSComp.txt:640) static member tcPropertyIsNotStatic(a0 : System.String) = (806, GetStringFunc("tcPropertyIsNotStatic",",,,%s,,,") a0) /// Property '%s' is not readable - /// (Originally from ..\FSComp.txt:640) + /// (Originally from ..\FSComp.txt:641) static member tcPropertyIsNotReadable(a0 : System.String) = (807, GetStringFunc("tcPropertyIsNotReadable",",,,%s,,,") a0) /// This lookup cannot be used here - /// (Originally from ..\FSComp.txt:641) + /// (Originally from ..\FSComp.txt:642) static member tcLookupMayNotBeUsedHere() = (808, GetStringFunc("tcLookupMayNotBeUsedHere",",,,") ) /// Property '%s' is static - /// (Originally from ..\FSComp.txt:642) + /// (Originally from ..\FSComp.txt:643) static member tcPropertyIsStatic(a0 : System.String) = (809, GetStringFunc("tcPropertyIsStatic",",,,%s,,,") a0) /// Property '%s' cannot be set - /// (Originally from ..\FSComp.txt:643) + /// (Originally from ..\FSComp.txt:644) static member tcPropertyCannotBeSet1(a0 : System.String) = (810, GetStringFunc("tcPropertyCannotBeSet1",",,,%s,,,") a0) /// Constructors must be applied to arguments and cannot be used as first-class values. If necessary use an anonymous function '(fun arg1 ... argN -> new Type(arg1,...,argN))'. - /// (Originally from ..\FSComp.txt:644) + /// (Originally from ..\FSComp.txt:645) static member tcConstructorsCannotBeFirstClassValues() = (811, GetStringFunc("tcConstructorsCannotBeFirstClassValues",",,,") ) /// The syntax 'expr.id' may only be used with record labels, properties and fields - /// (Originally from ..\FSComp.txt:645) + /// (Originally from ..\FSComp.txt:646) static member tcSyntaxFormUsedOnlyWithRecordLabelsPropertiesAndFields() = (812, GetStringFunc("tcSyntaxFormUsedOnlyWithRecordLabelsPropertiesAndFields",",,,") ) /// Event '%s' is static - /// (Originally from ..\FSComp.txt:646) + /// (Originally from ..\FSComp.txt:647) static member tcEventIsStatic(a0 : System.String) = (813, GetStringFunc("tcEventIsStatic",",,,%s,,,") a0) /// Event '%s' is not static - /// (Originally from ..\FSComp.txt:647) + /// (Originally from ..\FSComp.txt:648) static member tcEventIsNotStatic(a0 : System.String) = (814, GetStringFunc("tcEventIsNotStatic",",,,%s,,,") a0) /// The named argument '%s' did not match any argument or mutable property - /// (Originally from ..\FSComp.txt:648) + /// (Originally from ..\FSComp.txt:649) static member tcNamedArgumentDidNotMatch(a0 : System.String) = (815, GetStringFunc("tcNamedArgumentDidNotMatch",",,,%s,,,") a0) /// One or more of the overloads of this method has curried arguments. Consider redesigning these members to take arguments in tupled form. - /// (Originally from ..\FSComp.txt:649) + /// (Originally from ..\FSComp.txt:650) static member tcOverloadsCannotHaveCurriedArguments() = (816, GetStringFunc("tcOverloadsCannotHaveCurriedArguments",",,,") ) /// The unnamed arguments do not form a prefix of the arguments of the method called - /// (Originally from ..\FSComp.txt:650) + /// (Originally from ..\FSComp.txt:651) static member tcUnnamedArgumentsDoNotFormPrefix() = (GetStringFunc("tcUnnamedArgumentsDoNotFormPrefix",",,,") ) /// Static optimization conditionals are only for use within the F# library - /// (Originally from ..\FSComp.txt:651) + /// (Originally from ..\FSComp.txt:652) static member tcStaticOptimizationConditionalsOnlyForFSharpLibrary() = (817, GetStringFunc("tcStaticOptimizationConditionalsOnlyForFSharpLibrary",",,,") ) /// The corresponding formal argument is not optional - /// (Originally from ..\FSComp.txt:652) + /// (Originally from ..\FSComp.txt:653) static member tcFormalArgumentIsNotOptional() = (818, GetStringFunc("tcFormalArgumentIsNotOptional",",,,") ) /// Invalid optional assignment to a property or field - /// (Originally from ..\FSComp.txt:653) + /// (Originally from ..\FSComp.txt:654) static member tcInvalidOptionalAssignmentToPropertyOrField() = (819, GetStringFunc("tcInvalidOptionalAssignmentToPropertyOrField",",,,") ) /// A delegate constructor must be passed a single function value - /// (Originally from ..\FSComp.txt:654) + /// (Originally from ..\FSComp.txt:655) static member tcDelegateConstructorMustBePassed() = (820, GetStringFunc("tcDelegateConstructorMustBePassed",",,,") ) /// A binding cannot be marked both 'use' and 'rec' - /// (Originally from ..\FSComp.txt:655) + /// (Originally from ..\FSComp.txt:656) static member tcBindingCannotBeUseAndRec() = (821, GetStringFunc("tcBindingCannotBeUseAndRec",",,,") ) /// The 'VolatileField' attribute may only be used on 'let' bindings in classes - /// (Originally from ..\FSComp.txt:656) + /// (Originally from ..\FSComp.txt:657) static member tcVolatileOnlyOnClassLetBindings() = (823, GetStringFunc("tcVolatileOnlyOnClassLetBindings",",,,") ) /// Attributes are not permitted on 'let' bindings in expressions - /// (Originally from ..\FSComp.txt:657) + /// (Originally from ..\FSComp.txt:658) static member tcAttributesAreNotPermittedOnLetBindings() = (824, GetStringFunc("tcAttributesAreNotPermittedOnLetBindings",",,,") ) /// The 'DefaultValue' attribute may only be used on 'val' declarations - /// (Originally from ..\FSComp.txt:658) + /// (Originally from ..\FSComp.txt:659) static member tcDefaultValueAttributeRequiresVal() = (825, GetStringFunc("tcDefaultValueAttributeRequiresVal",",,,") ) /// The 'ConditionalAttribute' attribute may only be used on members - /// (Originally from ..\FSComp.txt:659) + /// (Originally from ..\FSComp.txt:660) static member tcConditionalAttributeRequiresMembers() = (826, GetStringFunc("tcConditionalAttributeRequiresMembers",",,,") ) /// This is not a valid name for an active pattern - /// (Originally from ..\FSComp.txt:660) + /// (Originally from ..\FSComp.txt:661) static member tcInvalidActivePatternName() = (827, GetStringFunc("tcInvalidActivePatternName",",,,") ) /// The 'EntryPointAttribute' attribute may only be used on function definitions in modules - /// (Originally from ..\FSComp.txt:661) + /// (Originally from ..\FSComp.txt:662) static member tcEntryPointAttributeRequiresFunctionInModule() = (828, GetStringFunc("tcEntryPointAttributeRequiresFunctionInModule",",,,") ) /// Mutable values cannot be marked 'inline' - /// (Originally from ..\FSComp.txt:662) + /// (Originally from ..\FSComp.txt:663) static member tcMutableValuesCannotBeInline() = (829, GetStringFunc("tcMutableValuesCannotBeInline",",,,") ) /// Mutable values cannot have generic parameters - /// (Originally from ..\FSComp.txt:663) + /// (Originally from ..\FSComp.txt:664) static member tcMutableValuesMayNotHaveGenericParameters() = (830, GetStringFunc("tcMutableValuesMayNotHaveGenericParameters",",,,") ) /// Mutable function values should be written 'let mutable f = (fun args -> ...)' - /// (Originally from ..\FSComp.txt:664) + /// (Originally from ..\FSComp.txt:665) static member tcMutableValuesSyntax() = (831, GetStringFunc("tcMutableValuesSyntax",",,,") ) /// Only functions may be marked 'inline' - /// (Originally from ..\FSComp.txt:665) + /// (Originally from ..\FSComp.txt:666) static member tcOnlyFunctionsCanBeInline() = (832, GetStringFunc("tcOnlyFunctionsCanBeInline",",,,") ) /// A literal value cannot be given the [] or [] attributes - /// (Originally from ..\FSComp.txt:666) + /// (Originally from ..\FSComp.txt:667) static member tcIllegalAttributesForLiteral() = (833, GetStringFunc("tcIllegalAttributesForLiteral",",,,") ) /// A literal value cannot be marked 'mutable' - /// (Originally from ..\FSComp.txt:667) + /// (Originally from ..\FSComp.txt:668) static member tcLiteralCannotBeMutable() = (834, GetStringFunc("tcLiteralCannotBeMutable",",,,") ) /// A literal value cannot be marked 'inline' - /// (Originally from ..\FSComp.txt:668) + /// (Originally from ..\FSComp.txt:669) static member tcLiteralCannotBeInline() = (835, GetStringFunc("tcLiteralCannotBeInline",",,,") ) /// Literal values cannot have generic parameters - /// (Originally from ..\FSComp.txt:669) + /// (Originally from ..\FSComp.txt:670) static member tcLiteralCannotHaveGenericParameters() = (836, GetStringFunc("tcLiteralCannotHaveGenericParameters",",,,") ) /// This is not a valid constant expression - /// (Originally from ..\FSComp.txt:670) + /// (Originally from ..\FSComp.txt:671) static member tcInvalidConstantExpression() = (837, GetStringFunc("tcInvalidConstantExpression",",,,") ) /// This type is not accessible from this code location - /// (Originally from ..\FSComp.txt:671) + /// (Originally from ..\FSComp.txt:672) static member tcTypeIsInaccessible() = (838, GetStringFunc("tcTypeIsInaccessible",",,,") ) /// Unexpected condition in imported assembly: failed to decode AttributeUsage attribute - /// (Originally from ..\FSComp.txt:672) + /// (Originally from ..\FSComp.txt:673) static member tcUnexpectedConditionInImportedAssembly() = (839, GetStringFunc("tcUnexpectedConditionInImportedAssembly",",,,") ) /// Unrecognized attribute target. Valid attribute targets are 'assembly', 'module', 'type', 'method', 'property', 'return', 'param', 'field', 'event', 'constructor'. - /// (Originally from ..\FSComp.txt:673) + /// (Originally from ..\FSComp.txt:674) static member tcUnrecognizedAttributeTarget() = (840, GetStringFunc("tcUnrecognizedAttributeTarget",",,,") ) /// This attribute is not valid for use on this language element. Assembly attributes should be attached to a 'do ()' declaration, if necessary within an F# module. - /// (Originally from ..\FSComp.txt:674) + /// (Originally from ..\FSComp.txt:675) static member tcAttributeIsNotValidForLanguageElementUseDo() = (841, GetStringFunc("tcAttributeIsNotValidForLanguageElementUseDo",",,,") ) /// This attribute is not valid for use on this language element - /// (Originally from ..\FSComp.txt:675) + /// (Originally from ..\FSComp.txt:676) static member tcAttributeIsNotValidForLanguageElement() = (842, GetStringFunc("tcAttributeIsNotValidForLanguageElement",",,,") ) /// Optional arguments cannot be used in custom attributes - /// (Originally from ..\FSComp.txt:676) + /// (Originally from ..\FSComp.txt:677) static member tcOptionalArgumentsCannotBeUsedInCustomAttribute() = (843, GetStringFunc("tcOptionalArgumentsCannotBeUsedInCustomAttribute",",,,") ) /// This property cannot be set - /// (Originally from ..\FSComp.txt:677) + /// (Originally from ..\FSComp.txt:678) static member tcPropertyCannotBeSet0() = (844, GetStringFunc("tcPropertyCannotBeSet0",",,,") ) /// This property or field was not found on this custom attribute type - /// (Originally from ..\FSComp.txt:678) + /// (Originally from ..\FSComp.txt:679) static member tcPropertyOrFieldNotFoundInAttribute() = (845, GetStringFunc("tcPropertyOrFieldNotFoundInAttribute",",,,") ) /// A custom attribute must be a reference type - /// (Originally from ..\FSComp.txt:679) + /// (Originally from ..\FSComp.txt:680) static member tcCustomAttributeMustBeReferenceType() = (846, GetStringFunc("tcCustomAttributeMustBeReferenceType",",,,") ) /// The number of args for a custom attribute does not match the expected number of args for the attribute constructor - /// (Originally from ..\FSComp.txt:680) + /// (Originally from ..\FSComp.txt:681) static member tcCustomAttributeArgumentMismatch() = (847, GetStringFunc("tcCustomAttributeArgumentMismatch",",,,") ) /// A custom attribute must invoke an object constructor - /// (Originally from ..\FSComp.txt:681) + /// (Originally from ..\FSComp.txt:682) static member tcCustomAttributeMustInvokeConstructor() = (848, GetStringFunc("tcCustomAttributeMustInvokeConstructor",",,,") ) /// Attribute expressions must be calls to object constructors - /// (Originally from ..\FSComp.txt:682) + /// (Originally from ..\FSComp.txt:683) static member tcAttributeExpressionsMustBeConstructorCalls() = (849, GetStringFunc("tcAttributeExpressionsMustBeConstructorCalls",",,,") ) /// This attribute cannot be used in this version of F# - /// (Originally from ..\FSComp.txt:683) + /// (Originally from ..\FSComp.txt:684) static member tcUnsupportedAttribute() = (850, GetStringFunc("tcUnsupportedAttribute",",,,") ) /// Invalid inline specification - /// (Originally from ..\FSComp.txt:684) + /// (Originally from ..\FSComp.txt:685) static member tcInvalidInlineSpecification() = (851, GetStringFunc("tcInvalidInlineSpecification",",,,") ) /// 'use' bindings must be of the form 'use = ' - /// (Originally from ..\FSComp.txt:685) + /// (Originally from ..\FSComp.txt:686) static member tcInvalidUseBinding() = (852, GetStringFunc("tcInvalidUseBinding",",,,") ) /// Abstract members are not permitted in an augmentation - they must be defined as part of the type itself - /// (Originally from ..\FSComp.txt:686) + /// (Originally from ..\FSComp.txt:687) static member tcAbstractMembersIllegalInAugmentation() = (853, GetStringFunc("tcAbstractMembersIllegalInAugmentation",",,,") ) /// Method overrides and interface implementations are not permitted here - /// (Originally from ..\FSComp.txt:687) + /// (Originally from ..\FSComp.txt:688) static member tcMethodOverridesIllegalHere() = (854, GetStringFunc("tcMethodOverridesIllegalHere",",,,") ) /// No abstract or interface member was found that corresponds to this override - /// (Originally from ..\FSComp.txt:688) + /// (Originally from ..\FSComp.txt:689) static member tcNoMemberFoundForOverride() = (855, GetStringFunc("tcNoMemberFoundForOverride",",,,") ) /// This override takes a different number of arguments to the corresponding abstract member. The following abstract members were found:%s - /// (Originally from ..\FSComp.txt:689) + /// (Originally from ..\FSComp.txt:690) static member tcOverrideArityMismatch(a0 : System.String) = (856, GetStringFunc("tcOverrideArityMismatch",",,,%s,,,") a0) /// This method already has a default implementation - /// (Originally from ..\FSComp.txt:690) + /// (Originally from ..\FSComp.txt:691) static member tcDefaultImplementationAlreadyExists() = (857, GetStringFunc("tcDefaultImplementationAlreadyExists",",,,") ) /// The method implemented by this default is ambiguous - /// (Originally from ..\FSComp.txt:691) + /// (Originally from ..\FSComp.txt:692) static member tcDefaultAmbiguous() = (858, GetStringFunc("tcDefaultAmbiguous",",,,") ) /// No abstract property was found that corresponds to this override - /// (Originally from ..\FSComp.txt:692) + /// (Originally from ..\FSComp.txt:693) static member tcNoPropertyFoundForOverride() = (859, GetStringFunc("tcNoPropertyFoundForOverride",",,,") ) /// This property overrides or implements an abstract property but the abstract property doesn't have a corresponding %s - /// (Originally from ..\FSComp.txt:693) + /// (Originally from ..\FSComp.txt:694) static member tcAbstractPropertyMissingGetOrSet(a0 : System.String) = (860, GetStringFunc("tcAbstractPropertyMissingGetOrSet",",,,%s,,,") a0) /// Invalid signature for set member - /// (Originally from ..\FSComp.txt:694) + /// (Originally from ..\FSComp.txt:695) static member tcInvalidSignatureForSet() = (861, GetStringFunc("tcInvalidSignatureForSet",",,,") ) /// This new member hides the abstract member '%s'. Rename the member or use 'override' instead. - /// (Originally from ..\FSComp.txt:695) + /// (Originally from ..\FSComp.txt:696) static member tcNewMemberHidesAbstractMember(a0 : System.String) = (864, GetStringFunc("tcNewMemberHidesAbstractMember",",,,%s,,,") a0) /// This new member hides the abstract member '%s' once tuples, functions, units of measure and/or provided types are erased. Rename the member or use 'override' instead. - /// (Originally from ..\FSComp.txt:696) + /// (Originally from ..\FSComp.txt:697) static member tcNewMemberHidesAbstractMemberWithSuffix(a0 : System.String) = (864, GetStringFunc("tcNewMemberHidesAbstractMemberWithSuffix",",,,%s,,,") a0) /// Interfaces cannot contain definitions of static initializers - /// (Originally from ..\FSComp.txt:697) + /// (Originally from ..\FSComp.txt:698) static member tcStaticInitializersIllegalInInterface() = (865, GetStringFunc("tcStaticInitializersIllegalInInterface",",,,") ) /// Interfaces cannot contain definitions of object constructors - /// (Originally from ..\FSComp.txt:698) + /// (Originally from ..\FSComp.txt:699) static member tcObjectConstructorsIllegalInInterface() = (866, GetStringFunc("tcObjectConstructorsIllegalInInterface",",,,") ) /// Interfaces cannot contain definitions of member overrides - /// (Originally from ..\FSComp.txt:699) + /// (Originally from ..\FSComp.txt:700) static member tcMemberOverridesIllegalInInterface() = (867, GetStringFunc("tcMemberOverridesIllegalInInterface",",,,") ) /// Interfaces cannot contain definitions of concrete members. You may need to define a constructor on your type to indicate that the type is a class. - /// (Originally from ..\FSComp.txt:700) + /// (Originally from ..\FSComp.txt:701) static member tcConcreteMembersIllegalInInterface() = (868, GetStringFunc("tcConcreteMembersIllegalInInterface",",,,") ) /// Constructors cannot be specified in exception augmentations - /// (Originally from ..\FSComp.txt:701) + /// (Originally from ..\FSComp.txt:702) static member tcConstructorsDisallowedInExceptionAugmentation() = (869, GetStringFunc("tcConstructorsDisallowedInExceptionAugmentation",",,,") ) /// Structs cannot have an object constructor with no arguments. This is a restriction imposed on all CLI languages as structs automatically support a default constructor. - /// (Originally from ..\FSComp.txt:702) + /// (Originally from ..\FSComp.txt:703) static member tcStructsCannotHaveConstructorWithNoArguments() = (870, GetStringFunc("tcStructsCannotHaveConstructorWithNoArguments",",,,") ) /// Constructors cannot be defined for this type - /// (Originally from ..\FSComp.txt:703) + /// (Originally from ..\FSComp.txt:704) static member tcConstructorsIllegalForThisType() = (871, GetStringFunc("tcConstructorsIllegalForThisType",",,,") ) /// Recursive bindings that include member specifications can only occur as a direct augmentation of a type - /// (Originally from ..\FSComp.txt:704) + /// (Originally from ..\FSComp.txt:705) static member tcRecursiveBindingsWithMembersMustBeDirectAugmentation() = (872, GetStringFunc("tcRecursiveBindingsWithMembersMustBeDirectAugmentation",",,,") ) /// Only simple variable patterns can be bound in 'let rec' constructs - /// (Originally from ..\FSComp.txt:705) + /// (Originally from ..\FSComp.txt:706) static member tcOnlySimplePatternsInLetRec() = (873, GetStringFunc("tcOnlySimplePatternsInLetRec",",,,") ) /// Only record fields and simple, non-recursive 'let' bindings may be marked mutable - /// (Originally from ..\FSComp.txt:706) + /// (Originally from ..\FSComp.txt:707) static member tcOnlyRecordFieldsAndSimpleLetCanBeMutable() = (874, GetStringFunc("tcOnlyRecordFieldsAndSimpleLetCanBeMutable",",,,") ) /// This member is not sufficiently generic - /// (Originally from ..\FSComp.txt:707) + /// (Originally from ..\FSComp.txt:708) static member tcMemberIsNotSufficientlyGeneric() = (875, GetStringFunc("tcMemberIsNotSufficientlyGeneric",",,,") ) /// A declaration may only be the [] attribute if a constant value is also given, e.g. 'val x : int = 1' - /// (Originally from ..\FSComp.txt:708) + /// (Originally from ..\FSComp.txt:709) static member tcLiteralAttributeRequiresConstantValue() = (876, GetStringFunc("tcLiteralAttributeRequiresConstantValue",",,,") ) /// A declaration may only be given a value in a signature if the declaration has the [] attribute - /// (Originally from ..\FSComp.txt:709) + /// (Originally from ..\FSComp.txt:710) static member tcValueInSignatureRequiresLiteralAttribute() = (877, GetStringFunc("tcValueInSignatureRequiresLiteralAttribute",",,,") ) /// Thread-static and context-static variables must be static and given the [] attribute to indicate that the value is initialized to the default value on each new thread - /// (Originally from ..\FSComp.txt:710) + /// (Originally from ..\FSComp.txt:711) static member tcThreadStaticAndContextStaticMustBeStatic() = (878, GetStringFunc("tcThreadStaticAndContextStaticMustBeStatic",",,,") ) /// Volatile fields must be marked 'mutable' and cannot be thread-static - /// (Originally from ..\FSComp.txt:711) + /// (Originally from ..\FSComp.txt:712) static member tcVolatileFieldsMustBeMutable() = (879, GetStringFunc("tcVolatileFieldsMustBeMutable",",,,") ) /// Uninitialized 'val' fields must be mutable and marked with the '[]' attribute. Consider using a 'let' binding instead of a 'val' field. - /// (Originally from ..\FSComp.txt:712) + /// (Originally from ..\FSComp.txt:713) static member tcUninitializedValFieldsMustBeMutable() = (880, GetStringFunc("tcUninitializedValFieldsMustBeMutable",",,,") ) /// Static 'val' fields in types must be mutable, private and marked with the '[]' attribute. They are initialized to the 'null' or 'zero' value for their type. Consider also using a 'static let mutable' binding in a class type. - /// (Originally from ..\FSComp.txt:713) + /// (Originally from ..\FSComp.txt:714) static member tcStaticValFieldsMustBeMutableAndPrivate() = (881, GetStringFunc("tcStaticValFieldsMustBeMutableAndPrivate",",,,") ) /// This field requires a name - /// (Originally from ..\FSComp.txt:714) + /// (Originally from ..\FSComp.txt:715) static member tcFieldRequiresName() = (882, GetStringFunc("tcFieldRequiresName",",,,") ) /// Invalid namespace, module, type or union case name - /// (Originally from ..\FSComp.txt:715) + /// (Originally from ..\FSComp.txt:716) static member tcInvalidNamespaceModuleTypeUnionName() = (883, GetStringFunc("tcInvalidNamespaceModuleTypeUnionName",",,,") ) /// Explicit type declarations for constructors must be of the form 'ty1 * ... * tyN -> resTy'. Parentheses may be required around 'resTy' - /// (Originally from ..\FSComp.txt:716) + /// (Originally from ..\FSComp.txt:717) static member tcIllegalFormForExplicitTypeDeclaration() = (884, GetStringFunc("tcIllegalFormForExplicitTypeDeclaration",",,,") ) /// Return types of union cases must be identical to the type being defined, up to abbreviations - /// (Originally from ..\FSComp.txt:717) + /// (Originally from ..\FSComp.txt:718) static member tcReturnTypesForUnionMustBeSameAsType() = (885, GetStringFunc("tcReturnTypesForUnionMustBeSameAsType",",,,") ) /// This is not a valid value for an enumeration literal - /// (Originally from ..\FSComp.txt:718) + /// (Originally from ..\FSComp.txt:719) static member tcInvalidEnumerationLiteral() = (886, GetStringFunc("tcInvalidEnumerationLiteral",",,,") ) /// The type '%s' is not an interface type - /// (Originally from ..\FSComp.txt:719) + /// (Originally from ..\FSComp.txt:720) static member tcTypeIsNotInterfaceType1(a0 : System.String) = (887, GetStringFunc("tcTypeIsNotInterfaceType1",",,,%s,,,") a0) /// Duplicate specification of an interface - /// (Originally from ..\FSComp.txt:720) + /// (Originally from ..\FSComp.txt:721) static member tcDuplicateSpecOfInterface() = (888, GetStringFunc("tcDuplicateSpecOfInterface",",,,") ) /// A field/val declaration is not permitted here - /// (Originally from ..\FSComp.txt:721) + /// (Originally from ..\FSComp.txt:722) static member tcFieldValIllegalHere() = (889, GetStringFunc("tcFieldValIllegalHere",",,,") ) /// A inheritance declaration is not permitted here - /// (Originally from ..\FSComp.txt:722) + /// (Originally from ..\FSComp.txt:723) static member tcInheritIllegalHere() = (890, GetStringFunc("tcInheritIllegalHere",",,,") ) /// This declaration opens the module '%s', which is marked as 'RequireQualifiedAccess'. Adjust your code to use qualified references to the elements of the module instead, e.g. 'List.map' instead of 'map'. This change will ensure that your code is robust as new constructs are added to libraries. - /// (Originally from ..\FSComp.txt:723) + /// (Originally from ..\FSComp.txt:724) static member tcModuleRequiresQualifiedAccess(a0 : System.String) = (892, GetStringFunc("tcModuleRequiresQualifiedAccess",",,,%s,,,") a0) /// This declaration opens the namespace or module '%s' through a partially qualified path. Adjust this code to use the full path of the namespace. This change will make your code more robust as new constructs are added to the F# and CLI libraries. - /// (Originally from ..\FSComp.txt:724) + /// (Originally from ..\FSComp.txt:725) static member tcOpenUsedWithPartiallyQualifiedPath(a0 : System.String) = (893, GetStringFunc("tcOpenUsedWithPartiallyQualifiedPath",",,,%s,,,") a0) /// Local class bindings cannot be marked inline. Consider lifting the definition out of the class or else do not mark it as inline. - /// (Originally from ..\FSComp.txt:725) + /// (Originally from ..\FSComp.txt:726) static member tcLocalClassBindingsCannotBeInline() = (894, GetStringFunc("tcLocalClassBindingsCannotBeInline",",,,") ) /// Type abbreviations cannot have members - /// (Originally from ..\FSComp.txt:726) + /// (Originally from ..\FSComp.txt:727) static member tcTypeAbbreviationsMayNotHaveMembers() = (895, GetStringFunc("tcTypeAbbreviationsMayNotHaveMembers",",,,") ) /// As of F# 4.1, the accessibility of type abbreviations is checked at compile-time. Consider changing the accessibility of the type abbreviation. Ignoring this warning might lead to runtime errors. - /// (Originally from ..\FSComp.txt:727) + /// (Originally from ..\FSComp.txt:728) static member tcTypeAbbreviationsCheckedAtCompileTime() = (GetStringFunc("tcTypeAbbreviationsCheckedAtCompileTime",",,,") ) /// Enumerations cannot have members - /// (Originally from ..\FSComp.txt:728) + /// (Originally from ..\FSComp.txt:729) static member tcEnumerationsMayNotHaveMembers() = (896, GetStringFunc("tcEnumerationsMayNotHaveMembers",",,,") ) /// Measure declarations may have only static members - /// (Originally from ..\FSComp.txt:729) + /// (Originally from ..\FSComp.txt:730) static member tcMeasureDeclarationsRequireStaticMembers() = (897, GetStringFunc("tcMeasureDeclarationsRequireStaticMembers",",,,") ) /// Structs cannot contain 'do' bindings because the default constructor for structs would not execute these bindings - /// (Originally from ..\FSComp.txt:730) + /// (Originally from ..\FSComp.txt:731) static member tcStructsMayNotContainDoBindings() = (GetStringFunc("tcStructsMayNotContainDoBindings",",,,") ) /// Structs cannot contain value definitions because the default constructor for structs will not execute these bindings. Consider adding additional arguments to the primary constructor for the type. - /// (Originally from ..\FSComp.txt:731) + /// (Originally from ..\FSComp.txt:732) static member tcStructsMayNotContainLetBindings() = (901, GetStringFunc("tcStructsMayNotContainLetBindings",",,,") ) /// Static value definitions may only be used in types with a primary constructor. Consider adding arguments to the type definition, e.g. 'type X(args) = ...'. - /// (Originally from ..\FSComp.txt:732) + /// (Originally from ..\FSComp.txt:733) static member tcStaticLetBindingsRequireClassesWithImplicitConstructors() = (902, GetStringFunc("tcStaticLetBindingsRequireClassesWithImplicitConstructors",",,,") ) /// Measure declarations may have only static members: constructors are not available - /// (Originally from ..\FSComp.txt:733) + /// (Originally from ..\FSComp.txt:734) static member tcMeasureDeclarationsRequireStaticMembersNotConstructors() = (904, GetStringFunc("tcMeasureDeclarationsRequireStaticMembersNotConstructors",",,,") ) /// A member and a local class binding both have the name '%s' - /// (Originally from ..\FSComp.txt:734) + /// (Originally from ..\FSComp.txt:735) static member tcMemberAndLocalClassBindingHaveSameName(a0 : System.String) = (905, GetStringFunc("tcMemberAndLocalClassBindingHaveSameName",",,,%s,,,") a0) /// Type abbreviations cannot have interface declarations - /// (Originally from ..\FSComp.txt:735) + /// (Originally from ..\FSComp.txt:736) static member tcTypeAbbreviationsCannotHaveInterfaceDeclaration() = (906, GetStringFunc("tcTypeAbbreviationsCannotHaveInterfaceDeclaration",",,,") ) /// Enumerations cannot have interface declarations - /// (Originally from ..\FSComp.txt:736) + /// (Originally from ..\FSComp.txt:737) static member tcEnumerationsCannotHaveInterfaceDeclaration() = (907, GetStringFunc("tcEnumerationsCannotHaveInterfaceDeclaration",",,,") ) /// This type is not an interface type - /// (Originally from ..\FSComp.txt:737) + /// (Originally from ..\FSComp.txt:738) static member tcTypeIsNotInterfaceType0() = (908, GetStringFunc("tcTypeIsNotInterfaceType0",",,,") ) /// All implemented interfaces should be declared on the initial declaration of the type - /// (Originally from ..\FSComp.txt:738) + /// (Originally from ..\FSComp.txt:739) static member tcAllImplementedInterfacesShouldBeDeclared() = (909, GetStringFunc("tcAllImplementedInterfacesShouldBeDeclared",",,,") ) /// A default implementation of this interface has already been added because the explicit implementation of the interface was not specified at the definition of the type - /// (Originally from ..\FSComp.txt:739) + /// (Originally from ..\FSComp.txt:740) static member tcDefaultImplementationForInterfaceHasAlreadyBeenAdded() = (910, GetStringFunc("tcDefaultImplementationForInterfaceHasAlreadyBeenAdded",",,,") ) /// This member is not permitted in an interface implementation - /// (Originally from ..\FSComp.txt:740) + /// (Originally from ..\FSComp.txt:741) static member tcMemberNotPermittedInInterfaceImplementation() = (911, GetStringFunc("tcMemberNotPermittedInInterfaceImplementation",",,,") ) /// This declaration element is not permitted in an augmentation - /// (Originally from ..\FSComp.txt:741) + /// (Originally from ..\FSComp.txt:742) static member tcDeclarationElementNotPermittedInAugmentation() = (912, GetStringFunc("tcDeclarationElementNotPermittedInAugmentation",",,,") ) /// Types cannot contain nested type definitions - /// (Originally from ..\FSComp.txt:742) + /// (Originally from ..\FSComp.txt:743) static member tcTypesCannotContainNestedTypes() = (913, GetStringFunc("tcTypesCannotContainNestedTypes",",,,") ) /// type, exception or module - /// (Originally from ..\FSComp.txt:743) + /// (Originally from ..\FSComp.txt:744) static member tcTypeExceptionOrModule() = (GetStringFunc("tcTypeExceptionOrModule",",,,") ) /// type or module - /// (Originally from ..\FSComp.txt:744) + /// (Originally from ..\FSComp.txt:745) static member tcTypeOrModule() = (GetStringFunc("tcTypeOrModule",",,,") ) /// The struct, record or union type '%s' implements the interface 'System.IStructuralEquatable' explicitly. Apply the 'CustomEquality' attribute to the type. - /// (Originally from ..\FSComp.txt:745) + /// (Originally from ..\FSComp.txt:746) static member tcImplementsIStructuralEquatableExplicitly(a0 : System.String) = (914, GetStringFunc("tcImplementsIStructuralEquatableExplicitly",",,,%s,,,") a0) /// The struct, record or union type '%s' implements the interface 'System.IEquatable<_>' explicitly. Apply the 'CustomEquality' attribute to the type and provide a consistent implementation of the non-generic override 'System.Object.Equals(obj)'. - /// (Originally from ..\FSComp.txt:746) + /// (Originally from ..\FSComp.txt:747) static member tcImplementsIEquatableExplicitly(a0 : System.String) = (915, GetStringFunc("tcImplementsIEquatableExplicitly",",,,%s,,,") a0) /// Explicit type specifications cannot be used for exception constructors - /// (Originally from ..\FSComp.txt:747) + /// (Originally from ..\FSComp.txt:748) static member tcExplicitTypeSpecificationCannotBeUsedForExceptionConstructors() = (916, GetStringFunc("tcExplicitTypeSpecificationCannotBeUsedForExceptionConstructors",",,,") ) /// Exception abbreviations should not have argument lists - /// (Originally from ..\FSComp.txt:748) + /// (Originally from ..\FSComp.txt:749) static member tcExceptionAbbreviationsShouldNotHaveArgumentList() = (917, GetStringFunc("tcExceptionAbbreviationsShouldNotHaveArgumentList",",,,") ) /// Abbreviations for Common IL exceptions cannot take arguments - /// (Originally from ..\FSComp.txt:749) + /// (Originally from ..\FSComp.txt:750) static member tcAbbreviationsFordotNetExceptionsCannotTakeArguments() = (918, GetStringFunc("tcAbbreviationsFordotNetExceptionsCannotTakeArguments",",,,") ) /// Exception abbreviations must refer to existing exceptions or F# types deriving from System.Exception - /// (Originally from ..\FSComp.txt:750) + /// (Originally from ..\FSComp.txt:751) static member tcExceptionAbbreviationsMustReferToValidExceptions() = (919, GetStringFunc("tcExceptionAbbreviationsMustReferToValidExceptions",",,,") ) /// Abbreviations for Common IL exception types must have a matching object constructor - /// (Originally from ..\FSComp.txt:751) + /// (Originally from ..\FSComp.txt:752) static member tcAbbreviationsFordotNetExceptionsMustHaveMatchingObjectConstructor() = (920, GetStringFunc("tcAbbreviationsFordotNetExceptionsMustHaveMatchingObjectConstructor",",,,") ) /// Not an exception - /// (Originally from ..\FSComp.txt:752) + /// (Originally from ..\FSComp.txt:753) static member tcNotAnException() = (921, GetStringFunc("tcNotAnException",",,,") ) /// Invalid module name - /// (Originally from ..\FSComp.txt:754) + /// (Originally from ..\FSComp.txt:755) static member tcInvalidModuleName() = (924, GetStringFunc("tcInvalidModuleName",",,,") ) /// Invalid type extension - /// (Originally from ..\FSComp.txt:755) + /// (Originally from ..\FSComp.txt:756) static member tcInvalidTypeExtension() = (925, GetStringFunc("tcInvalidTypeExtension",",,,") ) /// The attributes of this type specify multiple kinds for the type - /// (Originally from ..\FSComp.txt:756) + /// (Originally from ..\FSComp.txt:757) static member tcAttributesOfTypeSpecifyMultipleKindsForType() = (926, GetStringFunc("tcAttributesOfTypeSpecifyMultipleKindsForType",",,,") ) /// The kind of the type specified by its attributes does not match the kind implied by its definition - /// (Originally from ..\FSComp.txt:757) + /// (Originally from ..\FSComp.txt:758) static member tcKindOfTypeSpecifiedDoesNotMatchDefinition() = (927, GetStringFunc("tcKindOfTypeSpecifiedDoesNotMatchDefinition",",,,") ) /// Measure definitions cannot have type parameters - /// (Originally from ..\FSComp.txt:758) + /// (Originally from ..\FSComp.txt:759) static member tcMeasureDefinitionsCannotHaveTypeParameters() = (928, GetStringFunc("tcMeasureDefinitionsCannotHaveTypeParameters",",,,") ) /// This type requires a definition - /// (Originally from ..\FSComp.txt:759) + /// (Originally from ..\FSComp.txt:760) static member tcTypeRequiresDefinition() = (929, GetStringFunc("tcTypeRequiresDefinition",",,,") ) /// This type abbreviation has one or more declared type parameters that do not appear in the type being abbreviated. Type abbreviations must use all declared type parameters in the type being abbreviated. Consider removing one or more type parameters, or use a concrete type definition that wraps an underlying type, such as 'type C<'a> = C of ...'. - /// (Originally from ..\FSComp.txt:760) + /// (Originally from ..\FSComp.txt:761) static member tcTypeAbbreviationHasTypeParametersMissingOnType() = (GetStringFunc("tcTypeAbbreviationHasTypeParametersMissingOnType",",,,") ) /// Structs, interfaces, enums and delegates cannot inherit from other types - /// (Originally from ..\FSComp.txt:761) + /// (Originally from ..\FSComp.txt:762) static member tcStructsInterfacesEnumsDelegatesMayNotInheritFromOtherTypes() = (931, GetStringFunc("tcStructsInterfacesEnumsDelegatesMayNotInheritFromOtherTypes",",,,") ) /// Types cannot inherit from multiple concrete types - /// (Originally from ..\FSComp.txt:762) + /// (Originally from ..\FSComp.txt:763) static member tcTypesCannotInheritFromMultipleConcreteTypes() = (932, GetStringFunc("tcTypesCannotInheritFromMultipleConcreteTypes",",,,") ) /// Records, union, abbreviations and struct types cannot have the 'AllowNullLiteral' attribute - /// (Originally from ..\FSComp.txt:763) + /// (Originally from ..\FSComp.txt:764) static member tcRecordsUnionsAbbreviationsStructsMayNotHaveAllowNullLiteralAttribute() = (934, GetStringFunc("tcRecordsUnionsAbbreviationsStructsMayNotHaveAllowNullLiteralAttribute",",,,") ) /// Types with the 'AllowNullLiteral' attribute may only inherit from or implement types which also allow the use of the null literal - /// (Originally from ..\FSComp.txt:764) + /// (Originally from ..\FSComp.txt:765) static member tcAllowNullTypesMayOnlyInheritFromAllowNullTypes() = (935, GetStringFunc("tcAllowNullTypesMayOnlyInheritFromAllowNullTypes",",,,") ) /// Generic types cannot be given the 'StructLayout' attribute - /// (Originally from ..\FSComp.txt:765) + /// (Originally from ..\FSComp.txt:766) static member tcGenericTypesCannotHaveStructLayout() = (936, GetStringFunc("tcGenericTypesCannotHaveStructLayout",",,,") ) /// Only structs and classes without primary constructors may be given the 'StructLayout' attribute - /// (Originally from ..\FSComp.txt:766) + /// (Originally from ..\FSComp.txt:767) static member tcOnlyStructsCanHaveStructLayout() = (937, GetStringFunc("tcOnlyStructsCanHaveStructLayout",",,,") ) /// The representation of this type is hidden by the signature. It must be given an attribute such as [], [] or [] to indicate the characteristics of the type. - /// (Originally from ..\FSComp.txt:767) + /// (Originally from ..\FSComp.txt:768) static member tcRepresentationOfTypeHiddenBySignature() = (938, GetStringFunc("tcRepresentationOfTypeHiddenBySignature",",,,") ) /// Only classes may be given the 'AbstractClass' attribute - /// (Originally from ..\FSComp.txt:768) + /// (Originally from ..\FSComp.txt:769) static member tcOnlyClassesCanHaveAbstract() = (939, GetStringFunc("tcOnlyClassesCanHaveAbstract",",,,") ) /// Only types representing units-of-measure may be given the 'Measure' attribute - /// (Originally from ..\FSComp.txt:769) + /// (Originally from ..\FSComp.txt:770) static member tcOnlyTypesRepresentingUnitsOfMeasureCanHaveMeasure() = (940, GetStringFunc("tcOnlyTypesRepresentingUnitsOfMeasureCanHaveMeasure",",,,") ) /// Accessibility modifiers are not permitted on overrides or interface implementations - /// (Originally from ..\FSComp.txt:770) + /// (Originally from ..\FSComp.txt:771) static member tcOverridesCannotHaveVisibilityDeclarations() = (941, GetStringFunc("tcOverridesCannotHaveVisibilityDeclarations",",,,") ) /// Discriminated union types are always sealed - /// (Originally from ..\FSComp.txt:771) + /// (Originally from ..\FSComp.txt:772) static member tcTypesAreAlwaysSealedDU() = (942, GetStringFunc("tcTypesAreAlwaysSealedDU",",,,") ) /// Record types are always sealed - /// (Originally from ..\FSComp.txt:772) + /// (Originally from ..\FSComp.txt:773) static member tcTypesAreAlwaysSealedRecord() = (942, GetStringFunc("tcTypesAreAlwaysSealedRecord",",,,") ) /// Assembly code types are always sealed - /// (Originally from ..\FSComp.txt:773) + /// (Originally from ..\FSComp.txt:774) static member tcTypesAreAlwaysSealedAssemblyCode() = (942, GetStringFunc("tcTypesAreAlwaysSealedAssemblyCode",",,,") ) /// Struct types are always sealed - /// (Originally from ..\FSComp.txt:774) + /// (Originally from ..\FSComp.txt:775) static member tcTypesAreAlwaysSealedStruct() = (942, GetStringFunc("tcTypesAreAlwaysSealedStruct",",,,") ) /// Delegate types are always sealed - /// (Originally from ..\FSComp.txt:775) + /// (Originally from ..\FSComp.txt:776) static member tcTypesAreAlwaysSealedDelegate() = (942, GetStringFunc("tcTypesAreAlwaysSealedDelegate",",,,") ) /// Enum types are always sealed - /// (Originally from ..\FSComp.txt:776) + /// (Originally from ..\FSComp.txt:777) static member tcTypesAreAlwaysSealedEnum() = (942, GetStringFunc("tcTypesAreAlwaysSealedEnum",",,,") ) /// Interface types and delegate types cannot contain fields - /// (Originally from ..\FSComp.txt:777) + /// (Originally from ..\FSComp.txt:778) static member tcInterfaceTypesAndDelegatesCannotContainFields() = (943, GetStringFunc("tcInterfaceTypesAndDelegatesCannotContainFields",",,,") ) /// Abbreviated types cannot be given the 'Sealed' attribute - /// (Originally from ..\FSComp.txt:778) + /// (Originally from ..\FSComp.txt:779) static member tcAbbreviatedTypesCannotBeSealed() = (944, GetStringFunc("tcAbbreviatedTypesCannotBeSealed",",,,") ) /// Cannot inherit a sealed type - /// (Originally from ..\FSComp.txt:779) + /// (Originally from ..\FSComp.txt:780) static member tcCannotInheritFromSealedType() = (945, GetStringFunc("tcCannotInheritFromSealedType",",,,") ) /// Cannot inherit from interface type. Use interface ... with instead. - /// (Originally from ..\FSComp.txt:780) + /// (Originally from ..\FSComp.txt:781) static member tcCannotInheritFromInterfaceType() = (946, GetStringFunc("tcCannotInheritFromInterfaceType",",,,") ) /// Struct types cannot contain abstract members - /// (Originally from ..\FSComp.txt:781) + /// (Originally from ..\FSComp.txt:782) static member tcStructTypesCannotContainAbstractMembers() = (947, GetStringFunc("tcStructTypesCannotContainAbstractMembers",",,,") ) /// Interface types cannot be sealed - /// (Originally from ..\FSComp.txt:782) + /// (Originally from ..\FSComp.txt:783) static member tcInterfaceTypesCannotBeSealed() = (948, GetStringFunc("tcInterfaceTypesCannotBeSealed",",,,") ) /// Delegate specifications must be of the form 'typ -> typ' - /// (Originally from ..\FSComp.txt:783) + /// (Originally from ..\FSComp.txt:784) static member tcInvalidDelegateSpecification() = (949, GetStringFunc("tcInvalidDelegateSpecification",",,,") ) /// Delegate specifications must not be curried types. Use 'typ * ... * typ -> typ' for multi-argument delegates, and 'typ -> (typ -> typ)' for delegates returning function values. - /// (Originally from ..\FSComp.txt:784) + /// (Originally from ..\FSComp.txt:785) static member tcDelegatesCannotBeCurried() = (950, GetStringFunc("tcDelegatesCannotBeCurried",",,,") ) /// Literal enumerations must have type int, uint, int16, uint16, int64, uint64, byte, sbyte or char - /// (Originally from ..\FSComp.txt:785) + /// (Originally from ..\FSComp.txt:786) static member tcInvalidTypeForLiteralEnumeration() = (951, GetStringFunc("tcInvalidTypeForLiteralEnumeration",",,,") ) /// This type definition involves an immediate cyclic reference through an abbreviation - /// (Originally from ..\FSComp.txt:787) + /// (Originally from ..\FSComp.txt:788) static member tcTypeDefinitionIsCyclic() = (953, GetStringFunc("tcTypeDefinitionIsCyclic",",,,") ) /// This type definition involves an immediate cyclic reference through a struct field or inheritance relation - /// (Originally from ..\FSComp.txt:788) + /// (Originally from ..\FSComp.txt:789) static member tcTypeDefinitionIsCyclicThroughInheritance() = (954, GetStringFunc("tcTypeDefinitionIsCyclicThroughInheritance",",,,") ) /// The syntax 'type X with ...' is reserved for augmentations. Types whose representations are hidden but which have members are now declared in signatures using 'type X = ...'. You may also need to add the '[] attribute to the type definition in the signature - /// (Originally from ..\FSComp.txt:789) + /// (Originally from ..\FSComp.txt:790) static member tcReservedSyntaxForAugmentation() = (GetStringFunc("tcReservedSyntaxForAugmentation",",,,") ) /// Members that extend interface, delegate or enum types must be placed in a module separate to the definition of the type. This module must either have the AutoOpen attribute or be opened explicitly by client code to bring the extension members into scope. - /// (Originally from ..\FSComp.txt:790) + /// (Originally from ..\FSComp.txt:791) static member tcMembersThatExtendInterfaceMustBePlacedInSeparateModule() = (956, GetStringFunc("tcMembersThatExtendInterfaceMustBePlacedInSeparateModule",",,,") ) /// One or more of the declared type parameters for this type extension have a missing or wrong type constraint not matching the original type constraints on '%s' - /// (Originally from ..\FSComp.txt:791) + /// (Originally from ..\FSComp.txt:792) static member tcDeclaredTypeParametersForExtensionDoNotMatchOriginal(a0 : System.String) = (957, GetStringFunc("tcDeclaredTypeParametersForExtensionDoNotMatchOriginal",",,,%s,,,") a0) /// Type definitions may only have one 'inherit' specification and it must be the first declaration - /// (Originally from ..\FSComp.txt:792) + /// (Originally from ..\FSComp.txt:793) static member tcTypeDefinitionsWithImplicitConstructionMustHaveOneInherit() = (959, GetStringFunc("tcTypeDefinitionsWithImplicitConstructionMustHaveOneInherit",",,,") ) /// 'let' and 'do' bindings must come before member and interface definitions in type definitions - /// (Originally from ..\FSComp.txt:793) + /// (Originally from ..\FSComp.txt:794) static member tcTypeDefinitionsWithImplicitConstructionMustHaveLocalBindingsBeforeMembers() = (960, GetStringFunc("tcTypeDefinitionsWithImplicitConstructionMustHaveLocalBindingsBeforeMembers",",,,") ) /// This 'inherit' declaration specifies the inherited type but no arguments. Consider supplying arguments, e.g. 'inherit BaseType(args)'. - /// (Originally from ..\FSComp.txt:794) + /// (Originally from ..\FSComp.txt:795) static member tcInheritDeclarationMissingArguments() = (961, GetStringFunc("tcInheritDeclarationMissingArguments",",,,") ) /// This 'inherit' declaration has arguments, but is not in a type with a primary constructor. Consider adding arguments to your type definition, e.g. 'type X(args) = ...'. - /// (Originally from ..\FSComp.txt:795) + /// (Originally from ..\FSComp.txt:796) static member tcInheritConstructionCallNotPartOfImplicitSequence() = (962, GetStringFunc("tcInheritConstructionCallNotPartOfImplicitSequence",",,,") ) /// This definition may only be used in a type with a primary constructor. Consider adding arguments to your type definition, e.g. 'type X(args) = ...'. - /// (Originally from ..\FSComp.txt:796) + /// (Originally from ..\FSComp.txt:797) static member tcLetAndDoRequiresImplicitConstructionSequence() = (963, GetStringFunc("tcLetAndDoRequiresImplicitConstructionSequence",",,,") ) /// Type abbreviations cannot have augmentations - /// (Originally from ..\FSComp.txt:797) + /// (Originally from ..\FSComp.txt:798) static member tcTypeAbbreviationsCannotHaveAugmentations() = (964, GetStringFunc("tcTypeAbbreviationsCannotHaveAugmentations",",,,") ) /// The path '%s' is a namespace. A module abbreviation may not abbreviate a namespace. - /// (Originally from ..\FSComp.txt:798) + /// (Originally from ..\FSComp.txt:799) static member tcModuleAbbreviationForNamespace(a0 : System.String) = (965, GetStringFunc("tcModuleAbbreviationForNamespace",",,,%s,,,") a0) /// The type '%s' is used in an invalid way. A value prior to '%s' has an inferred type involving '%s', which is an invalid forward reference. - /// (Originally from ..\FSComp.txt:799) + /// (Originally from ..\FSComp.txt:800) static member tcTypeUsedInInvalidWay(a0 : System.String, a1 : System.String, a2 : System.String) = (966, GetStringFunc("tcTypeUsedInInvalidWay",",,,%s,,,%s,,,%s,,,") a0 a1 a2) /// The member '%s' is used in an invalid way. A use of '%s' has been inferred prior to the definition of '%s', which is an invalid forward reference. - /// (Originally from ..\FSComp.txt:800) + /// (Originally from ..\FSComp.txt:801) static member tcMemberUsedInInvalidWay(a0 : System.String, a1 : System.String, a2 : System.String) = (967, GetStringFunc("tcMemberUsedInInvalidWay",",,,%s,,,%s,,,%s,,,") a0 a1 a2) /// The attribute 'AutoOpen(\"%s\")' in the assembly '%s' did not refer to a valid module or namespace in that assembly and has been ignored - /// (Originally from ..\FSComp.txt:803) + /// (Originally from ..\FSComp.txt:804) static member tcAttributeAutoOpenWasIgnored(a0 : System.String, a1 : System.String) = (970, GetStringFunc("tcAttributeAutoOpenWasIgnored",",,,%s,,,%s,,,") a0 a1) /// Undefined value '%s' - /// (Originally from ..\FSComp.txt:804) + /// (Originally from ..\FSComp.txt:805) static member ilUndefinedValue(a0 : System.String) = (971, GetStringFunc("ilUndefinedValue",",,,%s,,,") a0) /// Label %s not found - /// (Originally from ..\FSComp.txt:805) + /// (Originally from ..\FSComp.txt:806) static member ilLabelNotFound(a0 : System.String) = (972, GetStringFunc("ilLabelNotFound",",,,%s,,,") a0) /// Incorrect number of type arguments to local call - /// (Originally from ..\FSComp.txt:806) + /// (Originally from ..\FSComp.txt:807) static member ilIncorrectNumberOfTypeArguments() = (973, GetStringFunc("ilIncorrectNumberOfTypeArguments",",,,") ) /// Dynamic invocation of %s is not supported - /// (Originally from ..\FSComp.txt:807) + /// (Originally from ..\FSComp.txt:808) static member ilDynamicInvocationNotSupported(a0 : System.String) = (GetStringFunc("ilDynamicInvocationNotSupported",",,,%s,,,") a0) /// Taking the address of a literal field is invalid - /// (Originally from ..\FSComp.txt:808) + /// (Originally from ..\FSComp.txt:809) static member ilAddressOfLiteralFieldIsInvalid() = (975, GetStringFunc("ilAddressOfLiteralFieldIsInvalid",",,,") ) /// This operation involves taking the address of a value '%s' represented using a local variable or other special representation. This is invalid. - /// (Originally from ..\FSComp.txt:809) + /// (Originally from ..\FSComp.txt:810) static member ilAddressOfValueHereIsInvalid(a0 : System.String) = (976, GetStringFunc("ilAddressOfValueHereIsInvalid",",,,%s,,,") a0) /// Custom marshallers cannot be specified in F# code. Consider using a C# helper function. - /// (Originally from ..\FSComp.txt:810) + /// (Originally from ..\FSComp.txt:811) static member ilCustomMarshallersCannotBeUsedInFSharp() = (980, GetStringFunc("ilCustomMarshallersCannotBeUsedInFSharp",",,,") ) /// The MarshalAs attribute could not be decoded - /// (Originally from ..\FSComp.txt:811) + /// (Originally from ..\FSComp.txt:812) static member ilMarshalAsAttributeCannotBeDecoded() = (981, GetStringFunc("ilMarshalAsAttributeCannotBeDecoded",",,,") ) /// The signature for this external function contains type parameters. Constrain the argument and return types to indicate the types of the corresponding C function. - /// (Originally from ..\FSComp.txt:812) + /// (Originally from ..\FSComp.txt:813) static member ilSignatureForExternalFunctionContainsTypeParameters() = (982, GetStringFunc("ilSignatureForExternalFunctionContainsTypeParameters",",,,") ) /// The DllImport attribute could not be decoded - /// (Originally from ..\FSComp.txt:813) + /// (Originally from ..\FSComp.txt:814) static member ilDllImportAttributeCouldNotBeDecoded() = (983, GetStringFunc("ilDllImportAttributeCouldNotBeDecoded",",,,") ) /// Literal fields cannot be set - /// (Originally from ..\FSComp.txt:814) + /// (Originally from ..\FSComp.txt:815) static member ilLiteralFieldsCannotBeSet() = (984, GetStringFunc("ilLiteralFieldsCannotBeSet",",,,") ) /// GenSetStorage: %s was represented as a static method but was not an appropriate lambda expression - /// (Originally from ..\FSComp.txt:815) + /// (Originally from ..\FSComp.txt:816) static member ilStaticMethodIsNotLambda(a0 : System.String) = (985, GetStringFunc("ilStaticMethodIsNotLambda",",,,%s,,,") a0) /// Mutable variables cannot escape their method - /// (Originally from ..\FSComp.txt:816) + /// (Originally from ..\FSComp.txt:817) static member ilMutableVariablesCannotEscapeMethod() = (986, GetStringFunc("ilMutableVariablesCannotEscapeMethod",",,,") ) /// Compiler error: unexpected unrealized value - /// (Originally from ..\FSComp.txt:817) + /// (Originally from ..\FSComp.txt:818) static member ilUnexpectedUnrealizedValue() = (987, GetStringFunc("ilUnexpectedUnrealizedValue",",,,") ) /// Main module of program is empty: nothing will happen when it is run - /// (Originally from ..\FSComp.txt:818) + /// (Originally from ..\FSComp.txt:819) static member ilMainModuleEmpty() = (988, GetStringFunc("ilMainModuleEmpty",",,,") ) /// This type cannot be used for a literal field - /// (Originally from ..\FSComp.txt:819) + /// (Originally from ..\FSComp.txt:820) static member ilTypeCannotBeUsedForLiteralField() = (989, GetStringFunc("ilTypeCannotBeUsedForLiteralField",",,,") ) /// Unexpected GetSet annotation on a property - /// (Originally from ..\FSComp.txt:820) + /// (Originally from ..\FSComp.txt:821) static member ilUnexpectedGetSetAnnotation() = (990, GetStringFunc("ilUnexpectedGetSetAnnotation",",,,") ) /// The FieldOffset attribute could not be decoded - /// (Originally from ..\FSComp.txt:821) + /// (Originally from ..\FSComp.txt:822) static member ilFieldOffsetAttributeCouldNotBeDecoded() = (991, GetStringFunc("ilFieldOffsetAttributeCouldNotBeDecoded",",,,") ) /// The StructLayout attribute could not be decoded - /// (Originally from ..\FSComp.txt:822) + /// (Originally from ..\FSComp.txt:823) static member ilStructLayoutAttributeCouldNotBeDecoded() = (992, GetStringFunc("ilStructLayoutAttributeCouldNotBeDecoded",",,,") ) /// The DefaultAugmentation attribute could not be decoded - /// (Originally from ..\FSComp.txt:823) + /// (Originally from ..\FSComp.txt:824) static member ilDefaultAugmentationAttributeCouldNotBeDecoded() = (993, GetStringFunc("ilDefaultAugmentationAttributeCouldNotBeDecoded",",,,") ) /// Reflected definitions cannot contain uses of the prefix splice operator '%%' - /// (Originally from ..\FSComp.txt:824) + /// (Originally from ..\FSComp.txt:825) static member ilReflectedDefinitionsCannotUseSliceOperator() = (994, GetStringFunc("ilReflectedDefinitionsCannotUseSliceOperator",",,,") ) /// Problem with codepage '%d': %s - /// (Originally from ..\FSComp.txt:825) + /// (Originally from ..\FSComp.txt:826) static member optsProblemWithCodepage(a0 : System.Int32, a1 : System.String) = (1000, GetStringFunc("optsProblemWithCodepage",",,,%d,,,%s,,,") a0 a1) /// Copyright (c) Microsoft Corporation. All Rights Reserved. - /// (Originally from ..\FSComp.txt:826) + /// (Originally from ..\FSComp.txt:827) static member optsCopyright() = (GetStringFunc("optsCopyright",",,,") ) /// Freely distributed under the MIT Open Source License. https://github.com/Microsoft/visualfsharp/blob/master/License.txt - /// (Originally from ..\FSComp.txt:827) + /// (Originally from ..\FSComp.txt:828) static member optsCopyrightCommunity() = (GetStringFunc("optsCopyrightCommunity",",,,") ) /// Name of the output file (Short form: -o) - /// (Originally from ..\FSComp.txt:828) + /// (Originally from ..\FSComp.txt:829) static member optsNameOfOutputFile() = (GetStringFunc("optsNameOfOutputFile",",,,") ) /// Build a console executable - /// (Originally from ..\FSComp.txt:829) + /// (Originally from ..\FSComp.txt:830) static member optsBuildConsole() = (GetStringFunc("optsBuildConsole",",,,") ) /// Build a Windows executable - /// (Originally from ..\FSComp.txt:830) + /// (Originally from ..\FSComp.txt:831) static member optsBuildWindows() = (GetStringFunc("optsBuildWindows",",,,") ) /// Build a library (Short form: -a) - /// (Originally from ..\FSComp.txt:831) + /// (Originally from ..\FSComp.txt:832) static member optsBuildLibrary() = (GetStringFunc("optsBuildLibrary",",,,") ) /// Build a module that can be added to another assembly - /// (Originally from ..\FSComp.txt:832) + /// (Originally from ..\FSComp.txt:833) static member optsBuildModule() = (GetStringFunc("optsBuildModule",",,,") ) /// Delay-sign the assembly using only the public portion of the strong name key - /// (Originally from ..\FSComp.txt:833) + /// (Originally from ..\FSComp.txt:834) static member optsDelaySign() = (GetStringFunc("optsDelaySign",",,,") ) /// Public-sign the assembly using only the public portion of the strong name key, and mark the assembly as signed - /// (Originally from ..\FSComp.txt:834) + /// (Originally from ..\FSComp.txt:835) static member optsPublicSign() = (GetStringFunc("optsPublicSign",",,,") ) /// Write the xmldoc of the assembly to the given file - /// (Originally from ..\FSComp.txt:835) + /// (Originally from ..\FSComp.txt:836) static member optsWriteXml() = (GetStringFunc("optsWriteXml",",,,") ) /// Specify a strong name key file - /// (Originally from ..\FSComp.txt:836) + /// (Originally from ..\FSComp.txt:837) static member optsStrongKeyFile() = (GetStringFunc("optsStrongKeyFile",",,,") ) /// Specify a strong name key container - /// (Originally from ..\FSComp.txt:837) + /// (Originally from ..\FSComp.txt:838) static member optsStrongKeyContainer() = (GetStringFunc("optsStrongKeyContainer",",,,") ) /// Limit which platforms this code can run on: x86, Itanium, x64, anycpu32bitpreferred, or anycpu. The default is anycpu. - /// (Originally from ..\FSComp.txt:838) + /// (Originally from ..\FSComp.txt:839) static member optsPlatform() = (GetStringFunc("optsPlatform",",,,") ) /// Only include optimization information essential for implementing inlined constructs. Inhibits cross-module inlining but improves binary compatibility. - /// (Originally from ..\FSComp.txt:839) + /// (Originally from ..\FSComp.txt:840) static member optsNoOpt() = (GetStringFunc("optsNoOpt",",,,") ) /// Don't add a resource to the generated assembly containing F#-specific metadata - /// (Originally from ..\FSComp.txt:840) + /// (Originally from ..\FSComp.txt:841) static member optsNoInterface() = (GetStringFunc("optsNoInterface",",,,") ) /// Print the inferred interface of the assembly to a file - /// (Originally from ..\FSComp.txt:841) + /// (Originally from ..\FSComp.txt:842) static member optsSig() = (GetStringFunc("optsSig",",,,") ) /// Reference an assembly (Short form: -r) - /// (Originally from ..\FSComp.txt:842) + /// (Originally from ..\FSComp.txt:843) static member optsReference() = (GetStringFunc("optsReference",",,,") ) /// Specify a Win32 resource file (.res) - /// (Originally from ..\FSComp.txt:843) + /// (Originally from ..\FSComp.txt:844) static member optsWin32res() = (GetStringFunc("optsWin32res",",,,") ) /// Specify a Win32 manifest file - /// (Originally from ..\FSComp.txt:844) + /// (Originally from ..\FSComp.txt:845) static member optsWin32manifest() = (GetStringFunc("optsWin32manifest",",,,") ) /// Do not include the default Win32 manifest - /// (Originally from ..\FSComp.txt:845) + /// (Originally from ..\FSComp.txt:846) static member optsNowin32manifest() = (GetStringFunc("optsNowin32manifest",",,,") ) /// Embed all source files in the portable PDB file - /// (Originally from ..\FSComp.txt:846) + /// (Originally from ..\FSComp.txt:847) static member optsEmbedAllSource() = (GetStringFunc("optsEmbedAllSource",",,,") ) /// Embed specific source files in the portable PDB file - /// (Originally from ..\FSComp.txt:847) + /// (Originally from ..\FSComp.txt:848) static member optsEmbedSource() = (GetStringFunc("optsEmbedSource",",,,") ) /// Source link information file to embed in the portable PDB file - /// (Originally from ..\FSComp.txt:848) + /// (Originally from ..\FSComp.txt:849) static member optsSourceLink() = (GetStringFunc("optsSourceLink",",,,") ) /// --embed switch only supported when emitting a Portable PDB (--debug:portable or --debug:embedded) - /// (Originally from ..\FSComp.txt:849) + /// (Originally from ..\FSComp.txt:850) static member optsEmbeddedSourceRequirePortablePDBs() = (1501, GetStringFunc("optsEmbeddedSourceRequirePortablePDBs",",,,") ) /// --sourcelink switch only supported when emitting a Portable PDB (--debug:portable or --debug:embedded) - /// (Originally from ..\FSComp.txt:850) + /// (Originally from ..\FSComp.txt:851) static member optsSourceLinkRequirePortablePDBs() = (1502, GetStringFunc("optsSourceLinkRequirePortablePDBs",",,,") ) /// Source file is too large to embed in a portable PDB - /// (Originally from ..\FSComp.txt:851) + /// (Originally from ..\FSComp.txt:852) static member srcFileTooLarge() = (GetStringFunc("srcFileTooLarge",",,,") ) /// Embed the specified managed resource - /// (Originally from ..\FSComp.txt:852) + /// (Originally from ..\FSComp.txt:853) static member optsResource() = (GetStringFunc("optsResource",",,,") ) /// Link the specified resource to this assembly where the resinfo format is [,[,public|private]] - /// (Originally from ..\FSComp.txt:853) + /// (Originally from ..\FSComp.txt:854) static member optsLinkresource() = (GetStringFunc("optsLinkresource",",,,") ) /// Emit debug information (Short form: -g) - /// (Originally from ..\FSComp.txt:854) + /// (Originally from ..\FSComp.txt:855) static member optsDebugPM() = (GetStringFunc("optsDebugPM",",,,") ) /// Specify debugging type: full, portable, embedded, pdbonly. ('%s' is the default if no debuggging type specified and enables attaching a debugger to a running program, 'portable' is a cross-platform format, 'embedded' is a cross-platform format embedded into the output file). - /// (Originally from ..\FSComp.txt:855) + /// (Originally from ..\FSComp.txt:856) static member optsDebug(a0 : System.String) = (GetStringFunc("optsDebug",",,,%s,,,") a0) /// Enable optimizations (Short form: -O) - /// (Originally from ..\FSComp.txt:856) + /// (Originally from ..\FSComp.txt:857) static member optsOptimize() = (GetStringFunc("optsOptimize",",,,") ) /// Enable or disable tailcalls - /// (Originally from ..\FSComp.txt:857) + /// (Originally from ..\FSComp.txt:858) static member optsTailcalls() = (GetStringFunc("optsTailcalls",",,,") ) /// Produce a deterministic assembly (including module version GUID and timestamp) - /// (Originally from ..\FSComp.txt:858) + /// (Originally from ..\FSComp.txt:859) static member optsDeterministic() = (GetStringFunc("optsDeterministic",",,,") ) /// Enable or disable cross-module optimizations - /// (Originally from ..\FSComp.txt:859) + /// (Originally from ..\FSComp.txt:860) static member optsCrossoptimize() = (GetStringFunc("optsCrossoptimize",",,,") ) /// Report all warnings as errors - /// (Originally from ..\FSComp.txt:860) + /// (Originally from ..\FSComp.txt:861) static member optsWarnaserrorPM() = (GetStringFunc("optsWarnaserrorPM",",,,") ) /// Report specific warnings as errors - /// (Originally from ..\FSComp.txt:861) + /// (Originally from ..\FSComp.txt:862) static member optsWarnaserror() = (GetStringFunc("optsWarnaserror",",,,") ) /// Set a warning level (0-5) - /// (Originally from ..\FSComp.txt:862) + /// (Originally from ..\FSComp.txt:863) static member optsWarn() = (GetStringFunc("optsWarn",",,,") ) /// Disable specific warning messages - /// (Originally from ..\FSComp.txt:863) + /// (Originally from ..\FSComp.txt:864) static member optsNowarn() = (GetStringFunc("optsNowarn",",,,") ) /// Enable specific warnings that may be off by default - /// (Originally from ..\FSComp.txt:864) + /// (Originally from ..\FSComp.txt:865) static member optsWarnOn() = (GetStringFunc("optsWarnOn",",,,") ) /// Generate overflow checks - /// (Originally from ..\FSComp.txt:865) + /// (Originally from ..\FSComp.txt:866) static member optsChecked() = (GetStringFunc("optsChecked",",,,") ) /// Define conditional compilation symbols (Short form: -d) - /// (Originally from ..\FSComp.txt:866) + /// (Originally from ..\FSComp.txt:867) static member optsDefine() = (GetStringFunc("optsDefine",",,,") ) /// Ignore ML compatibility warnings - /// (Originally from ..\FSComp.txt:867) + /// (Originally from ..\FSComp.txt:868) static member optsMlcompatibility() = (GetStringFunc("optsMlcompatibility",",,,") ) /// Suppress compiler copyright message - /// (Originally from ..\FSComp.txt:868) + /// (Originally from ..\FSComp.txt:869) static member optsNologo() = (GetStringFunc("optsNologo",",,,") ) /// Display this usage message (Short form: -?) - /// (Originally from ..\FSComp.txt:869) + /// (Originally from ..\FSComp.txt:870) static member optsHelp() = (GetStringFunc("optsHelp",",,,") ) /// Read response file for more options - /// (Originally from ..\FSComp.txt:870) + /// (Originally from ..\FSComp.txt:871) static member optsResponseFile() = (GetStringFunc("optsResponseFile",",,,") ) /// Specify the codepage used to read source files - /// (Originally from ..\FSComp.txt:871) + /// (Originally from ..\FSComp.txt:872) static member optsCodepage() = (GetStringFunc("optsCodepage",",,,") ) /// Output messages in UTF-8 encoding - /// (Originally from ..\FSComp.txt:872) + /// (Originally from ..\FSComp.txt:873) static member optsUtf8output() = (GetStringFunc("optsUtf8output",",,,") ) /// Output messages with fully qualified paths - /// (Originally from ..\FSComp.txt:873) + /// (Originally from ..\FSComp.txt:874) static member optsFullpaths() = (GetStringFunc("optsFullpaths",",,,") ) /// Specify a directory for the include path which is used to resolve source files and assemblies (Short form: -I) - /// (Originally from ..\FSComp.txt:874) + /// (Originally from ..\FSComp.txt:875) static member optsLib() = (GetStringFunc("optsLib",",,,") ) /// Base address for the library to be built - /// (Originally from ..\FSComp.txt:875) + /// (Originally from ..\FSComp.txt:876) static member optsBaseaddress() = (GetStringFunc("optsBaseaddress",",,,") ) /// Do not reference the default CLI assemblies by default - /// (Originally from ..\FSComp.txt:876) + /// (Originally from ..\FSComp.txt:877) static member optsNoframework() = (GetStringFunc("optsNoframework",",,,") ) /// Statically link the F# library and all referenced DLLs that depend on it into the assembly being generated - /// (Originally from ..\FSComp.txt:877) + /// (Originally from ..\FSComp.txt:878) static member optsStandalone() = (GetStringFunc("optsStandalone",",,,") ) /// Statically link the given assembly and all referenced DLLs that depend on this assembly. Use an assembly name e.g. mylib, not a DLL name. - /// (Originally from ..\FSComp.txt:878) + /// (Originally from ..\FSComp.txt:879) static member optsStaticlink() = (GetStringFunc("optsStaticlink",",,,") ) /// Use a resident background compilation service to improve compiler startup times. - /// (Originally from ..\FSComp.txt:879) + /// (Originally from ..\FSComp.txt:880) static member optsResident() = (GetStringFunc("optsResident",",,,") ) /// Name the output debug file - /// (Originally from ..\FSComp.txt:880) + /// (Originally from ..\FSComp.txt:881) static member optsPdb() = (GetStringFunc("optsPdb",",,,") ) /// Resolve assembly references using directory-based rules rather than MSBuild resolution - /// (Originally from ..\FSComp.txt:881) + /// (Originally from ..\FSComp.txt:882) static member optsSimpleresolution() = (GetStringFunc("optsSimpleresolution",",,,") ) /// Unrecognized target '%s', expected 'exe', 'winexe', 'library' or 'module' - /// (Originally from ..\FSComp.txt:882) + /// (Originally from ..\FSComp.txt:883) static member optsUnrecognizedTarget(a0 : System.String) = (1048, GetStringFunc("optsUnrecognizedTarget",",,,%s,,,") a0) /// Unrecognized debug type '%s', expected 'pdbonly' or 'full' - /// (Originally from ..\FSComp.txt:883) + /// (Originally from ..\FSComp.txt:884) static member optsUnrecognizedDebugType(a0 : System.String) = (1049, GetStringFunc("optsUnrecognizedDebugType",",,,%s,,,") a0) /// Invalid warning level '%d' - /// (Originally from ..\FSComp.txt:884) + /// (Originally from ..\FSComp.txt:885) static member optsInvalidWarningLevel(a0 : System.Int32) = (1050, GetStringFunc("optsInvalidWarningLevel",",,,%d,,,") a0) /// Short form of '%s' - /// (Originally from ..\FSComp.txt:885) + /// (Originally from ..\FSComp.txt:886) static member optsShortFormOf(a0 : System.String) = (GetStringFunc("optsShortFormOf",",,,%s,,,") a0) /// The command-line option '--cliroot' has been deprecated. Use an explicit reference to a specific copy of mscorlib.dll instead. - /// (Originally from ..\FSComp.txt:886) + /// (Originally from ..\FSComp.txt:887) static member optsClirootDeprecatedMsg() = (GetStringFunc("optsClirootDeprecatedMsg",",,,") ) /// Use to override where the compiler looks for mscorlib.dll and framework components - /// (Originally from ..\FSComp.txt:887) + /// (Originally from ..\FSComp.txt:888) static member optsClirootDescription() = (GetStringFunc("optsClirootDescription",",,,") ) /// - OUTPUT FILES - - /// (Originally from ..\FSComp.txt:888) + /// (Originally from ..\FSComp.txt:889) static member optsHelpBannerOutputFiles() = (GetStringFunc("optsHelpBannerOutputFiles",",,,") ) /// - INPUT FILES - - /// (Originally from ..\FSComp.txt:889) + /// (Originally from ..\FSComp.txt:890) static member optsHelpBannerInputFiles() = (GetStringFunc("optsHelpBannerInputFiles",",,,") ) /// - RESOURCES - - /// (Originally from ..\FSComp.txt:890) + /// (Originally from ..\FSComp.txt:891) static member optsHelpBannerResources() = (GetStringFunc("optsHelpBannerResources",",,,") ) /// - CODE GENERATION - - /// (Originally from ..\FSComp.txt:891) + /// (Originally from ..\FSComp.txt:892) static member optsHelpBannerCodeGen() = (GetStringFunc("optsHelpBannerCodeGen",",,,") ) /// - ADVANCED - - /// (Originally from ..\FSComp.txt:892) + /// (Originally from ..\FSComp.txt:893) static member optsHelpBannerAdvanced() = (GetStringFunc("optsHelpBannerAdvanced",",,,") ) /// - MISCELLANEOUS - - /// (Originally from ..\FSComp.txt:893) + /// (Originally from ..\FSComp.txt:894) static member optsHelpBannerMisc() = (GetStringFunc("optsHelpBannerMisc",",,,") ) /// - LANGUAGE - - /// (Originally from ..\FSComp.txt:894) + /// (Originally from ..\FSComp.txt:895) static member optsHelpBannerLanguage() = (GetStringFunc("optsHelpBannerLanguage",",,,") ) /// - ERRORS AND WARNINGS - - /// (Originally from ..\FSComp.txt:895) + /// (Originally from ..\FSComp.txt:896) static member optsHelpBannerErrsAndWarns() = (GetStringFunc("optsHelpBannerErrsAndWarns",",,,") ) /// Unknown --test argument: '%s' - /// (Originally from ..\FSComp.txt:896) + /// (Originally from ..\FSComp.txt:897) static member optsUnknownArgumentToTheTestSwitch(a0 : System.String) = (1063, GetStringFunc("optsUnknownArgumentToTheTestSwitch",",,,%s,,,") a0) /// Unrecognized platform '%s', valid values are 'x86', 'x64', 'Itanium', 'anycpu32bitpreferred', and 'anycpu' - /// (Originally from ..\FSComp.txt:897) + /// (Originally from ..\FSComp.txt:898) static member optsUnknownPlatform(a0 : System.String) = (1064, GetStringFunc("optsUnknownPlatform",",,,%s,,,") a0) /// The command-line option '%s' is for test purposes only - /// (Originally from ..\FSComp.txt:898) + /// (Originally from ..\FSComp.txt:899) static member optsInternalNoDescription(a0 : System.String) = (GetStringFunc("optsInternalNoDescription",",,,%s,,,") a0) /// The command-line option '%s' has been deprecated - /// (Originally from ..\FSComp.txt:899) + /// (Originally from ..\FSComp.txt:900) static member optsDCLONoDescription(a0 : System.String) = (GetStringFunc("optsDCLONoDescription",",,,%s,,,") a0) /// The command-line option '%s' has been deprecated. Use '%s' instead. - /// (Originally from ..\FSComp.txt:900) + /// (Originally from ..\FSComp.txt:901) static member optsDCLODeprecatedSuggestAlternative(a0 : System.String, a1 : System.String) = (GetStringFunc("optsDCLODeprecatedSuggestAlternative",",,,%s,,,%s,,,") a0 a1) /// The command-line option '%s' has been deprecated. HTML document generation is now part of the F# Power Pack, via the tool FsHtmlDoc.exe. - /// (Originally from ..\FSComp.txt:901) + /// (Originally from ..\FSComp.txt:902) static member optsDCLOHtmlDoc(a0 : System.String) = (GetStringFunc("optsDCLOHtmlDoc",",,,%s,,,") a0) /// Output warning and error messages in color - /// (Originally from ..\FSComp.txt:902) + /// (Originally from ..\FSComp.txt:903) static member optsConsoleColors() = (GetStringFunc("optsConsoleColors",",,,") ) /// Enable high-entropy ASLR - /// (Originally from ..\FSComp.txt:903) + /// (Originally from ..\FSComp.txt:904) static member optsUseHighEntropyVA() = (GetStringFunc("optsUseHighEntropyVA",",,,") ) /// Specify subsystem version of this assembly - /// (Originally from ..\FSComp.txt:904) + /// (Originally from ..\FSComp.txt:905) static member optsSubSystemVersion() = (GetStringFunc("optsSubSystemVersion",",,,") ) /// Specify target framework profile of this assembly. Valid values are mscorlib, netcore or netstandard. Default - mscorlib - /// (Originally from ..\FSComp.txt:905) + /// (Originally from ..\FSComp.txt:906) static member optsTargetProfile() = (GetStringFunc("optsTargetProfile",",,,") ) /// Emit debug information in quotations - /// (Originally from ..\FSComp.txt:906) + /// (Originally from ..\FSComp.txt:907) static member optsEmitDebugInfoInQuotations() = (GetStringFunc("optsEmitDebugInfoInQuotations",",,,") ) /// Specify the preferred output language culture name (e.g. es-ES, ja-JP) - /// (Originally from ..\FSComp.txt:907) + /// (Originally from ..\FSComp.txt:908) static member optsPreferredUiLang() = (GetStringFunc("optsPreferredUiLang",",,,") ) /// Don't copy FSharp.Core.dll along the produced binaries - /// (Originally from ..\FSComp.txt:908) + /// (Originally from ..\FSComp.txt:909) static member optsNoCopyFsharpCore() = (GetStringFunc("optsNoCopyFsharpCore",",,,") ) /// Invalid version '%s' for '--subsystemversion'. The version must be 4.00 or greater. - /// (Originally from ..\FSComp.txt:909) + /// (Originally from ..\FSComp.txt:910) static member optsInvalidSubSystemVersion(a0 : System.String) = (1051, GetStringFunc("optsInvalidSubSystemVersion",",,,%s,,,") a0) /// Invalid value '%s' for '--targetprofile', valid values are 'mscorlib', 'netcore' or 'netstandard'. - /// (Originally from ..\FSComp.txt:910) + /// (Originally from ..\FSComp.txt:911) static member optsInvalidTargetProfile(a0 : System.String) = (1052, GetStringFunc("optsInvalidTargetProfile",",,,%s,,,") a0) /// Full name - /// (Originally from ..\FSComp.txt:911) + /// (Originally from ..\FSComp.txt:912) static member typeInfoFullName() = (GetStringFunc("typeInfoFullName",",,,") ) /// and %d other overloads - /// (Originally from ..\FSComp.txt:915) + /// (Originally from ..\FSComp.txt:916) static member typeInfoOtherOverloads(a0 : System.Int32) = (GetStringFunc("typeInfoOtherOverloads",",,,%d,,,") a0) /// union case - /// (Originally from ..\FSComp.txt:916) + /// (Originally from ..\FSComp.txt:917) static member typeInfoUnionCase() = (GetStringFunc("typeInfoUnionCase",",,,") ) /// active pattern result - /// (Originally from ..\FSComp.txt:917) + /// (Originally from ..\FSComp.txt:918) static member typeInfoActivePatternResult() = (GetStringFunc("typeInfoActivePatternResult",",,,") ) /// active recognizer - /// (Originally from ..\FSComp.txt:918) + /// (Originally from ..\FSComp.txt:919) static member typeInfoActiveRecognizer() = (GetStringFunc("typeInfoActiveRecognizer",",,,") ) /// field - /// (Originally from ..\FSComp.txt:919) + /// (Originally from ..\FSComp.txt:920) static member typeInfoField() = (GetStringFunc("typeInfoField",",,,") ) /// event - /// (Originally from ..\FSComp.txt:920) + /// (Originally from ..\FSComp.txt:921) static member typeInfoEvent() = (GetStringFunc("typeInfoEvent",",,,") ) /// property - /// (Originally from ..\FSComp.txt:921) + /// (Originally from ..\FSComp.txt:922) static member typeInfoProperty() = (GetStringFunc("typeInfoProperty",",,,") ) /// extension - /// (Originally from ..\FSComp.txt:922) + /// (Originally from ..\FSComp.txt:923) static member typeInfoExtension() = (GetStringFunc("typeInfoExtension",",,,") ) /// custom operation - /// (Originally from ..\FSComp.txt:923) + /// (Originally from ..\FSComp.txt:924) static member typeInfoCustomOperation() = (GetStringFunc("typeInfoCustomOperation",",,,") ) /// argument - /// (Originally from ..\FSComp.txt:924) + /// (Originally from ..\FSComp.txt:925) static member typeInfoArgument() = (GetStringFunc("typeInfoArgument",",,,") ) + /// anonymous record field + /// (Originally from ..\FSComp.txt:926) + static member typeInfoAnonRecdField() = (GetStringFunc("typeInfoAnonRecdField",",,,") ) /// patvar - /// (Originally from ..\FSComp.txt:925) + /// (Originally from ..\FSComp.txt:927) static member typeInfoPatternVariable() = (GetStringFunc("typeInfoPatternVariable",",,,") ) /// namespace - /// (Originally from ..\FSComp.txt:926) + /// (Originally from ..\FSComp.txt:928) static member typeInfoNamespace() = (GetStringFunc("typeInfoNamespace",",,,") ) /// module - /// (Originally from ..\FSComp.txt:927) + /// (Originally from ..\FSComp.txt:929) static member typeInfoModule() = (GetStringFunc("typeInfoModule",",,,") ) /// namespace/module - /// (Originally from ..\FSComp.txt:928) + /// (Originally from ..\FSComp.txt:930) static member typeInfoNamespaceOrModule() = (GetStringFunc("typeInfoNamespaceOrModule",",,,") ) /// from %s - /// (Originally from ..\FSComp.txt:929) + /// (Originally from ..\FSComp.txt:931) static member typeInfoFromFirst(a0 : System.String) = (GetStringFunc("typeInfoFromFirst",",,,%s,,,") a0) /// also from %s - /// (Originally from ..\FSComp.txt:930) + /// (Originally from ..\FSComp.txt:932) static member typeInfoFromNext(a0 : System.String) = (GetStringFunc("typeInfoFromNext",",,,%s,,,") a0) /// generated property - /// (Originally from ..\FSComp.txt:931) + /// (Originally from ..\FSComp.txt:933) static member typeInfoGeneratedProperty() = (GetStringFunc("typeInfoGeneratedProperty",",,,") ) /// generated type - /// (Originally from ..\FSComp.txt:932) + /// (Originally from ..\FSComp.txt:934) static member typeInfoGeneratedType() = (GetStringFunc("typeInfoGeneratedType",",,,") ) /// Found by AssemblyFolders registry key - /// (Originally from ..\FSComp.txt:933) + /// (Originally from ..\FSComp.txt:935) static member assemblyResolutionFoundByAssemblyFoldersKey() = (GetStringFunc("assemblyResolutionFoundByAssemblyFoldersKey",",,,") ) /// Found by AssemblyFoldersEx registry key - /// (Originally from ..\FSComp.txt:934) + /// (Originally from ..\FSComp.txt:936) static member assemblyResolutionFoundByAssemblyFoldersExKey() = (GetStringFunc("assemblyResolutionFoundByAssemblyFoldersExKey",",,,") ) /// .NET Framework - /// (Originally from ..\FSComp.txt:935) + /// (Originally from ..\FSComp.txt:937) static member assemblyResolutionNetFramework() = (GetStringFunc("assemblyResolutionNetFramework",",,,") ) /// Global Assembly Cache - /// (Originally from ..\FSComp.txt:936) + /// (Originally from ..\FSComp.txt:938) static member assemblyResolutionGAC() = (GetStringFunc("assemblyResolutionGAC",",,,") ) /// Recursive class hierarchy in type '%s' - /// (Originally from ..\FSComp.txt:937) + /// (Originally from ..\FSComp.txt:939) static member recursiveClassHierarchy(a0 : System.String) = (1089, GetStringFunc("recursiveClassHierarchy",",,,%s,,,") a0) /// Invalid recursive reference to an abstract slot - /// (Originally from ..\FSComp.txt:938) + /// (Originally from ..\FSComp.txt:940) static member InvalidRecursiveReferenceToAbstractSlot() = (1090, GetStringFunc("InvalidRecursiveReferenceToAbstractSlot",",,,") ) /// The event '%s' has a non-standard type. If this event is declared in another CLI language, you may need to access this event using the explicit %s and %s methods for the event. If this event is declared in F#, make the type of the event an instantiation of either 'IDelegateEvent<_>' or 'IEvent<_,_>'. - /// (Originally from ..\FSComp.txt:939) + /// (Originally from ..\FSComp.txt:941) static member eventHasNonStandardType(a0 : System.String, a1 : System.String, a2 : System.String) = (1091, GetStringFunc("eventHasNonStandardType",",,,%s,,,%s,,,%s,,,") a0 a1 a2) /// The type '%s' is not accessible from this code location - /// (Originally from ..\FSComp.txt:940) + /// (Originally from ..\FSComp.txt:942) static member typeIsNotAccessible(a0 : System.String) = (1092, GetStringFunc("typeIsNotAccessible",",,,%s,,,") a0) /// The union cases or fields of the type '%s' are not accessible from this code location - /// (Originally from ..\FSComp.txt:941) + /// (Originally from ..\FSComp.txt:943) static member unionCasesAreNotAccessible(a0 : System.String) = (1093, GetStringFunc("unionCasesAreNotAccessible",",,,%s,,,") a0) /// The value '%s' is not accessible from this code location - /// (Originally from ..\FSComp.txt:942) + /// (Originally from ..\FSComp.txt:944) static member valueIsNotAccessible(a0 : System.String) = (1094, GetStringFunc("valueIsNotAccessible",",,,%s,,,") a0) /// The union case '%s' is not accessible from this code location - /// (Originally from ..\FSComp.txt:943) + /// (Originally from ..\FSComp.txt:945) static member unionCaseIsNotAccessible(a0 : System.String) = (1095, GetStringFunc("unionCaseIsNotAccessible",",,,%s,,,") a0) /// The record, struct or class field '%s' is not accessible from this code location - /// (Originally from ..\FSComp.txt:944) + /// (Originally from ..\FSComp.txt:946) static member fieldIsNotAccessible(a0 : System.String) = (1096, GetStringFunc("fieldIsNotAccessible",",,,%s,,,") a0) /// The struct or class field '%s' is not accessible from this code location - /// (Originally from ..\FSComp.txt:945) + /// (Originally from ..\FSComp.txt:947) static member structOrClassFieldIsNotAccessible(a0 : System.String) = (1097, GetStringFunc("structOrClassFieldIsNotAccessible",",,,%s,,,") a0) /// This construct is experimental - /// (Originally from ..\FSComp.txt:946) + /// (Originally from ..\FSComp.txt:948) static member experimentalConstruct() = (GetStringFunc("experimentalConstruct",",,,") ) /// No Invoke methods found for delegate type - /// (Originally from ..\FSComp.txt:947) + /// (Originally from ..\FSComp.txt:949) static member noInvokeMethodsFound() = (1099, GetStringFunc("noInvokeMethodsFound",",,,") ) /// More than one Invoke method found for delegate type - /// (Originally from ..\FSComp.txt:948) + /// (Originally from ..\FSComp.txt:950) static member moreThanOneInvokeMethodFound() = (GetStringFunc("moreThanOneInvokeMethodFound",",,,") ) /// Delegates are not allowed to have curried signatures - /// (Originally from ..\FSComp.txt:949) + /// (Originally from ..\FSComp.txt:951) static member delegatesNotAllowedToHaveCurriedSignatures() = (1101, GetStringFunc("delegatesNotAllowedToHaveCurriedSignatures",",,,") ) /// Unexpected Expr.TyChoose - /// (Originally from ..\FSComp.txt:950) + /// (Originally from ..\FSComp.txt:952) static member tlrUnexpectedTExpr() = (1102, GetStringFunc("tlrUnexpectedTExpr",",,,") ) /// Note: Lambda-lifting optimizations have not been applied because of the use of this local constrained generic function as a first class value. Adding type constraints may resolve this condition. - /// (Originally from ..\FSComp.txt:951) + /// (Originally from ..\FSComp.txt:953) static member tlrLambdaLiftingOptimizationsNotApplied() = (1103, GetStringFunc("tlrLambdaLiftingOptimizationsNotApplied",",,,") ) /// Identifiers containing '@' are reserved for use in F# code generation - /// (Originally from ..\FSComp.txt:952) + /// (Originally from ..\FSComp.txt:954) static member lexhlpIdentifiersContainingAtSymbolReserved() = (1104, GetStringFunc("lexhlpIdentifiersContainingAtSymbolReserved",",,,") ) /// The identifier '%s' is reserved for future use by F# - /// (Originally from ..\FSComp.txt:953) + /// (Originally from ..\FSComp.txt:955) static member lexhlpIdentifierReserved(a0 : System.String) = (GetStringFunc("lexhlpIdentifierReserved",",,,%s,,,") a0) /// Missing variable '%s' - /// (Originally from ..\FSComp.txt:954) + /// (Originally from ..\FSComp.txt:956) static member patcMissingVariable(a0 : System.String) = (1106, GetStringFunc("patcMissingVariable",",,,%s,,,") a0) /// Partial active patterns may only generate one result - /// (Originally from ..\FSComp.txt:955) + /// (Originally from ..\FSComp.txt:957) static member patcPartialActivePatternsGenerateOneResult() = (1107, GetStringFunc("patcPartialActivePatternsGenerateOneResult",",,,") ) /// The type '%s' is required here and is unavailable. You must add a reference to assembly '%s'. - /// (Originally from ..\FSComp.txt:956) + /// (Originally from ..\FSComp.txt:958) static member impTypeRequiredUnavailable(a0 : System.String, a1 : System.String) = (1108, GetStringFunc("impTypeRequiredUnavailable",",,,%s,,,%s,,,") a0 a1) /// A reference to the type '%s' in assembly '%s' was found, but the type could not be found in that assembly - /// (Originally from ..\FSComp.txt:957) + /// (Originally from ..\FSComp.txt:959) static member impReferencedTypeCouldNotBeFoundInAssembly(a0 : System.String, a1 : System.String) = (1109, GetStringFunc("impReferencedTypeCouldNotBeFoundInAssembly",",,,%s,,,%s,,,") a0 a1) /// Internal error or badly formed metadata: not enough type parameters were in scope while importing - /// (Originally from ..\FSComp.txt:958) + /// (Originally from ..\FSComp.txt:960) static member impNotEnoughTypeParamsInScopeWhileImporting() = (1110, GetStringFunc("impNotEnoughTypeParamsInScopeWhileImporting",",,,") ) /// A reference to the DLL %s is required by assembly %s. The imported type %s is located in the first assembly and could not be resolved. - /// (Originally from ..\FSComp.txt:959) + /// (Originally from ..\FSComp.txt:961) static member impReferenceToDllRequiredByAssembly(a0 : System.String, a1 : System.String, a2 : System.String) = (1111, GetStringFunc("impReferenceToDllRequiredByAssembly",",,,%s,,,%s,,,%s,,,") a0 a1 a2) /// An imported assembly uses the type '%s' but that type is not public - /// (Originally from ..\FSComp.txt:960) + /// (Originally from ..\FSComp.txt:962) static member impImportedAssemblyUsesNotPublicType(a0 : System.String) = (1112, GetStringFunc("impImportedAssemblyUsesNotPublicType",",,,%s,,,") a0) /// The value '%s' was marked inline but its implementation makes use of an internal or private function which is not sufficiently accessible - /// (Originally from ..\FSComp.txt:961) + /// (Originally from ..\FSComp.txt:963) static member optValueMarkedInlineButIncomplete(a0 : System.String) = (1113, GetStringFunc("optValueMarkedInlineButIncomplete",",,,%s,,,") a0) /// The value '%s' was marked inline but was not bound in the optimization environment - /// (Originally from ..\FSComp.txt:962) + /// (Originally from ..\FSComp.txt:964) static member optValueMarkedInlineButWasNotBoundInTheOptEnv(a0 : System.String) = (1114, GetStringFunc("optValueMarkedInlineButWasNotBoundInTheOptEnv",",,,%s,,,") a0) /// Local value %s not found during optimization - /// (Originally from ..\FSComp.txt:963) + /// (Originally from ..\FSComp.txt:965) static member optLocalValueNotFoundDuringOptimization(a0 : System.String) = (1115, GetStringFunc("optLocalValueNotFoundDuringOptimization",",,,%s,,,") a0) /// A value marked as 'inline' has an unexpected value - /// (Originally from ..\FSComp.txt:964) + /// (Originally from ..\FSComp.txt:966) static member optValueMarkedInlineHasUnexpectedValue() = (1116, GetStringFunc("optValueMarkedInlineHasUnexpectedValue",",,,") ) /// A value marked as 'inline' could not be inlined - /// (Originally from ..\FSComp.txt:965) + /// (Originally from ..\FSComp.txt:967) static member optValueMarkedInlineCouldNotBeInlined() = (1117, GetStringFunc("optValueMarkedInlineCouldNotBeInlined",",,,") ) /// Failed to inline the value '%s' marked 'inline', perhaps because a recursive value was marked 'inline' - /// (Originally from ..\FSComp.txt:966) + /// (Originally from ..\FSComp.txt:968) static member optFailedToInlineValue(a0 : System.String) = (1118, GetStringFunc("optFailedToInlineValue",",,,%s,,,") a0) /// Recursive ValValue %s - /// (Originally from ..\FSComp.txt:967) + /// (Originally from ..\FSComp.txt:969) static member optRecursiveValValue(a0 : System.String) = (1119, GetStringFunc("optRecursiveValValue",",,,%s,,,") a0) /// The indentation of this 'in' token is incorrect with respect to the corresponding 'let' - /// (Originally from ..\FSComp.txt:968) + /// (Originally from ..\FSComp.txt:970) static member lexfltIncorrentIndentationOfIn() = (GetStringFunc("lexfltIncorrentIndentationOfIn",",,,") ) /// Possible incorrect indentation: this token is offside of context started at position %s. Try indenting this token further or using standard formatting conventions. - /// (Originally from ..\FSComp.txt:969) + /// (Originally from ..\FSComp.txt:971) static member lexfltTokenIsOffsideOfContextStartedEarlier(a0 : System.String) = (GetStringFunc("lexfltTokenIsOffsideOfContextStartedEarlier",",,,%s,,,") a0) /// The '|' tokens separating rules of this pattern match are misaligned by one column. Consider realigning your code or using further indentation. - /// (Originally from ..\FSComp.txt:970) + /// (Originally from ..\FSComp.txt:972) static member lexfltSeparatorTokensOfPatternMatchMisaligned() = (GetStringFunc("lexfltSeparatorTokensOfPatternMatchMisaligned",",,,") ) /// Invalid module/expression/type - /// (Originally from ..\FSComp.txt:971) + /// (Originally from ..\FSComp.txt:973) static member nrInvalidModuleExprType() = (1123, GetStringFunc("nrInvalidModuleExprType",",,,") ) /// Multiple types exist called '%s', taking different numbers of generic parameters. Provide a type instantiation to disambiguate the type resolution, e.g. '%s'. - /// (Originally from ..\FSComp.txt:972) + /// (Originally from ..\FSComp.txt:974) static member nrTypeInstantiationNeededToDisambiguateTypesWithSameName(a0 : System.String, a1 : System.String) = (1124, GetStringFunc("nrTypeInstantiationNeededToDisambiguateTypesWithSameName",",,,%s,,,%s,,,") a0 a1) /// The instantiation of the generic type '%s' is missing and can't be inferred from the arguments or return type of this member. Consider providing a type instantiation when accessing this type, e.g. '%s'. - /// (Originally from ..\FSComp.txt:973) + /// (Originally from ..\FSComp.txt:975) static member nrTypeInstantiationIsMissingAndCouldNotBeInferred(a0 : System.String, a1 : System.String) = (1125, GetStringFunc("nrTypeInstantiationIsMissingAndCouldNotBeInferred",",,,%s,,,%s,,,") a0 a1) /// 'global' may only be used as the first name in a qualified path - /// (Originally from ..\FSComp.txt:974) + /// (Originally from ..\FSComp.txt:976) static member nrGlobalUsedOnlyAsFirstName() = (1126, GetStringFunc("nrGlobalUsedOnlyAsFirstName",",,,") ) /// This is not a constructor or literal, or a constructor is being used incorrectly - /// (Originally from ..\FSComp.txt:975) + /// (Originally from ..\FSComp.txt:977) static member nrIsNotConstructorOrLiteral() = (1127, GetStringFunc("nrIsNotConstructorOrLiteral",",,,") ) /// Unexpected empty long identifier - /// (Originally from ..\FSComp.txt:976) + /// (Originally from ..\FSComp.txt:978) static member nrUnexpectedEmptyLongId() = (1128, GetStringFunc("nrUnexpectedEmptyLongId",",,,") ) /// The record type '%s' does not contain a label '%s'. - /// (Originally from ..\FSComp.txt:977) + /// (Originally from ..\FSComp.txt:979) static member nrRecordDoesNotContainSuchLabel(a0 : System.String, a1 : System.String) = (1129, GetStringFunc("nrRecordDoesNotContainSuchLabel",",,,%s,,,%s,,,") a0 a1) /// Invalid field label - /// (Originally from ..\FSComp.txt:978) + /// (Originally from ..\FSComp.txt:980) static member nrInvalidFieldLabel() = (1130, GetStringFunc("nrInvalidFieldLabel",",,,") ) /// Invalid expression '%s' - /// (Originally from ..\FSComp.txt:979) + /// (Originally from ..\FSComp.txt:981) static member nrInvalidExpression(a0 : System.String) = (1132, GetStringFunc("nrInvalidExpression",",,,%s,,,") a0) /// No constructors are available for the type '%s' - /// (Originally from ..\FSComp.txt:980) + /// (Originally from ..\FSComp.txt:982) static member nrNoConstructorsAvailableForType(a0 : System.String) = (1133, GetStringFunc("nrNoConstructorsAvailableForType",",,,%s,,,") a0) /// The union type for union case '%s' was defined with the RequireQualifiedAccessAttribute. Include the name of the union type ('%s') in the name you are using. - /// (Originally from ..\FSComp.txt:981) + /// (Originally from ..\FSComp.txt:983) static member nrUnionTypeNeedsQualifiedAccess(a0 : System.String, a1 : System.String) = (1134, GetStringFunc("nrUnionTypeNeedsQualifiedAccess",",,,%s,,,%s,,,") a0 a1) /// The record type for the record field '%s' was defined with the RequireQualifiedAccessAttribute. Include the name of the record type ('%s') in the name you are using. - /// (Originally from ..\FSComp.txt:982) + /// (Originally from ..\FSComp.txt:984) static member nrRecordTypeNeedsQualifiedAccess(a0 : System.String, a1 : System.String) = (1135, GetStringFunc("nrRecordTypeNeedsQualifiedAccess",",,,%s,,,%s,,,") a0 a1) /// Unexpected error creating debug information file '%s' - /// (Originally from ..\FSComp.txt:983) + /// (Originally from ..\FSComp.txt:985) static member ilwriteErrorCreatingPdb(a0 : System.String) = (1136, GetStringFunc("ilwriteErrorCreatingPdb",",,,%s,,,") a0) /// This number is outside the allowable range for this integer type - /// (Originally from ..\FSComp.txt:984) + /// (Originally from ..\FSComp.txt:986) static member lexOutsideIntegerRange() = (1138, GetStringFunc("lexOutsideIntegerRange",",,,") ) /// '%s' is not permitted as a character in operator names and is reserved for future use - /// (Originally from ..\FSComp.txt:988) + /// (Originally from ..\FSComp.txt:990) static member lexCharNotAllowedInOperatorNames(a0 : System.String) = (GetStringFunc("lexCharNotAllowedInOperatorNames",",,,%s,,,") a0) /// Unexpected character '%s' - /// (Originally from ..\FSComp.txt:989) + /// (Originally from ..\FSComp.txt:991) static member lexUnexpectedChar(a0 : System.String) = (GetStringFunc("lexUnexpectedChar",",,,%s,,,") a0) /// This byte array literal contains characters that do not encode as a single byte - /// (Originally from ..\FSComp.txt:990) + /// (Originally from ..\FSComp.txt:992) static member lexByteArrayCannotEncode() = (1140, GetStringFunc("lexByteArrayCannotEncode",",,,") ) /// Identifiers followed by '%s' are reserved for future use - /// (Originally from ..\FSComp.txt:991) + /// (Originally from ..\FSComp.txt:993) static member lexIdentEndInMarkReserved(a0 : System.String) = (1141, GetStringFunc("lexIdentEndInMarkReserved",",,,%s,,,") a0) /// This number is outside the allowable range for 8-bit signed integers - /// (Originally from ..\FSComp.txt:992) + /// (Originally from ..\FSComp.txt:994) static member lexOutsideEightBitSigned() = (1142, GetStringFunc("lexOutsideEightBitSigned",",,,") ) /// This number is outside the allowable range for hexadecimal 8-bit signed integers - /// (Originally from ..\FSComp.txt:993) + /// (Originally from ..\FSComp.txt:995) static member lexOutsideEightBitSignedHex() = (1143, GetStringFunc("lexOutsideEightBitSignedHex",",,,") ) /// This number is outside the allowable range for 8-bit unsigned integers - /// (Originally from ..\FSComp.txt:994) + /// (Originally from ..\FSComp.txt:996) static member lexOutsideEightBitUnsigned() = (1144, GetStringFunc("lexOutsideEightBitUnsigned",",,,") ) /// This number is outside the allowable range for 16-bit signed integers - /// (Originally from ..\FSComp.txt:995) + /// (Originally from ..\FSComp.txt:997) static member lexOutsideSixteenBitSigned() = (1145, GetStringFunc("lexOutsideSixteenBitSigned",",,,") ) /// This number is outside the allowable range for 16-bit unsigned integers - /// (Originally from ..\FSComp.txt:996) + /// (Originally from ..\FSComp.txt:998) static member lexOutsideSixteenBitUnsigned() = (1146, GetStringFunc("lexOutsideSixteenBitUnsigned",",,,") ) /// This number is outside the allowable range for 32-bit signed integers - /// (Originally from ..\FSComp.txt:997) + /// (Originally from ..\FSComp.txt:999) static member lexOutsideThirtyTwoBitSigned() = (1147, GetStringFunc("lexOutsideThirtyTwoBitSigned",",,,") ) /// This number is outside the allowable range for 32-bit unsigned integers - /// (Originally from ..\FSComp.txt:998) + /// (Originally from ..\FSComp.txt:1000) static member lexOutsideThirtyTwoBitUnsigned() = (1148, GetStringFunc("lexOutsideThirtyTwoBitUnsigned",",,,") ) /// This number is outside the allowable range for 64-bit signed integers - /// (Originally from ..\FSComp.txt:999) + /// (Originally from ..\FSComp.txt:1001) static member lexOutsideSixtyFourBitSigned() = (1149, GetStringFunc("lexOutsideSixtyFourBitSigned",",,,") ) /// This number is outside the allowable range for 64-bit unsigned integers - /// (Originally from ..\FSComp.txt:1000) + /// (Originally from ..\FSComp.txt:1002) static member lexOutsideSixtyFourBitUnsigned() = (1150, GetStringFunc("lexOutsideSixtyFourBitUnsigned",",,,") ) /// This number is outside the allowable range for signed native integers - /// (Originally from ..\FSComp.txt:1001) + /// (Originally from ..\FSComp.txt:1003) static member lexOutsideNativeSigned() = (1151, GetStringFunc("lexOutsideNativeSigned",",,,") ) /// This number is outside the allowable range for unsigned native integers - /// (Originally from ..\FSComp.txt:1002) + /// (Originally from ..\FSComp.txt:1004) static member lexOutsideNativeUnsigned() = (1152, GetStringFunc("lexOutsideNativeUnsigned",",,,") ) /// Invalid floating point number - /// (Originally from ..\FSComp.txt:1003) + /// (Originally from ..\FSComp.txt:1005) static member lexInvalidFloat() = (1153, GetStringFunc("lexInvalidFloat",",,,") ) /// This number is outside the allowable range for decimal literals - /// (Originally from ..\FSComp.txt:1004) + /// (Originally from ..\FSComp.txt:1006) static member lexOusideDecimal() = (1154, GetStringFunc("lexOusideDecimal",",,,") ) /// This number is outside the allowable range for 32-bit floats - /// (Originally from ..\FSComp.txt:1005) + /// (Originally from ..\FSComp.txt:1007) static member lexOusideThirtyTwoBitFloat() = (1155, GetStringFunc("lexOusideThirtyTwoBitFloat",",,,") ) /// This is not a valid numeric literal. Valid numeric literals include 1, 0x1, 0b0001 (int), 1u (uint32), 1L (int64), 1UL (uint64), 1s (int16), 1y (sbyte), 1uy (byte), 1.0 (float), 1.0f (float32), 1.0m (decimal), 1I (BigInteger). - /// (Originally from ..\FSComp.txt:1006) + /// (Originally from ..\FSComp.txt:1008) static member lexInvalidNumericLiteral() = (1156, GetStringFunc("lexInvalidNumericLiteral",",,,") ) /// This is not a valid byte literal - /// (Originally from ..\FSComp.txt:1007) + /// (Originally from ..\FSComp.txt:1009) static member lexInvalidByteLiteral() = (1157, GetStringFunc("lexInvalidByteLiteral",",,,") ) /// This is not a valid character literal - /// (Originally from ..\FSComp.txt:1008) + /// (Originally from ..\FSComp.txt:1010) static member lexInvalidCharLiteral() = (1158, GetStringFunc("lexInvalidCharLiteral",",,,") ) /// This Unicode encoding is only valid in string literals - /// (Originally from ..\FSComp.txt:1009) + /// (Originally from ..\FSComp.txt:1011) static member lexThisUnicodeOnlyInStringLiterals() = (1159, GetStringFunc("lexThisUnicodeOnlyInStringLiterals",",,,") ) /// This token is reserved for future use - /// (Originally from ..\FSComp.txt:1010) + /// (Originally from ..\FSComp.txt:1012) static member lexTokenReserved() = (1160, GetStringFunc("lexTokenReserved",",,,") ) /// TABs are not allowed in F# code unless the #indent \"off\" option is used - /// (Originally from ..\FSComp.txt:1011) + /// (Originally from ..\FSComp.txt:1013) static member lexTabsNotAllowed() = (1161, GetStringFunc("lexTabsNotAllowed",",,,") ) /// Invalid line number: '%s' - /// (Originally from ..\FSComp.txt:1012) + /// (Originally from ..\FSComp.txt:1014) static member lexInvalidLineNumber(a0 : System.String) = (1162, GetStringFunc("lexInvalidLineNumber",",,,%s,,,") a0) /// #if directive must appear as the first non-whitespace character on a line - /// (Originally from ..\FSComp.txt:1013) + /// (Originally from ..\FSComp.txt:1015) static member lexHashIfMustBeFirst() = (1163, GetStringFunc("lexHashIfMustBeFirst",",,,") ) /// #else has no matching #if - /// (Originally from ..\FSComp.txt:1014) + /// (Originally from ..\FSComp.txt:1016) static member lexHashElseNoMatchingIf() = (GetStringFunc("lexHashElseNoMatchingIf",",,,") ) /// #endif required for #else - /// (Originally from ..\FSComp.txt:1015) + /// (Originally from ..\FSComp.txt:1017) static member lexHashEndifRequiredForElse() = (GetStringFunc("lexHashEndifRequiredForElse",",,,") ) /// #else directive must appear as the first non-whitespace character on a line - /// (Originally from ..\FSComp.txt:1016) + /// (Originally from ..\FSComp.txt:1018) static member lexHashElseMustBeFirst() = (1166, GetStringFunc("lexHashElseMustBeFirst",",,,") ) /// #endif has no matching #if - /// (Originally from ..\FSComp.txt:1017) + /// (Originally from ..\FSComp.txt:1019) static member lexHashEndingNoMatchingIf() = (GetStringFunc("lexHashEndingNoMatchingIf",",,,") ) /// #endif directive must appear as the first non-whitespace character on a line - /// (Originally from ..\FSComp.txt:1018) + /// (Originally from ..\FSComp.txt:1020) static member lexHashEndifMustBeFirst() = (1168, GetStringFunc("lexHashEndifMustBeFirst",",,,") ) /// #if directive should be immediately followed by an identifier - /// (Originally from ..\FSComp.txt:1019) + /// (Originally from ..\FSComp.txt:1021) static member lexHashIfMustHaveIdent() = (1169, GetStringFunc("lexHashIfMustHaveIdent",",,,") ) /// Syntax error. Wrong nested #endif, unexpected tokens before it. - /// (Originally from ..\FSComp.txt:1020) + /// (Originally from ..\FSComp.txt:1022) static member lexWrongNestedHashEndif() = (1170, GetStringFunc("lexWrongNestedHashEndif",",,,") ) /// #! may only appear as the first line at the start of a file. - /// (Originally from ..\FSComp.txt:1021) + /// (Originally from ..\FSComp.txt:1023) static member lexHashBangMustBeFirstInFile() = (GetStringFunc("lexHashBangMustBeFirstInFile",",,,") ) /// Expected single line comment or end of line - /// (Originally from ..\FSComp.txt:1022) + /// (Originally from ..\FSComp.txt:1024) static member pplexExpectedSingleLineComment() = (1171, GetStringFunc("pplexExpectedSingleLineComment",",,,") ) /// Infix operator member '%s' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... - /// (Originally from ..\FSComp.txt:1023) + /// (Originally from ..\FSComp.txt:1025) static member memberOperatorDefinitionWithNoArguments(a0 : System.String) = (1172, GetStringFunc("memberOperatorDefinitionWithNoArguments",",,,%s,,,") a0) /// Infix operator member '%s' has %d initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... - /// (Originally from ..\FSComp.txt:1024) + /// (Originally from ..\FSComp.txt:1026) static member memberOperatorDefinitionWithNonPairArgument(a0 : System.String, a1 : System.Int32) = (1173, GetStringFunc("memberOperatorDefinitionWithNonPairArgument",",,,%s,,,%d,,,") a0 a1) /// Infix operator member '%s' has extra curried arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... - /// (Originally from ..\FSComp.txt:1025) + /// (Originally from ..\FSComp.txt:1027) static member memberOperatorDefinitionWithCurriedArguments(a0 : System.String) = (1174, GetStringFunc("memberOperatorDefinitionWithCurriedArguments",",,,%s,,,") a0) /// All record, union and struct types in FSharp.Core.dll must be explicitly labelled with 'StructuralComparison' or 'NoComparison' - /// (Originally from ..\FSComp.txt:1026) + /// (Originally from ..\FSComp.txt:1028) static member tcFSharpCoreRequiresExplicit() = (1175, GetStringFunc("tcFSharpCoreRequiresExplicit",",,,") ) /// The struct, record or union type '%s' has the 'StructuralComparison' attribute but the type parameter '%s' does not satisfy the 'comparison' constraint. Consider adding the 'comparison' constraint to the type parameter - /// (Originally from ..\FSComp.txt:1027) + /// (Originally from ..\FSComp.txt:1029) static member tcStructuralComparisonNotSatisfied1(a0 : System.String, a1 : System.String) = (1176, GetStringFunc("tcStructuralComparisonNotSatisfied1",",,,%s,,,%s,,,") a0 a1) /// The struct, record or union type '%s' has the 'StructuralComparison' attribute but the component type '%s' does not satisfy the 'comparison' constraint - /// (Originally from ..\FSComp.txt:1028) + /// (Originally from ..\FSComp.txt:1030) static member tcStructuralComparisonNotSatisfied2(a0 : System.String, a1 : System.String) = (1177, GetStringFunc("tcStructuralComparisonNotSatisfied2",",,,%s,,,%s,,,") a0 a1) /// The struct, record or union type '%s' is not structurally comparable because the type parameter %s does not satisfy the 'comparison' constraint. Consider adding the 'NoComparison' attribute to the type '%s' to clarify that the type is not comparable - /// (Originally from ..\FSComp.txt:1029) + /// (Originally from ..\FSComp.txt:1031) static member tcNoComparisonNeeded1(a0 : System.String, a1 : System.String, a2 : System.String) = (1178, GetStringFunc("tcNoComparisonNeeded1",",,,%s,,,%s,,,%s,,,") a0 a1 a2) /// The struct, record or union type '%s' is not structurally comparable because the type '%s' does not satisfy the 'comparison' constraint. Consider adding the 'NoComparison' attribute to the type '%s' to clarify that the type is not comparable - /// (Originally from ..\FSComp.txt:1030) + /// (Originally from ..\FSComp.txt:1032) static member tcNoComparisonNeeded2(a0 : System.String, a1 : System.String, a2 : System.String) = (1178, GetStringFunc("tcNoComparisonNeeded2",",,,%s,,,%s,,,%s,,,") a0 a1 a2) /// The struct, record or union type '%s' does not support structural equality because the type parameter %s does not satisfy the 'equality' constraint. Consider adding the 'NoEquality' attribute to the type '%s' to clarify that the type does not support structural equality - /// (Originally from ..\FSComp.txt:1031) + /// (Originally from ..\FSComp.txt:1033) static member tcNoEqualityNeeded1(a0 : System.String, a1 : System.String, a2 : System.String) = (1178, GetStringFunc("tcNoEqualityNeeded1",",,,%s,,,%s,,,%s,,,") a0 a1 a2) /// The struct, record or union type '%s' does not support structural equality because the type '%s' does not satisfy the 'equality' constraint. Consider adding the 'NoEquality' attribute to the type '%s' to clarify that the type does not support structural equality - /// (Originally from ..\FSComp.txt:1032) + /// (Originally from ..\FSComp.txt:1034) static member tcNoEqualityNeeded2(a0 : System.String, a1 : System.String, a2 : System.String) = (1178, GetStringFunc("tcNoEqualityNeeded2",",,,%s,,,%s,,,%s,,,") a0 a1 a2) /// The struct, record or union type '%s' has the 'StructuralEquality' attribute but the type parameter '%s' does not satisfy the 'equality' constraint. Consider adding the 'equality' constraint to the type parameter - /// (Originally from ..\FSComp.txt:1033) + /// (Originally from ..\FSComp.txt:1035) static member tcStructuralEqualityNotSatisfied1(a0 : System.String, a1 : System.String) = (1179, GetStringFunc("tcStructuralEqualityNotSatisfied1",",,,%s,,,%s,,,") a0 a1) /// The struct, record or union type '%s' has the 'StructuralEquality' attribute but the component type '%s' does not satisfy the 'equality' constraint - /// (Originally from ..\FSComp.txt:1034) + /// (Originally from ..\FSComp.txt:1036) static member tcStructuralEqualityNotSatisfied2(a0 : System.String, a1 : System.String) = (1180, GetStringFunc("tcStructuralEqualityNotSatisfied2",",,,%s,,,%s,,,") a0 a1) /// Each argument of the primary constructor for a struct must be given a type, for example 'type S(x1:int, x2: int) = ...'. These arguments determine the fields of the struct. - /// (Originally from ..\FSComp.txt:1035) + /// (Originally from ..\FSComp.txt:1037) static member tcStructsMustDeclareTypesOfImplicitCtorArgsExplicitly() = (1181, GetStringFunc("tcStructsMustDeclareTypesOfImplicitCtorArgsExplicitly",",,,") ) /// The value '%s' is unused - /// (Originally from ..\FSComp.txt:1036) + /// (Originally from ..\FSComp.txt:1038) static member chkUnusedValue(a0 : System.String) = (1182, GetStringFunc("chkUnusedValue",",,,%s,,,") a0) /// The recursive object reference '%s' is unused. The presence of a recursive object reference adds runtime initialization checks to members in this and derived types. Consider removing this recursive object reference. - /// (Originally from ..\FSComp.txt:1037) + /// (Originally from ..\FSComp.txt:1039) static member chkUnusedThisVariable(a0 : System.String) = (1183, GetStringFunc("chkUnusedThisVariable",",,,%s,,,") a0) /// A getter property may have at most one argument group - /// (Originally from ..\FSComp.txt:1038) + /// (Originally from ..\FSComp.txt:1040) static member parsGetterAtMostOneArgument() = (1184, GetStringFunc("parsGetterAtMostOneArgument",",,,") ) /// A setter property may have at most two argument groups - /// (Originally from ..\FSComp.txt:1039) + /// (Originally from ..\FSComp.txt:1041) static member parsSetterAtMostTwoArguments() = (1185, GetStringFunc("parsSetterAtMostTwoArguments",",,,") ) /// Invalid property getter or setter - /// (Originally from ..\FSComp.txt:1040) + /// (Originally from ..\FSComp.txt:1042) static member parsInvalidProperty() = (1186, GetStringFunc("parsInvalidProperty",",,,") ) /// An indexer property must be given at least one argument - /// (Originally from ..\FSComp.txt:1041) + /// (Originally from ..\FSComp.txt:1043) static member parsIndexerPropertyRequiresAtLeastOneArgument() = (1187, GetStringFunc("parsIndexerPropertyRequiresAtLeastOneArgument",",,,") ) /// This operation accesses a mutable top-level value defined in another assembly in an unsupported way. The value cannot be accessed through its address. Consider copying the expression to a mutable local, e.g. 'let mutable x = ...', and if necessary assigning the value back after the completion of the operation - /// (Originally from ..\FSComp.txt:1042) + /// (Originally from ..\FSComp.txt:1044) static member tastInvalidAddressOfMutableAcrossAssemblyBoundary() = (1188, GetStringFunc("tastInvalidAddressOfMutableAcrossAssemblyBoundary",",,,") ) - /// Type parameters must be placed directly adjacent to the type name, e.g. \"type C<'T>\", not type \"C <'T>\" - /// (Originally from ..\FSComp.txt:1043) + /// Remove spaces between the type name and type parameter, e.g. \"type C<'T>\", not type \"C <'T>\". Type parameters must be placed directly adjacent to the type name. + /// (Originally from ..\FSComp.txt:1045) static member parsNonAdjacentTypars() = (1189, GetStringFunc("parsNonAdjacentTypars",",,,") ) - /// Type arguments must be placed directly adjacent to the type name, e.g. \"C<'T>\", not \"C <'T>\" - /// (Originally from ..\FSComp.txt:1044) + /// Remove spaces between the type name and type parameter, e.g. \"C<'T>\", not \"C <'T>\". Type parameters must be placed directly adjacent to the type name. + /// (Originally from ..\FSComp.txt:1046) static member parsNonAdjacentTyargs() = (1190, GetStringFunc("parsNonAdjacentTyargs",",,,") ) /// The use of the type syntax 'int C' and 'C ' is not permitted here. Consider adjusting this type to be written in the form 'C' - /// (Originally from ..\FSComp.txt:1045) + /// (Originally from ..\FSComp.txt:1047) static member parsNonAtomicType() = (GetStringFunc("parsNonAtomicType",",,,") ) /// The module/namespace '%s' from compilation unit '%s' did not contain the module/namespace '%s' - /// (Originally from ..\FSComp.txt:1048) + /// (Originally from ..\FSComp.txt:1050) static member tastUndefinedItemRefModuleNamespace(a0 : System.String, a1 : System.String, a2 : System.String) = (1193, GetStringFunc("tastUndefinedItemRefModuleNamespace",",,,%s,,,%s,,,%s,,,") a0 a1 a2) /// The module/namespace '%s' from compilation unit '%s' did not contain the val '%s' - /// (Originally from ..\FSComp.txt:1049) + /// (Originally from ..\FSComp.txt:1051) static member tastUndefinedItemRefVal(a0 : System.String, a1 : System.String, a2 : System.String) = (1194, GetStringFunc("tastUndefinedItemRefVal",",,,%s,,,%s,,,%s,,,") a0 a1 a2) /// The module/namespace '%s' from compilation unit '%s' did not contain the namespace, module or type '%s' - /// (Originally from ..\FSComp.txt:1050) + /// (Originally from ..\FSComp.txt:1052) static member tastUndefinedItemRefModuleNamespaceType(a0 : System.String, a1 : System.String, a2 : System.String) = (1195, GetStringFunc("tastUndefinedItemRefModuleNamespaceType",",,,%s,,,%s,,,%s,,,") a0 a1 a2) /// The 'UseNullAsTrueValue' attribute flag may only be used with union types that have one nullary case and at least one non-nullary case - /// (Originally from ..\FSComp.txt:1051) + /// (Originally from ..\FSComp.txt:1053) static member tcInvalidUseNullAsTrueValue() = (1196, GetStringFunc("tcInvalidUseNullAsTrueValue",",,,") ) /// The parameter '%s' was inferred to have byref type. Parameters of byref type must be given an explicit type annotation, e.g. 'x1: byref'. When used, a byref parameter is implicitly dereferenced. - /// (Originally from ..\FSComp.txt:1052) + /// (Originally from ..\FSComp.txt:1054) static member tcParameterInferredByref(a0 : System.String) = (1197, GetStringFunc("tcParameterInferredByref",",,,%s,,,") a0) /// The generic member '%s' has been used at a non-uniform instantiation prior to this program point. Consider reordering the members so this member occurs first. Alternatively, specify the full type of the member explicitly, including argument types, return type and any additional generic parameters and constraints. - /// (Originally from ..\FSComp.txt:1053) + /// (Originally from ..\FSComp.txt:1055) static member tcNonUniformMemberUse(a0 : System.String) = (1198, GetStringFunc("tcNonUniformMemberUse",",,,%s,,,") a0) /// The attribute '%s' appears in both the implementation and the signature, but the attribute arguments differ. Only the attribute from the signature will be included in the compiled code. - /// (Originally from ..\FSComp.txt:1054) + /// (Originally from ..\FSComp.txt:1056) static member tcAttribArgsDiffer(a0 : System.String) = (1200, GetStringFunc("tcAttribArgsDiffer",",,,%s,,,") a0) /// Cannot call an abstract base member: '%s' - /// (Originally from ..\FSComp.txt:1055) + /// (Originally from ..\FSComp.txt:1057) static member tcCannotCallAbstractBaseMember(a0 : System.String) = (1201, GetStringFunc("tcCannotCallAbstractBaseMember",",,,%s,,,") a0) /// Could not resolve the ambiguity in the use of a generic construct with an 'unmanaged' constraint at or near this position - /// (Originally from ..\FSComp.txt:1056) + /// (Originally from ..\FSComp.txt:1058) static member typrelCannotResolveAmbiguityInUnmanaged() = (1202, GetStringFunc("typrelCannotResolveAmbiguityInUnmanaged",",,,") ) /// This construct is for ML compatibility. %s. You can disable this warning by using '--mlcompatibility' or '--nowarn:62'. - /// (Originally from ..\FSComp.txt:1059) + /// (Originally from ..\FSComp.txt:1061) static member mlCompatMessage(a0 : System.String) = (GetStringFunc("mlCompatMessage",",,,%s,,,") a0) /// The type '%s' has been marked as having an Explicit layout, but the field '%s' has not been marked with the 'FieldOffset' attribute - /// (Originally from ..\FSComp.txt:1061) + /// (Originally from ..\FSComp.txt:1063) static member ilFieldDoesNotHaveValidOffsetForStructureLayout(a0 : System.String, a1 : System.String) = (1206, GetStringFunc("ilFieldDoesNotHaveValidOffsetForStructureLayout",",,,%s,,,%s,,,") a0 a1) /// Interfaces inherited by other interfaces should be declared using 'inherit ...' instead of 'interface ...' - /// (Originally from ..\FSComp.txt:1062) + /// (Originally from ..\FSComp.txt:1064) static member tcInterfacesShouldUseInheritNotInterface() = (1207, GetStringFunc("tcInterfacesShouldUseInheritNotInterface",",,,") ) /// Invalid prefix operator - /// (Originally from ..\FSComp.txt:1063) + /// (Originally from ..\FSComp.txt:1065) static member parsInvalidPrefixOperator() = (1208, GetStringFunc("parsInvalidPrefixOperator",",,,") ) /// Invalid operator definition. Prefix operator definitions must use a valid prefix operator name. - /// (Originally from ..\FSComp.txt:1064) + /// (Originally from ..\FSComp.txt:1066) static member parsInvalidPrefixOperatorDefinition() = (1208, GetStringFunc("parsInvalidPrefixOperatorDefinition",",,,") ) /// The file extensions '.ml' and '.mli' are for ML compatibility - /// (Originally from ..\FSComp.txt:1065) + /// (Originally from ..\FSComp.txt:1067) static member buildCompilingExtensionIsForML() = (GetStringFunc("buildCompilingExtensionIsForML",",,,") ) /// Consider using a file with extension '.ml' or '.mli' instead - /// (Originally from ..\FSComp.txt:1066) + /// (Originally from ..\FSComp.txt:1068) static member lexIndentOffForML() = (GetStringFunc("lexIndentOffForML",",,,") ) /// Active pattern '%s' is not a function - /// (Originally from ..\FSComp.txt:1067) + /// (Originally from ..\FSComp.txt:1069) static member activePatternIdentIsNotFunctionTyped(a0 : System.String) = (1209, GetStringFunc("activePatternIdentIsNotFunctionTyped",",,,%s,,,") a0) /// Active pattern '%s' has a result type containing type variables that are not determined by the input. The common cause is a when a result case is not mentioned, e.g. 'let (|A|B|) (x:int) = A x'. This can be fixed with a type constraint, e.g. 'let (|A|B|) (x:int) : Choice = A x' - /// (Originally from ..\FSComp.txt:1068) + /// (Originally from ..\FSComp.txt:1070) static member activePatternChoiceHasFreeTypars(a0 : System.String) = (1210, GetStringFunc("activePatternChoiceHasFreeTypars",",,,%s,,,") a0) /// The FieldOffset attribute can only be placed on members of types marked with the StructLayout(LayoutKind.Explicit) - /// (Originally from ..\FSComp.txt:1069) + /// (Originally from ..\FSComp.txt:1071) static member ilFieldHasOffsetForSequentialLayout() = (1211, GetStringFunc("ilFieldHasOffsetForSequentialLayout",",,,") ) /// Optional arguments must come at the end of the argument list, after any non-optional arguments - /// (Originally from ..\FSComp.txt:1070) + /// (Originally from ..\FSComp.txt:1072) static member tcOptionalArgsMustComeAfterNonOptionalArgs() = (1212, GetStringFunc("tcOptionalArgsMustComeAfterNonOptionalArgs",",,,") ) /// Attribute 'System.Diagnostics.ConditionalAttribute' is only valid on methods or attribute classes - /// (Originally from ..\FSComp.txt:1071) + /// (Originally from ..\FSComp.txt:1073) static member tcConditionalAttributeUsage() = (1213, GetStringFunc("tcConditionalAttributeUsage",",,,") ) /// Extension members cannot provide operator overloads. Consider defining the operator as part of the type definition instead. - /// (Originally from ..\FSComp.txt:1073) + /// (Originally from ..\FSComp.txt:1075) static member tcMemberOperatorDefinitionInExtrinsic() = (1215, GetStringFunc("tcMemberOperatorDefinitionInExtrinsic",",,,") ) /// The name of the MDB file must be .mdb. The --pdb option will be ignored. - /// (Originally from ..\FSComp.txt:1074) + /// (Originally from ..\FSComp.txt:1076) static member ilwriteMDBFileNameCannotBeChangedWarning() = (1216, GetStringFunc("ilwriteMDBFileNameCannotBeChangedWarning",",,,") ) /// MDB generation failed. Could not find compatible member %s - /// (Originally from ..\FSComp.txt:1075) + /// (Originally from ..\FSComp.txt:1077) static member ilwriteMDBMemberMissing(a0 : System.String) = (1217, GetStringFunc("ilwriteMDBMemberMissing",",,,%s,,,") a0) /// Cannot generate MDB debug information. Failed to load the 'MonoSymbolWriter' type from the 'Mono.CompilerServices.SymbolWriter.dll' assembly. - /// (Originally from ..\FSComp.txt:1076) + /// (Originally from ..\FSComp.txt:1078) static member ilwriteErrorCreatingMdb() = (1218, GetStringFunc("ilwriteErrorCreatingMdb",",,,") ) /// The union case named '%s' conflicts with the generated type '%s' - /// (Originally from ..\FSComp.txt:1077) + /// (Originally from ..\FSComp.txt:1079) static member tcUnionCaseNameConflictsWithGeneratedType(a0 : System.String, a1 : System.String) = (1219, GetStringFunc("tcUnionCaseNameConflictsWithGeneratedType",",,,%s,,,%s,,,") a0 a1) /// ReflectedDefinitionAttribute may not be applied to an instance member on a struct type, because the instance member takes an implicit 'this' byref parameter - /// (Originally from ..\FSComp.txt:1078) + /// (Originally from ..\FSComp.txt:1080) static member chkNoReflectedDefinitionOnStructMember() = (1220, GetStringFunc("chkNoReflectedDefinitionOnStructMember",",,,") ) /// DLLImport bindings must be static members in a class or function definitions in a module - /// (Originally from ..\FSComp.txt:1079) + /// (Originally from ..\FSComp.txt:1081) static member tcDllImportNotAllowed() = (1221, GetStringFunc("tcDllImportNotAllowed",",,,") ) /// When mscorlib.dll or FSharp.Core.dll is explicitly referenced the %s option must also be passed - /// (Originally from ..\FSComp.txt:1080) + /// (Originally from ..\FSComp.txt:1082) static member buildExplicitCoreLibRequiresNoFramework(a0 : System.String) = (1222, GetStringFunc("buildExplicitCoreLibRequiresNoFramework",",,,%s,,,") a0) /// FSharp.Core.sigdata not found alongside FSharp.Core. File expected in %s. Consider upgrading to a more recent version of FSharp.Core, where this file is no longer be required. - /// (Originally from ..\FSComp.txt:1081) + /// (Originally from ..\FSComp.txt:1083) static member buildExpectedSigdataFile(a0 : System.String) = (1223, GetStringFunc("buildExpectedSigdataFile",",,,%s,,,") a0) /// File '%s' not found alongside FSharp.Core. File expected in %s. Consider upgrading to a more recent version of FSharp.Core, where this file is no longer be required. - /// (Originally from ..\FSComp.txt:1082) + /// (Originally from ..\FSComp.txt:1084) static member buildExpectedFileAlongSideFSharpCore(a0 : System.String, a1 : System.String) = (1225, GetStringFunc("buildExpectedFileAlongSideFSharpCore",",,,%s,,,%s,,,") a0 a1) /// Filename '%s' contains invalid character '%s' - /// (Originally from ..\FSComp.txt:1083) + /// (Originally from ..\FSComp.txt:1085) static member buildUnexpectedFileNameCharacter(a0 : System.String, a1 : System.String) = (1227, GetStringFunc("buildUnexpectedFileNameCharacter",",,,%s,,,%s,,,") a0 a1) /// 'use!' bindings must be of the form 'use! = ' - /// (Originally from ..\FSComp.txt:1084) + /// (Originally from ..\FSComp.txt:1086) static member tcInvalidUseBangBinding() = (1228, GetStringFunc("tcInvalidUseBangBinding",",,,") ) /// Inner generic functions are not permitted in quoted expressions. Consider adding some type constraints until this function is no longer generic. - /// (Originally from ..\FSComp.txt:1085) + /// (Originally from ..\FSComp.txt:1087) static member crefNoInnerGenericsInQuotations() = (1230, GetStringFunc("crefNoInnerGenericsInQuotations",",,,") ) /// The type '%s' is not a valid enumerator type , i.e. does not have a 'MoveNext()' method returning a bool, and a 'Current' property - /// (Originally from ..\FSComp.txt:1086) + /// (Originally from ..\FSComp.txt:1088) static member tcEnumTypeCannotBeEnumerated(a0 : System.String) = (1231, GetStringFunc("tcEnumTypeCannotBeEnumerated",",,,%s,,,") a0) /// End of file in triple-quote string begun at or before here - /// (Originally from ..\FSComp.txt:1087) + /// (Originally from ..\FSComp.txt:1089) static member parsEofInTripleQuoteString() = (1232, GetStringFunc("parsEofInTripleQuoteString",",,,") ) /// End of file in triple-quote string embedded in comment begun at or before here - /// (Originally from ..\FSComp.txt:1088) + /// (Originally from ..\FSComp.txt:1090) static member parsEofInTripleQuoteStringInComment() = (1233, GetStringFunc("parsEofInTripleQuoteStringInComment",",,,") ) /// This type test or downcast will ignore the unit-of-measure '%s' - /// (Originally from ..\FSComp.txt:1089) + /// (Originally from ..\FSComp.txt:1091) static member tcTypeTestLosesMeasures(a0 : System.String) = (1240, GetStringFunc("tcTypeTestLosesMeasures",",,,%s,,,") a0) /// Expected type argument or static argument - /// (Originally from ..\FSComp.txt:1090) + /// (Originally from ..\FSComp.txt:1092) static member parsMissingTypeArgs() = (1241, GetStringFunc("parsMissingTypeArgs",",,,") ) /// Unmatched '<'. Expected closing '>' - /// (Originally from ..\FSComp.txt:1091) + /// (Originally from ..\FSComp.txt:1093) static member parsMissingGreaterThan() = (1242, GetStringFunc("parsMissingGreaterThan",",,,") ) /// Unexpected quotation operator '<@' in type definition. If you intend to pass a verbatim string as a static argument to a type provider, put a space between the '<' and '@' characters. - /// (Originally from ..\FSComp.txt:1092) + /// (Originally from ..\FSComp.txt:1094) static member parsUnexpectedQuotationOperatorInTypeAliasDidYouMeanVerbatimString() = (1243, GetStringFunc("parsUnexpectedQuotationOperatorInTypeAliasDidYouMeanVerbatimString",",,,") ) /// Attempted to parse this as an operator name, but failed - /// (Originally from ..\FSComp.txt:1093) + /// (Originally from ..\FSComp.txt:1095) static member parsErrorParsingAsOperatorName() = (1244, GetStringFunc("parsErrorParsingAsOperatorName",",,,") ) /// \U%s is not a valid Unicode character escape sequence - /// (Originally from ..\FSComp.txt:1094) + /// (Originally from ..\FSComp.txt:1096) static member lexInvalidUnicodeLiteral(a0 : System.String) = (1245, GetStringFunc("lexInvalidUnicodeLiteral",",,,%s,,,") a0) /// '%s' must be applied to an argument of type '%s', but has been applied to an argument of type '%s' - /// (Originally from ..\FSComp.txt:1095) + /// (Originally from ..\FSComp.txt:1097) static member tcCallerInfoWrongType(a0 : System.String, a1 : System.String, a2 : System.String) = (1246, GetStringFunc("tcCallerInfoWrongType",",,,%s,,,%s,,,%s,,,") a0 a1 a2) /// '%s' can only be applied to optional arguments - /// (Originally from ..\FSComp.txt:1096) + /// (Originally from ..\FSComp.txt:1098) static member tcCallerInfoNotOptional(a0 : System.String) = (1247, GetStringFunc("tcCallerInfoNotOptional",",,,%s,,,") a0) /// The specified .NET Framework version '%s' is not supported. Please specify a value from the enumeration Microsoft.Build.Utilities.TargetDotNetFrameworkVersion. - /// (Originally from ..\FSComp.txt:1098) + /// (Originally from ..\FSComp.txt:1100) static member toolLocationHelperUnsupportedFrameworkVersion(a0 : System.String) = (1300, GetStringFunc("toolLocationHelperUnsupportedFrameworkVersion",",,,%s,,,") a0) /// Invalid Magic value in CLR Header - /// (Originally from ..\FSComp.txt:1102) + /// (Originally from ..\FSComp.txt:1104) static member ilSignInvalidMagicValue() = (1301, GetStringFunc("ilSignInvalidMagicValue",",,,") ) /// Bad image format - /// (Originally from ..\FSComp.txt:1103) + /// (Originally from ..\FSComp.txt:1105) static member ilSignBadImageFormat() = (1302, GetStringFunc("ilSignBadImageFormat",",,,") ) /// Private key expected - /// (Originally from ..\FSComp.txt:1104) + /// (Originally from ..\FSComp.txt:1106) static member ilSignPrivateKeyExpected() = (1303, GetStringFunc("ilSignPrivateKeyExpected",",,,") ) /// RSA key expected - /// (Originally from ..\FSComp.txt:1105) + /// (Originally from ..\FSComp.txt:1107) static member ilSignRsaKeyExpected() = (1304, GetStringFunc("ilSignRsaKeyExpected",",,,") ) /// Invalid bit Length - /// (Originally from ..\FSComp.txt:1106) + /// (Originally from ..\FSComp.txt:1108) static member ilSignInvalidBitLen() = (1305, GetStringFunc("ilSignInvalidBitLen",",,,") ) /// Invalid RSAParameters structure - '{0}' expected - /// (Originally from ..\FSComp.txt:1107) + /// (Originally from ..\FSComp.txt:1109) static member ilSignInvalidRSAParams() = (1306, GetStringFunc("ilSignInvalidRSAParams",",,,") ) /// Invalid algId - 'Exponent' expected - /// (Originally from ..\FSComp.txt:1108) + /// (Originally from ..\FSComp.txt:1110) static member ilSignInvalidAlgId() = (1307, GetStringFunc("ilSignInvalidAlgId",",,,") ) /// Invalid signature size - /// (Originally from ..\FSComp.txt:1109) + /// (Originally from ..\FSComp.txt:1111) static member ilSignInvalidSignatureSize() = (1308, GetStringFunc("ilSignInvalidSignatureSize",",,,") ) /// No signature directory - /// (Originally from ..\FSComp.txt:1110) + /// (Originally from ..\FSComp.txt:1112) static member ilSignNoSignatureDirectory() = (1309, GetStringFunc("ilSignNoSignatureDirectory",",,,") ) /// Invalid Public Key blob - /// (Originally from ..\FSComp.txt:1111) + /// (Originally from ..\FSComp.txt:1113) static member ilSignInvalidPKBlob() = (1310, GetStringFunc("ilSignInvalidPKBlob",",,,") ) /// Exiting - too many errors - /// (Originally from ..\FSComp.txt:1113) + /// (Originally from ..\FSComp.txt:1115) static member fscTooManyErrors() = (GetStringFunc("fscTooManyErrors",",,,") ) /// The documentation file has no .xml suffix - /// (Originally from ..\FSComp.txt:1114) + /// (Originally from ..\FSComp.txt:1116) static member docfileNoXmlSuffix() = (2001, GetStringFunc("docfileNoXmlSuffix",",,,") ) /// No implementation files specified - /// (Originally from ..\FSComp.txt:1115) + /// (Originally from ..\FSComp.txt:1117) static member fscNoImplementationFiles() = (2002, GetStringFunc("fscNoImplementationFiles",",,,") ) /// The attribute %s specified version '%s', but this value is invalid and has been ignored - /// (Originally from ..\FSComp.txt:1116) + /// (Originally from ..\FSComp.txt:1118) static member fscBadAssemblyVersion(a0 : System.String, a1 : System.String) = (2003, GetStringFunc("fscBadAssemblyVersion",",,,%s,,,%s,,,") a0 a1) /// Conflicting options specified: 'win32manifest' and 'win32res'. Only one of these can be used. - /// (Originally from ..\FSComp.txt:1117) + /// (Originally from ..\FSComp.txt:1119) static member fscTwoResourceManifests() = (2004, GetStringFunc("fscTwoResourceManifests",",,,") ) /// The code in assembly '%s' makes uses of quotation literals. Static linking may not include components that make use of quotation literals unless all assemblies are compiled with at least F# 4.0. - /// (Originally from ..\FSComp.txt:1118) + /// (Originally from ..\FSComp.txt:1120) static member fscQuotationLiteralsStaticLinking(a0 : System.String) = (2005, GetStringFunc("fscQuotationLiteralsStaticLinking",",,,%s,,,") a0) /// Code in this assembly makes uses of quotation literals. Static linking may not include components that make use of quotation literals unless all assemblies are compiled with at least F# 4.0. - /// (Originally from ..\FSComp.txt:1119) + /// (Originally from ..\FSComp.txt:1121) static member fscQuotationLiteralsStaticLinking0() = (2006, GetStringFunc("fscQuotationLiteralsStaticLinking0",",,,") ) /// Static linking may not include a .EXE - /// (Originally from ..\FSComp.txt:1120) + /// (Originally from ..\FSComp.txt:1122) static member fscStaticLinkingNoEXE() = (2007, GetStringFunc("fscStaticLinkingNoEXE",",,,") ) /// Static linking may not include a mixed managed/unmanaged DLL - /// (Originally from ..\FSComp.txt:1121) + /// (Originally from ..\FSComp.txt:1123) static member fscStaticLinkingNoMixedDLL() = (2008, GetStringFunc("fscStaticLinkingNoMixedDLL",",,,") ) /// Ignoring mixed managed/unmanaged assembly '%s' during static linking - /// (Originally from ..\FSComp.txt:1122) + /// (Originally from ..\FSComp.txt:1124) static member fscIgnoringMixedWhenLinking(a0 : System.String) = (2009, GetStringFunc("fscIgnoringMixedWhenLinking",",,,%s,,,") a0) /// Assembly '%s' was referenced transitively and the assembly could not be resolved automatically. Static linking will assume this DLL has no dependencies on the F# library or other statically linked DLLs. Consider adding an explicit reference to this DLL. - /// (Originally from ..\FSComp.txt:1123) + /// (Originally from ..\FSComp.txt:1125) static member fscAssumeStaticLinkContainsNoDependencies(a0 : System.String) = (2011, GetStringFunc("fscAssumeStaticLinkContainsNoDependencies",",,,%s,,,") a0) /// Assembly '%s' not found in dependency set of target binary. Statically linked roots should be specified using an assembly name, without a DLL or EXE extension. If this assembly was referenced explicitly then it is possible the assembly was not actually required by the generated binary, in which case it should not be statically linked. - /// (Originally from ..\FSComp.txt:1124) + /// (Originally from ..\FSComp.txt:1126) static member fscAssemblyNotFoundInDependencySet(a0 : System.String) = (2012, GetStringFunc("fscAssemblyNotFoundInDependencySet",",,,%s,,,") a0) /// The key file '%s' could not be opened - /// (Originally from ..\FSComp.txt:1125) + /// (Originally from ..\FSComp.txt:1127) static member fscKeyFileCouldNotBeOpened(a0 : System.String) = (2013, GetStringFunc("fscKeyFileCouldNotBeOpened",",,,%s,,,") a0) /// A problem occurred writing the binary '%s': %s - /// (Originally from ..\FSComp.txt:1126) + /// (Originally from ..\FSComp.txt:1128) static member fscProblemWritingBinary(a0 : System.String, a1 : System.String) = (2014, GetStringFunc("fscProblemWritingBinary",",,,%s,,,%s,,,") a0 a1) /// The 'AssemblyVersionAttribute' has been ignored because a version was given using a command line option - /// (Originally from ..\FSComp.txt:1127) + /// (Originally from ..\FSComp.txt:1129) static member fscAssemblyVersionAttributeIgnored() = (2015, GetStringFunc("fscAssemblyVersionAttributeIgnored",",,,") ) /// Error emitting 'System.Reflection.AssemblyCultureAttribute' attribute -- 'Executables cannot be satellite assemblies, Culture should always be empty' - /// (Originally from ..\FSComp.txt:1128) + /// (Originally from ..\FSComp.txt:1130) static member fscAssemblyCultureAttributeError() = (2016, GetStringFunc("fscAssemblyCultureAttributeError",",,,") ) /// Option '--delaysign' overrides attribute 'System.Reflection.AssemblyDelaySignAttribute' given in a source file or added module - /// (Originally from ..\FSComp.txt:1129) + /// (Originally from ..\FSComp.txt:1131) static member fscDelaySignWarning() = (2017, GetStringFunc("fscDelaySignWarning",",,,") ) /// Option '--keyfile' overrides attribute 'System.Reflection.AssemblyKeyFileAttribute' given in a source file or added module - /// (Originally from ..\FSComp.txt:1130) + /// (Originally from ..\FSComp.txt:1132) static member fscKeyFileWarning() = (2018, GetStringFunc("fscKeyFileWarning",",,,") ) /// Option '--keycontainer' overrides attribute 'System.Reflection.AssemblyNameAttribute' given in a source file or added module - /// (Originally from ..\FSComp.txt:1131) + /// (Originally from ..\FSComp.txt:1133) static member fscKeyNameWarning() = (2019, GetStringFunc("fscKeyNameWarning",",,,") ) /// The assembly '%s' is listed on the command line. Assemblies should be referenced using a command line flag such as '-r'. - /// (Originally from ..\FSComp.txt:1132) + /// (Originally from ..\FSComp.txt:1134) static member fscReferenceOnCommandLine(a0 : System.String) = (2020, GetStringFunc("fscReferenceOnCommandLine",",,,%s,,,") a0) /// The resident compilation service was not used because a problem occured in communicating with the server. - /// (Originally from ..\FSComp.txt:1133) + /// (Originally from ..\FSComp.txt:1135) static member fscRemotingError() = (2021, GetStringFunc("fscRemotingError",",,,") ) /// Problem with filename '%s': Illegal characters in path. - /// (Originally from ..\FSComp.txt:1134) + /// (Originally from ..\FSComp.txt:1136) static member pathIsInvalid(a0 : System.String) = (2022, GetStringFunc("pathIsInvalid",",,,%s,,,") a0) /// Passing a .resx file (%s) as a source file to the compiler is deprecated. Use resgen.exe to transform the .resx file into a .resources file to pass as a --resource option. If you are using MSBuild, this can be done via an item in the .fsproj project file. - /// (Originally from ..\FSComp.txt:1135) + /// (Originally from ..\FSComp.txt:1137) static member fscResxSourceFileDeprecated(a0 : System.String) = (2023, GetStringFunc("fscResxSourceFileDeprecated",",,,%s,,,") a0) /// Static linking may not be used on an assembly referencing mscorlib (e.g. a .NET Framework assembly) when generating an assembly that references System.Runtime (e.g. a .NET Core or Portable assembly). - /// (Originally from ..\FSComp.txt:1136) + /// (Originally from ..\FSComp.txt:1138) static member fscStaticLinkingNoProfileMismatches() = (2024, GetStringFunc("fscStaticLinkingNoProfileMismatches",",,,") ) /// An %s specified version '%s', but this value is a wildcard, and you have requested a deterministic build, these are in conflict. - /// (Originally from ..\FSComp.txt:1137) + /// (Originally from ..\FSComp.txt:1139) static member fscAssemblyWildcardAndDeterminism(a0 : System.String, a1 : System.String) = (2025, GetStringFunc("fscAssemblyWildcardAndDeterminism",",,,%s,,,%s,,,") a0 a1) /// Determinstic builds only support portable PDBs (--debug:portable or --debug:embedded) - /// (Originally from ..\FSComp.txt:1138) + /// (Originally from ..\FSComp.txt:1140) static member fscDeterministicDebugRequiresPortablePdb() = (2026, GetStringFunc("fscDeterministicDebugRequiresPortablePdb",",,,") ) /// Character '%s' is not allowed in provided namespace name '%s' - /// (Originally from ..\FSComp.txt:1139) + /// (Originally from ..\FSComp.txt:1141) static member etIllegalCharactersInNamespaceName(a0 : System.String, a1 : System.String) = (3000, GetStringFunc("etIllegalCharactersInNamespaceName",",,,%s,,,%s,,,") a0 a1) /// The provided type '%s' returned a member with a null or empty member name - /// (Originally from ..\FSComp.txt:1140) + /// (Originally from ..\FSComp.txt:1142) static member etNullOrEmptyMemberName(a0 : System.String) = (3001, GetStringFunc("etNullOrEmptyMemberName",",,,%s,,,") a0) /// The provided type '%s' returned a null member - /// (Originally from ..\FSComp.txt:1141) + /// (Originally from ..\FSComp.txt:1143) static member etNullMember(a0 : System.String) = (3002, GetStringFunc("etNullMember",",,,%s,,,") a0) /// The provided type '%s' member info '%s' has null declaring type - /// (Originally from ..\FSComp.txt:1142) + /// (Originally from ..\FSComp.txt:1144) static member etNullMemberDeclaringType(a0 : System.String, a1 : System.String) = (3003, GetStringFunc("etNullMemberDeclaringType",",,,%s,,,%s,,,") a0 a1) /// The provided type '%s' has member '%s' which has declaring type '%s'. Expected declaring type to be the same as provided type. - /// (Originally from ..\FSComp.txt:1143) + /// (Originally from ..\FSComp.txt:1145) static member etNullMemberDeclaringTypeDifferentFromProvidedType(a0 : System.String, a1 : System.String, a2 : System.String) = (3004, GetStringFunc("etNullMemberDeclaringTypeDifferentFromProvidedType",",,,%s,,,%s,,,%s,,,") a0 a1 a2) /// Referenced assembly '%s' has assembly level attribute '%s' but no public type provider classes were found - /// (Originally from ..\FSComp.txt:1144) + /// (Originally from ..\FSComp.txt:1146) static member etHostingAssemblyFoundWithoutHosts(a0 : System.String, a1 : System.String) = (3005, GetStringFunc("etHostingAssemblyFoundWithoutHosts",",,,%s,,,%s,,,") a0 a1) /// Type '%s' from type provider '%s' has an empty namespace. Use 'null' for the global namespace. - /// (Originally from ..\FSComp.txt:1145) + /// (Originally from ..\FSComp.txt:1147) static member etEmptyNamespaceOfTypeNotAllowed(a0 : System.String, a1 : System.String) = (3006, GetStringFunc("etEmptyNamespaceOfTypeNotAllowed",",,,%s,,,%s,,,") a0 a1) /// Empty namespace found from the type provider '%s'. Use 'null' for the global namespace. - /// (Originally from ..\FSComp.txt:1146) + /// (Originally from ..\FSComp.txt:1148) static member etEmptyNamespaceNotAllowed(a0 : System.String) = (3007, GetStringFunc("etEmptyNamespaceNotAllowed",",,,%s,,,") a0) /// Provided type '%s' has 'IsGenericType' as true, but generic types are not supported. - /// (Originally from ..\FSComp.txt:1147) + /// (Originally from ..\FSComp.txt:1149) static member etMustNotBeGeneric(a0 : System.String) = (3011, GetStringFunc("etMustNotBeGeneric",",,,%s,,,") a0) /// Provided type '%s' has 'IsArray' as true, but array types are not supported. - /// (Originally from ..\FSComp.txt:1148) + /// (Originally from ..\FSComp.txt:1150) static member etMustNotBeAnArray(a0 : System.String) = (3013, GetStringFunc("etMustNotBeAnArray",",,,%s,,,") a0) /// Invalid member '%s' on provided type '%s'. Provided type members must be public, and not be generic, virtual, or abstract. - /// (Originally from ..\FSComp.txt:1149) + /// (Originally from ..\FSComp.txt:1151) static member etMethodHasRequirements(a0 : System.String, a1 : System.String) = (3014, GetStringFunc("etMethodHasRequirements",",,,%s,,,%s,,,") a0 a1) /// Invalid member '%s' on provided type '%s'. Only properties, methods and constructors are allowed - /// (Originally from ..\FSComp.txt:1150) + /// (Originally from ..\FSComp.txt:1152) static member etUnsupportedMemberKind(a0 : System.String, a1 : System.String) = (3015, GetStringFunc("etUnsupportedMemberKind",",,,%s,,,%s,,,") a0 a1) /// Property '%s' on provided type '%s' has CanRead=true but there was no value from GetGetMethod() - /// (Originally from ..\FSComp.txt:1151) + /// (Originally from ..\FSComp.txt:1153) static member etPropertyCanReadButHasNoGetter(a0 : System.String, a1 : System.String) = (3016, GetStringFunc("etPropertyCanReadButHasNoGetter",",,,%s,,,%s,,,") a0 a1) /// Property '%s' on provided type '%s' has CanRead=false but GetGetMethod() returned a method - /// (Originally from ..\FSComp.txt:1152) + /// (Originally from ..\FSComp.txt:1154) static member etPropertyHasGetterButNoCanRead(a0 : System.String, a1 : System.String) = (3017, GetStringFunc("etPropertyHasGetterButNoCanRead",",,,%s,,,%s,,,") a0 a1) /// Property '%s' on provided type '%s' has CanWrite=true but there was no value from GetSetMethod() - /// (Originally from ..\FSComp.txt:1153) + /// (Originally from ..\FSComp.txt:1155) static member etPropertyCanWriteButHasNoSetter(a0 : System.String, a1 : System.String) = (3018, GetStringFunc("etPropertyCanWriteButHasNoSetter",",,,%s,,,%s,,,") a0 a1) /// Property '%s' on provided type '%s' has CanWrite=false but GetSetMethod() returned a method - /// (Originally from ..\FSComp.txt:1154) + /// (Originally from ..\FSComp.txt:1156) static member etPropertyHasSetterButNoCanWrite(a0 : System.String, a1 : System.String) = (3019, GetStringFunc("etPropertyHasSetterButNoCanWrite",",,,%s,,,%s,,,") a0 a1) /// One or more errors seen during provided type setup - /// (Originally from ..\FSComp.txt:1155) + /// (Originally from ..\FSComp.txt:1157) static member etOneOrMoreErrorsSeenDuringExtensionTypeSetting() = (3020, GetStringFunc("etOneOrMoreErrorsSeenDuringExtensionTypeSetting",",,,") ) /// Unexpected exception from provided type '%s' member '%s': %s - /// (Originally from ..\FSComp.txt:1156) + /// (Originally from ..\FSComp.txt:1158) static member etUnexpectedExceptionFromProvidedTypeMember(a0 : System.String, a1 : System.String, a2 : System.String) = (3021, GetStringFunc("etUnexpectedExceptionFromProvidedTypeMember",",,,%s,,,%s,,,%s,,,") a0 a1 a2) /// Unsupported constant type '%s'. Quotations provided by type providers can only contain simple constants. The implementation of the type provider may need to be adjusted by moving a value declared outside a provided quotation literal to be a 'let' binding inside the quotation literal. - /// (Originally from ..\FSComp.txt:1157) + /// (Originally from ..\FSComp.txt:1159) static member etUnsupportedConstantType(a0 : System.String) = (3022, GetStringFunc("etUnsupportedConstantType",",,,%s,,,") a0) /// Unsupported expression '%s' from type provider. If you are the author of this type provider, consider adjusting it to provide a different provided expression. - /// (Originally from ..\FSComp.txt:1158) + /// (Originally from ..\FSComp.txt:1160) static member etUnsupportedProvidedExpression(a0 : System.String) = (3025, GetStringFunc("etUnsupportedProvidedExpression",",,,%s,,,") a0) /// Expected provided type named '%s' but provided type has 'Name' with value '%s' - /// (Originally from ..\FSComp.txt:1159) + /// (Originally from ..\FSComp.txt:1161) static member etProvidedTypeHasUnexpectedName(a0 : System.String, a1 : System.String) = (3028, GetStringFunc("etProvidedTypeHasUnexpectedName",",,,%s,,,%s,,,") a0 a1) /// Event '%s' on provided type '%s' has no value from GetAddMethod() - /// (Originally from ..\FSComp.txt:1160) + /// (Originally from ..\FSComp.txt:1162) static member etEventNoAdd(a0 : System.String, a1 : System.String) = (3029, GetStringFunc("etEventNoAdd",",,,%s,,,%s,,,") a0 a1) /// Event '%s' on provided type '%s' has no value from GetRemoveMethod() - /// (Originally from ..\FSComp.txt:1161) + /// (Originally from ..\FSComp.txt:1163) static member etEventNoRemove(a0 : System.String, a1 : System.String) = (3030, GetStringFunc("etEventNoRemove",",,,%s,,,%s,,,") a0 a1) /// Assembly attribute '%s' refers to a designer assembly '%s' which cannot be loaded or doesn't exist. %s - /// (Originally from ..\FSComp.txt:1162) + /// (Originally from ..\FSComp.txt:1164) static member etProviderHasWrongDesignerAssembly(a0 : System.String, a1 : System.String, a2 : System.String) = (3031, GetStringFunc("etProviderHasWrongDesignerAssembly",",,,%s,,,%s,,,%s,,,") a0 a1 a2) /// The type provider does not have a valid constructor. A constructor taking either no arguments or one argument of type 'TypeProviderConfig' was expected. - /// (Originally from ..\FSComp.txt:1163) + /// (Originally from ..\FSComp.txt:1165) static member etProviderDoesNotHaveValidConstructor() = (3032, GetStringFunc("etProviderDoesNotHaveValidConstructor",",,,") ) /// The type provider '%s' reported an error: %s - /// (Originally from ..\FSComp.txt:1164) + /// (Originally from ..\FSComp.txt:1166) static member etProviderError(a0 : System.String, a1 : System.String) = (3033, GetStringFunc("etProviderError",",,,%s,,,%s,,,") a0 a1) /// The type provider '%s' used an invalid parameter in the ParameterExpression: %s - /// (Originally from ..\FSComp.txt:1165) + /// (Originally from ..\FSComp.txt:1167) static member etIncorrectParameterExpression(a0 : System.String, a1 : System.String) = (3034, GetStringFunc("etIncorrectParameterExpression",",,,%s,,,%s,,,") a0 a1) /// The type provider '%s' provided a method with a name '%s' and metadata token '%d', which is not reported among its methods of its declaring type '%s' - /// (Originally from ..\FSComp.txt:1166) + /// (Originally from ..\FSComp.txt:1168) static member etIncorrectProvidedMethod(a0 : System.String, a1 : System.String, a2 : System.Int32, a3 : System.String) = (3035, GetStringFunc("etIncorrectProvidedMethod",",,,%s,,,%s,,,%d,,,%s,,,") a0 a1 a2 a3) /// The type provider '%s' provided a constructor which is not reported among the constructors of its declaring type '%s' - /// (Originally from ..\FSComp.txt:1167) + /// (Originally from ..\FSComp.txt:1169) static member etIncorrectProvidedConstructor(a0 : System.String, a1 : System.String) = (3036, GetStringFunc("etIncorrectProvidedConstructor",",,,%s,,,%s,,,") a0 a1) /// A direct reference to the generated type '%s' is not permitted. Instead, use a type definition, e.g. 'type TypeAlias = '. This indicates that a type provider adds generated types to your assembly. - /// (Originally from ..\FSComp.txt:1168) + /// (Originally from ..\FSComp.txt:1170) static member etDirectReferenceToGeneratedTypeNotAllowed(a0 : System.String) = (3039, GetStringFunc("etDirectReferenceToGeneratedTypeNotAllowed",",,,%s,,,") a0) /// Expected provided type with path '%s' but provided type has path '%s' - /// (Originally from ..\FSComp.txt:1169) + /// (Originally from ..\FSComp.txt:1171) static member etProvidedTypeHasUnexpectedPath(a0 : System.String, a1 : System.String) = (3041, GetStringFunc("etProvidedTypeHasUnexpectedPath",",,,%s,,,%s,,,") a0 a1) /// Unexpected 'null' return value from provided type '%s' member '%s' - /// (Originally from ..\FSComp.txt:1170) + /// (Originally from ..\FSComp.txt:1172) static member etUnexpectedNullFromProvidedTypeMember(a0 : System.String, a1 : System.String) = (3042, GetStringFunc("etUnexpectedNullFromProvidedTypeMember",",,,%s,,,%s,,,") a0 a1) /// Unexpected exception from member '%s' of provided type '%s' member '%s': %s - /// (Originally from ..\FSComp.txt:1171) + /// (Originally from ..\FSComp.txt:1173) static member etUnexpectedExceptionFromProvidedMemberMember(a0 : System.String, a1 : System.String, a2 : System.String, a3 : System.String) = (3043, GetStringFunc("etUnexpectedExceptionFromProvidedMemberMember",",,,%s,,,%s,,,%s,,,%s,,,") a0 a1 a2 a3) /// Nested provided types do not take static arguments or generic parameters - /// (Originally from ..\FSComp.txt:1172) + /// (Originally from ..\FSComp.txt:1174) static member etNestedProvidedTypesDoNotTakeStaticArgumentsOrGenericParameters() = (3044, GetStringFunc("etNestedProvidedTypesDoNotTakeStaticArgumentsOrGenericParameters",",,,") ) /// Invalid static argument to provided type. Expected an argument of kind '%s'. - /// (Originally from ..\FSComp.txt:1173) + /// (Originally from ..\FSComp.txt:1175) static member etInvalidStaticArgument(a0 : System.String) = (3045, GetStringFunc("etInvalidStaticArgument",",,,%s,,,") a0) /// An error occured applying the static arguments to a provided type - /// (Originally from ..\FSComp.txt:1174) + /// (Originally from ..\FSComp.txt:1176) static member etErrorApplyingStaticArgumentsToType() = (3046, GetStringFunc("etErrorApplyingStaticArgumentsToType",",,,") ) /// Unknown static argument kind '%s' when resolving a reference to a provided type or method '%s' - /// (Originally from ..\FSComp.txt:1175) + /// (Originally from ..\FSComp.txt:1177) static member etUnknownStaticArgumentKind(a0 : System.String, a1 : System.String) = (3047, GetStringFunc("etUnknownStaticArgumentKind",",,,%s,,,%s,,,") a0 a1) /// invalid namespace for provided type - /// (Originally from ..\FSComp.txt:1176) + /// (Originally from ..\FSComp.txt:1178) static member invalidNamespaceForProvidedType() = (GetStringFunc("invalidNamespaceForProvidedType",",,,") ) /// invalid full name for provided type - /// (Originally from ..\FSComp.txt:1177) + /// (Originally from ..\FSComp.txt:1179) static member invalidFullNameForProvidedType() = (GetStringFunc("invalidFullNameForProvidedType",",,,") ) /// The type provider returned 'null', which is not a valid return value from '%s' - /// (Originally from ..\FSComp.txt:1179) + /// (Originally from ..\FSComp.txt:1181) static member etProviderReturnedNull(a0 : System.String) = (3051, GetStringFunc("etProviderReturnedNull",",,,%s,,,") a0) /// The type provider constructor has thrown an exception: %s - /// (Originally from ..\FSComp.txt:1180) + /// (Originally from ..\FSComp.txt:1182) static member etTypeProviderConstructorException(a0 : System.String) = (3053, GetStringFunc("etTypeProviderConstructorException",",,,%s,,,") a0) /// Type provider '%s' returned null from GetInvokerExpression. - /// (Originally from ..\FSComp.txt:1181) + /// (Originally from ..\FSComp.txt:1183) static member etNullProvidedExpression(a0 : System.String) = (3056, GetStringFunc("etNullProvidedExpression",",,,%s,,,") a0) /// The type provider '%s' returned an invalid type from 'ApplyStaticArguments'. A type with name '%s' was expected, but a type with name '%s' was returned. - /// (Originally from ..\FSComp.txt:1182) + /// (Originally from ..\FSComp.txt:1184) static member etProvidedAppliedTypeHadWrongName(a0 : System.String, a1 : System.String, a2 : System.String) = (3057, GetStringFunc("etProvidedAppliedTypeHadWrongName",",,,%s,,,%s,,,%s,,,") a0 a1 a2) /// The type provider '%s' returned an invalid method from 'ApplyStaticArgumentsForMethod'. A method with name '%s' was expected, but a method with name '%s' was returned. - /// (Originally from ..\FSComp.txt:1183) + /// (Originally from ..\FSComp.txt:1185) static member etProvidedAppliedMethodHadWrongName(a0 : System.String, a1 : System.String, a2 : System.String) = (3058, GetStringFunc("etProvidedAppliedMethodHadWrongName",",,,%s,,,%s,,,%s,,,") a0 a1 a2) /// This type test or downcast will erase the provided type '%s' to the type '%s' - /// (Originally from ..\FSComp.txt:1184) + /// (Originally from ..\FSComp.txt:1186) static member tcTypeTestLossy(a0 : System.String, a1 : System.String) = (3060, GetStringFunc("tcTypeTestLossy",",,,%s,,,%s,,,") a0 a1) /// This downcast will erase the provided type '%s' to the type '%s'. - /// (Originally from ..\FSComp.txt:1185) + /// (Originally from ..\FSComp.txt:1187) static member tcTypeCastErased(a0 : System.String, a1 : System.String) = (3061, GetStringFunc("tcTypeCastErased",",,,%s,,,%s,,,") a0 a1) /// This type test with a provided type '%s' is not allowed because this provided type will be erased to '%s' at runtime. - /// (Originally from ..\FSComp.txt:1186) + /// (Originally from ..\FSComp.txt:1188) static member tcTypeTestErased(a0 : System.String, a1 : System.String) = (3062, GetStringFunc("tcTypeTestErased",",,,%s,,,%s,,,") a0 a1) /// Cannot inherit from erased provided type - /// (Originally from ..\FSComp.txt:1187) + /// (Originally from ..\FSComp.txt:1189) static member tcCannotInheritFromErasedType() = (3063, GetStringFunc("tcCannotInheritFromErasedType",",,,") ) /// Assembly '%s' hase TypeProviderAssembly attribute with invalid value '%s'. The value should be a valid assembly name - /// (Originally from ..\FSComp.txt:1188) + /// (Originally from ..\FSComp.txt:1190) static member etInvalidTypeProviderAssemblyName(a0 : System.String, a1 : System.String) = (3065, GetStringFunc("etInvalidTypeProviderAssemblyName",",,,%s,,,%s,,,") a0 a1) /// Invalid member name. Members may not have name '.ctor' or '.cctor' - /// (Originally from ..\FSComp.txt:1189) + /// (Originally from ..\FSComp.txt:1191) static member tcInvalidMemberNameCtor() = (3066, GetStringFunc("tcInvalidMemberNameCtor",",,,") ) /// The function or member '%s' is used in a way that requires further type annotations at its definition to ensure consistency of inferred types. The inferred signature is '%s'. - /// (Originally from ..\FSComp.txt:1190) + /// (Originally from ..\FSComp.txt:1192) static member tcInferredGenericTypeGivesRiseToInconsistency(a0 : System.String, a1 : System.String) = (3068, GetStringFunc("tcInferredGenericTypeGivesRiseToInconsistency",",,,%s,,,%s,,,") a0 a1) /// The number of type arguments did not match: '%d' given, '%d' expected. This may be related to a previously reported error. - /// (Originally from ..\FSComp.txt:1191) + /// (Originally from ..\FSComp.txt:1193) static member tcInvalidTypeArgumentCount(a0 : System.Int32, a1 : System.Int32) = (3069, GetStringFunc("tcInvalidTypeArgumentCount",",,,%d,,,%d,,,") a0 a1) /// Cannot override inherited member '%s' because it is sealed - /// (Originally from ..\FSComp.txt:1192) + /// (Originally from ..\FSComp.txt:1194) static member tcCannotOverrideSealedMethod(a0 : System.String) = (3070, GetStringFunc("tcCannotOverrideSealedMethod",",,,%s,,,") a0) /// The type provider '%s' reported an error in the context of provided type '%s', member '%s'. The error: %s - /// (Originally from ..\FSComp.txt:1193) + /// (Originally from ..\FSComp.txt:1195) static member etProviderErrorWithContext(a0 : System.String, a1 : System.String, a2 : System.String, a3 : System.String) = (3071, GetStringFunc("etProviderErrorWithContext",",,,%s,,,%s,,,%s,,,%s,,,") a0 a1 a2 a3) /// An exception occurred when accessing the '%s' of a provided type: %s - /// (Originally from ..\FSComp.txt:1194) + /// (Originally from ..\FSComp.txt:1196) static member etProvidedTypeWithNameException(a0 : System.String, a1 : System.String) = (3072, GetStringFunc("etProvidedTypeWithNameException",",,,%s,,,%s,,,") a0 a1) /// The '%s' of a provided type was null or empty. - /// (Originally from ..\FSComp.txt:1195) + /// (Originally from ..\FSComp.txt:1197) static member etProvidedTypeWithNullOrEmptyName(a0 : System.String) = (3073, GetStringFunc("etProvidedTypeWithNullOrEmptyName",",,,%s,,,") a0) /// Character '%s' is not allowed in provided type name '%s' - /// (Originally from ..\FSComp.txt:1196) + /// (Originally from ..\FSComp.txt:1198) static member etIllegalCharactersInTypeName(a0 : System.String, a1 : System.String) = (3075, GetStringFunc("etIllegalCharactersInTypeName",",,,%s,,,%s,,,") a0 a1) /// In queries, '%s' must use a simple pattern - /// (Originally from ..\FSComp.txt:1197) + /// (Originally from ..\FSComp.txt:1199) static member tcJoinMustUseSimplePattern(a0 : System.String) = (3077, GetStringFunc("tcJoinMustUseSimplePattern",",,,%s,,,") a0) /// A custom query operation for '%s' is required but not specified - /// (Originally from ..\FSComp.txt:1198) + /// (Originally from ..\FSComp.txt:1200) static member tcMissingCustomOperation(a0 : System.String) = (3078, GetStringFunc("tcMissingCustomOperation",",,,%s,,,") a0) /// Named static arguments must come after all unnamed static arguments - /// (Originally from ..\FSComp.txt:1199) + /// (Originally from ..\FSComp.txt:1201) static member etBadUnnamedStaticArgs() = (3080, GetStringFunc("etBadUnnamedStaticArgs",",,,") ) /// The static parameter '%s' of the provided type or method '%s' requires a value. Static parameters to type providers may be optionally specified using named arguments, e.g. '%s<%s=...>'. - /// (Originally from ..\FSComp.txt:1200) + /// (Originally from ..\FSComp.txt:1202) static member etStaticParameterRequiresAValue(a0 : System.String, a1 : System.String, a2 : System.String, a3 : System.String) = (3081, GetStringFunc("etStaticParameterRequiresAValue",",,,%s,,,%s,,,%s,,,%s,,,") a0 a1 a2 a3) /// No static parameter exists with name '%s' - /// (Originally from ..\FSComp.txt:1201) + /// (Originally from ..\FSComp.txt:1203) static member etNoStaticParameterWithName(a0 : System.String) = (3082, GetStringFunc("etNoStaticParameterWithName",",,,%s,,,") a0) /// The static parameter '%s' has already been given a value - /// (Originally from ..\FSComp.txt:1202) + /// (Originally from ..\FSComp.txt:1204) static member etStaticParameterAlreadyHasValue(a0 : System.String) = (3083, GetStringFunc("etStaticParameterAlreadyHasValue",",,,%s,,,") a0) /// Multiple static parameters exist with name '%s' - /// (Originally from ..\FSComp.txt:1203) + /// (Originally from ..\FSComp.txt:1205) static member etMultipleStaticParameterWithName(a0 : System.String) = (3084, GetStringFunc("etMultipleStaticParameterWithName",",,,%s,,,") a0) /// A custom operation may not be used in conjunction with a non-value or recursive 'let' binding in another part of this computation expression - /// (Originally from ..\FSComp.txt:1204) + /// (Originally from ..\FSComp.txt:1206) static member tcCustomOperationMayNotBeUsedInConjunctionWithNonSimpleLetBindings() = (3085, GetStringFunc("tcCustomOperationMayNotBeUsedInConjunctionWithNonSimpleLetBindings",",,,") ) /// A custom operation may not be used in conjunction with 'use', 'try/with', 'try/finally', 'if/then/else' or 'match' operators within this computation expression - /// (Originally from ..\FSComp.txt:1205) + /// (Originally from ..\FSComp.txt:1207) static member tcCustomOperationMayNotBeUsedHere() = (3086, GetStringFunc("tcCustomOperationMayNotBeUsedHere",",,,") ) /// The custom operation '%s' refers to a method which is overloaded. The implementations of custom operations may not be overloaded. - /// (Originally from ..\FSComp.txt:1206) + /// (Originally from ..\FSComp.txt:1208) static member tcCustomOperationMayNotBeOverloaded(a0 : System.String) = (3087, GetStringFunc("tcCustomOperationMayNotBeOverloaded",",,,%s,,,") a0) /// An if/then/else expression may not be used within queries. Consider using either an if/then expression, or use a sequence expression instead. - /// (Originally from ..\FSComp.txt:1207) + /// (Originally from ..\FSComp.txt:1209) static member tcIfThenElseMayNotBeUsedWithinQueries() = (3090, GetStringFunc("tcIfThenElseMayNotBeUsedWithinQueries",",,,") ) /// Invalid argument to 'methodhandleof' during codegen - /// (Originally from ..\FSComp.txt:1208) + /// (Originally from ..\FSComp.txt:1210) static member ilxgenUnexpectedArgumentToMethodHandleOfDuringCodegen() = (3091, GetStringFunc("ilxgenUnexpectedArgumentToMethodHandleOfDuringCodegen",",,,") ) /// A reference to a provided type was missing a value for the static parameter '%s'. You may need to recompile one or more referenced assemblies. - /// (Originally from ..\FSComp.txt:1209) + /// (Originally from ..\FSComp.txt:1211) static member etProvidedTypeReferenceMissingArgument(a0 : System.String) = (3092, GetStringFunc("etProvidedTypeReferenceMissingArgument",",,,%s,,,") a0) /// A reference to a provided type had an invalid value '%s' for a static parameter. You may need to recompile one or more referenced assemblies. - /// (Originally from ..\FSComp.txt:1210) + /// (Originally from ..\FSComp.txt:1212) static member etProvidedTypeReferenceInvalidText(a0 : System.String) = (3093, GetStringFunc("etProvidedTypeReferenceInvalidText",",,,%s,,,") a0) /// '%s' is not used correctly. This is a custom operation in this query or computation expression. - /// (Originally from ..\FSComp.txt:1211) + /// (Originally from ..\FSComp.txt:1213) static member tcCustomOperationNotUsedCorrectly(a0 : System.String) = (3095, GetStringFunc("tcCustomOperationNotUsedCorrectly",",,,%s,,,") a0) /// '%s' is not used correctly. Usage: %s. This is a custom operation in this query or computation expression. - /// (Originally from ..\FSComp.txt:1212) + /// (Originally from ..\FSComp.txt:1214) static member tcCustomOperationNotUsedCorrectly2(a0 : System.String, a1 : System.String) = (3095, GetStringFunc("tcCustomOperationNotUsedCorrectly2",",,,%s,,,%s,,,") a0 a1) /// %s var in collection %s (outerKey = innerKey). Note that parentheses are required after '%s' - /// (Originally from ..\FSComp.txt:1213) + /// (Originally from ..\FSComp.txt:1215) static member customOperationTextLikeJoin(a0 : System.String, a1 : System.String, a2 : System.String) = (GetStringFunc("customOperationTextLikeJoin",",,,%s,,,%s,,,%s,,,") a0 a1 a2) /// %s var in collection %s (outerKey = innerKey) into group. Note that parentheses are required after '%s' - /// (Originally from ..\FSComp.txt:1214) + /// (Originally from ..\FSComp.txt:1216) static member customOperationTextLikeGroupJoin(a0 : System.String, a1 : System.String, a2 : System.String) = (GetStringFunc("customOperationTextLikeGroupJoin",",,,%s,,,%s,,,%s,,,") a0 a1 a2) /// %s var in collection - /// (Originally from ..\FSComp.txt:1215) + /// (Originally from ..\FSComp.txt:1217) static member customOperationTextLikeZip(a0 : System.String) = (GetStringFunc("customOperationTextLikeZip",",,,%s,,,") a0) /// '%s' must be followed by a variable name. Usage: %s. - /// (Originally from ..\FSComp.txt:1216) + /// (Originally from ..\FSComp.txt:1218) static member tcBinaryOperatorRequiresVariable(a0 : System.String, a1 : System.String) = (3096, GetStringFunc("tcBinaryOperatorRequiresVariable",",,,%s,,,%s,,,") a0 a1) /// Incorrect syntax for '%s'. Usage: %s. - /// (Originally from ..\FSComp.txt:1217) + /// (Originally from ..\FSComp.txt:1219) static member tcOperatorIncorrectSyntax(a0 : System.String, a1 : System.String) = (3097, GetStringFunc("tcOperatorIncorrectSyntax",",,,%s,,,%s,,,") a0 a1) /// '%s' must come after a 'for' selection clause and be followed by the rest of the query. Syntax: ... %s ... - /// (Originally from ..\FSComp.txt:1218) + /// (Originally from ..\FSComp.txt:1220) static member tcBinaryOperatorRequiresBody(a0 : System.String, a1 : System.String) = (3098, GetStringFunc("tcBinaryOperatorRequiresBody",",,,%s,,,%s,,,") a0 a1) /// '%s' is used with an incorrect number of arguments. This is a custom operation in this query or computation expression. Expected %d argument(s), but given %d. - /// (Originally from ..\FSComp.txt:1219) + /// (Originally from ..\FSComp.txt:1221) static member tcCustomOperationHasIncorrectArgCount(a0 : System.String, a1 : System.Int32, a2 : System.Int32) = (3099, GetStringFunc("tcCustomOperationHasIncorrectArgCount",",,,%s,,,%d,,,%d,,,") a0 a1 a2) /// Expected an expression after this point - /// (Originally from ..\FSComp.txt:1220) + /// (Originally from ..\FSComp.txt:1222) static member parsExpectedExpressionAfterToken() = (3100, GetStringFunc("parsExpectedExpressionAfterToken",",,,") ) /// Expected a type after this point - /// (Originally from ..\FSComp.txt:1221) + /// (Originally from ..\FSComp.txt:1223) static member parsExpectedTypeAfterToken() = (3101, GetStringFunc("parsExpectedTypeAfterToken",",,,") ) /// Unmatched '[<'. Expected closing '>]' - /// (Originally from ..\FSComp.txt:1222) + /// (Originally from ..\FSComp.txt:1224) static member parsUnmatchedLBrackLess() = (3102, GetStringFunc("parsUnmatchedLBrackLess",",,,") ) /// Unexpected end of input in 'match' expression. Expected 'match with | -> | -> ...'. - /// (Originally from ..\FSComp.txt:1223) + /// (Originally from ..\FSComp.txt:1225) static member parsUnexpectedEndOfFileMatch() = (3103, GetStringFunc("parsUnexpectedEndOfFileMatch",",,,") ) /// Unexpected end of input in 'try' expression. Expected 'try with ' or 'try finally '. - /// (Originally from ..\FSComp.txt:1224) + /// (Originally from ..\FSComp.txt:1226) static member parsUnexpectedEndOfFileTry() = (3104, GetStringFunc("parsUnexpectedEndOfFileTry",",,,") ) /// Unexpected end of input in 'while' expression. Expected 'while do '. - /// (Originally from ..\FSComp.txt:1225) + /// (Originally from ..\FSComp.txt:1227) static member parsUnexpectedEndOfFileWhile() = (3105, GetStringFunc("parsUnexpectedEndOfFileWhile",",,,") ) /// Unexpected end of input in 'for' expression. Expected 'for in do '. - /// (Originally from ..\FSComp.txt:1226) + /// (Originally from ..\FSComp.txt:1228) static member parsUnexpectedEndOfFileFor() = (3106, GetStringFunc("parsUnexpectedEndOfFileFor",",,,") ) /// Unexpected end of input in 'match' or 'try' expression - /// (Originally from ..\FSComp.txt:1227) + /// (Originally from ..\FSComp.txt:1229) static member parsUnexpectedEndOfFileWith() = (3107, GetStringFunc("parsUnexpectedEndOfFileWith",",,,") ) /// Unexpected end of input in 'then' branch of conditional expression. Expected 'if then ' or 'if then else '. - /// (Originally from ..\FSComp.txt:1228) + /// (Originally from ..\FSComp.txt:1230) static member parsUnexpectedEndOfFileThen() = (3108, GetStringFunc("parsUnexpectedEndOfFileThen",",,,") ) /// Unexpected end of input in 'else' branch of conditional expression. Expected 'if then ' or 'if then else '. - /// (Originally from ..\FSComp.txt:1229) + /// (Originally from ..\FSComp.txt:1231) static member parsUnexpectedEndOfFileElse() = (3109, GetStringFunc("parsUnexpectedEndOfFileElse",",,,") ) /// Unexpected end of input in body of lambda expression. Expected 'fun ... -> '. - /// (Originally from ..\FSComp.txt:1230) + /// (Originally from ..\FSComp.txt:1232) static member parsUnexpectedEndOfFileFunBody() = (3110, GetStringFunc("parsUnexpectedEndOfFileFunBody",",,,") ) /// Unexpected end of input in type arguments - /// (Originally from ..\FSComp.txt:1231) + /// (Originally from ..\FSComp.txt:1233) static member parsUnexpectedEndOfFileTypeArgs() = (3111, GetStringFunc("parsUnexpectedEndOfFileTypeArgs",",,,") ) /// Unexpected end of input in type signature - /// (Originally from ..\FSComp.txt:1232) + /// (Originally from ..\FSComp.txt:1234) static member parsUnexpectedEndOfFileTypeSignature() = (3112, GetStringFunc("parsUnexpectedEndOfFileTypeSignature",",,,") ) /// Unexpected end of input in type definition - /// (Originally from ..\FSComp.txt:1233) + /// (Originally from ..\FSComp.txt:1235) static member parsUnexpectedEndOfFileTypeDefinition() = (3113, GetStringFunc("parsUnexpectedEndOfFileTypeDefinition",",,,") ) /// Unexpected end of input in object members - /// (Originally from ..\FSComp.txt:1234) + /// (Originally from ..\FSComp.txt:1236) static member parsUnexpectedEndOfFileObjectMembers() = (3114, GetStringFunc("parsUnexpectedEndOfFileObjectMembers",",,,") ) /// Unexpected end of input in value, function or member definition - /// (Originally from ..\FSComp.txt:1235) + /// (Originally from ..\FSComp.txt:1237) static member parsUnexpectedEndOfFileDefinition() = (3115, GetStringFunc("parsUnexpectedEndOfFileDefinition",",,,") ) /// Unexpected end of input in expression - /// (Originally from ..\FSComp.txt:1236) + /// (Originally from ..\FSComp.txt:1238) static member parsUnexpectedEndOfFileExpression() = (3116, GetStringFunc("parsUnexpectedEndOfFileExpression",",,,") ) /// Unexpected end of type. Expected a name after this point. - /// (Originally from ..\FSComp.txt:1237) + /// (Originally from ..\FSComp.txt:1239) static member parsExpectedNameAfterToken() = (3117, GetStringFunc("parsExpectedNameAfterToken",",,,") ) /// Incomplete value or function definition. If this is in an expression, the body of the expression must be indented to the same column as the 'let' keyword. - /// (Originally from ..\FSComp.txt:1238) + /// (Originally from ..\FSComp.txt:1240) static member parsUnmatchedLet() = (3118, GetStringFunc("parsUnmatchedLet",",,,") ) /// Incomplete value definition. If this is in an expression, the body of the expression must be indented to the same column as the 'let!' keyword. - /// (Originally from ..\FSComp.txt:1239) + /// (Originally from ..\FSComp.txt:1241) static member parsUnmatchedLetBang() = (3119, GetStringFunc("parsUnmatchedLetBang",",,,") ) /// Incomplete value definition. If this is in an expression, the body of the expression must be indented to the same column as the 'use!' keyword. - /// (Originally from ..\FSComp.txt:1240) + /// (Originally from ..\FSComp.txt:1242) static member parsUnmatchedUseBang() = (3120, GetStringFunc("parsUnmatchedUseBang",",,,") ) /// Incomplete value definition. If this is in an expression, the body of the expression must be indented to the same column as the 'use' keyword. - /// (Originally from ..\FSComp.txt:1241) + /// (Originally from ..\FSComp.txt:1243) static member parsUnmatchedUse() = (3121, GetStringFunc("parsUnmatchedUse",",,,") ) /// Missing 'do' in 'while' expression. Expected 'while do '. - /// (Originally from ..\FSComp.txt:1242) + /// (Originally from ..\FSComp.txt:1244) static member parsWhileDoExpected() = (3122, GetStringFunc("parsWhileDoExpected",",,,") ) /// Missing 'do' in 'for' expression. Expected 'for in do '. - /// (Originally from ..\FSComp.txt:1243) + /// (Originally from ..\FSComp.txt:1245) static member parsForDoExpected() = (3123, GetStringFunc("parsForDoExpected",",,,") ) /// Invalid join relation in '%s'. Expected 'expr expr', where is =, =?, ?= or ?=?. - /// (Originally from ..\FSComp.txt:1244) + /// (Originally from ..\FSComp.txt:1246) static member tcInvalidRelationInJoin(a0 : System.String) = (3125, GetStringFunc("tcInvalidRelationInJoin",",,,%s,,,") a0) /// Calls - /// (Originally from ..\FSComp.txt:1245) + /// (Originally from ..\FSComp.txt:1247) static member typeInfoCallsWord() = (GetStringFunc("typeInfoCallsWord",",,,") ) /// Invalid number of generic arguments to type '%s' in provided type. Expected '%d' arguments, given '%d'. - /// (Originally from ..\FSComp.txt:1246) + /// (Originally from ..\FSComp.txt:1248) static member impInvalidNumberOfGenericArguments(a0 : System.String, a1 : System.Int32, a2 : System.Int32) = (3126, GetStringFunc("impInvalidNumberOfGenericArguments",",,,%s,,,%d,,,%d,,,") a0 a1 a2) /// Invalid value '%s' for unit-of-measure parameter '%s' - /// (Originally from ..\FSComp.txt:1247) + /// (Originally from ..\FSComp.txt:1249) static member impInvalidMeasureArgument1(a0 : System.String, a1 : System.String) = (3127, GetStringFunc("impInvalidMeasureArgument1",",,,%s,,,%s,,,") a0 a1) /// Invalid value unit-of-measure parameter '%s' - /// (Originally from ..\FSComp.txt:1248) + /// (Originally from ..\FSComp.txt:1250) static member impInvalidMeasureArgument2(a0 : System.String) = (3127, GetStringFunc("impInvalidMeasureArgument2",",,,%s,,,") a0) /// Property '%s' on provided type '%s' is neither readable nor writable as it has CanRead=false and CanWrite=false - /// (Originally from ..\FSComp.txt:1249) + /// (Originally from ..\FSComp.txt:1251) static member etPropertyNeedsCanWriteOrCanRead(a0 : System.String, a1 : System.String) = (3128, GetStringFunc("etPropertyNeedsCanWriteOrCanRead",",,,%s,,,%s,,,") a0 a1) /// A use of 'into' must be followed by the remainder of the computation - /// (Originally from ..\FSComp.txt:1250) + /// (Originally from ..\FSComp.txt:1252) static member tcIntoNeedsRestOfQuery() = (3129, GetStringFunc("tcIntoNeedsRestOfQuery",",,,") ) /// The operator '%s' does not accept the use of 'into' - /// (Originally from ..\FSComp.txt:1251) + /// (Originally from ..\FSComp.txt:1253) static member tcOperatorDoesntAcceptInto(a0 : System.String) = (3130, GetStringFunc("tcOperatorDoesntAcceptInto",",,,%s,,,") a0) /// The definition of the custom operator '%s' does not use a valid combination of attribute flags - /// (Originally from ..\FSComp.txt:1252) + /// (Originally from ..\FSComp.txt:1254) static member tcCustomOperationInvalid(a0 : System.String) = (3131, GetStringFunc("tcCustomOperationInvalid",",,,%s,,,") a0) /// This type definition may not have the 'CLIMutable' attribute. Only record types may have this attribute. - /// (Originally from ..\FSComp.txt:1253) + /// (Originally from ..\FSComp.txt:1255) static member tcThisTypeMayNotHaveACLIMutableAttribute() = (3132, GetStringFunc("tcThisTypeMayNotHaveACLIMutableAttribute",",,,") ) /// 'member val' definitions are only permitted in types with a primary constructor. Consider adding arguments to your type definition, e.g. 'type X(args) = ...'. - /// (Originally from ..\FSComp.txt:1254) + /// (Originally from ..\FSComp.txt:1256) static member tcAutoPropertyRequiresImplicitConstructionSequence() = (3133, GetStringFunc("tcAutoPropertyRequiresImplicitConstructionSequence",",,,") ) /// Property definitions may not be declared mutable. To indicate that this property can be set, use 'member val PropertyName = expr with get,set'. - /// (Originally from ..\FSComp.txt:1255) + /// (Originally from ..\FSComp.txt:1257) static member parsMutableOnAutoPropertyShouldBeGetSet() = (3134, GetStringFunc("parsMutableOnAutoPropertyShouldBeGetSet",",,,") ) /// To indicate that this property can be set, use 'member val PropertyName = expr with get,set'. - /// (Originally from ..\FSComp.txt:1256) + /// (Originally from ..\FSComp.txt:1258) static member parsMutableOnAutoPropertyShouldBeGetSetNotJustSet() = (3135, GetStringFunc("parsMutableOnAutoPropertyShouldBeGetSetNotJustSet",",,,") ) /// Type '%s' is illegal because in byref, T cannot contain byref types. - /// (Originally from ..\FSComp.txt:1257) + /// (Originally from ..\FSComp.txt:1259) static member chkNoByrefsOfByrefs(a0 : System.String) = (3136, GetStringFunc("chkNoByrefsOfByrefs",",,,%s,,,") a0) /// F# supports array ranks between 1 and 32. The value %d is not allowed. - /// (Originally from ..\FSComp.txt:1258) + /// (Originally from ..\FSComp.txt:1260) static member tastopsMaxArrayThirtyTwo(a0 : System.Int32) = (3138, GetStringFunc("tastopsMaxArrayThirtyTwo",",,,%d,,,") a0) /// In queries, use the form 'for x in n .. m do ...' for ranging over integers - /// (Originally from ..\FSComp.txt:1259) + /// (Originally from ..\FSComp.txt:1261) static member tcNoIntegerForLoopInQuery() = (3139, GetStringFunc("tcNoIntegerForLoopInQuery",",,,") ) /// 'while' expressions may not be used in queries - /// (Originally from ..\FSComp.txt:1260) + /// (Originally from ..\FSComp.txt:1262) static member tcNoWhileInQuery() = (3140, GetStringFunc("tcNoWhileInQuery",",,,") ) /// 'try/finally' expressions may not be used in queries - /// (Originally from ..\FSComp.txt:1261) + /// (Originally from ..\FSComp.txt:1263) static member tcNoTryFinallyInQuery() = (3141, GetStringFunc("tcNoTryFinallyInQuery",",,,") ) /// 'use' expressions may not be used in queries - /// (Originally from ..\FSComp.txt:1262) + /// (Originally from ..\FSComp.txt:1264) static member tcUseMayNotBeUsedInQueries() = (3142, GetStringFunc("tcUseMayNotBeUsedInQueries",",,,") ) /// 'let!', 'use!' and 'do!' expressions may not be used in queries - /// (Originally from ..\FSComp.txt:1263) + /// (Originally from ..\FSComp.txt:1265) static member tcBindMayNotBeUsedInQueries() = (3143, GetStringFunc("tcBindMayNotBeUsedInQueries",",,,") ) /// 'return' and 'return!' may not be used in queries - /// (Originally from ..\FSComp.txt:1264) + /// (Originally from ..\FSComp.txt:1266) static member tcReturnMayNotBeUsedInQueries() = (3144, GetStringFunc("tcReturnMayNotBeUsedInQueries",",,,") ) /// This is not a known query operator. Query operators are identifiers such as 'select', 'where', 'sortBy', 'thenBy', 'groupBy', 'groupValBy', 'join', 'groupJoin', 'sumBy' and 'averageBy', defined using corresponding methods on the 'QueryBuilder' type. - /// (Originally from ..\FSComp.txt:1265) + /// (Originally from ..\FSComp.txt:1267) static member tcUnrecognizedQueryOperator() = (3145, GetStringFunc("tcUnrecognizedQueryOperator",",,,") ) /// 'try/with' expressions may not be used in queries - /// (Originally from ..\FSComp.txt:1266) + /// (Originally from ..\FSComp.txt:1268) static member tcTryWithMayNotBeUsedInQueries() = (3146, GetStringFunc("tcTryWithMayNotBeUsedInQueries",",,,") ) /// This 'let' definition may not be used in a query. Only simple value definitions may be used in queries. - /// (Originally from ..\FSComp.txt:1267) + /// (Originally from ..\FSComp.txt:1269) static member tcNonSimpleLetBindingInQuery() = (3147, GetStringFunc("tcNonSimpleLetBindingInQuery",",,,") ) /// Too many static parameters. Expected at most %d parameters, but got %d unnamed and %d named parameters. - /// (Originally from ..\FSComp.txt:1268) + /// (Originally from ..\FSComp.txt:1270) static member etTooManyStaticParameters(a0 : System.Int32, a1 : System.Int32, a2 : System.Int32) = (3148, GetStringFunc("etTooManyStaticParameters",",,,%d,,,%d,,,%d,,,") a0 a1 a2) /// Invalid provided literal value '%s' - /// (Originally from ..\FSComp.txt:1269) + /// (Originally from ..\FSComp.txt:1271) static member infosInvalidProvidedLiteralValue(a0 : System.String) = (3149, GetStringFunc("infosInvalidProvidedLiteralValue",",,,%s,,,") a0) /// The 'anycpu32bitpreferred' platform can only be used with EXE targets. You must use 'anycpu' instead. - /// (Originally from ..\FSComp.txt:1270) + /// (Originally from ..\FSComp.txt:1272) static member invalidPlatformTarget() = (3150, GetStringFunc("invalidPlatformTarget",",,,") ) /// This member, function or value declaration may not be declared 'inline' - /// (Originally from ..\FSComp.txt:1271) + /// (Originally from ..\FSComp.txt:1273) static member tcThisValueMayNotBeInlined() = (3151, GetStringFunc("tcThisValueMayNotBeInlined",",,,") ) /// The provider '%s' returned a non-generated type '%s' in the context of a set of generated types. Consider adjusting the type provider to only return generated types. - /// (Originally from ..\FSComp.txt:1272) + /// (Originally from ..\FSComp.txt:1274) static member etErasedTypeUsedInGeneration(a0 : System.String, a1 : System.String) = (3152, GetStringFunc("etErasedTypeUsedInGeneration",",,,%s,,,%s,,,") a0 a1) /// Arguments to query operators may require parentheses, e.g. 'where (x > y)' or 'groupBy (x.Length / 10)' - /// (Originally from ..\FSComp.txt:1273) + /// (Originally from ..\FSComp.txt:1275) static member tcUnrecognizedQueryBinaryOperator() = (3153, GetStringFunc("tcUnrecognizedQueryBinaryOperator",",,,") ) /// A quotation may not involve an assignment to or taking the address of a captured local variable - /// (Originally from ..\FSComp.txt:1274) + /// (Originally from ..\FSComp.txt:1276) static member crefNoSetOfHole() = (3155, GetStringFunc("crefNoSetOfHole",",,,") ) /// + 1 overload - /// (Originally from ..\FSComp.txt:1275) + /// (Originally from ..\FSComp.txt:1277) static member nicePrintOtherOverloads1() = (GetStringFunc("nicePrintOtherOverloads1",",,,") ) /// + %d overloads - /// (Originally from ..\FSComp.txt:1276) + /// (Originally from ..\FSComp.txt:1278) static member nicePrintOtherOverloadsN(a0 : System.Int32) = (GetStringFunc("nicePrintOtherOverloadsN",",,,%d,,,") a0) /// Erased to - /// (Originally from ..\FSComp.txt:1277) + /// (Originally from ..\FSComp.txt:1279) static member erasedTo() = (GetStringFunc("erasedTo",",,,") ) /// Unexpected token '%s' or incomplete expression - /// (Originally from ..\FSComp.txt:1278) + /// (Originally from ..\FSComp.txt:1280) static member parsUnfinishedExpression(a0 : System.String) = (3156, GetStringFunc("parsUnfinishedExpression",",,,%s,,,") a0) /// Cannot find code target for this attribute, possibly because the code after the attribute is incomplete. - /// (Originally from ..\FSComp.txt:1279) + /// (Originally from ..\FSComp.txt:1281) static member parsAttributeOnIncompleteCode() = (3158, GetStringFunc("parsAttributeOnIncompleteCode",",,,") ) /// Type name cannot be empty. - /// (Originally from ..\FSComp.txt:1280) + /// (Originally from ..\FSComp.txt:1282) static member parsTypeNameCannotBeEmpty() = (3159, GetStringFunc("parsTypeNameCannotBeEmpty",",,,") ) /// Problem reading assembly '%s': %s - /// (Originally from ..\FSComp.txt:1281) + /// (Originally from ..\FSComp.txt:1283) static member buildProblemReadingAssembly(a0 : System.String, a1 : System.String) = (3160, GetStringFunc("buildProblemReadingAssembly",",,,%s,,,%s,,,") a0 a1) /// Invalid provided field. Provided fields of erased provided types must be literals. - /// (Originally from ..\FSComp.txt:1282) + /// (Originally from ..\FSComp.txt:1284) static member tcTPFieldMustBeLiteral() = (3161, GetStringFunc("tcTPFieldMustBeLiteral",",,,") ) /// (loading description...) - /// (Originally from ..\FSComp.txt:1283) + /// (Originally from ..\FSComp.txt:1285) static member loadingDescription() = (GetStringFunc("loadingDescription",",,,") ) /// (description unavailable...) - /// (Originally from ..\FSComp.txt:1284) + /// (Originally from ..\FSComp.txt:1286) static member descriptionUnavailable() = (GetStringFunc("descriptionUnavailable",",,,") ) /// A type variable has been constrained by multiple different class types. A type variable may only have one class constraint. - /// (Originally from ..\FSComp.txt:1285) + /// (Originally from ..\FSComp.txt:1287) static member chkTyparMultipleClassConstraints() = (3162, GetStringFunc("chkTyparMultipleClassConstraints",",,,") ) /// 'match' expressions may not be used in queries - /// (Originally from ..\FSComp.txt:1286) + /// (Originally from ..\FSComp.txt:1288) static member tcMatchMayNotBeUsedWithQuery() = (3163, GetStringFunc("tcMatchMayNotBeUsedWithQuery",",,,") ) /// Infix operator member '%s' has %d initial argument(s). Expected a tuple of 3 arguments - /// (Originally from ..\FSComp.txt:1287) + /// (Originally from ..\FSComp.txt:1289) static member memberOperatorDefinitionWithNonTripleArgument(a0 : System.String, a1 : System.Int32) = (3164, GetStringFunc("memberOperatorDefinitionWithNonTripleArgument",",,,%s,,,%d,,,") a0 a1) /// The operator '%s' cannot be resolved. Consider opening the module 'Microsoft.FSharp.Linq.NullableOperators'. - /// (Originally from ..\FSComp.txt:1288) + /// (Originally from ..\FSComp.txt:1290) static member cannotResolveNullableOperators(a0 : System.String) = (3165, GetStringFunc("cannotResolveNullableOperators",",,,%s,,,") a0) /// '%s' must be followed by 'in'. Usage: %s. - /// (Originally from ..\FSComp.txt:1289) + /// (Originally from ..\FSComp.txt:1291) static member tcOperatorRequiresIn(a0 : System.String, a1 : System.String) = (3167, GetStringFunc("tcOperatorRequiresIn",",,,%s,,,%s,,,") a0 a1) /// Neither 'member val' nor 'override val' definitions are permitted in object expressions. - /// (Originally from ..\FSComp.txt:1290) + /// (Originally from ..\FSComp.txt:1292) static member parsIllegalMemberVarInObjectImplementation() = (3168, GetStringFunc("parsIllegalMemberVarInObjectImplementation",",,,") ) /// Copy-and-update record expressions must include at least one field. - /// (Originally from ..\FSComp.txt:1291) + /// (Originally from ..\FSComp.txt:1293) static member tcEmptyCopyAndUpdateRecordInvalid() = (3169, GetStringFunc("tcEmptyCopyAndUpdateRecordInvalid",",,,") ) /// '_' cannot be used as field name - /// (Originally from ..\FSComp.txt:1292) + /// (Originally from ..\FSComp.txt:1294) static member parsUnderscoreInvalidFieldName() = (3170, GetStringFunc("parsUnderscoreInvalidFieldName",",,,") ) /// The provided types generated by this use of a type provider may not be used from other F# assemblies and should be marked internal or private. Consider using 'type internal TypeName = ...' or 'type private TypeName = ...'. - /// (Originally from ..\FSComp.txt:1293) + /// (Originally from ..\FSComp.txt:1295) static member tcGeneratedTypesShouldBeInternalOrPrivate() = (3171, GetStringFunc("tcGeneratedTypesShouldBeInternalOrPrivate",",,,") ) /// A property's getter and setter must have the same type. Property '%s' has getter of type '%s' but setter of type '%s'. - /// (Originally from ..\FSComp.txt:1294) + /// (Originally from ..\FSComp.txt:1296) static member chkGetterAndSetterHaveSamePropertyType(a0 : System.String, a1 : System.String, a2 : System.String) = (3172, GetStringFunc("chkGetterAndSetterHaveSamePropertyType",",,,%s,,,%s,,,%s,,,") a0 a1 a2) /// Array method '%s' is supplied by the runtime and cannot be directly used in code. For operations with array elements consider using family of GetArray/SetArray functions from LanguagePrimitives.IntrinsicFunctions module. - /// (Originally from ..\FSComp.txt:1295) + /// (Originally from ..\FSComp.txt:1297) static member tcRuntimeSuppliedMethodCannotBeUsedInUserCode(a0 : System.String) = (3173, GetStringFunc("tcRuntimeSuppliedMethodCannotBeUsedInUserCode",",,,%s,,,") a0) - /// Union case/exception '%s' does not have field named '%s'. - /// (Originally from ..\FSComp.txt:1296) + /// The union case '%s' does not have a field named '%s'. + /// (Originally from ..\FSComp.txt:1298) static member tcUnionCaseConstructorDoesNotHaveFieldWithGivenName(a0 : System.String, a1 : System.String) = (3174, GetStringFunc("tcUnionCaseConstructorDoesNotHaveFieldWithGivenName",",,,%s,,,%s,,,") a0 a1) + /// The exception '%s' does not have a field named '%s'. + /// (Originally from ..\FSComp.txt:1299) + static member tcExceptionConstructorDoesNotHaveFieldWithGivenName(a0 : System.String, a1 : System.String) = (3174, GetStringFunc("tcExceptionConstructorDoesNotHaveFieldWithGivenName",",,,%s,,,%s,,,") a0 a1) + /// Active patterns do not have fields. This syntax is invalid. + /// (Originally from ..\FSComp.txt:1300) + static member tcActivePatternsDoNotHaveFields() = (3174, GetStringFunc("tcActivePatternsDoNotHaveFields",",,,") ) + /// The constructor does not have a field named '%s'. + /// (Originally from ..\FSComp.txt:1301) + static member tcConstructorDoesNotHaveFieldWithGivenName(a0 : System.String) = (3174, GetStringFunc("tcConstructorDoesNotHaveFieldWithGivenName",",,,%s,,,") a0) /// Union case/exception field '%s' cannot be used more than once. - /// (Originally from ..\FSComp.txt:1297) + /// (Originally from ..\FSComp.txt:1302) static member tcUnionCaseFieldCannotBeUsedMoreThanOnce(a0 : System.String) = (3175, GetStringFunc("tcUnionCaseFieldCannotBeUsedMoreThanOnce",",,,%s,,,") a0) /// Named field '%s' is used more than once. - /// (Originally from ..\FSComp.txt:1298) + /// (Originally from ..\FSComp.txt:1303) static member tcFieldNameIsUsedModeThanOnce(a0 : System.String) = (3176, GetStringFunc("tcFieldNameIsUsedModeThanOnce",",,,%s,,,") a0) /// Named field '%s' conflicts with autogenerated name for anonymous field. - /// (Originally from ..\FSComp.txt:1299) + /// (Originally from ..\FSComp.txt:1304) static member tcFieldNameConflictsWithGeneratedNameForAnonymousField(a0 : System.String) = (3176, GetStringFunc("tcFieldNameConflictsWithGeneratedNameForAnonymousField",",,,%s,,,") a0) /// This literal expression or attribute argument results in an arithmetic overflow. - /// (Originally from ..\FSComp.txt:1300) + /// (Originally from ..\FSComp.txt:1305) static member tastConstantExpressionOverflow() = (3177, GetStringFunc("tastConstantExpressionOverflow",",,,") ) /// This is not valid literal expression. The [] attribute will be ignored. - /// (Originally from ..\FSComp.txt:1301) + /// (Originally from ..\FSComp.txt:1306) static member tcIllegalStructTypeForConstantExpression() = (3178, GetStringFunc("tcIllegalStructTypeForConstantExpression",",,,") ) /// System.Runtime.InteropServices assembly is required to use UnknownWrapper\DispatchWrapper classes. - /// (Originally from ..\FSComp.txt:1302) + /// (Originally from ..\FSComp.txt:1307) static member fscSystemRuntimeInteropServicesIsRequired() = (3179, GetStringFunc("fscSystemRuntimeInteropServicesIsRequired",",,,") ) /// The mutable local '%s' is implicitly allocated as a reference cell because it has been captured by a closure. This warning is for informational purposes only to indicate where implicit allocations are performed. - /// (Originally from ..\FSComp.txt:1303) + /// (Originally from ..\FSComp.txt:1308) static member abImplicitHeapAllocation(a0 : System.String) = (3180, GetStringFunc("abImplicitHeapAllocation",",,,%s,,,") a0) /// A type provider implemented GetStaticParametersForMethod, but ApplyStaticArgumentsForMethod was not implemented or invalid - /// (Originally from ..\FSComp.txt:1304) + /// (Originally from ..\FSComp.txt:1309) static member estApplyStaticArgumentsForMethodNotImplemented() = (GetStringFunc("estApplyStaticArgumentsForMethodNotImplemented",",,,") ) /// An error occured applying the static arguments to a provided method - /// (Originally from ..\FSComp.txt:1305) + /// (Originally from ..\FSComp.txt:1310) static member etErrorApplyingStaticArgumentsToMethod() = (3181, GetStringFunc("etErrorApplyingStaticArgumentsToMethod",",,,") ) /// Unexpected character '%s' in preprocessor expression - /// (Originally from ..\FSComp.txt:1306) + /// (Originally from ..\FSComp.txt:1311) static member pplexUnexpectedChar(a0 : System.String) = (3182, GetStringFunc("pplexUnexpectedChar",",,,%s,,,") a0) /// Unexpected token '%s' in preprocessor expression - /// (Originally from ..\FSComp.txt:1307) + /// (Originally from ..\FSComp.txt:1312) static member ppparsUnexpectedToken(a0 : System.String) = (3183, GetStringFunc("ppparsUnexpectedToken",",,,%s,,,") a0) /// Incomplete preprocessor expression - /// (Originally from ..\FSComp.txt:1308) + /// (Originally from ..\FSComp.txt:1313) static member ppparsIncompleteExpression() = (3184, GetStringFunc("ppparsIncompleteExpression",",,,") ) /// Missing token '%s' in preprocessor expression - /// (Originally from ..\FSComp.txt:1309) + /// (Originally from ..\FSComp.txt:1314) static member ppparsMissingToken(a0 : System.String) = (3185, GetStringFunc("ppparsMissingToken",",,,%s,,,") a0) /// An error occurred while reading the F# metadata node at position %d in table '%s' of assembly '%s'. The node had no matching declaration. Please report this warning. You may need to recompile the F# assembly you are using. - /// (Originally from ..\FSComp.txt:1310) + /// (Originally from ..\FSComp.txt:1315) static member pickleMissingDefinition(a0 : System.Int32, a1 : System.String, a2 : System.String) = (3186, GetStringFunc("pickleMissingDefinition",",,,%d,,,%s,,,%s,,,") a0 a1 a2) /// Type inference caused the type variable %s to escape its scope. Consider adding an explicit type parameter declaration or adjusting your code to be less generic. - /// (Originally from ..\FSComp.txt:1311) + /// (Originally from ..\FSComp.txt:1316) static member checkNotSufficientlyGenericBecauseOfScope(a0 : System.String) = (3187, GetStringFunc("checkNotSufficientlyGenericBecauseOfScope",",,,%s,,,") a0) /// Type inference caused an inference type variable to escape its scope. Consider adding type annotations to make your code less generic. - /// (Originally from ..\FSComp.txt:1312) + /// (Originally from ..\FSComp.txt:1317) static member checkNotSufficientlyGenericBecauseOfScopeAnon() = (3188, GetStringFunc("checkNotSufficientlyGenericBecauseOfScopeAnon",",,,") ) /// Redundant arguments are being ignored in function '%s'. Expected %d but got %d arguments. - /// (Originally from ..\FSComp.txt:1313) + /// (Originally from ..\FSComp.txt:1318) static member checkRaiseFamilyFunctionArgumentCount(a0 : System.String, a1 : System.Int32, a2 : System.Int32) = (3189, GetStringFunc("checkRaiseFamilyFunctionArgumentCount",",,,%s,,,%d,,,%d,,,") a0 a1 a2) /// Lowercase literal '%s' is being shadowed by a new pattern with the same name. Only uppercase and module-prefixed literals can be used as named patterns. - /// (Originally from ..\FSComp.txt:1314) + /// (Originally from ..\FSComp.txt:1319) static member checkLowercaseLiteralBindingInPattern(a0 : System.String) = (3190, GetStringFunc("checkLowercaseLiteralBindingInPattern",",,,%s,,,") a0) /// This literal pattern does not take arguments - /// (Originally from ..\FSComp.txt:1315) + /// (Originally from ..\FSComp.txt:1320) static member tcLiteralDoesNotTakeArguments() = (3191, GetStringFunc("tcLiteralDoesNotTakeArguments",",,,") ) /// Constructors are not permitted as extension members - they must be defined as part of the original definition of the type - /// (Originally from ..\FSComp.txt:1316) + /// (Originally from ..\FSComp.txt:1321) static member tcConstructorsIllegalInAugmentation() = (3192, GetStringFunc("tcConstructorsIllegalInAugmentation",",,,") ) /// Invalid response file '%s' ( '%s' ) - /// (Originally from ..\FSComp.txt:1317) + /// (Originally from ..\FSComp.txt:1322) static member optsInvalidResponseFile(a0 : System.String, a1 : System.String) = (3193, GetStringFunc("optsInvalidResponseFile",",,,%s,,,%s,,,") a0 a1) /// Response file '%s' not found in '%s' - /// (Originally from ..\FSComp.txt:1318) + /// (Originally from ..\FSComp.txt:1323) static member optsResponseFileNotFound(a0 : System.String, a1 : System.String) = (3194, GetStringFunc("optsResponseFileNotFound",",,,%s,,,%s,,,") a0 a1) /// Response file name '%s' is empty, contains invalid characters, has a drive specification without an absolute path, or is too long - /// (Originally from ..\FSComp.txt:1319) + /// (Originally from ..\FSComp.txt:1324) static member optsResponseFileNameInvalid(a0 : System.String) = (3195, GetStringFunc("optsResponseFileNameInvalid",",,,%s,,,") a0) /// Cannot find FSharp.Core.dll in compiler's directory - /// (Originally from ..\FSComp.txt:1320) + /// (Originally from ..\FSComp.txt:1325) static member fsharpCoreNotFoundToBeCopied() = (3196, GetStringFunc("fsharpCoreNotFoundToBeCopied",",,,") ) /// One tuple type is a struct tuple, the other is a reference tuple - /// (Originally from ..\FSComp.txt:1321) + /// (Originally from ..\FSComp.txt:1326) static member tcTupleStructMismatch() = (GetStringFunc("tcTupleStructMismatch",",,,") ) /// This provided method requires static parameters - /// (Originally from ..\FSComp.txt:1322) + /// (Originally from ..\FSComp.txt:1327) static member etMissingStaticArgumentsToMethod() = (3197, GetStringFunc("etMissingStaticArgumentsToMethod",",,,") ) /// The conversion from %s to %s is a compile-time safe upcast, not a downcast. Consider using 'upcast' instead of 'downcast'. - /// (Originally from ..\FSComp.txt:1323) + /// (Originally from ..\FSComp.txt:1328) static member considerUpcast(a0 : System.String, a1 : System.String) = (3198, GetStringFunc("considerUpcast",",,,%s,,,%s,,,") a0 a1) /// The conversion from %s to %s is a compile-time safe upcast, not a downcast. Consider using the :> (upcast) operator instead of the :?> (downcast) operator. - /// (Originally from ..\FSComp.txt:1324) + /// (Originally from ..\FSComp.txt:1329) static member considerUpcastOperator(a0 : System.String, a1 : System.String) = (3198, GetStringFunc("considerUpcastOperator",",,,%s,,,%s,,,") a0 a1) /// The 'rec' on this module is implied by an outer 'rec' declaration and is being ignored - /// (Originally from ..\FSComp.txt:1325) + /// (Originally from ..\FSComp.txt:1330) static member tcRecImplied() = (3199, GetStringFunc("tcRecImplied",",,,") ) /// In a recursive declaration group, 'open' declarations must come first in each module - /// (Originally from ..\FSComp.txt:1326) + /// (Originally from ..\FSComp.txt:1331) static member tcOpenFirstInMutRec() = (3200, GetStringFunc("tcOpenFirstInMutRec",",,,") ) /// In a recursive declaration group, module abbreviations must come after all 'open' declarations and before other declarations - /// (Originally from ..\FSComp.txt:1327) + /// (Originally from ..\FSComp.txt:1332) static member tcModuleAbbrevFirstInMutRec() = (3201, GetStringFunc("tcModuleAbbrevFirstInMutRec",",,,") ) /// This declaration is not supported in recursive declaration groups - /// (Originally from ..\FSComp.txt:1328) + /// (Originally from ..\FSComp.txt:1333) static member tcUnsupportedMutRecDecl() = (3202, GetStringFunc("tcUnsupportedMutRecDecl",",,,") ) /// Invalid use of 'rec' keyword - /// (Originally from ..\FSComp.txt:1329) + /// (Originally from ..\FSComp.txt:1334) static member parsInvalidUseOfRec() = (3203, GetStringFunc("parsInvalidUseOfRec",",,,") ) /// If a union type has more than one case and is a struct, then all fields within the union type must be given unique names. - /// (Originally from ..\FSComp.txt:1330) + /// (Originally from ..\FSComp.txt:1335) static member tcStructUnionMultiCaseDistinctFields() = (3204, GetStringFunc("tcStructUnionMultiCaseDistinctFields",",,,") ) /// The CallerMemberNameAttribute applied to parameter '%s' will have no effect. It is overridden by the CallerFilePathAttribute. - /// (Originally from ..\FSComp.txt:1331) + /// (Originally from ..\FSComp.txt:1336) static member CallerMemberNameIsOverriden(a0 : System.String) = (3206, GetStringFunc("CallerMemberNameIsOverriden",",,,%s,,,") a0) /// Invalid use of 'fixed'. 'fixed' may only be used in a declaration of the form 'use x = fixed expr' where the expression is an array, the address of a field, the address of an array element or a string' - /// (Originally from ..\FSComp.txt:1332) + /// (Originally from ..\FSComp.txt:1337) static member tcFixedNotAllowed() = (3207, GetStringFunc("tcFixedNotAllowed",",,,") ) /// Could not find method System.Runtime.CompilerServices.OffsetToStringData in references when building 'fixed' expression. - /// (Originally from ..\FSComp.txt:1333) + /// (Originally from ..\FSComp.txt:1338) static member tcCouldNotFindOffsetToStringData() = (3208, GetStringFunc("tcCouldNotFindOffsetToStringData",",,,") ) /// The address of the variable '%s' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. - /// (Originally from ..\FSComp.txt:1334) + /// (Originally from ..\FSComp.txt:1339) static member chkNoByrefAddressOfLocal(a0 : System.String) = (3209, GetStringFunc("chkNoByrefAddressOfLocal",",,,%s,,,") a0) /// %s is an active pattern and cannot be treated as a discriminated union case with named fields. - /// (Originally from ..\FSComp.txt:1335) + /// (Originally from ..\FSComp.txt:1340) static member tcNamedActivePattern(a0 : System.String) = (3210, GetStringFunc("tcNamedActivePattern",",,,%s,,,") a0) /// The default value does not have the same type as the argument. The DefaultParameterValue attribute and any Optional attribute will be ignored. Note: 'null' needs to be annotated with the correct type, e.g. 'DefaultParameterValue(null:obj)'. - /// (Originally from ..\FSComp.txt:1336) + /// (Originally from ..\FSComp.txt:1341) static member DefaultParameterValueNotAppropriateForArgument() = (3211, GetStringFunc("DefaultParameterValueNotAppropriateForArgument",",,,") ) /// The system type '%s' was required but no referenced system DLL contained this type - /// (Originally from ..\FSComp.txt:1337) + /// (Originally from ..\FSComp.txt:1342) static member tcGlobalsSystemTypeNotFound(a0 : System.String) = (GetStringFunc("tcGlobalsSystemTypeNotFound",",,,%s,,,") a0) /// The member '%s' matches multiple overloads of the same method.\nPlease restrict it to one of the following:%s. - /// (Originally from ..\FSComp.txt:1338) + /// (Originally from ..\FSComp.txt:1343) static member typrelMemberHasMultiplePossibleDispatchSlots(a0 : System.String, a1 : System.String) = (3213, GetStringFunc("typrelMemberHasMultiplePossibleDispatchSlots",",,,%s,,,%s,,,") a0 a1) /// Method or object constructor '%s' is not static - /// (Originally from ..\FSComp.txt:1339) + /// (Originally from ..\FSComp.txt:1344) static member methodIsNotStatic(a0 : System.String) = (3214, GetStringFunc("methodIsNotStatic",",,,%s,,,") a0) /// Unexpected symbol '=' in expression. Did you intend to use 'for x in y .. z do' instead? - /// (Originally from ..\FSComp.txt:1340) + /// (Originally from ..\FSComp.txt:1345) static member parsUnexpectedSymbolEqualsInsteadOfIn() = (3215, GetStringFunc("parsUnexpectedSymbolEqualsInsteadOfIn",",,,") ) + /// Two anonymous record types are from different assemblies '%s' and '%s' + /// (Originally from ..\FSComp.txt:1346) + static member tcAnonRecdCcuMismatch(a0 : System.String, a1 : System.String) = (GetStringFunc("tcAnonRecdCcuMismatch",",,,%s,,,%s,,,") a0 a1) + /// Two anonymous record types have mismatched sets of field names '%s' and '%s' + /// (Originally from ..\FSComp.txt:1347) + static member tcAnonRecdFieldNameMismatch(a0 : System.String, a1 : System.String) = (GetStringFunc("tcAnonRecdFieldNameMismatch",",,,%s,,,%s,,,") a0 a1) /// Indicates a method that either has no implementation in the type in which it is declared or that is virtual and has a default implementation. - /// (Originally from ..\FSComp.txt:1341) + /// (Originally from ..\FSComp.txt:1348) static member keywordDescriptionAbstract() = (GetStringFunc("keywordDescriptionAbstract",",,,") ) /// Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. - /// (Originally from ..\FSComp.txt:1342) + /// (Originally from ..\FSComp.txt:1349) static member keyworkDescriptionAnd() = (GetStringFunc("keyworkDescriptionAnd",",,,") ) /// Used to give the current class object an object name. Also used to give a name to a whole pattern within a pattern match. - /// (Originally from ..\FSComp.txt:1343) + /// (Originally from ..\FSComp.txt:1350) static member keywordDescriptionAs() = (GetStringFunc("keywordDescriptionAs",",,,") ) /// Used to verify code during debugging. - /// (Originally from ..\FSComp.txt:1344) + /// (Originally from ..\FSComp.txt:1351) static member keywordDescriptionAssert() = (GetStringFunc("keywordDescriptionAssert",",,,") ) /// Used as the name of the base class object. - /// (Originally from ..\FSComp.txt:1345) + /// (Originally from ..\FSComp.txt:1352) static member keywordDescriptionBase() = (GetStringFunc("keywordDescriptionBase",",,,") ) /// In verbose syntax, indicates the start of a code block. - /// (Originally from ..\FSComp.txt:1346) + /// (Originally from ..\FSComp.txt:1353) static member keywordDescriptionBegin() = (GetStringFunc("keywordDescriptionBegin",",,,") ) /// In verbose syntax, indicates the start of a class definition. - /// (Originally from ..\FSComp.txt:1347) + /// (Originally from ..\FSComp.txt:1354) static member keywordDescriptionClass() = (GetStringFunc("keywordDescriptionClass",",,,") ) /// Indicates an implementation of an abstract method; used together with an abstract method declaration to create a virtual method. - /// (Originally from ..\FSComp.txt:1348) + /// (Originally from ..\FSComp.txt:1355) static member keywordDescriptionDefault() = (GetStringFunc("keywordDescriptionDefault",",,,") ) /// Used to declare a delegate. - /// (Originally from ..\FSComp.txt:1349) + /// (Originally from ..\FSComp.txt:1356) static member keywordDescriptionDelegate() = (GetStringFunc("keywordDescriptionDelegate",",,,") ) /// Used in looping constructs or to execute imperative code. - /// (Originally from ..\FSComp.txt:1350) + /// (Originally from ..\FSComp.txt:1357) static member keywordDescriptionDo() = (GetStringFunc("keywordDescriptionDo",",,,") ) /// In verbose syntax, indicates the end of a block of code in a looping expression. - /// (Originally from ..\FSComp.txt:1351) + /// (Originally from ..\FSComp.txt:1358) static member keywordDescriptionDone() = (GetStringFunc("keywordDescriptionDone",",,,") ) /// Used to convert to a type that is lower in the inheritance chain. - /// (Originally from ..\FSComp.txt:1352) + /// (Originally from ..\FSComp.txt:1359) static member keywordDescriptionDowncast() = (GetStringFunc("keywordDescriptionDowncast",",,,") ) /// In a for expression, used when counting in reverse. - /// (Originally from ..\FSComp.txt:1353) + /// (Originally from ..\FSComp.txt:1360) static member keywordDescriptionDownto() = (GetStringFunc("keywordDescriptionDownto",",,,") ) /// Used in conditional branching. A short form of else if. - /// (Originally from ..\FSComp.txt:1354) + /// (Originally from ..\FSComp.txt:1361) static member keywordDescriptionElif() = (GetStringFunc("keywordDescriptionElif",",,,") ) /// Used in conditional branching. - /// (Originally from ..\FSComp.txt:1355) + /// (Originally from ..\FSComp.txt:1362) static member keywordDescriptionElse() = (GetStringFunc("keywordDescriptionElse",",,,") ) /// In type definitions and type extensions, indicates the end of a section of member definitions. In verbose syntax, used to specify the end of a code block that starts with the begin keyword. - /// (Originally from ..\FSComp.txt:1356) + /// (Originally from ..\FSComp.txt:1363) static member keywordDescriptionEnd() = (GetStringFunc("keywordDescriptionEnd",",,,") ) /// Used to declare an exception type. - /// (Originally from ..\FSComp.txt:1357) + /// (Originally from ..\FSComp.txt:1364) static member keywordDescriptionException() = (GetStringFunc("keywordDescriptionException",",,,") ) /// Indicates that a declared program element is defined in another binary or assembly. - /// (Originally from ..\FSComp.txt:1358) + /// (Originally from ..\FSComp.txt:1365) static member keywordDescriptionExtern() = (GetStringFunc("keywordDescriptionExtern",",,,") ) /// Used as a Boolean literal. - /// (Originally from ..\FSComp.txt:1359) + /// (Originally from ..\FSComp.txt:1366) static member keywordDescriptionTrueFalse() = (GetStringFunc("keywordDescriptionTrueFalse",",,,") ) /// Used together with try to introduce a block of code that executes regardless of whether an exception occurs. - /// (Originally from ..\FSComp.txt:1360) + /// (Originally from ..\FSComp.txt:1367) static member keywordDescriptionFinally() = (GetStringFunc("keywordDescriptionFinally",",,,") ) /// Used in looping constructs. - /// (Originally from ..\FSComp.txt:1361) + /// (Originally from ..\FSComp.txt:1368) static member keywordDescriptionFor() = (GetStringFunc("keywordDescriptionFor",",,,") ) /// Used in lambda expressions, also known as anonymous functions. - /// (Originally from ..\FSComp.txt:1362) + /// (Originally from ..\FSComp.txt:1369) static member keywordDescriptionFun() = (GetStringFunc("keywordDescriptionFun",",,,") ) /// Used as a shorter alternative to the fun keyword and a match expression in a lambda expression that has pattern matching on a single argument. - /// (Originally from ..\FSComp.txt:1363) + /// (Originally from ..\FSComp.txt:1370) static member keywordDescriptionFunction() = (GetStringFunc("keywordDescriptionFunction",",,,") ) /// Used to reference the top-level .NET namespace. - /// (Originally from ..\FSComp.txt:1364) + /// (Originally from ..\FSComp.txt:1371) static member keywordDescriptionGlobal() = (GetStringFunc("keywordDescriptionGlobal",",,,") ) /// Used in conditional branching constructs. - /// (Originally from ..\FSComp.txt:1365) + /// (Originally from ..\FSComp.txt:1372) static member keywordDescriptionIf() = (GetStringFunc("keywordDescriptionIf",",,,") ) /// Used for sequence expressions and, in verbose syntax, to separate expressions from bindings. - /// (Originally from ..\FSComp.txt:1366) + /// (Originally from ..\FSComp.txt:1373) static member keywordDescriptionIn() = (GetStringFunc("keywordDescriptionIn",",,,") ) /// Used to specify a base class or base interface. - /// (Originally from ..\FSComp.txt:1367) + /// (Originally from ..\FSComp.txt:1374) static member keywordDescriptionInherit() = (GetStringFunc("keywordDescriptionInherit",",,,") ) /// Used to indicate a function that should be integrated directly into the caller's code. - /// (Originally from ..\FSComp.txt:1368) + /// (Originally from ..\FSComp.txt:1375) static member keywordDescriptionInline() = (GetStringFunc("keywordDescriptionInline",",,,") ) /// Used to declare and implement interfaces. - /// (Originally from ..\FSComp.txt:1369) + /// (Originally from ..\FSComp.txt:1376) static member keywordDescriptionInterface() = (GetStringFunc("keywordDescriptionInterface",",,,") ) /// Used to specify that a member is visible inside an assembly but not outside it. - /// (Originally from ..\FSComp.txt:1370) + /// (Originally from ..\FSComp.txt:1377) static member keywordDescriptionInternal() = (GetStringFunc("keywordDescriptionInternal",",,,") ) /// Used to specify a computation that is to be performed only when a result is needed. - /// (Originally from ..\FSComp.txt:1371) + /// (Originally from ..\FSComp.txt:1378) static member keywordDescriptionLazy() = (GetStringFunc("keywordDescriptionLazy",",,,") ) /// Used to associate, or bind, a name to a value or function. - /// (Originally from ..\FSComp.txt:1372) + /// (Originally from ..\FSComp.txt:1379) static member keywordDescriptionLet() = (GetStringFunc("keywordDescriptionLet",",,,") ) /// Used in computation expressions to bind a name to the result of another computation expression. - /// (Originally from ..\FSComp.txt:1373) + /// (Originally from ..\FSComp.txt:1380) static member keywordDescriptionLetBang() = (GetStringFunc("keywordDescriptionLetBang",",,,") ) /// Used to branch by comparing a value to a pattern. - /// (Originally from ..\FSComp.txt:1374) + /// (Originally from ..\FSComp.txt:1381) static member keywordDescriptionMatch() = (GetStringFunc("keywordDescriptionMatch",",,,") ) /// Used in computation expressions to pattern match directly over the result of another computation expression. - /// (Originally from ..\FSComp.txt:1375) + /// (Originally from ..\FSComp.txt:1382) static member keywordDescriptionMatchBang() = (GetStringFunc("keywordDescriptionMatchBang",",,,") ) /// Used to declare a property or method in an object type. - /// (Originally from ..\FSComp.txt:1376) + /// (Originally from ..\FSComp.txt:1383) static member keywordDescriptionMember() = (GetStringFunc("keywordDescriptionMember",",,,") ) /// Used to associate a name with a group of related types, values, and functions, to logically separate it from other code. - /// (Originally from ..\FSComp.txt:1377) + /// (Originally from ..\FSComp.txt:1384) static member keywordDescriptionModule() = (GetStringFunc("keywordDescriptionModule",",,,") ) /// Used to declare a variable, that is, a value that can be changed. - /// (Originally from ..\FSComp.txt:1378) + /// (Originally from ..\FSComp.txt:1385) static member keywordDescriptionMutable() = (GetStringFunc("keywordDescriptionMutable",",,,") ) /// Used to associate a name with a group of related types and modules, to logically separate it from other code. - /// (Originally from ..\FSComp.txt:1379) + /// (Originally from ..\FSComp.txt:1386) static member keywordDescriptionNamespace() = (GetStringFunc("keywordDescriptionNamespace",",,,") ) /// Used to declare, define, or invoke a constructor that creates or that can create an object. Also used in generic parameter constraints to indicate that a type must have a certain constructor. - /// (Originally from ..\FSComp.txt:1380) + /// (Originally from ..\FSComp.txt:1387) static member keywordDescriptionNew() = (GetStringFunc("keywordDescriptionNew",",,,") ) /// Not actually a keyword. However, not struct in combination is used as a generic parameter constraint. - /// (Originally from ..\FSComp.txt:1381) + /// (Originally from ..\FSComp.txt:1388) static member keywordDescriptionNot() = (GetStringFunc("keywordDescriptionNot",",,,") ) /// Indicates the absence of an object. Also used in generic parameter constraints. - /// (Originally from ..\FSComp.txt:1382) + /// (Originally from ..\FSComp.txt:1389) static member keywordDescriptionNull() = (GetStringFunc("keywordDescriptionNull",",,,") ) /// Used in discriminated unions to indicate the type of categories of values, and in delegate and exception declarations. - /// (Originally from ..\FSComp.txt:1383) + /// (Originally from ..\FSComp.txt:1390) static member keywordDescriptionOf() = (GetStringFunc("keywordDescriptionOf",",,,") ) /// Used to make the contents of a namespace or module available without qualification. - /// (Originally from ..\FSComp.txt:1384) + /// (Originally from ..\FSComp.txt:1391) static member keywordDescriptionOpen() = (GetStringFunc("keywordDescriptionOpen",",,,") ) /// Used with Boolean conditions as a Boolean or operator. Equivalent to ||. Also used in member constraints. - /// (Originally from ..\FSComp.txt:1385) + /// (Originally from ..\FSComp.txt:1392) static member keywordDescriptionOr() = (GetStringFunc("keywordDescriptionOr",",,,") ) /// Used to implement a version of an abstract or virtual method that differs from the base version. - /// (Originally from ..\FSComp.txt:1386) + /// (Originally from ..\FSComp.txt:1393) static member keywordDescriptionOverride() = (GetStringFunc("keywordDescriptionOverride",",,,") ) /// Restricts access to a member to code in the same type or module. - /// (Originally from ..\FSComp.txt:1387) + /// (Originally from ..\FSComp.txt:1394) static member keywordDescriptionPrivate() = (GetStringFunc("keywordDescriptionPrivate",",,,") ) /// Allows access to a member from outside the type. - /// (Originally from ..\FSComp.txt:1388) + /// (Originally from ..\FSComp.txt:1395) static member keywordDescriptionPublic() = (GetStringFunc("keywordDescriptionPublic",",,,") ) /// Used to indicate that a function is recursive. - /// (Originally from ..\FSComp.txt:1389) + /// (Originally from ..\FSComp.txt:1396) static member keywordDescriptionRec() = (GetStringFunc("keywordDescriptionRec",",,,") ) /// Used to provide a value for the result of the containing computation expression. - /// (Originally from ..\FSComp.txt:1390) + /// (Originally from ..\FSComp.txt:1397) static member keywordDescriptionReturn() = (GetStringFunc("keywordDescriptionReturn",",,,") ) /// Used to provide a value for the result of the containing computation expression, where that value itself comes from the result another computation expression. - /// (Originally from ..\FSComp.txt:1391) + /// (Originally from ..\FSComp.txt:1398) static member keywordDescriptionReturnBang() = (GetStringFunc("keywordDescriptionReturnBang",",,,") ) /// Used in query expressions to specify what fields or columns to extract. Note that this is a contextual keyword, which means that it is not actually a reserved word and it only acts like a keyword in appropriate context. - /// (Originally from ..\FSComp.txt:1392) + /// (Originally from ..\FSComp.txt:1399) static member keywordDescriptionSelect() = (GetStringFunc("keywordDescriptionSelect",",,,") ) /// Used to indicate a method or property that can be called without an instance of a type, or a value member that is shared among all instances of a type. - /// (Originally from ..\FSComp.txt:1393) + /// (Originally from ..\FSComp.txt:1400) static member keywordDescriptionStatic() = (GetStringFunc("keywordDescriptionStatic",",,,") ) /// Used to declare a structure type. Also used in generic parameter constraints. Used for OCaml compatibility in module definitions. - /// (Originally from ..\FSComp.txt:1394) + /// (Originally from ..\FSComp.txt:1401) static member keywordDescriptionStruct() = (GetStringFunc("keywordDescriptionStruct",",,,") ) /// Used in conditional expressions. Also used to perform side effects after object construction. - /// (Originally from ..\FSComp.txt:1395) + /// (Originally from ..\FSComp.txt:1402) static member keywordDescriptionThen() = (GetStringFunc("keywordDescriptionThen",",,,") ) /// Used in for loops to indicate a range. - /// (Originally from ..\FSComp.txt:1396) + /// (Originally from ..\FSComp.txt:1403) static member keywordDescriptionTo() = (GetStringFunc("keywordDescriptionTo",",,,") ) /// Used to introduce a block of code that might generate an exception. Used together with with or finally. - /// (Originally from ..\FSComp.txt:1397) + /// (Originally from ..\FSComp.txt:1404) static member keywordDescriptionTry() = (GetStringFunc("keywordDescriptionTry",",,,") ) /// Used to declare a class, record, structure, discriminated union, enumeration type, unit of measure, or type abbreviation. - /// (Originally from ..\FSComp.txt:1398) + /// (Originally from ..\FSComp.txt:1405) static member keywordDescriptionType() = (GetStringFunc("keywordDescriptionType",",,,") ) /// Used to convert to a type that is higher in the inheritance chain. - /// (Originally from ..\FSComp.txt:1399) + /// (Originally from ..\FSComp.txt:1406) static member keywordDescriptionUpcast() = (GetStringFunc("keywordDescriptionUpcast",",,,") ) /// Used instead of let for values that implement IDisposable" - /// (Originally from ..\FSComp.txt:1400) + /// (Originally from ..\FSComp.txt:1407) static member keywordDescriptionUse() = (GetStringFunc("keywordDescriptionUse",",,,") ) /// Used instead of let! in computation expressions for computation expression results that implement IDisposable. - /// (Originally from ..\FSComp.txt:1401) + /// (Originally from ..\FSComp.txt:1408) static member keywordDescriptionUseBang() = (GetStringFunc("keywordDescriptionUseBang",",,,") ) /// Used in a signature to indicate a value, or in a type to declare a member, in limited situations. - /// (Originally from ..\FSComp.txt:1402) + /// (Originally from ..\FSComp.txt:1409) static member keywordDescriptionVal() = (GetStringFunc("keywordDescriptionVal",",,,") ) /// Indicates the .NET void type. Used when interoperating with other .NET languages. - /// (Originally from ..\FSComp.txt:1403) + /// (Originally from ..\FSComp.txt:1410) static member keywordDescriptionVoid() = (GetStringFunc("keywordDescriptionVoid",",,,") ) /// Used for Boolean conditions (when guards) on pattern matches and to introduce a constraint clause for a generic type parameter. - /// (Originally from ..\FSComp.txt:1404) + /// (Originally from ..\FSComp.txt:1411) static member keywordDescriptionWhen() = (GetStringFunc("keywordDescriptionWhen",",,,") ) /// Introduces a looping construct. - /// (Originally from ..\FSComp.txt:1405) + /// (Originally from ..\FSComp.txt:1412) static member keywordDescriptionWhile() = (GetStringFunc("keywordDescriptionWhile",",,,") ) /// Used together with the match keyword in pattern matching expressions. Also used in object expressions, record copying expressions, and type extensions to introduce member definitions, and to introduce exception handlers. - /// (Originally from ..\FSComp.txt:1406) + /// (Originally from ..\FSComp.txt:1413) static member keywordDescriptionWith() = (GetStringFunc("keywordDescriptionWith",",,,") ) /// Used in a sequence expression to produce a value for a sequence. - /// (Originally from ..\FSComp.txt:1407) + /// (Originally from ..\FSComp.txt:1414) static member keywordDescriptionYield() = (GetStringFunc("keywordDescriptionYield",",,,") ) /// Used in a computation expression to append the result of a given computation expression to a collection of results for the containing computation expression. - /// (Originally from ..\FSComp.txt:1408) + /// (Originally from ..\FSComp.txt:1415) static member keywordDescriptionYieldBang() = (GetStringFunc("keywordDescriptionYieldBang",",,,") ) /// In function types, delimits arguments and return values. Yields an expression (in sequence expressions); equivalent to the yield keyword. Used in match expressions - /// (Originally from ..\FSComp.txt:1409) + /// (Originally from ..\FSComp.txt:1416) static member keywordDescriptionRightArrow() = (GetStringFunc("keywordDescriptionRightArrow",",,,") ) /// Assigns a value to a variable. - /// (Originally from ..\FSComp.txt:1410) + /// (Originally from ..\FSComp.txt:1417) static member keywordDescriptionLeftArrow() = (GetStringFunc("keywordDescriptionLeftArrow",",,,") ) /// Converts a type to type that is higher in the hierarchy. - /// (Originally from ..\FSComp.txt:1411) + /// (Originally from ..\FSComp.txt:1418) static member keywordDescriptionCast() = (GetStringFunc("keywordDescriptionCast",",,,") ) /// Converts a type to a type that is lower in the hierarchy. - /// (Originally from ..\FSComp.txt:1412) + /// (Originally from ..\FSComp.txt:1419) static member keywordDescriptionDynamicCast() = (GetStringFunc("keywordDescriptionDynamicCast",",,,") ) /// Delimits a typed code quotation. - /// (Originally from ..\FSComp.txt:1413) + /// (Originally from ..\FSComp.txt:1420) static member keywordDescriptionTypedQuotation() = (GetStringFunc("keywordDescriptionTypedQuotation",",,,") ) /// Delimits a untyped code quotation. - /// (Originally from ..\FSComp.txt:1414) + /// (Originally from ..\FSComp.txt:1421) static member keywordDescriptionUntypedQuotation() = (GetStringFunc("keywordDescriptionUntypedQuotation",",,,") ) /// %s '%s' not found in assembly '%s'. A possible cause may be a version incompatibility. You may need to explicitly reference the correct version of this assembly to allow all referenced components to use the correct version. - /// (Originally from ..\FSComp.txt:1415) + /// (Originally from ..\FSComp.txt:1422) static member itemNotFoundDuringDynamicCodeGen(a0 : System.String, a1 : System.String, a2 : System.String) = (3216, GetStringFunc("itemNotFoundDuringDynamicCodeGen",",,,%s,,,%s,,,%s,,,") a0 a1 a2) /// %s '%s' not found in type '%s' from assembly '%s'. A possible cause may be a version incompatibility. You may need to explicitly reference the correct version of this assembly to allow all referenced components to use the correct version. - /// (Originally from ..\FSComp.txt:1416) + /// (Originally from ..\FSComp.txt:1423) static member itemNotFoundInTypeDuringDynamicCodeGen(a0 : System.String, a1 : System.String, a2 : System.String, a3 : System.String) = (3216, GetStringFunc("itemNotFoundInTypeDuringDynamicCodeGen",",,,%s,,,%s,,,%s,,,%s,,,") a0 a1 a2 a3) /// is - /// (Originally from ..\FSComp.txt:1417) + /// (Originally from ..\FSComp.txt:1424) static member descriptionWordIs() = (GetStringFunc("descriptionWordIs",",,,") ) /// This value is not a function and cannot be applied. - /// (Originally from ..\FSComp.txt:1418) + /// (Originally from ..\FSComp.txt:1425) static member notAFunction() = (GetStringFunc("notAFunction",",,,") ) /// This value is not a function and cannot be applied. Did you intend to access the indexer via %s.[index] instead? - /// (Originally from ..\FSComp.txt:1419) + /// (Originally from ..\FSComp.txt:1426) static member notAFunctionButMaybeIndexerWithName(a0 : System.String) = (GetStringFunc("notAFunctionButMaybeIndexerWithName",",,,%s,,,") a0) /// This expression is not a function and cannot be applied. Did you intend to access the indexer via expr.[index] instead? - /// (Originally from ..\FSComp.txt:1420) + /// (Originally from ..\FSComp.txt:1427) static member notAFunctionButMaybeIndexer() = (GetStringFunc("notAFunctionButMaybeIndexer",",,,") ) /// - /// (Originally from ..\FSComp.txt:1421) + /// (Originally from ..\FSComp.txt:1428) static member notAFunctionButMaybeIndexerErrorCode() = (3217, GetStringFunc("notAFunctionButMaybeIndexerErrorCode",",,,") ) /// This value is not a function and cannot be applied. Did you forget to terminate a declaration? - /// (Originally from ..\FSComp.txt:1422) + /// (Originally from ..\FSComp.txt:1429) static member notAFunctionButMaybeDeclaration() = (GetStringFunc("notAFunctionButMaybeDeclaration",",,,") ) /// The argument names in the signature '%s' and implementation '%s' do not match. The argument name from the signature file will be used. This may cause problems when debugging or profiling. - /// (Originally from ..\FSComp.txt:1423) + /// (Originally from ..\FSComp.txt:1430) static member ArgumentsInSigAndImplMismatch(a0 : System.String, a1 : System.String) = (3218, GetStringFunc("ArgumentsInSigAndImplMismatch",",,,%s,,,%s,,,") a0 a1) /// An error occurred while reading the F# metadata of assembly '%s'. A reserved construct was utilized. You may need to upgrade your F# compiler or use an earlier version of the assembly that doesn't make use of a specific construct. - /// (Originally from ..\FSComp.txt:1424) + /// (Originally from ..\FSComp.txt:1431) static member pickleUnexpectedNonZero(a0 : System.String) = (3219, GetStringFunc("pickleUnexpectedNonZero",",,,%s,,,") a0) /// This method or property is not normally used from F# code, use an explicit tuple pattern for deconstruction instead. - /// (Originally from ..\FSComp.txt:1425) + /// (Originally from ..\FSComp.txt:1432) static member tcTupleMemberNotNormallyUsed() = (3220, GetStringFunc("tcTupleMemberNotNormallyUsed",",,,") ) /// This expression returns a value of type '%s' but is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to use the expression as a value in the sequence then use an explicit 'yield'. - /// (Originally from ..\FSComp.txt:1426) + /// (Originally from ..\FSComp.txt:1433) static member implicitlyDiscardedInSequenceExpression(a0 : System.String) = (3221, GetStringFunc("implicitlyDiscardedInSequenceExpression",",,,%s,,,") a0) /// This expression returns a value of type '%s' but is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to use the expression as a value in the sequence then use an explicit 'yield!'. - /// (Originally from ..\FSComp.txt:1427) + /// (Originally from ..\FSComp.txt:1434) static member implicitlyDiscardedSequenceInSequenceExpression(a0 : System.String) = (3222, GetStringFunc("implicitlyDiscardedSequenceInSequenceExpression",",,,%s,,,") a0) /// The file '%s' changed on disk unexpectedly, please reload. - /// (Originally from ..\FSComp.txt:1428) + /// (Originally from ..\FSComp.txt:1435) static member ilreadFileChanged(a0 : System.String) = (3223, GetStringFunc("ilreadFileChanged",",,,%s,,,") a0) /// The byref pointer is readonly, so this write is not permitted. - /// (Originally from ..\FSComp.txt:1429) + /// (Originally from ..\FSComp.txt:1436) static member writeToReadOnlyByref() = (3224, GetStringFunc("writeToReadOnlyByref",",,,") ) /// A ReadOnly attribute has been applied to a struct type with a mutable field. - /// (Originally from ..\FSComp.txt:1430) + /// (Originally from ..\FSComp.txt:1437) static member readOnlyAttributeOnStructWithMutableField() = (3225, GetStringFunc("readOnlyAttributeOnStructWithMutableField",",,,") ) /// A byref pointer returned by a function or method is implicitly dereferenced as of F# 4.5. To acquire the return value as a pointer, use the address-of operator, e.g. '&f(x)' or '&obj.Method(arg1, arg2)'. - /// (Originally from ..\FSComp.txt:1431) + /// (Originally from ..\FSComp.txt:1438) static member tcByrefReturnImplicitlyDereferenced() = (3226, GetStringFunc("tcByrefReturnImplicitlyDereferenced",",,,") ) /// A type annotated with IsByRefLike must also be a struct. Consider adding the [] attribute to the type. - /// (Originally from ..\FSComp.txt:1432) + /// (Originally from ..\FSComp.txt:1439) static member tcByRefLikeNotStruct() = (3227, GetStringFunc("tcByRefLikeNotStruct",",,,") ) /// The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. - /// (Originally from ..\FSComp.txt:1433) + /// (Originally from ..\FSComp.txt:1440) static member chkNoByrefAddressOfValueFromExpression() = (3228, GetStringFunc("chkNoByrefAddressOfValueFromExpression",",,,") ) - /// The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. - /// (Originally from ..\FSComp.txt:1434) - static member chkNoReturnOfLimitedSpan() = (3229, GetStringFunc("chkNoReturnOfLimitedSpan",",,,") ) /// This value can't be assigned because the target '%s' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. - /// (Originally from ..\FSComp.txt:1435) - static member chkNoWriteToLimitedSpan(a0 : System.String) = (3230, GetStringFunc("chkNoWriteToLimitedSpan",",,,%s,,,") a0) + /// (Originally from ..\FSComp.txt:1441) + static member chkNoWriteToLimitedSpan(a0 : System.String) = (3229, GetStringFunc("chkNoWriteToLimitedSpan",",,,%s,,,") a0) /// A value defined in a module must be mutable in order to take its address, e.g. 'let mutable x = ...' - /// (Originally from ..\FSComp.txt:1436) - static member tastValueMustBeLocal() = (3231, GetStringFunc("tastValueMustBeLocal",",,,") ) + /// (Originally from ..\FSComp.txt:1442) + static member tastValueMustBeLocal() = (3230, GetStringFunc("tastValueMustBeLocal",",,,") ) /// A type annotated with IsReadOnly must also be a struct. Consider adding the [] attribute to the type. - /// (Originally from ..\FSComp.txt:1437) - static member tcIsReadOnlyNotStruct() = (3232, GetStringFunc("tcIsReadOnlyNotStruct",",,,") ) + /// (Originally from ..\FSComp.txt:1443) + static member tcIsReadOnlyNotStruct() = (3231, GetStringFunc("tcIsReadOnlyNotStruct",",,,") ) /// Struct members cannot return the address of fields of the struct by reference - /// (Originally from ..\FSComp.txt:1438) - static member chkStructsMayNotReturnAddressesOfContents() = (3233, GetStringFunc("chkStructsMayNotReturnAddressesOfContents",",,,") ) + /// (Originally from ..\FSComp.txt:1444) + static member chkStructsMayNotReturnAddressesOfContents() = (3232, GetStringFunc("chkStructsMayNotReturnAddressesOfContents",",,,") ) /// The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. - /// (Originally from ..\FSComp.txt:1439) - static member chkNoByrefLikeFunctionCall() = (3234, GetStringFunc("chkNoByrefLikeFunctionCall",",,,") ) + /// (Originally from ..\FSComp.txt:1445) + static member chkNoByrefLikeFunctionCall() = (3233, GetStringFunc("chkNoByrefLikeFunctionCall",",,,") ) /// The Span or IsByRefLike variable '%s' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. - /// (Originally from ..\FSComp.txt:1440) - static member chkNoSpanLikeVariable(a0 : System.String) = (3235, GetStringFunc("chkNoSpanLikeVariable",",,,%s,,,") a0) + /// (Originally from ..\FSComp.txt:1446) + static member chkNoSpanLikeVariable(a0 : System.String) = (3234, GetStringFunc("chkNoSpanLikeVariable",",,,%s,,,") a0) /// A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. - /// (Originally from ..\FSComp.txt:1441) - static member chkNoSpanLikeValueFromExpression() = (3236, GetStringFunc("chkNoSpanLikeValueFromExpression",",,,") ) + /// (Originally from ..\FSComp.txt:1447) + static member chkNoSpanLikeValueFromExpression() = (3235, GetStringFunc("chkNoSpanLikeValueFromExpression",",,,") ) /// Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. - /// (Originally from ..\FSComp.txt:1442) - static member tastCantTakeAddressOfExpression() = (3237, GetStringFunc("tastCantTakeAddressOfExpression",",,,") ) + /// (Originally from ..\FSComp.txt:1448) + static member tastCantTakeAddressOfExpression() = (3236, GetStringFunc("tastCantTakeAddressOfExpression",",,,") ) + /// Cannot call the byref extension method '%s. The first parameter requires the value to be mutable or a non-readonly byref type. + /// (Originally from ..\FSComp.txt:1449) + static member tcCannotCallExtensionMethodInrefToByref(a0 : System.String) = (3237, GetStringFunc("tcCannotCallExtensionMethodInrefToByref",",,,%s,,,") a0) + /// Byref types are not allowed to have optional type extensions. + /// (Originally from ..\FSComp.txt:1450) + static member tcByrefsMayNotHaveTypeExtensions() = (3238, GetStringFunc("tcByrefsMayNotHaveTypeExtensions",",,,") ) + /// Cannot partially apply the extension method '%s' because the first parameter is a byref type. + /// (Originally from ..\FSComp.txt:1451) + static member tcCannotPartiallyApplyExtensionMethodForByref(a0 : System.String) = (3239, GetStringFunc("tcCannotPartiallyApplyExtensionMethodForByref",",,,%s,,,") a0) /// This type does not inherit Attribute, it will not work correctly with other .NET languages. - /// (Originally from ..\FSComp.txt:1443) + /// (Originally from ..\FSComp.txt:1452) static member tcTypeDoesNotInheritAttribute() = (3242, GetStringFunc("tcTypeDoesNotInheritAttribute",",,,") ) + /// Invalid anonymous record expression + /// (Originally from ..\FSComp.txt:1453) + static member parsInvalidAnonRecdExpr() = (3243, GetStringFunc("parsInvalidAnonRecdExpr",",,,") ) + /// Invalid anonymous record type + /// (Originally from ..\FSComp.txt:1454) + static member parsInvalidAnonRecdType() = (3244, GetStringFunc("parsInvalidAnonRecdType",",,,") ) + /// The input to a copy-and-update expression that creates an anonymous record must be either an anonymous record or a record + /// (Originally from ..\FSComp.txt:1455) + static member tcCopyAndUpdateNeedsRecordType() = (3245, GetStringFunc("tcCopyAndUpdateNeedsRecordType",",,,") ) + /// The parameter '%s' has an invalid type '%s'. This is not permitted by the rules of Common IL. + /// (Originally from ..\FSComp.txt:1456) + static member chkInvalidFunctionParameterType(a0 : System.String, a1 : System.String) = (3300, GetStringFunc("chkInvalidFunctionParameterType",",,,%s,,,%s,,,") a0 a1) + /// The function or method has an invalid return type '%s'. This is not permitted by the rules of Common IL. + /// (Originally from ..\FSComp.txt:1457) + static member chkInvalidFunctionReturnType(a0 : System.String) = (3301, GetStringFunc("chkInvalidFunctionReturnType",",,,%s,,,") a0) /// Call this method once to validate that all known resources are valid; throws if not static member RunStartupValidation() = @@ -4798,6 +4840,7 @@ type internal SR private() = ignore(GetString("parsUnmatched")) ignore(GetString("parsUnmatchedBracketBar")) ignore(GetString("parsUnmatchedBrace")) + ignore(GetString("parsUnmatchedBraceBar")) ignore(GetString("parsFieldBinding")) ignore(GetString("parsMemberIllegalInObjectImplementation")) ignore(GetString("parsMissingFunctionBody")) @@ -5270,6 +5313,7 @@ type internal SR private() = ignore(GetString("typeInfoExtension")) ignore(GetString("typeInfoCustomOperation")) ignore(GetString("typeInfoArgument")) + ignore(GetString("typeInfoAnonRecdField")) ignore(GetString("typeInfoPatternVariable")) ignore(GetString("typeInfoNamespace")) ignore(GetString("typeInfoModule")) @@ -5627,6 +5671,9 @@ type internal SR private() = ignore(GetString("chkGetterAndSetterHaveSamePropertyType")) ignore(GetString("tcRuntimeSuppliedMethodCannotBeUsedInUserCode")) ignore(GetString("tcUnionCaseConstructorDoesNotHaveFieldWithGivenName")) + ignore(GetString("tcExceptionConstructorDoesNotHaveFieldWithGivenName")) + ignore(GetString("tcActivePatternsDoNotHaveFields")) + ignore(GetString("tcConstructorDoesNotHaveFieldWithGivenName")) ignore(GetString("tcUnionCaseFieldCannotBeUsedMoreThanOnce")) ignore(GetString("tcFieldNameIsUsedModeThanOnce")) ignore(GetString("tcFieldNameConflictsWithGeneratedNameForAnonymousField")) @@ -5671,6 +5718,8 @@ type internal SR private() = ignore(GetString("typrelMemberHasMultiplePossibleDispatchSlots")) ignore(GetString("methodIsNotStatic")) ignore(GetString("parsUnexpectedSymbolEqualsInsteadOfIn")) + ignore(GetString("tcAnonRecdCcuMismatch")) + ignore(GetString("tcAnonRecdFieldNameMismatch")) ignore(GetString("keywordDescriptionAbstract")) ignore(GetString("keyworkDescriptionAnd")) ignore(GetString("keywordDescriptionAs")) @@ -5764,7 +5813,6 @@ type internal SR private() = ignore(GetString("tcByrefReturnImplicitlyDereferenced")) ignore(GetString("tcByRefLikeNotStruct")) ignore(GetString("chkNoByrefAddressOfValueFromExpression")) - ignore(GetString("chkNoReturnOfLimitedSpan")) ignore(GetString("chkNoWriteToLimitedSpan")) ignore(GetString("tastValueMustBeLocal")) ignore(GetString("tcIsReadOnlyNotStruct")) @@ -5773,5 +5821,13 @@ type internal SR private() = ignore(GetString("chkNoSpanLikeVariable")) ignore(GetString("chkNoSpanLikeValueFromExpression")) ignore(GetString("tastCantTakeAddressOfExpression")) + ignore(GetString("tcCannotCallExtensionMethodInrefToByref")) + ignore(GetString("tcByrefsMayNotHaveTypeExtensions")) + ignore(GetString("tcCannotPartiallyApplyExtensionMethodForByref")) ignore(GetString("tcTypeDoesNotInheritAttribute")) + ignore(GetString("parsInvalidAnonRecdExpr")) + ignore(GetString("parsInvalidAnonRecdType")) + ignore(GetString("tcCopyAndUpdateNeedsRecordType")) + ignore(GetString("chkInvalidFunctionParameterType")) + ignore(GetString("chkInvalidFunctionReturnType")) () diff --git a/src/buildfromsource/FSharp.Compiler.Private/FSComp.resx b/src/buildfromsource/FSharp.Compiler.Private/FSComp.resx index be8589241b4..4985923a951 100644 --- a/src/buildfromsource/FSharp.Compiler.Private/FSComp.resx +++ b/src/buildfromsource/FSharp.Compiler.Private/FSComp.resx @@ -1431,6 +1431,9 @@ Unmatched '{{' + + Unmatched '{{|' + Field bindings must have the form 'id = expr;' @@ -2847,6 +2850,9 @@ argument + + anonymous record field + patvar @@ -3193,10 +3199,10 @@ This operation accesses a mutable top-level value defined in another assembly in an unsupported way. The value cannot be accessed through its address. Consider copying the expression to a mutable local, e.g. 'let mutable x = ...', and if necessary assigning the value back after the completion of the operation - Type parameters must be placed directly adjacent to the type name, e.g. \"type C<'T>\", not type \"C <'T>\" + Remove spaces between the type name and type parameter, e.g. \"type C<'T>\", not type \"C <'T>\". Type parameters must be placed directly adjacent to the type name. - Type arguments must be placed directly adjacent to the type name, e.g. \"C<'T>\", not \"C <'T>\" + Remove spaces between the type name and type parameter, e.g. \"C<'T>\", not \"C <'T>\". Type parameters must be placed directly adjacent to the type name. The use of the type syntax 'int C' and 'C <int>' is not permitted here. Consider adjusting this type to be written in the form 'C<int>' @@ -3916,7 +3922,16 @@ Array method '{0}' is supplied by the runtime and cannot be directly used in code. For operations with array elements consider using family of GetArray/SetArray functions from LanguagePrimitives.IntrinsicFunctions module. - Union case/exception '{0}' does not have field named '{1}'. + The union case '{0}' does not have a field named '{1}'. + + + The exception '{0}' does not have a field named '{1}'. + + + Active patterns do not have fields. This syntax is invalid. + + + The constructor does not have a field named '{0}'. Union case/exception field '{0}' cannot be used more than once. @@ -4050,6 +4065,12 @@ Unexpected symbol '=' in expression. Did you intend to use 'for x in y .. z do' instead? + + Two anonymous record types are from different assemblies '{0}' and '{1}' + + + Two anonymous record types have mismatched sets of field names '{0}' and '{1}' + Indicates a method that either has no implementation in the type in which it is declared or that is virtual and has a default implementation. @@ -4330,9 +4351,6 @@ The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. - - The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. - This value can't be assigned because the target '{0}' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. @@ -4357,7 +4375,31 @@ Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. + + Cannot call the byref extension method '{0}. The first parameter requires the value to be mutable or a non-readonly byref type. + + + Byref types are not allowed to have optional type extensions. + + + Cannot partially apply the extension method '{0}' because the first parameter is a byref type. + This type does not inherit Attribute, it will not work correctly with other .NET languages. + + Invalid anonymous record expression + + + Invalid anonymous record type + + + The input to a copy-and-update expression that creates an anonymous record must be either an anonymous record or a record + + + The parameter '{0}' has an invalid type '{1}'. This is not permitted by the rules of Common IL. + + + The function or method has an invalid return type '{0}'. This is not permitted by the rules of Common IL. + \ No newline at end of file diff --git a/src/buildfromsource/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj b/src/buildfromsource/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj index 1668c425ebe..7edd03a10e8 100644 --- a/src/buildfromsource/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj +++ b/src/buildfromsource/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj @@ -629,18 +629,22 @@ + + + + diff --git a/src/buildfromsource/FSharp.Compiler.nuget/FSharp.Compiler.nuget.fsproj b/src/buildfromsource/FSharp.Compiler.nuget/FSharp.Compiler.nuget.fsproj index 92144d8db07..0a6b022ba75 100644 --- a/src/buildfromsource/FSharp.Compiler.nuget/FSharp.Compiler.nuget.fsproj +++ b/src/buildfromsource/FSharp.Compiler.nuget/FSharp.Compiler.nuget.fsproj @@ -25,7 +25,7 @@ - $(FSharpSourcesRoot)\fsharp\FSharp.Compiler.nuget\Microsoft.FSharp.Compiler.nuspec + Microsoft.FSharp.Compiler.nuspec licenseUrl=$(PackageLicenceUrl);version=$(PackageVersion);authors=$(PackageAuthors);projectUrl=$(PackageProjectUrl);tags=$(PackageTags) $(OutputPath)/$(TargetFramework) diff --git a/src/fsharp/FSharp.Compiler.nuget/Testing.FSharp.Compiler.nuspec b/src/buildfromsource/FSharp.Compiler.nuget/Microsoft.FSharp.Compiler.nuspec similarity index 52% rename from src/fsharp/FSharp.Compiler.nuget/Testing.FSharp.Compiler.nuspec rename to src/buildfromsource/FSharp.Compiler.nuget/Microsoft.FSharp.Compiler.nuspec index d2dd36b3174..d77c01e9ecc 100644 --- a/src/fsharp/FSharp.Compiler.nuget/Testing.FSharp.Compiler.nuspec +++ b/src/buildfromsource/FSharp.Compiler.nuget/Microsoft.FSharp.Compiler.nuspec @@ -1,9 +1,11 @@ - Testing.FSharp.Compiler + Microsoft.FSharp.Compiler - Test deployable versionthe fsharp compiler fsc.exe. Supported Platforms: - .NET Core (.netstandard1.6) + .NET Core compatible version of the F# compiler fsc.exe. + Supported Platforms: - .NET Core (.netstandard2.0). + Commit hash: $githeadsha$. en-US true @@ -13,53 +15,69 @@ $projectUrl$ $tags$ - - - + + + - - - - - - - + + + + + + - - - - - - - + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/buildfromsource/FSharp.Core/FSharp.Core.fsproj b/src/buildfromsource/FSharp.Core/FSharp.Core.fsproj index 29030516ebd..fae084de12a 100644 --- a/src/buildfromsource/FSharp.Core/FSharp.Core.fsproj +++ b/src/buildfromsource/FSharp.Core/FSharp.Core.fsproj @@ -25,7 +25,7 @@ Primitives/prim-types-prelude.fs - + Primitives/SR.fs diff --git a/src/fsharp/FSharp.Core/SR.fs b/src/buildfromsource/FSharp.Core/SR.fs similarity index 100% rename from src/fsharp/FSharp.Core/SR.fs rename to src/buildfromsource/FSharp.Core/SR.fs diff --git a/src/buildfromsource/Fsc/Fsc.fsproj b/src/buildfromsource/Fsc/Fsc.fsproj index d1b1bfa2f80..c5178aaca2e 100644 --- a/src/buildfromsource/Fsc/Fsc.fsproj +++ b/src/buildfromsource/Fsc/Fsc.fsproj @@ -29,7 +29,6 @@ - diff --git a/src/buildfromsource/Fsi/Fsi.fsproj b/src/buildfromsource/Fsi/Fsi.fsproj index 56390954225..69daac7764a 100644 --- a/src/buildfromsource/Fsi/Fsi.fsproj +++ b/src/buildfromsource/Fsi/Fsi.fsproj @@ -34,7 +34,6 @@ - diff --git a/src/buildfromsource/targets/PackageVersions.props b/src/buildfromsource/targets/PackageVersions.props index e4f39318bac..a24eded9c32 100644 --- a/src/buildfromsource/targets/PackageVersions.props +++ b/src/buildfromsource/targets/PackageVersions.props @@ -9,23 +9,28 @@ 4.3.0 4.3.0 4.3.0 + 4.3.0 4.3.0 1.5.0 4.3.0 4.3.0 4.3.0 4.3.0 + 4.3.0 4.3.0 + 4.3.0 + 4.3.0 4.3.0 4.3.0 4.3.0 4.4.0 - 15.1.548 - 15.1.548 - 15.1.548 - 15.1.548 + 15.8.166 + $(MicrosoftBuildOverallPackagesVersion) + $(MicrosoftBuildOverallPackagesVersion) + $(MicrosoftBuildOverallPackagesVersion) + $(MicrosoftBuildOverallPackagesVersion) 4.3.0 diff --git a/src/buildtools/Directory.Build.props b/src/buildtools/Directory.Build.props new file mode 100644 index 00000000000..12d9ad073ec --- /dev/null +++ b/src/buildtools/Directory.Build.props @@ -0,0 +1,3 @@ + + + diff --git a/src/buildtools/Directory.Build.targets b/src/buildtools/Directory.Build.targets new file mode 100644 index 00000000000..14437118703 --- /dev/null +++ b/src/buildtools/Directory.Build.targets @@ -0,0 +1,3 @@ + + + diff --git a/src/buildtools/README-fslexyacc.md b/src/buildtools/README-fslexyacc.md new file mode 100644 index 00000000000..a498a74720b --- /dev/null +++ b/src/buildtools/README-fslexyacc.md @@ -0,0 +1,74 @@ +# Notes on FsLex and FsYacc + +For better or worse the F# compiler contains three tokenizers (`*.fsl`) and three +grammars (`*.fsy`) implemented using FsLex and FsYacc respectively, including the all-important F# grammar itself. +The canonical home for FsLex and FsYacc is http://github.com/fsprojects/FsLexYacc. +FsLex and FsYacc are themselves built using earlier versions of FsLex and FsYacc. + +**If you would like to improve, modify, extend, test or document these +tools, generally please do so in that repository. There are some exceptions, see below.** + +The `src\buildtools\fslex` and `src\buildtools\fsyacc` directories are an _exact_ copy of `packages\FsLexYacc.XYZ\src\fslex` and `packages\FsLexYacc.XYZ\src\fsyacc`. We should really verify this as part of our build. +This copy is done because we needed to have a build-from-source story. +In build-from-source, the only tool we can assume is an install of the .NET SDK. +That means we have to build up FsLex and FsYacc from scratch, _including_ their own generated fslexlex.fs, fslexpars.fs and so on. +We can't pick up the source from "packages" because in a build-from-source scenario we can't even fetch those +packages - we really have to build from just our source tree and .NET SDK. + +Please do _not_ modify the code in these directories except by copying over from an upgraded FsLexYacc pacakge. +Without the testing and documentation in the `FsLexYacc` repo, this copied code is just a bunch of untested, undocumented and +largely generated code checked into our source tree. + +## What if I want to modify/improve FsLex and FsYacc + +First, be clear on what you want to do: + +1. You might want to update the _code generators_ for the fslex or fsyacc tools. + +2. You might want to update the _runtime_ of the fslex or fsyacc tools. + +For (1), to improve the code/table generators, make a PR to the `FsLexYacc` repository and go through the cycle of updating these files to match a package upgrade. + +For (2), normally for FsLexYacc-based tools the runtime is either a source inclusion of `Lexing.fs`, Lexing.fsi, Parsing.fs, Parsing.fsi or a reference to the `FsLexYacc.Runtime` package. The runtime contains LexBuffer and the lexing/parsing table interpreters. + +However long ago we decided to duplicate and ingest the _runtime_ files for FsLex and FsYacc into the F# compiler rather than taking them directly from the FsLexYacc project. This was mainly because we wanted to squeeze optimizations out of them based on profiling and simplify them a bit. The duplicated files are `prim-lexing.fs`, `prim-parsing.fs` and the corresponding `.fsi` files in `src/utils`. These files are sufficient to implement the contracts exepcted by the FsLex/FsYacc generated code, and require exactly the same table formats as generated by FsLex/FsYacc. + +This means you can improve some aspects of the _runtime_ for FsLex and FsYacc by making direct changes to `prim-lexing.fs` and `prim-parsing.fs`. + +For example, the _actual_ `LexBuffer` type being used in the F# compiler (for all three lexers and grammars) is this one: https://github.com/Microsoft/visualfsharp/blob/master/src/utils/prim-lexing.fsi#L50. (That version of the Lex/Yacc runtime has added some things: `BufferLocalStore` for example, which we use for the `XmlDoc` accumulator as we strip those out. It's also dropped any mention of async lexing, and any mention of `byte`. The use +of generics for `LexBuffer<'Char>` is also superfluous because `'Char` is always `char` but is needed because the FsLex/FsYacc generated code expects this type to be generic.) + +## What if I want to eridicate our use of FsLex and FsYacc? + +The use of FsLex and FsYacc in this repo is somewhat controversial since the C# compiler implementation uses hand-written lexers and parsers. + +In the balance the use of FsLex is fairly reasonable and unlikely to change, though moving to an alternative tokenization technique wouldn't be +overly difficult given the declarative nature of `FsLex` tokenization. + +The use of a table-driven LALR(1) parser is more controversial: there is a general feeling that it would be great to +somehow move on from FsYacc and do parsing some other way. However, it is not at all easy to do that and remain +fully compatible. For this reason it is unlikely we will remove the use of FsYacc any time soon. However incremental +modifications to extract more information from the grammer may yield good results. + +## Why aren't FsLex and FsYacc just ingested into this repo if we depend on them (and even have an exact copy of them for build-from-source)? + +FsLex and FsYacc are non-trivial tools that require documentation and testing. Also, for external users, they require packaging. Changes to their design should be +considered carefully. While we are open to adding features to these tools specifically for use by the F# compiler, the tools are open source and available +independently. For these reasons it is generally best that these tools live in their own repository. + +The copy of the `fslex` and `fsyacc` source code in `buildtools` is an exact copy and is not tested or documented +apart from what's been done before in FsLexYacc repo. Adjusting these copies is not allowed and would be wrong from an engineering persepctive, +because there's no place to put documentation or tests. + +Occasionally we discuss ingesting FsLex and FsYacc into this repository. This often comes up in the hope that by doing so +we can somehow eventually code-fold them away until we no longer require them at all, instead moving to hand-written parsers +and lexers. That's an admirable goal. However, moving the tools into this repo doesn't actually help with eliminating their +use, and may indeed make it harder. This is because these tools use table generation +based on very specific lexer/grammar specifications. The tables are unreadable and unmaintainable. You can't just +somehow "specialize" the tools to the F# grammar and then get rid of them as this doesn't give a useful, maintainable lexer or parser. +To our knowledge there is no way to convert an LALR(1) parser specification to readable, maintainable recursive descent parsing code. + +As a result, ingesting the tools into this repo (and modifying them here) would be counter-productive, as the tools would no longer be tested, documented or +maintained properly, and overall engineering quality would decrease. Further the bootstrap process for the repo then becomes very unwieldy. + + diff --git a/src/buildtools/buildtools.proj b/src/buildtools/buildtools.proj new file mode 100644 index 00000000000..593f086dd07 --- /dev/null +++ b/src/buildtools/buildtools.proj @@ -0,0 +1,32 @@ + + + + Debug + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/buildtools/buildtools.targets b/src/buildtools/buildtools.targets index f82f981542c..9b00e18cf72 100644 --- a/src/buildtools/buildtools.targets +++ b/src/buildtools/buildtools.targets @@ -1,69 +1,56 @@ - + $(DotNetExe) + + + + + + + $(ArtifactsBinDir)\fslex\Proto\netcoreapp2.0\fslex.dll + + + + + + + + + + + + + + + + + + + $(ArtifactsBinDir)\fsyacc\Proto\netcoreapp2.0\fsyacc.dll + + + + + + + + + + + + + -WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have - created a backup copy. Incorrect changes to this file will make it - impossible to load or build your projects from the command-line or the IDE. - -PowerPack build rules. - -Copyright (C) Microsoft Corporation. All rights reserved. -*********************************************************************************************** ---> - - - - CallFsLex;CallFsYacc;$(CompileDependsOn) - $(MSBuildThisFileDirectory) - fslex.exe - $(MSBuildThisFileDirectory) - fsyacc.exe - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - false - - - false - - - - diff --git a/src/buildtools/fslex/fslex.fs b/src/buildtools/fslex/fslex.fs index 46795d728ef..d2f1af826bd 100644 --- a/src/buildtools/fslex/fslex.fs +++ b/src/buildtools/fslex/fslex.fs @@ -67,7 +67,8 @@ let sentinel = 255 * 256 + 255 let lineCount = ref 0 let cfprintfn (os: #TextWriter) fmt = Printf.kfprintf (fun () -> incr lineCount; os.WriteLine()) os fmt -let main() = +[] +let main(args: string[]) = try let filename = (match !input with Some x -> x | None -> failwith "no input given") let domain = if !unicode then "Unicode" else "Ascii" @@ -216,10 +217,8 @@ let main() = printLinesIfCodeDefined spec.BottomCode cfprintfn os "# 3000000 \"%s\"" output; + 0 with e -> eprintf "FSLEX: error FSL000: %s" (match e with Failure s -> s | e -> e.ToString()); exit 1 - - -let result = main() diff --git a/src/buildtools/fslex/fslex.fsproj b/src/buildtools/fslex/fslex.fsproj index 9fba6aab33f..9e21a860d8c 100644 --- a/src/buildtools/fslex/fslex.fsproj +++ b/src/buildtools/fslex/fslex.fsproj @@ -1,12 +1,22 @@ - + + Exe netcoreapp2.0 INTERNALIZED_FSLEXYACC_RUNTIME;$(DefineConstant) - + + + + + + + + + + diff --git a/src/buildtools/fslex/fslex.fsx b/src/buildtools/fslex/fslex.fsx deleted file mode 100644 index 82e434bcbbe..00000000000 --- a/src/buildtools/fslex/fslex.fsx +++ /dev/null @@ -1,3 +0,0 @@ -#load "Lexing.fsi" "Lexing.fs" "Parsing.fsi" "Parsing.fs" "Arg.fsi" "Arg.fs" "fslexast.fs" "fslexpars.fs" "fslexlex.fs" "fslex.fs" - -let v = FsLexYacc.FsLex.Driver.result diff --git a/src/buildtools/fssrgen/fssrgen.fsproj b/src/buildtools/fssrgen/fssrgen.fsproj deleted file mode 100644 index d6d06d53dfe..00000000000 --- a/src/buildtools/fssrgen/fssrgen.fsproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - netcoreapp2.0 - COMPILED;$(DefineConstant) - - - - - - - diff --git a/src/buildtools/fssrgen/fssrgen.fsx b/src/buildtools/fssrgen/fssrgen.fsx deleted file mode 100644 index 4fe5bbb38e1..00000000000 --- a/src/buildtools/fssrgen/fssrgen.fsx +++ /dev/null @@ -1,476 +0,0 @@ -// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. -let PrintErr(filename, line, msg) = - printfn "%s(%d): error : %s" filename line msg - -let Err(filename, line, msg) = - PrintErr(filename, line, msg) - printfn "Note that the syntax of each line is one of these three alternatives:" - printfn "# comment" - printfn "ident,\"string\"" - printfn "errNum,ident,\"string\"" - failwith (sprintf "there were errors in the file '%s'" filename) - -let xmlBoilerPlateString = @" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - -" - - -type HoleType = string - - -// The kinds of 'holes' we can do -let ComputeHoles filename lineNum (txt:string) : ResizeArray * string = - // takes in a %d%s kind of string, returns array of HoleType and {0}{1} kind of string - let mutable i = 0 - let mutable holeNumber = 0 - let mutable holes = ResizeArray() // order - let sb = new System.Text.StringBuilder() - let AddHole holeType = - sb.Append(sprintf "{%d}" holeNumber) |> ignore - holeNumber <- holeNumber + 1 - holes.Add(holeType) - while i < txt.Length do - if txt.[i] = '%' then - if i+1 = txt.Length then - Err(filename, lineNum, "(at end of string) % must be followed by d, f, s, or %") - else - match txt.[i+1] with - | 'd' -> AddHole "System.Int32" - | 'f' -> AddHole "System.Double" - | 's' -> AddHole "System.String" - | '%' -> sb.Append('%') |> ignore - | c -> Err(filename, lineNum, sprintf "'%%%c' is not a valid sequence, only %%d %%f %%s or %%%%" c) - i <- i + 2 - else - match txt.[i] with - | '{' -> sb.Append "{{" |> ignore - | '}' -> sb.Append "}}" |> ignore - | c -> sb.Append c |> ignore - i <- i + 1 - //printfn "holes.Length = %d, lineNum = %d" holes.Length //lineNum txt - (holes, sb.ToString()) - -let Unquote (s : string) = - if s.StartsWith "\"" && s.EndsWith "\"" then s.Substring(1, s.Length - 2) - else failwith "error message string should be quoted" - -let ParseLine filename lineNum (txt:string) = - let mutable errNum = None - let identB = new System.Text.StringBuilder() - let mutable i = 0 - // parse optional error number - if i < txt.Length && System.Char.IsDigit txt.[i] then - let numB = new System.Text.StringBuilder() - while i < txt.Length && System.Char.IsDigit txt.[i] do - numB.Append txt.[i] |> ignore - i <- i + 1 - errNum <- Some(int (numB.ToString())) - if i = txt.Length || not(txt.[i] = ',') then - Err(filename, lineNum, sprintf "After the error number '%d' there should be a comma" errNum.Value) - // Skip the comma - i <- i + 1 - // parse short identifier - if i < txt.Length && not(System.Char.IsLetter(txt.[i])) then - Err(filename, lineNum, sprintf "The first character in the short identifier should be a letter, but found '%c'" txt.[i]) - while i < txt.Length && System.Char.IsLetterOrDigit txt.[i] do - identB.Append txt.[i] |> ignore - i <- i + 1 - let ident = identB.ToString() - if ident.Length = 0 then - Err(filename, lineNum, "Did not find the short identifier") - else - if i = txt.Length || not(txt.[i] = ',') then - Err(filename, lineNum, sprintf "After the identifier '%s' there should be a comma" ident) - else - // Skip the comma - i <- i + 1 - if i = txt.Length then - Err(filename, lineNum, sprintf "After the identifier '%s' and comma, there should be the quoted string resource" ident) - else - let str = - try - System.String.Format(Unquote(txt.Substring i)) // Format turns e.g '\n' into that char, but also requires that we 'escape' curlies in the original .txt file, e.g. "{{" - with - e -> Err(filename, lineNum, sprintf "Error calling System.String.Format (note that curly braces must be escaped, and there cannot be trailing space on the line): >>>%s<<< -- %s" (txt.Substring i) e.Message) - let holes, netFormatString = ComputeHoles filename lineNum str - (lineNum, (errNum,ident), str, holes.ToArray(), netFormatString) - -let stringBoilerPlatePrefix = @" -open Microsoft.FSharp.Core.LanguagePrimitives.IntrinsicOperators -open Microsoft.FSharp.Reflection -open System.Reflection -// (namespaces below for specific case of using the tool to compile FSharp.Core itself) -open Microsoft.FSharp.Core -open Microsoft.FSharp.Core.Operators -open Microsoft.FSharp.Text -open Microsoft.FSharp.Collections -open Printf -" -let StringBoilerPlate filename = - - @" - // BEGIN BOILERPLATE - - static let getCurrentAssembly () = - #if FX_RESHAPED_REFLECTION - typeof.GetTypeInfo().Assembly - #else - System.Reflection.Assembly.GetExecutingAssembly() - #endif - - static let getTypeInfo (t: System.Type) = - #if FX_RESHAPED_REFLECTION - t.GetTypeInfo() - #else - t - #endif - - static let resources = lazy (new System.Resources.ResourceManager(""" + filename + @""", getCurrentAssembly())) - - static let GetString(name:string) = - let s = resources.Value.GetString(name, System.Globalization.CultureInfo.CurrentUICulture) - #if DEBUG - if null = s then - System.Diagnostics.Debug.Assert(false, sprintf ""**RESOURCE ERROR**: Resource token %s does not exist!"" name) - #endif - s - - static let mkFunctionValue (tys: System.Type[]) (impl:obj->obj) = - FSharpValue.MakeFunction(FSharpType.MakeFunctionType(tys.[0],tys.[1]), impl) - - static let funTyC = typeof<(obj -> obj)>.GetGenericTypeDefinition() - - static let isNamedType(ty:System.Type) = not (ty.IsArray || ty.IsByRef || ty.IsPointer) - static let isFunctionType (ty1:System.Type) = - isNamedType(ty1) && getTypeInfo(ty1).IsGenericType && (ty1.GetGenericTypeDefinition()).Equals(funTyC) - - static let rec destFunTy (ty:System.Type) = - if isFunctionType ty then - ty, ty.GetGenericArguments() - else - match getTypeInfo(ty).BaseType with - | null -> failwith ""destFunTy: not a function type"" - | b -> destFunTy b - - static let buildFunctionForOneArgPat (ty: System.Type) impl = - let _,tys = destFunTy ty - let rty = tys.[1] - // PERF: this technique is a bit slow (e.g. in simple cases, like 'sprintf ""%x""') - mkFunctionValue tys (fun inp -> impl rty inp) - - static let capture1 (fmt:string) i args ty (go : obj list -> System.Type -> int -> obj) : obj = - match fmt.[i] with - | '%' -> go args ty (i+1) - | 'd' - | 'f' - | 's' -> buildFunctionForOneArgPat ty (fun rty n -> go (n::args) rty (i+1)) - | _ -> failwith ""bad format specifier"" - - // newlines and tabs get converted to strings when read from a resource file - // this will preserve their original intention - static let postProcessString (s : string) = - s.Replace(""\\n"",""\n"").Replace(""\\t"",""\t"").Replace(""\\r"",""\r"").Replace(""\\\"""", ""\"""") - - static let createMessageString (messageString : string) (fmt : Printf.StringFormat<'T>) : 'T = - let fmt = fmt.Value // here, we use the actual error string, as opposed to the one stored as fmt - let len = fmt.Length - - /// Function to capture the arguments and then run. - let rec capture args ty i = - if i >= len || (fmt.[i] = '%' && i+1 >= len) then - let b = new System.Text.StringBuilder() - b.AppendFormat(messageString, [| for x in List.rev args -> x |]) |> ignore - box(b.ToString()) - // REVIEW: For these purposes, this should be a nop, but I'm leaving it - // in incase we ever decide to support labels for the error format string - // E.g., ""%s%d"" - elif System.Char.IsSurrogatePair(fmt,i) then - capture args ty (i+2) - else - match fmt.[i] with - | '%' -> - let i = i+1 - capture1 fmt i args ty capture - | _ -> - capture args ty (i+1) - - (unbox (capture [] (typeof<'T>) 0) : 'T) - - static let mutable swallowResourceText = false - - static let GetStringFunc((messageID : string),(fmt : Printf.StringFormat<'T>)) : 'T = - if swallowResourceText then - sprintf fmt - else - let mutable messageString = GetString(messageID) - messageString <- postProcessString messageString - createMessageString messageString fmt - - /// If set to true, then all error messages will just return the filled 'holes' delimited by ',,,'s - this is for language-neutral testing (e.g. localization-invariant baselines). - static member SwallowResourceText with get () = swallowResourceText - and set (b) = swallowResourceText <- b - // END BOILERPLATE -" - -let RunMain(filename, outFilename, outXmlFilenameOpt, projectNameOpt) = - try - let justfilename = System.IO.Path.GetFileNameWithoutExtension(filename) - if justfilename |> Seq.exists (fun c -> not(System.Char.IsLetterOrDigit(c))) then - Err(filename, 0, sprintf "The filename '%s' is not allowed; only letters and digits can be used, as the filename also becomes the namespace for the SR class" justfilename) - - printfn "fssrgen.fsx: Reading %s" filename - let lines = System.IO.File.ReadAllLines(filename) - |> Array.mapi (fun i s -> i,s) // keep line numbers - |> Array.filter (fun (i,s) -> not(s.StartsWith "#")) // filter out comments - - printfn "fssrgen.fsx: Parsing %s" filename - let stringInfos = lines |> Array.map (fun (i,s) -> ParseLine filename i s) - // now we have array of (lineNum, ident, str, holes, netFormatString) // str has %d, netFormatString has {0} - - printfn "fssrgen.fsx: Validating %s" filename - // validate that all the idents are unique - let allIdents = new System.Collections.Generic.Dictionary() - for (line,(_,ident),_,_,_) in stringInfos do - if allIdents.ContainsKey(ident) then - Err(filename,line,sprintf "Identifier '%s' is already used previously on line %d - each identifier must be unique" ident allIdents.[ident]) - allIdents.Add(ident,line) - - printfn "fssrgen.fsx: Validating uniqueness of %s" filename - // validate that all the strings themselves are unique - let allStrs = new System.Collections.Generic.Dictionary() - for (line,(_,ident),str,_,_) in stringInfos do - if allStrs.ContainsKey(str) then - let prevLine,prevIdent = allStrs.[str] - Err(filename,line,sprintf "String '%s' already appears on line %d with identifier '%s' - each string must be unique" str prevLine prevIdent) - allStrs.Add(str,(line,ident)) - - printfn "fssrgen.fsx: Generating %s" outFilename - use outStream = System.IO.File.Create outFilename - use out = new System.IO.StreamWriter(outStream) - fprintfn out "// This is a generated file; the original input is '%s'" filename - fprintfn out "namespace %s" justfilename - if Option.isNone outXmlFilenameOpt then - fprintfn out "type internal SR private() =" - else - fprintfn out "%s" stringBoilerPlatePrefix - fprintfn out "type internal SR private() =" - let theResourceName = match projectNameOpt with Some p -> sprintf "%s.%s" p justfilename | None -> justfilename - fprintfn out "%s" (StringBoilerPlate theResourceName) - - printfn "fssrgen.fsx: Generating resource methods for %s" outFilename - // gen each resource method - stringInfos |> Seq.iter (fun (lineNum, (optErrNum,ident), str, holes, netFormatString) -> - let formalArgs = new System.Text.StringBuilder() - let actualArgs = new System.Text.StringBuilder() - let firstTime = ref true - let n = ref 0 - formalArgs.Append "(" |> ignore - for hole in holes do - if !firstTime then - firstTime := false - else - formalArgs.Append ", " |> ignore - actualArgs.Append " " |> ignore - formalArgs.Append(sprintf "a%d : %s" !n hole) |> ignore - actualArgs.Append(sprintf "a%d" !n) |> ignore - n := !n + 1 - formalArgs.Append ")" |> ignore - fprintfn out " /// %s" str - fprintfn out " /// (Originally from %s:%d)" filename (lineNum+1) - let justPercentsFromFormatString = - (holes |> Array.fold (fun acc holeType -> - acc + match holeType with - | "System.Int32" -> ",,,%d" - | "System.Double" -> ",,,%f" - | "System.String" -> ",,,%s" - | _ -> failwith "unreachable") "") + ",,," - let errPrefix = match optErrNum with - | None -> "" - | Some n -> sprintf "%d, " n - if Option.isNone outXmlFilenameOpt then - fprintfn out " static member %s%s = (%ssprintf \"%s\" %s)" ident (formalArgs.ToString()) errPrefix str (actualArgs.ToString()) - else - fprintfn out " static member %s%s = (%sGetStringFunc(\"%s\",\"%s\") %s)" ident (formalArgs.ToString()) errPrefix ident justPercentsFromFormatString (actualArgs.ToString()) - ) - - if Option.isSome outXmlFilenameOpt then - printfn "fssrgen.fsx: Generating .resx for %s" outFilename - fprintfn out "" - // gen validation method - fprintfn out " /// Call this method once to validate that all known resources are valid; throws if not" - fprintfn out " static member RunStartupValidation() =" - stringInfos |> Seq.iter (fun (lineNum, (optErrNum,ident), str, holes, netFormatString) -> - fprintfn out " ignore(GetString(\"%s\"))" ident - ) - fprintfn out " ()" // in case there are 0 strings, we need the generated code to parse - // gen to resx - let xd = new System.Xml.XmlDocument() - xd.LoadXml(xmlBoilerPlateString) - stringInfos |> Seq.iter (fun (lineNum, (optErrNum,ident), str, holes, netFormatString) -> - let xn = xd.CreateElement("data") - xn.SetAttribute("name",ident) |> ignore - xn.SetAttribute("xml:space","preserve") |> ignore - let xnc = xd.CreateElement "value" - xn.AppendChild xnc |> ignore - xnc.AppendChild(xd.CreateTextNode netFormatString) |> ignore - xd.LastChild.AppendChild xn |> ignore - ) - use outXmlStream = System.IO.File.Create outXmlFilenameOpt.Value - xd.Save outXmlStream - printfn "fssrgen.fsx: Done %s" outFilename - 0 - with e -> - PrintErr(filename, 0, sprintf "An exception occurred when processing '%s'\n%s" filename (e.ToString())) - 1 - -#if COMPILED -[] -#endif -let Main args = - - match args |> List.ofArray with - | [ inputFile; outFile; ] -> - let filename = System.IO.Path.GetFullPath(inputFile) - let outFilename = System.IO.Path.GetFullPath(outFile) - - RunMain(filename, outFilename, None, None) - - | [ inputFile; outFile; outXml ] -> - let filename = System.IO.Path.GetFullPath inputFile - let outFilename = System.IO.Path.GetFullPath outFile - let outXmlFilename = System.IO.Path.GetFullPath outXml - - RunMain(filename, outFilename, Some outXmlFilename, None) - - | [ inputFile; outFile; outXml; projectName ] -> - let filename = System.IO.Path.GetFullPath inputFile - let outFilename = System.IO.Path.GetFullPath outFile - let outXmlFilename = System.IO.Path.GetFullPath outXml - - RunMain(filename, outFilename, Some outXmlFilename, Some projectName) - - | _ -> - printfn "Error: invalid arguments." - printfn "Usage: " - 1 -#if !COMPILED -printfn "fssrgen: args = %A" fsi.CommandLineArgs -Main (fsi.CommandLineArgs |> Seq.skip 1 |> Seq.toArray) -#endif diff --git a/src/buildtools/fssrgen/fssrgen.targets b/src/buildtools/fssrgen/fssrgen.targets deleted file mode 100644 index 525015ae163..00000000000 --- a/src/buildtools/fssrgen/fssrgen.targets +++ /dev/null @@ -1,57 +0,0 @@ - - - - - ProcessFsSrGen;$(PrepareForBuildDependsOn) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - false - - - diff --git a/src/buildtools/fsyacc/fsyacc.fs b/src/buildtools/fsyacc/fsyacc.fs index 513262f29db..185ff33232b 100644 --- a/src/buildtools/fsyacc/fsyacc.fs +++ b/src/buildtools/fsyacc/fsyacc.fs @@ -523,9 +523,11 @@ let main() = logf (fun oso -> oso.Close()) -let result = - try main() +[] +let result(args: string[]) = + try + main() + 0 with e -> - eprintf "FSYACC: error FSY000: %s" (match e with Failure s -> s | e -> e.Message); - exit 1 - + eprintf "FSYACC: error FSY000: %s" (match e with Failure s -> s | e -> e.Message); + 1 diff --git a/src/buildtools/fsyacc/fsyacc.fsproj b/src/buildtools/fsyacc/fsyacc.fsproj index 32a1d6f3317..286c7a4eb12 100644 --- a/src/buildtools/fsyacc/fsyacc.fsproj +++ b/src/buildtools/fsyacc/fsyacc.fsproj @@ -1,12 +1,22 @@ - + + Exe netcoreapp2.0 INTERNALIZED_FSLEXYACC_RUNTIME;$(DefineConstant) - + + + + + + + + + + diff --git a/src/buildtools/fsyacc/fsyacc.fsx b/src/buildtools/fsyacc/fsyacc.fsx deleted file mode 100644 index 65b608372f8..00000000000 --- a/src/buildtools/fsyacc/fsyacc.fsx +++ /dev/null @@ -1,3 +0,0 @@ -#load "Lexing.fsi" "Lexing.fs" "Parsing.fsi" "Parsing.fs" "Arg.fsi" "Arg.fs" "fsyaccast.fs" "fsyaccpars.fs" "fsyacclex.fs" "fsyacc.fs" - -let v = FsLexYacc.FsYacc.Driver.result diff --git a/src/fsharp-proto-build.proj b/src/fsharp-proto-build.proj deleted file mode 100644 index 5dc178032ef..00000000000 --- a/src/fsharp-proto-build.proj +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/src/fsharp/AccessibilityLogic.fs b/src/fsharp/AccessibilityLogic.fs index 7e2e2ef5d9c..dcd8d5d801e 100644 --- a/src/fsharp/AccessibilityLogic.fs +++ b/src/fsharp/AccessibilityLogic.fs @@ -194,9 +194,10 @@ let CheckTyconReprAccessible amap m ad tcref = /// Indicates if a type is accessible (both definition and instantiation) let rec IsTypeAccessible g amap m ad ty = - not (isAppTy g ty) || - let tcref, tinst = destAppTy g ty - IsEntityAccessible amap m ad tcref && IsTypeInstAccessible g amap m ad tinst + match tryAppTy g ty with + | ValueNone -> true + | ValueSome(tcref, tinst) -> + IsEntityAccessible amap m ad tcref && IsTypeInstAccessible g amap m ad tinst and IsTypeInstAccessible g amap m ad tinst = match tinst with @@ -210,7 +211,7 @@ let IsProvidedMemberAccessible (amap:Import.ImportMap) m ad ty access = if not isTyAccessible then false else not (isAppTy g ty) || - let tcrefOfViewedItem, _ = destAppTy g ty + let tcrefOfViewedItem = tcrefOfAppTy g ty IsILMemberAccessible g amap m tcrefOfViewedItem ad access /// Compute the accessibility of a provided member diff --git a/src/fsharp/AttributeChecking.fs b/src/fsharp/AttributeChecking.fs index 3be4a3a0705..a28598d9708 100644 --- a/src/fsharp/AttributeChecking.fs +++ b/src/fsharp/AttributeChecking.fs @@ -449,8 +449,8 @@ let MethInfoIsUnseen g m ty minfo = // We are only interested in filtering out the method on System.Object, so it is sufficient // just to look at the attributes on IL methods. if tcref.IsILTycon then - tcref.ILTyconRawMetadata.CustomAttrs.AsList - |> List.exists (fun attr -> attr.Method.DeclaringType.TypeSpec.Name = typeof.FullName) + tcref.ILTyconRawMetadata.CustomAttrs.AsArray + |> Array.exists (fun attr -> attr.Method.DeclaringType.TypeSpec.Name = typeof.FullName) else false #else diff --git a/src/fsharp/CheckFormatStrings.fs b/src/fsharp/CheckFormatStrings.fs index 4d532904a16..9d7fd72d7a0 100644 --- a/src/fsharp/CheckFormatStrings.fs +++ b/src/fsharp/CheckFormatStrings.fs @@ -54,15 +54,15 @@ let parseFormatStringInternal (m:range) (g: TcGlobals) (context: FormatStringChe let (offset, fmt) = match context with | Some context -> - let length = context.NormalizedSource.Length - if m.EndLine < context.LineEndPositions.Length then - let startIndex = context.LineEndPositions.[m.StartLine-1] + m.StartColumn - let endIndex = context.LineEndPositions.[m.EndLine-1] + m.EndColumn - 1 - if startIndex < length-3 && context.NormalizedSource.[startIndex..startIndex+2] = "\"\"\"" then - (3, context.NormalizedSource.[startIndex+3..endIndex-3]) - elif startIndex < length-2 && context.NormalizedSource.[startIndex..startIndex+1] = "@\"" then - (2, context.NormalizedSource.[startIndex+2..endIndex-1]) - else (1, context.NormalizedSource.[startIndex+1..endIndex-1]) + let length = context.Source.Length + if m.EndLine < context.LineStartPositions.Length then + let startIndex = context.LineStartPositions.[m.StartLine-1] + m.StartColumn + let endIndex = context.LineStartPositions.[m.EndLine-1] + m.EndColumn - 1 + if startIndex < length-3 && context.Source.[startIndex..startIndex+2] = "\"\"\"" then + (3, context.Source.[startIndex+3..endIndex-3]) + elif startIndex < length-2 && context.Source.[startIndex..startIndex+1] = "@\"" then + (2, context.Source.[startIndex+2..endIndex-1]) + else (1, context.Source.[startIndex+1..endIndex-1]) else (1, fmt) | None -> (1, fmt) diff --git a/src/fsharp/CompileOps.fs b/src/fsharp/CompileOps.fs index d54373c5548..830a08bf2f4 100644 --- a/src/fsharp/CompileOps.fs +++ b/src/fsharp/CompileOps.fs @@ -960,12 +960,12 @@ let OutputPhasedErrorR (os:StringBuilder) (err:PhasedDiagnostic) = | Parser.TOKEN_RPAREN | Parser.TOKEN_RPAREN_COMING_SOON | Parser.TOKEN_RPAREN_IS_HERE -> getErrorString("Parser.TOKEN.RPAREN") | Parser.TOKEN_LQUOTE -> getErrorString("Parser.TOKEN.LQUOTE") | Parser.TOKEN_LBRACK -> getErrorString("Parser.TOKEN.LBRACK") + | Parser.TOKEN_LBRACE_BAR -> getErrorString("Parser.TOKEN.LBRACE.BAR") | Parser.TOKEN_LBRACK_BAR -> getErrorString("Parser.TOKEN.LBRACK.BAR") | Parser.TOKEN_LBRACK_LESS -> getErrorString("Parser.TOKEN.LBRACK.LESS") | Parser.TOKEN_LBRACE -> getErrorString("Parser.TOKEN.LBRACE") - | Parser.TOKEN_LBRACE_LESS-> getErrorString("Parser.TOKEN.LBRACE.LESS") | Parser.TOKEN_BAR_RBRACK -> getErrorString("Parser.TOKEN.BAR.RBRACK") - | Parser.TOKEN_GREATER_RBRACE -> getErrorString("Parser.TOKEN.GREATER.RBRACE") + | Parser.TOKEN_BAR_RBRACE -> getErrorString("Parser.TOKEN.BAR.RBRACE") | Parser.TOKEN_GREATER_RBRACK -> getErrorString("Parser.TOKEN.GREATER.RBRACK") | Parser.TOKEN_RQUOTE_DOT _ | Parser.TOKEN_RQUOTE -> getErrorString("Parser.TOKEN.RQUOTE") @@ -1096,7 +1096,7 @@ let OutputPhasedErrorR (os:StringBuilder) (err:PhasedDiagnostic) = (* Merge a bunch of expression non terminals *) let (|NONTERM_Category_Expr|_|) = function | Parser.NONTERM_argExpr|Parser.NONTERM_minusExpr|Parser.NONTERM_parenExpr|Parser.NONTERM_atomicExpr - | Parser.NONTERM_appExpr|Parser.NONTERM_tupleExpr|Parser.NONTERM_declExpr|Parser.NONTERM_braceExpr + | Parser.NONTERM_appExpr|Parser.NONTERM_tupleExpr|Parser.NONTERM_declExpr|Parser.NONTERM_braceExpr|Parser.NONTERM_braceBarExpr | Parser.NONTERM_typedSeqExprBlock | Parser.NONTERM_interactiveExpr -> Some() | _ -> None @@ -1825,6 +1825,7 @@ let DefaultReferencesForScriptsAndOutOfProjectSources(assumeDotNetFramework) = yield "System.Data" yield "System.Drawing" yield "System.Core" + // These are the Portable-profile and .NET Standard 1.6 dependencies of FSharp.Core.dll. These are needed // when an F# sript references an F# profile 7, 78, 259 or .NET Standard 1.6 component which in turn refers // to FSharp.Core for profile 7, 78, 259 or .NET Standard. @@ -1850,17 +1851,24 @@ let DefaultReferencesForScriptsAndOutOfProjectSources(assumeDotNetFramework) = yield "System.Windows.Forms" yield "System.Numerics" else - yield Path.Combine(Path.GetDirectoryName(typeof.Assembly.Location), "mscorlib.dll"); // mscorlib - yield typeof.Assembly.Location; // System.Console - yield typeof.Assembly.Location; // System.Runtime - yield typeof.Assembly.Location; // System.ObjectModel - yield typeof.Assembly.Location; // System.IO - yield typeof.Assembly.Location; // System.Linq - //yield typeof.Assembly.Location; // System.Xml.Linq - yield typeof.Assembly.Location; // System.Net.Requests - yield typeof.Assembly.Location; // System.Runtime.Numerics - yield typeof.Assembly.Location; // System.Threading.Tasks - yield typeof.Assembly.Location; // FSharp.Core + yield Path.Combine(Path.GetDirectoryName(typeof.Assembly.Location), "mscorlib.dll") // mscorlib + yield typeof.Assembly.Location // System.Console + yield typeof.Assembly.Location // System.Collections + yield typeof.Assembly.Location // System.Data.SqlClient + yield typeof.Assembly.Location // System.ObjectModel + yield typeof.Assembly.Location // System.IO.FileSystem + yield typeof.Assembly.Location // System.IO + yield typeof.Assembly.Location // System.Linq + yield typeof.Assembly.Location // System.Xml + yield typeof.Assembly.Location // System.Xml.Linq + yield typeof.Assembly.Location // System.Net.Requests + yield typeof.Assembly.Location // System.Runtime.Numerics + yield typeof.Assembly.Location // System.Net.Security + yield typeof.Assembly.Location // System.Security.Claims + yield typeof.Assembly.Location // System.Text.RegularExpressions.Regex + yield typeof.Assembly.Location // System.Threading.Tasks + yield typeof.Assembly.Location // System.Threading + yield typeof.Assembly.Location // FSharp.Core ] @@ -2348,6 +2356,8 @@ type TcConfigBuilder = mutable tryGetMetadataSnapshot : ILReaderTryGetMetadataSnapshot mutable internalTestSpanStackReferring : bool + + mutable noConditionalErasure : bool } static member Initial = @@ -2485,6 +2495,7 @@ type TcConfigBuilder = shadowCopyReferences = false tryGetMetadataSnapshot = (fun _ -> None) internalTestSpanStackReferring = false + noConditionalErasure = false } static member CreateNew(legacyReferenceResolver, defaultFSharpBinariesDir, reduceMemoryUsage, implicitIncludeDir, @@ -2609,13 +2620,13 @@ type TcConfigBuilder = member tcConfigB.RemoveReferencedAssemblyByPath (m, path) = tcConfigB.referencedDLLs <- tcConfigB.referencedDLLs |> List.filter (fun ar-> ar.Range <> m || ar.Text <> path) - static member SplitCommandLineResourceInfo ri = - if String.contains ri ',' then - let p = String.index ri ',' + static member SplitCommandLineResourceInfo (ri:string) = + let p = ri.IndexOf ',' + if p <> -1 then let file = String.sub ri 0 p let rest = String.sub ri (p+1) (String.length ri - p - 1) - if String.contains rest ',' then - let p = String.index rest ',' + let p = rest.IndexOf ',' + if p <> -1 then let name = String.sub rest 0 p+".resources" let pubpri = String.sub rest (p+1) (rest.Length - p - 1) if pubpri = "public" then file, name, ILResourceAccess.Public @@ -2674,9 +2685,9 @@ type AssemblyResolution = member this.GetILAssemblyRef(ctok, reduceMemoryUsage, tryGetMetadataSnapshot) = cancellable { match !this.ilAssemblyRef with - | Some(assref) -> return assref + | Some(assemblyRef) -> return assemblyRef | None -> - let! assRefOpt = + let! assemblyRefOpt = cancellable { match this.ProjectReference with | Some r -> @@ -2689,8 +2700,8 @@ type AssemblyResolution = | _ -> return None | None -> return None } - let assRef = - match assRefOpt with + let assemblyRef = + match assemblyRefOpt with | Some aref -> aref | None -> let readerSettings : ILReaderOptions = @@ -2701,8 +2712,8 @@ type AssemblyResolution = tryGetMetadataSnapshot = tryGetMetadataSnapshot } use reader = OpenILModuleReader this.resolvedPath readerSettings mkRefToILAssembly reader.ILModuleDef.ManifestOfAssembly - this.ilAssemblyRef := Some(assRef) - return assRef + this.ilAssemblyRef := Some(assemblyRef) + return assemblyRef } //---------------------------------------------------------------------------- @@ -2946,6 +2957,8 @@ type TcConfig private (data : TcConfigBuilder, validate:bool) = member x.shadowCopyReferences = data.shadowCopyReferences member x.tryGetMetadataSnapshot = data.tryGetMetadataSnapshot member x.internalTestSpanStackReferring = data.internalTestSpanStackReferring + member x.noConditionalErasure = data.noConditionalErasure + static member Create(builder, validate) = use unwindBuildPhase = PushThreadBuildPhaseUntilUnwind BuildPhase.Parameter TcConfig(builder, validate) @@ -3376,14 +3389,14 @@ let ComputeQualifiedNameOfFileFromUniquePath (m, p: string list) = QualifiedName let QualFileNameOfSpecs filename specs = match specs with - | [SynModuleOrNamespaceSig(modname, _, true, _, _, _, _, m)] -> QualFileNameOfModuleName m filename modname - | [SynModuleOrNamespaceSig(_, _, false, _, _, _, _, m)] -> QualFileNameOfFilename m filename + | [SynModuleOrNamespaceSig(modname, _, kind, _, _, _, _, m)] when kind.IsModule -> QualFileNameOfModuleName m filename modname + | [SynModuleOrNamespaceSig(_, _, kind, _, _, _, _, m)] when not kind.IsModule -> QualFileNameOfFilename m filename | _ -> QualFileNameOfFilename (mkRange filename pos0 pos0) filename let QualFileNameOfImpls filename specs = match specs with - | [SynModuleOrNamespace(modname, _, true, _, _, _, _, m)] -> QualFileNameOfModuleName m filename modname - | [SynModuleOrNamespace(_, _, false, _, _, _, _, m)] -> QualFileNameOfFilename m filename + | [SynModuleOrNamespace(modname, _, kind, _, _, _, _, m)] when kind.IsModule -> QualFileNameOfModuleName m filename modname + | [SynModuleOrNamespace(_, _, kind, _, _, _, _, m)] when not kind.IsModule -> QualFileNameOfFilename m filename | _ -> QualFileNameOfFilename (mkRange filename pos0 pos0) filename let PrepandPathToQualFileName x (QualifiedNameOfFile(q)) = ComputeQualifiedNameOfFileFromUniquePath (q.idRange, pathOfLid x@[q.idText]) @@ -3412,13 +3425,14 @@ let ComputeAnonModuleName check defaultNamespace filename (m: range) = let PostParseModuleImpl (_i, defaultNamespace, isLastCompiland, filename, impl) = match impl with - | ParsedImplFileFragment.NamedModule(SynModuleOrNamespace(lid, isRec, isModule, decls, xmlDoc, attribs, access, m)) -> + | ParsedImplFileFragment.NamedModule(SynModuleOrNamespace(lid, isRec, kind, decls, xmlDoc, attribs, access, m)) -> let lid = match lid with - | [id] when isModule && id.idText = MangledGlobalName -> error(Error(FSComp.SR.buildInvalidModuleOrNamespaceName(), id.idRange)) + | [id] when kind.IsModule && id.idText = MangledGlobalName -> + error(Error(FSComp.SR.buildInvalidModuleOrNamespaceName(), id.idRange)) | id :: rest when id.idText = MangledGlobalName -> rest | _ -> lid - SynModuleOrNamespace(lid, isRec, isModule, decls, xmlDoc, attribs, access, m) + SynModuleOrNamespace(lid, isRec, kind, decls, xmlDoc, attribs, access, m) | ParsedImplFileFragment.AnonModule (defs, m)-> let isLast, isExe = isLastCompiland @@ -3429,24 +3443,26 @@ let PostParseModuleImpl (_i, defaultNamespace, isLastCompiland, filename, impl) | _ -> errorR(Error(FSComp.SR.buildMultiFileRequiresNamespaceOrModule(), trimRangeToLine m)) let modname = ComputeAnonModuleName (not (isNil defs)) defaultNamespace filename (trimRangeToLine m) - SynModuleOrNamespace(modname, false, true, defs, PreXmlDoc.Empty, [], None, m) + SynModuleOrNamespace(modname, false, AnonModule, defs, PreXmlDoc.Empty, [], None, m) - | ParsedImplFileFragment.NamespaceFragment (lid, a, b, c, d, e, m)-> - let lid = + | ParsedImplFileFragment.NamespaceFragment (lid, a, kind, c, d, e, m)-> + let lid, kind = match lid with - | id :: rest when id.idText = MangledGlobalName -> rest - | _ -> lid - SynModuleOrNamespace(lid, a, b, c, d, e, None, m) + | id :: rest when id.idText = MangledGlobalName -> + rest, if List.isEmpty rest then GlobalNamespace else kind + | _ -> lid, kind + SynModuleOrNamespace(lid, a, kind, c, d, e, None, m) let PostParseModuleSpec (_i, defaultNamespace, isLastCompiland, filename, intf) = match intf with - | ParsedSigFileFragment.NamedModule(SynModuleOrNamespaceSig(lid, isRec, isModule, decls, xmlDoc, attribs, access, m)) -> + | ParsedSigFileFragment.NamedModule(SynModuleOrNamespaceSig(lid, isRec, kind, decls, xmlDoc, attribs, access, m)) -> let lid = match lid with - | [id] when isModule && id.idText = MangledGlobalName -> error(Error(FSComp.SR.buildInvalidModuleOrNamespaceName(), id.idRange)) + | [id] when kind.IsModule && id.idText = MangledGlobalName -> + error(Error(FSComp.SR.buildInvalidModuleOrNamespaceName(), id.idRange)) | id :: rest when id.idText = MangledGlobalName -> rest | _ -> lid - SynModuleOrNamespaceSig(lid, isRec, isModule, decls, xmlDoc, attribs, access, m) + SynModuleOrNamespaceSig(lid, isRec, NamedModule, decls, xmlDoc, attribs, access, m) | ParsedSigFileFragment.AnonModule (defs, m) -> let isLast, isExe = isLastCompiland @@ -3457,14 +3473,15 @@ let PostParseModuleSpec (_i, defaultNamespace, isLastCompiland, filename, intf) | _ -> errorR(Error(FSComp.SR.buildMultiFileRequiresNamespaceOrModule(), m)) let modname = ComputeAnonModuleName (not (isNil defs)) defaultNamespace filename (trimRangeToLine m) - SynModuleOrNamespaceSig(modname, false, true, defs, PreXmlDoc.Empty, [], None, m) + SynModuleOrNamespaceSig(modname, false, AnonModule, defs, PreXmlDoc.Empty, [], None, m) - | ParsedSigFileFragment.NamespaceFragment (lid, a, b, c, d, e, m)-> - let lid = + | ParsedSigFileFragment.NamespaceFragment (lid, a, kind, c, d, e, m)-> + let lid, kind = match lid with - | id :: rest when id.idText = MangledGlobalName -> rest - | _ -> lid - SynModuleOrNamespaceSig(lid, a, b, c, d, e, None, m) + | id :: rest when id.idText = MangledGlobalName -> + rest, if List.isEmpty rest then GlobalNamespace else kind + | _ -> lid, kind + SynModuleOrNamespaceSig(lid, a, kind, c, d, e, None, m) @@ -3508,34 +3525,37 @@ let PostParseModuleSpecs (defaultNamespace, filename, isLastCompiland, ParsedSig ParsedInput.SigFile(ParsedSigFileInput(filename, qualName, scopedPragmas, hashDirectives, specs)) +type ModuleNamesDict = Map> + /// Checks if a module name is already given and deduplicates the name if needed. -let DeduplicateModuleName (moduleNamesDict:IDictionary>) (paths: Set) path (qualifiedNameOfFile: QualifiedNameOfFile) = - let count = if paths.Contains path then paths.Count else paths.Count + 1 - moduleNamesDict.[qualifiedNameOfFile.Text] <- Set.add path paths - let id = qualifiedNameOfFile.Id - if count = 1 then qualifiedNameOfFile else QualifiedNameOfFile(Ident(id.idText + "___" + count.ToString(), id.idRange)) +let DeduplicateModuleName (moduleNamesDict:ModuleNamesDict) fileName (qualNameOfFile: QualifiedNameOfFile) = + let path = Path.GetDirectoryName fileName + let path = if FileSystem.IsPathRootedShim path then try FileSystem.GetFullPathShim path with _ -> path else path + match moduleNamesDict.TryGetValue qualNameOfFile.Text with + | true, paths -> + if paths.ContainsKey path then + paths.[path], moduleNamesDict + else + let count = paths.Count + 1 + let id = qualNameOfFile.Id + let qualNameOfFileT = if count = 1 then qualNameOfFile else QualifiedNameOfFile(Ident(id.idText + "___" + count.ToString(), id.idRange)) + let moduleNamesDictT = moduleNamesDict.Add(qualNameOfFile.Text, paths.Add(path, qualNameOfFileT)) + qualNameOfFileT, moduleNamesDictT + | _ -> + let moduleNamesDictT = moduleNamesDict.Add(qualNameOfFile.Text, Map.empty.Add(path, qualNameOfFile)) + qualNameOfFile, moduleNamesDictT /// Checks if a ParsedInput is using a module name that was already given and deduplicates the name if needed. -let DeduplicateParsedInputModuleName (moduleNamesDict:IDictionary>) input = +let DeduplicateParsedInputModuleName (moduleNamesDict: ModuleNamesDict) input = match input with - | ParsedInput.ImplFile (ParsedImplFileInput.ParsedImplFileInput(fileName, isScript, qualifiedNameOfFile, scopedPragmas, hashDirectives, modules, (isLastCompiland, isExe))) -> - let path = Path.GetDirectoryName fileName - match moduleNamesDict.TryGetValue qualifiedNameOfFile.Text with - | true, paths -> - let qualifiedNameOfFile = DeduplicateModuleName moduleNamesDict paths path qualifiedNameOfFile - ParsedInput.ImplFile(ParsedImplFileInput.ParsedImplFileInput(fileName, isScript, qualifiedNameOfFile, scopedPragmas, hashDirectives, modules, (isLastCompiland, isExe))) - | _ -> - moduleNamesDict.[qualifiedNameOfFile.Text] <- Set.singleton path - input - | ParsedInput.SigFile (ParsedSigFileInput.ParsedSigFileInput(fileName, qualifiedNameOfFile, scopedPragmas, hashDirectives, modules)) -> - let path = Path.GetDirectoryName fileName - match moduleNamesDict.TryGetValue qualifiedNameOfFile.Text with - | true, paths -> - let qualifiedNameOfFile = DeduplicateModuleName moduleNamesDict paths path qualifiedNameOfFile - ParsedInput.SigFile (ParsedSigFileInput.ParsedSigFileInput(fileName, qualifiedNameOfFile, scopedPragmas, hashDirectives, modules)) - | _ -> - moduleNamesDict.[qualifiedNameOfFile.Text] <- Set.singleton path - input + | ParsedInput.ImplFile (ParsedImplFileInput.ParsedImplFileInput(fileName, isScript, qualNameOfFile, scopedPragmas, hashDirectives, modules, (isLastCompiland, isExe))) -> + let qualNameOfFileT, moduleNamesDictT = DeduplicateModuleName moduleNamesDict fileName qualNameOfFile + let inputT = ParsedInput.ImplFile(ParsedImplFileInput.ParsedImplFileInput(fileName, isScript, qualNameOfFileT, scopedPragmas, hashDirectives, modules, (isLastCompiland, isExe))) + inputT, moduleNamesDictT + | ParsedInput.SigFile (ParsedSigFileInput.ParsedSigFileInput(fileName, qualNameOfFile, scopedPragmas, hashDirectives, modules)) -> + let qualNameOfFileT, moduleNamesDictT = DeduplicateModuleName moduleNamesDict fileName qualNameOfFile + let inputT = ParsedInput.SigFile (ParsedSigFileInput.ParsedSigFileInput(fileName, qualNameOfFileT, scopedPragmas, hashDirectives, modules)) + inputT, moduleNamesDictT let ParseInput (lexer, errorLogger:ErrorLogger, lexbuf:UnicodeLexing.Lexbuf, defaultNamespace, filename, isLastCompiland) = // The assert below is almost ok, but it fires in two cases: @@ -3655,10 +3675,10 @@ type TcAssemblyResolutions(tcConfig: TcConfig, results: AssemblyResolution list, member tcResolutions.TryFindByOriginalReference(assemblyReference:AssemblyReference) = originalReferenceToResolution.TryFind assemblyReference.Text /// This doesn't need to be cancellable, it is only used by F# Interactive - member tcResolution.TryFindByExactILAssemblyRef (ctok, assref) = + member tcResolution.TryFindByExactILAssemblyRef (ctok, assemblyRef) = results |> List.tryFind (fun ar-> let r = ar.GetILAssemblyRef(ctok, tcConfig.reduceMemoryUsage, tcConfig.tryGetMetadataSnapshot) |> Cancellable.runWithoutCancellation - r = assref) + r = assemblyRef) /// This doesn't need to be cancellable, it is only used by F# Interactive member tcResolution.TryFindBySimpleAssemblyName (ctok, simpleAssemName) = @@ -4026,11 +4046,11 @@ type TcImports(tcConfigP:TcConfigProvider, initialResolutions:TcAssemblyResoluti | ResolvedImportedAssembly(importedAssembly) -> ResolvedCcu(importedAssembly.FSharpViewOfMetadata) | UnresolvedImportedAssembly(assemblyName) -> UnresolvedCcu(assemblyName) - member tcImports.FindCcuFromAssemblyRef(ctok, m, assref:ILAssemblyRef) = + member tcImports.FindCcuFromAssemblyRef(ctok, m, assemblyRef:ILAssemblyRef) = CheckDisposed() - match tcImports.FindCcuInfo(ctok, m, assref.Name, lookupOnly=false) with + match tcImports.FindCcuInfo(ctok, m, assemblyRef.Name, lookupOnly=false) with | ResolvedImportedAssembly(importedAssembly) -> ResolvedCcu(importedAssembly.FSharpViewOfMetadata) - | UnresolvedImportedAssembly _ -> UnresolvedCcu(assref.QualifiedName) + | UnresolvedImportedAssembly _ -> UnresolvedCcu(assemblyRef.QualifiedName) #if !NO_EXTENSIONTYPING @@ -4641,8 +4661,8 @@ type TcImports(tcConfigP:TcConfigProvider, initialResolutions:TcAssemblyResoluti resolutions.TryFindBySimpleAssemblyName (ctok, simpleAssemName) |> Option.map (fun r -> r.resolvedPath) /// This doesn't need to be cancellable, it is only used by F# Interactive - member tcImports.TryFindExistingFullyQualifiedPathByExactAssemblyRef(ctok, assref:ILAssemblyRef) : string option = - resolutions.TryFindByExactILAssemblyRef (ctok, assref) |> Option.map (fun r -> r.resolvedPath) + member tcImports.TryFindExistingFullyQualifiedPathByExactAssemblyRef(ctok, assemblyRef:ILAssemblyRef) : string option = + resolutions.TryFindByExactILAssemblyRef (ctok, assemblyRef) |> Option.map (fun r -> r.resolvedPath) member tcImports.TryResolveAssemblyReference(ctok, assemblyReference:AssemblyReference, mode:ResolveAssemblyReferenceMode) : OperationResult = let tcConfig = tcConfigP.Get(ctok) @@ -5432,9 +5452,12 @@ let TypeCheckOneInputEventually (checkForErrors, tcConfig:TcConfig, tcImports:Tc if Zset.contains qualNameOfFile tcState.tcsRootImpls then errorR(Error(FSComp.SR.buildImplementationAlreadyGivenDetail(qualNameOfFile.Text), m)) + let conditionalDefines = + if tcConfig.noConditionalErasure then None else Some (tcConfig.conditionalCompilationDefines) + // Typecheck the signature file let! (tcEnv, sigFileType, createsGeneratedProvidedTypes) = - TypeCheckOneSigFile (tcGlobals, tcState.tcsNiceNameGen, amap, tcState.tcsCcu, checkForErrors, tcConfig.conditionalCompilationDefines, tcSink, tcConfig.internalTestSpanStackReferring) tcState.tcsTcSigEnv file + TypeCheckOneSigFile (tcGlobals, tcState.tcsNiceNameGen, amap, tcState.tcsCcu, checkForErrors, conditionalDefines, tcSink, tcConfig.internalTestSpanStackReferring) tcState.tcsTcSigEnv file let rootSigs = Zmap.add qualNameOfFile sigFileType tcState.tcsRootSigs @@ -5469,9 +5492,12 @@ let TypeCheckOneInputEventually (checkForErrors, tcConfig:TcConfig, tcImports:Tc let tcImplEnv = tcState.tcsTcImplEnv + let conditionalDefines = + if tcConfig.noConditionalErasure then None else Some (tcConfig.conditionalCompilationDefines) + // Typecheck the implementation file let! topAttrs, implFile, _implFileHiddenType, tcEnvAtEnd, createsGeneratedProvidedTypes = - TypeCheckOneImplFile (tcGlobals, tcState.tcsNiceNameGen, amap, tcState.tcsCcu, checkForErrors, tcConfig.conditionalCompilationDefines, tcSink, tcConfig.internalTestSpanStackReferring) tcImplEnv rootSigOpt file + TypeCheckOneImplFile (tcGlobals, tcState.tcsNiceNameGen, amap, tcState.tcsCcu, checkForErrors, conditionalDefines, tcSink, tcConfig.internalTestSpanStackReferring) tcImplEnv rootSigOpt file let hadSig = rootSigOpt.IsSome let implFileSigType = SigTypeOfImplFile implFile diff --git a/src/fsharp/CompileOps.fsi b/src/fsharp/CompileOps.fsi index eb371fa5927..9ee74ee9930 100755 --- a/src/fsharp/CompileOps.fsi +++ b/src/fsharp/CompileOps.fsi @@ -59,12 +59,13 @@ val ComputeQualifiedNameOfFileFromUniquePath: range * string list -> Ast.Qualifi val PrependPathToInput: Ast.Ident list -> Ast.ParsedInput -> Ast.ParsedInput -/// Checks if a module name is already given and deduplicates the name if needed. -val DeduplicateModuleName: IDictionary> -> Set -> string -> Ast.QualifiedNameOfFile -> Ast.QualifiedNameOfFile +/// State used to de-deuplicate module names along a list of file names +type ModuleNamesDict = Map> /// Checks if a ParsedInput is using a module name that was already given and deduplicates the name if needed. -val DeduplicateParsedInputModuleName: IDictionary> -> Ast.ParsedInput -> Ast.ParsedInput +val DeduplicateParsedInputModuleName: ModuleNamesDict -> Ast.ParsedInput -> Ast.ParsedInput * ModuleNamesDict +/// Parse a single input (A signature file or implementation file) val ParseInput: (UnicodeLexing.Lexbuf -> Parser.token) * ErrorLogger * UnicodeLexing.Lexbuf * string option * string * isLastCompiland:(bool * bool) -> Ast.ParsedInput //---------------------------------------------------------------------------- @@ -366,6 +367,9 @@ type TcConfigBuilder = /// if true - 'let mutable x = Span.Empty', the value 'x' is a stack referring span. Used for internal testing purposes only until we get true stack spans. mutable internalTestSpanStackReferring : bool + + /// Prevent erasure of conditional attributes and methods so tooling is able analyse them. + mutable noConditionalErasure: bool } static member Initial: TcConfigBuilder diff --git a/src/fsharp/CompileOptions.fs b/src/fsharp/CompileOptions.fs index 6ae18644dea..344c0e1412a 100644 --- a/src/fsharp/CompileOptions.fs +++ b/src/fsharp/CompileOptions.fs @@ -848,8 +848,8 @@ let testFlag tcConfigB = | str -> warning(Error(FSComp.SR.optsUnknownArgumentToTheTestSwitch(str),rangeCmdArgs))), None, None) -// not shown in fsc.exe help, no warning on use, motivation is for use from VS -let vsSpecificFlags (tcConfigB: TcConfigBuilder) = +// Not shown in fsc.exe help, no warning on use, motivation is for use from tooling. +let editorSpecificFlags (tcConfigB: TcConfigBuilder) = [ CompilerOption("vserrors", tagNone, OptionUnit (fun () -> tcConfigB.errorStyle <- ErrorStyle.VSErrors), None, None) CompilerOption("validate-type-providers", tagNone, OptionUnit (id), None, None) // preserved for compatibility's sake, no longer has any effect CompilerOption("LCID", tagInt, OptionInt ignore, None, None) @@ -857,7 +857,8 @@ let vsSpecificFlags (tcConfigB: TcConfigBuilder) = CompilerOption("sqmsessionguid", tagNone, OptionString ignore, None, None) CompilerOption("gccerrors", tagNone, OptionUnit (fun () -> tcConfigB.errorStyle <- ErrorStyle.GccErrors), None, None) CompilerOption("exename", tagNone, OptionString (fun s -> tcConfigB.exename <- Some(s)), None, None) - CompilerOption("maxerrors", tagInt, OptionInt (fun n -> tcConfigB.maxErrors <- n), None, None) ] + CompilerOption("maxerrors", tagInt, OptionInt (fun n -> tcConfigB.maxErrors <- n), None, None) + CompilerOption("noconditionalerasure", tagNone, OptionUnit (fun () -> tcConfigB.noConditionalErasure <- true), None, None) ] let internalFlags (tcConfigB:TcConfigBuilder) = [ @@ -896,7 +897,7 @@ let internalFlags (tcConfigB:TcConfigBuilder) = CompilerOption("alwayscallvirt",tagNone,OptionSwitch(callVirtSwitch tcConfigB),Some(InternalCommandLineOption("alwayscallvirt",rangeCmdArgs)), None) CompilerOption("nodebugdata",tagNone, OptionUnit (fun () -> tcConfigB.noDebugData<-true),Some(InternalCommandLineOption("--nodebugdata",rangeCmdArgs)), None) testFlag tcConfigB ] @ - vsSpecificFlags tcConfigB @ + editorSpecificFlags tcConfigB @ [ CompilerOption("jit", tagNone, OptionSwitch (jitoptimizeSwitch tcConfigB), Some(InternalCommandLineOption("jit", rangeCmdArgs)), None) CompilerOption("localoptimize", tagNone, OptionSwitch(localoptimizeSwitch tcConfigB),Some(InternalCommandLineOption("localoptimize", rangeCmdArgs)), None) CompilerOption("splitting", tagNone, OptionSwitch(splittingSwitch tcConfigB),Some(InternalCommandLineOption("splitting", rangeCmdArgs)), None) diff --git a/src/fsharp/ConstraintSolver.fs b/src/fsharp/ConstraintSolver.fs index 869d0dc31a3..1cd69a223fa 100644 --- a/src/fsharp/ConstraintSolver.fs +++ b/src/fsharp/ConstraintSolver.fs @@ -227,6 +227,7 @@ let rec occursCheck g un ty = match stripTyEqns g ty with | TType_ucase(_, l) | TType_app (_, l) + | TType_anon(_, l) | TType_tuple (_, l) -> List.exists (occursCheck g un) l | TType_fun (d, r) -> occursCheck g un d || occursCheck g un r | TType_var r -> typarEq un r @@ -301,6 +302,7 @@ type TraitConstraintSolution = | TTraitBuiltIn | TTraitSolved of MethInfo * TypeInst | TTraitSolvedRecdProp of RecdFieldInfo * bool + | TTraitSolvedAnonRecdProp of AnonRecdTypeInfo * TypeInst * int let BakedInTraitConstraintNames = [ "op_Division" ; "op_Multiply"; "op_Addition" @@ -471,11 +473,14 @@ and SolveTypStaticReq (csenv:ConstraintSolverEnv) trace req ty = match stripTyparEqns ty with | TType_measure ms -> let vs = ListMeasureVarOccsWithNonZeroExponents ms - IterateD (fun ((tpr:Typar), _) -> SolveTypStaticReqTypar csenv trace req tpr) vs + trackErrors { + for (tpr, _) in vs do + return! SolveTypStaticReqTypar csenv trace req tpr + } | _ -> match tryAnyParTy csenv.g ty with - | Some tpr -> SolveTypStaticReqTypar csenv trace req tpr - | None -> CompleteD + | ValueSome tpr -> SolveTypStaticReqTypar csenv trace req tpr + | ValueNone -> CompleteD let TransactDynamicReq (trace:OptionalTrace) (tpr:Typar) req = let orig = tpr.DynamicReq @@ -487,7 +492,7 @@ let SolveTypDynamicReq (csenv:ConstraintSolverEnv) trace req ty = | TyparDynamicReq.No -> CompleteD | TyparDynamicReq.Yes -> match tryAnyParTy csenv.g ty with - | Some tpr when tpr.DynamicReq <> TyparDynamicReq.Yes -> + | ValueSome tpr when tpr.DynamicReq <> TyparDynamicReq.Yes -> TransactDynamicReq trace tpr TyparDynamicReq.Yes | _ -> CompleteD @@ -499,25 +504,27 @@ let TransactIsCompatFlex (trace:OptionalTrace) (tpr:Typar) req = let SolveTypIsCompatFlex (csenv:ConstraintSolverEnv) trace req ty = if req then match tryAnyParTy csenv.g ty with - | Some tpr when not tpr.IsCompatFlex -> TransactIsCompatFlex trace tpr req + | ValueSome tpr when not tpr.IsCompatFlex -> TransactIsCompatFlex trace tpr req | _ -> CompleteD else CompleteD -let SubstMeasureWarnIfRigid (csenv:ConstraintSolverEnv) trace (v:Typar) ms = +let SubstMeasureWarnIfRigid (csenv:ConstraintSolverEnv) trace (v:Typar) ms = trackErrors { if v.Rigidity.WarnIfUnified && not (isAnyParTy csenv.g (TType_measure ms)) then // NOTE: we grab the name eagerly to make sure the type variable prints as a type variable - let tpnmOpt = if v.IsCompilerGenerated then None else Some v.Name - SolveTypStaticReq csenv trace v.StaticReq (TType_measure ms) ++ (fun () -> + let tpnmOpt = if v.IsCompilerGenerated then None else Some v.Name + do! SolveTypStaticReq csenv trace v.StaticReq (TType_measure ms) SubstMeasure v ms - WarnD(NonRigidTypar(csenv.DisplayEnv, tpnmOpt, v.Range, TType_measure (Measure.Var v), TType_measure ms, csenv.m))) + return! WarnD(NonRigidTypar(csenv.DisplayEnv, tpnmOpt, v.Range, TType_measure (Measure.Var v), TType_measure ms, csenv.m)) else // Propagate static requirements from 'tp' to 'ty' - SolveTypStaticReq csenv trace v.StaticReq (TType_measure ms) ++ (fun () -> + do! SolveTypStaticReq csenv trace v.StaticReq (TType_measure ms) SubstMeasure v ms if v.Rigidity = TyparRigidity.Anon && measureEquiv csenv.g ms Measure.One then - WarnD(Error(FSComp.SR.csCodeLessGeneric(), v.Range)) - else CompleteD) + return! WarnD(Error(FSComp.SR.csCodeLessGeneric(), v.Range)) + else + () + } /// Imperatively unify the unit-of-measure expression ms against 1. /// There are three cases @@ -576,6 +583,7 @@ let rec SimplifyMeasuresInType g resultFirst ((generalizable, generalized) as pa match stripTyparEqns ty with | TType_ucase(_, l) | TType_app (_, l) + | TType_anon (_,l) | TType_tuple (_, l) -> SimplifyMeasuresInTypes g param l | TType_fun (d, r) -> if resultFirst then SimplifyMeasuresInTypes g param [r;d] else SimplifyMeasuresInTypes g param [d;r] @@ -613,6 +621,7 @@ let rec GetMeasureVarGcdInType v ty = match stripTyparEqns ty with | TType_ucase(_, l) | TType_app (_, l) + | TType_anon (_,l) | TType_tuple (_, l) -> GetMeasureVarGcdInTypes v l | TType_fun (d, r) -> GcdRational (GetMeasureVarGcdInType v d) (GetMeasureVarGcdInType v r) @@ -687,8 +696,8 @@ let CheckWarnIfRigid (csenv:ConstraintSolverEnv) ty1 (r:Typar) ty = if not r.Rigidity.WarnIfUnified then CompleteD else let needsWarning = match tryAnyParTy g ty with - | None -> true - | Some tp2 -> + | ValueNone -> true + | ValueSome tp2 -> not tp2.IsCompilerGenerated && (r.IsCompilerGenerated || // exclude this warning for two identically named user-specified type parameters, e.g. from different mutually recursive functions or types @@ -703,21 +712,17 @@ let CheckWarnIfRigid (csenv:ConstraintSolverEnv) ty1 (r:Typar) ty = /// Add the constraint "ty1 = ty" to the constraint problem, where ty1 is a type variable. /// Propagate all effects of adding this constraint, e.g. to solve other variables -let rec SolveTyparEqualsType (csenv:ConstraintSolverEnv) ndeep m2 (trace:OptionalTrace) ty1 ty = +let rec SolveTyparEqualsType (csenv:ConstraintSolverEnv) ndeep m2 (trace:OptionalTrace) ty1 ty = trackErrors { let m = csenv.m - - DepthCheck ndeep m ++ (fun () -> + do! DepthCheck ndeep m match ty1 with | TType_var r | TType_measure (Measure.Var r) -> // The types may still be equivalent due to abbreviations, which we are trying not to eliminate - if typeEquiv csenv.g ty1 ty then CompleteD else - + if typeEquiv csenv.g ty1 ty then () else // The famous 'occursCheck' check to catch "infinite types" like 'a = list<'a> - see also https://github.com/Microsoft/visualfsharp/issues/1170 - if occursCheck csenv.g r ty then ErrorD (ConstraintSolverInfiniteTypes(csenv.eContextInfo, csenv.DisplayEnv, ty1, ty, m, m2)) else - + if occursCheck csenv.g r ty then return! ErrorD (ConstraintSolverInfiniteTypes(csenv.eContextInfo, csenv.DisplayEnv, ty1, ty, m, m2)) else // Note: warn _and_ continue! - CheckWarnIfRigid csenv ty1 r ty ++ (fun () -> - + do! CheckWarnIfRigid csenv ty1 r ty // Record the solution before we solve the constraints, since // We may need to make use of the equation when solving the constraints. // Record a entry in the undo trace if one is provided @@ -726,40 +731,39 @@ let rec SolveTyparEqualsType (csenv:ConstraintSolverEnv) ndeep m2 (trace:Optiona (* dprintf "setting typar %d to type %s at %a\n" r.Stamp ((DebugPrint.showType ty)) outputRange m; *) // Only solve constraints if this is not an error var - if r.IsFromError then CompleteD else - + if r.IsFromError then () else // Check to see if this type variable is relevant to any trait constraints. // If so, re-solve the relevant constraints. - (if csenv.SolverState.ExtraCxs.ContainsKey r.Stamp then - RepeatWhileD ndeep (fun ndeep -> SolveRelevantMemberConstraintsForTypar csenv ndeep false trace r) - else - CompleteD) ++ (fun _ -> - + if csenv.SolverState.ExtraCxs.ContainsKey r.Stamp then + do! RepeatWhileD ndeep (fun ndeep -> SolveRelevantMemberConstraintsForTypar csenv ndeep false trace r) // Re-solve the other constraints associated with this type variable - solveTypMeetsTyparConstraints csenv ndeep m2 trace ty r)) + return! solveTypMeetsTyparConstraints csenv ndeep m2 trace ty r - | _ -> failwith "SolveTyparEqualsType") + | _ -> failwith "SolveTyparEqualsType" + } /// Apply the constraints on 'typar' to the type 'ty' -and solveTypMeetsTyparConstraints (csenv:ConstraintSolverEnv) ndeep m2 trace ty (r: Typar) = +and solveTypMeetsTyparConstraints (csenv:ConstraintSolverEnv) ndeep m2 trace ty (r: Typar) = trackErrors { let g = csenv.g // Propagate compat flex requirements from 'tp' to 'ty' - SolveTypIsCompatFlex csenv trace r.IsCompatFlex ty ++ (fun () -> + do! SolveTypIsCompatFlex csenv trace r.IsCompatFlex ty // Propagate dynamic requirements from 'tp' to 'ty' - SolveTypDynamicReq csenv trace r.DynamicReq ty ++ (fun () -> + do! SolveTypDynamicReq csenv trace r.DynamicReq ty // Propagate static requirements from 'tp' to 'ty' - SolveTypStaticReq csenv trace r.StaticReq ty ++ (fun () -> + do! SolveTypStaticReq csenv trace r.StaticReq ty // Solve constraints on 'tp' w.r.t. 'ty' - r.Constraints |> IterateD (function + for e in r.Constraints do + do! + match e with | TyparConstraint.DefaultsTo (priority, dty, m) -> if typeEquiv g ty dty then CompleteD else match tryDestTyparTy g ty with - | None -> CompleteD - | Some destTypar -> + | ValueNone -> CompleteD + | ValueSome destTypar -> AddConstraint csenv ndeep m2 trace destTypar (TyparConstraint.DefaultsTo(priority, dty, m)) | TyparConstraint.SupportsNull m2 -> SolveTypeSupportsNull csenv ndeep m2 trace ty @@ -774,10 +778,18 @@ and solveTypMeetsTyparConstraints (csenv:ConstraintSolverEnv) ndeep m2 trace ty | TyparConstraint.SimpleChoice(tys, m2) -> SolveTypeChoice csenv ndeep m2 trace ty tys | TyparConstraint.CoercesTo(ty2, m2) -> SolveTypeSubsumesTypeKeepAbbrevs csenv ndeep m2 trace None ty2 ty | TyparConstraint.MayResolveMember(traitInfo, m2) -> - SolveMemberConstraint csenv false false ndeep m2 trace traitInfo ++ (fun _ -> CompleteD) - )))) + SolveMemberConstraint csenv false false ndeep m2 trace traitInfo |> OperationResult.ignore + } +and SolveAnonInfoEqualsAnonInfo (csenv:ConstraintSolverEnv) m2 (anonInfo1: AnonRecdTypeInfo) (anonInfo2: AnonRecdTypeInfo) = + if evalTupInfoIsStruct anonInfo1.TupInfo <> evalTupInfoIsStruct anonInfo2.TupInfo then ErrorD (ConstraintSolverError(FSComp.SR.tcTupleStructMismatch(), csenv.m,m2)) else + (match anonInfo1.Assembly, anonInfo2.Assembly with + | ccu1, ccu2 -> if not (ccuEq ccu1 ccu2) then ErrorD (ConstraintSolverError(FSComp.SR.tcAnonRecdCcuMismatch(ccu1.AssemblyName, ccu2.AssemblyName), csenv.m,m2)) else ResultD () + ) ++ (fun () -> + if not (anonInfo1.SortedNames = anonInfo2.SortedNames) then ErrorD (ConstraintSolverError(FSComp.SR.tcAnonRecdFieldNameMismatch(sprintf "%A" (Array.toList anonInfo1.SortedNames), sprintf "%A" (Array.toList anonInfo2.SortedNames)), csenv.m,m2)) else + ResultD ()) + /// Add the constraint "ty1 = ty2" to the constraint problem. /// Propagate all effects of adding this constraint, e.g. to solve type variables and SolveTypeEqualsType (csenv:ConstraintSolverEnv) ndeep m2 (trace: OptionalTrace) (cxsln:(TraitConstraintInfo * TraitConstraintSln) option) ty1 ty2 = @@ -818,6 +830,9 @@ and SolveTypeEqualsType (csenv:ConstraintSolverEnv) ndeep m2 (trace: OptionalTra | TType_tuple (tupInfo1, l1) , TType_tuple (tupInfo2, l2) -> if evalTupInfoIsStruct tupInfo1 <> evalTupInfoIsStruct tupInfo2 then ErrorD (ConstraintSolverError(FSComp.SR.tcTupleStructMismatch(), csenv.m, m2)) else SolveTypeEqualsTypeEqns csenv ndeep m2 trace None l1 l2 + | TType_anon (anonInfo1, l1),TType_anon (anonInfo2, l2) -> + SolveAnonInfoEqualsAnonInfo csenv m2 anonInfo1 anonInfo2 ++ (fun () -> + SolveTypeEqualsTypeEqns csenv ndeep m2 trace None l1 l2) | TType_fun (d1, r1) , TType_fun (d2, r2) -> SolveFunTypeEqn csenv ndeep m2 trace None d1 d2 r1 r2 | TType_measure ms1 , TType_measure ms2 -> UnifyMeasures csenv trace ms1 ms2 | TType_forall(tps1, rty1), TType_forall(tps2, rty2) -> @@ -854,9 +869,10 @@ and SolveTypeEqualsTypeEqns csenv ndeep m2 trace cxsln origl1 origl2 = ErrorD(ConstraintSolverTupleDiffLengths(csenv.DisplayEnv, origl1, origl2, csenv.m, m2)) loop origl1 origl2 -and SolveFunTypeEqn csenv ndeep m2 trace cxsln d1 d2 r1 r2 = - SolveTypeEqualsTypeKeepAbbrevsWithCxsln csenv ndeep m2 trace cxsln d1 d2 ++ (fun () -> - SolveTypeEqualsTypeKeepAbbrevsWithCxsln csenv ndeep m2 trace cxsln r1 r2) +and SolveFunTypeEqn csenv ndeep m2 trace cxsln d1 d2 r1 r2 = trackErrors { + do! SolveTypeEqualsTypeKeepAbbrevsWithCxsln csenv ndeep m2 trace cxsln d1 d2 + return! SolveTypeEqualsTypeKeepAbbrevsWithCxsln csenv ndeep m2 trace cxsln r1 r2 + } // ty1: expected // ty2: actual @@ -890,6 +906,9 @@ and SolveTypeSubsumesType (csenv:ConstraintSolverEnv) ndeep m2 (trace: OptionalT | TType_tuple (tupInfo1, l1) , TType_tuple (tupInfo2, l2) -> if evalTupInfoIsStruct tupInfo1 <> evalTupInfoIsStruct tupInfo2 then ErrorD (ConstraintSolverError(FSComp.SR.tcTupleStructMismatch(), csenv.m, m2)) else SolveTypeEqualsTypeEqns csenv ndeep m2 trace cxsln l1 l2 (* nb. can unify since no variance *) + | TType_anon (anonInfo1, l1), TType_anon (anonInfo2, l2) -> + SolveAnonInfoEqualsAnonInfo csenv m2 anonInfo1 anonInfo2 ++ (fun () -> + SolveTypeEqualsTypeEqns csenv ndeep m2 trace cxsln l1 l2) (* nb. can unify since no variance *) | TType_fun (d1, r1) , TType_fun (d2, r2) -> SolveFunTypeEqn csenv ndeep m2 trace cxsln d1 d2 r1 r2 (* nb. can unify since no variance *) | TType_measure ms1, TType_measure ms2 -> UnifyMeasures csenv trace ms1 ms2 @@ -902,13 +921,14 @@ and SolveTypeSubsumesType (csenv:ConstraintSolverEnv) ndeep m2 (trace: OptionalT // Special subsumption rule for byref tags | TType_app (tc1, l1) , TType_app (tc2, l2) when tyconRefEq g tc1 tc2 && g.byref2_tcr.CanDeref && tyconRefEq g g.byref2_tcr tc1 -> match l1, l2 with - | [ h1; tag1 ], [ h2; tag2 ] -> - SolveTypeEqualsType csenv ndeep m2 trace None h1 h2 ++ (fun () -> + | [ h1; tag1 ], [ h2; tag2 ] -> trackErrors { + do! SolveTypeEqualsType csenv ndeep m2 trace None h1 h2 match stripTyEqnsA csenv.g canShortcut tag1, stripTyEqnsA csenv.g canShortcut tag2 with | TType_app(tagc1, []), TType_app(tagc2, []) when (tyconRefEq g tagc2 g.byrefkind_InOut_tcr && - (tyconRefEq g tagc1 g.byrefkind_In_tcr || tyconRefEq g tagc1 g.byrefkind_Out_tcr) ) -> CompleteD - | _ -> SolveTypeEqualsType csenv ndeep m2 trace cxsln tag1 tag2) + (tyconRefEq g tagc1 g.byrefkind_In_tcr || tyconRefEq g tagc1 g.byrefkind_Out_tcr) ) -> () + | _ -> return! SolveTypeEqualsType csenv ndeep m2 trace cxsln tag1 tag2 + } | _ -> SolveTypeEqualsTypeEqns csenv ndeep m2 trace cxsln l1 l2 | TType_app (tc1, l1) , TType_app (tc2, l2) when tyconRefEq g tc1 tc2 -> @@ -988,16 +1008,16 @@ and SolveDimensionlessNumericType (csenv:ConstraintSolverEnv) ndeep m2 trace ty /// We pretend int and other types support a number of operators. In the actual IL for mscorlib they /// don't, however the type-directed static optimization rules in the library code that makes use of this /// will deal with the problem. -and SolveMemberConstraint (csenv:ConstraintSolverEnv) ignoreUnresolvedOverload permitWeakResolution ndeep m2 trace (TTrait(tys, nm, memFlags, argtys, rty, sln)): OperationResult = +and SolveMemberConstraint (csenv:ConstraintSolverEnv) ignoreUnresolvedOverload permitWeakResolution ndeep m2 trace (TTrait(tys, nm, memFlags, argtys, rty, sln)): OperationResult = trackErrors { // Do not re-solve if already solved - if sln.Value.IsSome then ResultD true else + if sln.Value.IsSome then return true else let g = csenv.g let m = csenv.m let amap = csenv.amap let aenv = csenv.EquivEnv let denv = csenv.DisplayEnv let ndeep = ndeep + 1 - DepthCheck ndeep m ++ (fun () -> + do! DepthCheck ndeep m // Remove duplicates from the set of types in the support let tys = ListSet.setify (typeAEquiv g aenv) tys @@ -1008,19 +1028,19 @@ and SolveMemberConstraint (csenv:ConstraintSolverEnv) ignoreUnresolvedOverload p // Assert the object type if the constraint is for an instance member if memFlags.IsInstance then match tys, argtys with - | [ty], (h :: _) -> SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace h ty - | _ -> ErrorD (ConstraintSolverError(FSComp.SR.csExpectedArguments(), m, m2)) - else CompleteD - ++ (fun () -> - + | [ty], (h :: _) -> do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace h ty + | _ -> do! ErrorD (ConstraintSolverError(FSComp.SR.csExpectedArguments(), m, m2)) // Trait calls are only supported on pseudo type (variables) - tys |> IterateD (SolveTypStaticReq csenv trace HeadTypeStaticReq)) ++ (fun () -> + for e in tys do + do! SolveTypStaticReq csenv trace HeadTypeStaticReq e let argtys = if memFlags.IsInstance then List.tail argtys else argtys let minfos = GetRelevantMethodsForTrait csenv permitWeakResolution nm traitInfo - match minfos, tys, memFlags.IsInstance, nm, argtys with + let! res = + trackErrors { + match minfos, tys, memFlags.IsInstance, nm, argtys with | _, _, false, ("op_Division" | "op_Multiply"), [argty1;argty2] when // This simulates the existence of @@ -1063,153 +1083,155 @@ and SolveMemberConstraint (csenv:ConstraintSolverEnv) ignoreUnresolvedOverload p checkRuleAppliesInPreferenceToMethods argty2 argty1) -> match GetMeasureOfType g argty1 with - | Some (tcref, ms1) -> + | Some (tcref, ms1) -> let ms2 = freshMeasure () - SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace argty2 (mkAppTy tcref [TType_measure ms2]) ++ (fun () -> - SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace rty (mkAppTy tcref [TType_measure (Measure.Prod(ms1, if nm = "op_Multiply" then ms2 else Measure.Inv ms2))]) ++ (fun () -> - ResultD TTraitBuiltIn)) + do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace argty2 (mkAppTy tcref [TType_measure ms2]) + do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace rty (mkAppTy tcref [TType_measure (Measure.Prod(ms1, if nm = "op_Multiply" then ms2 else Measure.Inv ms2))]) + return TTraitBuiltIn | _ -> match GetMeasureOfType g argty2 with - | Some (tcref, ms2) -> + | Some (tcref, ms2) -> let ms1 = freshMeasure () - SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace argty1 (mkAppTy tcref [TType_measure ms1]) ++ (fun () -> - SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace rty (mkAppTy tcref [TType_measure (Measure.Prod(ms1, if nm = "op_Multiply" then ms2 else Measure.Inv ms2))]) ++ (fun () -> - ResultD TTraitBuiltIn)) - | _ -> - SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace argty2 argty1 ++ (fun () -> - SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace rty argty1 ++ (fun () -> - ResultD TTraitBuiltIn)) + do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace argty1 (mkAppTy tcref [TType_measure ms1]) + do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace rty (mkAppTy tcref [TType_measure (Measure.Prod(ms1, if nm = "op_Multiply" then ms2 else Measure.Inv ms2))]) + return TTraitBuiltIn + | _ -> + do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace argty2 argty1 + do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace rty argty1 + return TTraitBuiltIn | _, _, false, ("op_Addition" | "op_Subtraction" | "op_Modulus"), [argty1;argty2] when // Ignore any explicit +/- overloads from any basic integral types (minfos |> List.forall (fun minfo -> isIntegerTy g minfo.ApparentEnclosingType ) && ( (IsNumericOrIntegralEnumType g argty1 || (nm = "op_Addition" && (isCharTy g argty1 || isStringTy g argty1))) && (permitWeakResolution || not (isTyparTy g argty2)) - || (IsNumericOrIntegralEnumType g argty2 || (nm = "op_Addition" && (isCharTy g argty2 || isStringTy g argty2))) && (permitWeakResolution || not (isTyparTy g argty1)))) -> - SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace argty2 argty1 ++ (fun () -> - SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace rty argty1 ++ (fun () -> - ResultD TTraitBuiltIn)) + || (IsNumericOrIntegralEnumType g argty2 || (nm = "op_Addition" && (isCharTy g argty2 || isStringTy g argty2))) && (permitWeakResolution || not (isTyparTy g argty1)))) -> + do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace argty2 argty1 + do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace rty argty1 + return TTraitBuiltIn | _, _, false, ("op_LessThan" | "op_LessThanOrEqual" | "op_GreaterThan" | "op_GreaterThanOrEqual" | "op_Equality" | "op_Inequality" ), [argty1;argty2] when // Ignore any explicit overloads from any basic integral types (minfos |> List.forall (fun minfo -> isIntegerTy g minfo.ApparentEnclosingType ) && ( (IsRelationalType g argty1 && (permitWeakResolution || not (isTyparTy g argty2))) - || (IsRelationalType g argty2 && (permitWeakResolution || not (isTyparTy g argty1))))) -> - SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace argty2 argty1 ++ (fun () -> - SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace rty g.bool_ty ++ (fun () -> - ResultD TTraitBuiltIn)) + || (IsRelationalType g argty2 && (permitWeakResolution || not (isTyparTy g argty1))))) -> + do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace argty2 argty1 + do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace rty g.bool_ty + return TTraitBuiltIn // We pretend for uniformity that the numeric types have a static property called Zero and One // As with constants, only zero is polymorphic in its units | [], [ty], false, "get_Zero", [] - when IsNumericType g ty -> - SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace rty ty ++ (fun () -> - ResultD TTraitBuiltIn) + when IsNumericType g ty -> + do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace rty ty + return TTraitBuiltIn | [], [ty], false, "get_One", [] - when IsNumericType g ty || isCharTy g ty -> - SolveDimensionlessNumericType csenv ndeep m2 trace ty ++ (fun () -> - SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace rty ty ++ (fun () -> - ResultD TTraitBuiltIn)) + when IsNumericType g ty || isCharTy g ty -> + do! SolveDimensionlessNumericType csenv ndeep m2 trace ty + do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace rty ty + return TTraitBuiltIn | [], _, false, ("DivideByInt"), [argty1;argty2] - when isFpTy g argty1 || isDecimalTy g argty1 -> - SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace argty2 g.int_ty ++ (fun () -> - SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace rty argty1 ++ (fun () -> - ResultD TTraitBuiltIn)) + when isFpTy g argty1 || isDecimalTy g argty1 -> + do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace argty2 g.int_ty + do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace rty argty1 + return TTraitBuiltIn // We pretend for uniformity that the 'string' and 'array' types have an indexer property called 'Item' | [], [ty], true, ("get_Item"), [argty1] - when isStringTy g ty -> + when isStringTy g ty -> - SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace argty1 g.int_ty ++ (fun () -> - SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace rty g.char_ty ++ (fun () -> - ResultD TTraitBuiltIn)) + do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace argty1 g.int_ty + do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace rty g.char_ty + return TTraitBuiltIn | [], [ty], true, ("get_Item"), argtys - when isArrayTy g ty -> + when isArrayTy g ty -> - (if rankOfArrayTy g ty <> argtys.Length then ErrorD(ConstraintSolverError(FSComp.SR.csIndexArgumentMismatch((rankOfArrayTy g ty), argtys.Length), m, m2)) else CompleteD) ++ (fun () -> - (argtys |> IterateD (fun argty -> SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace argty g.int_ty)) ++ (fun () -> + if rankOfArrayTy g ty <> argtys.Length then do! ErrorD(ConstraintSolverError(FSComp.SR.csIndexArgumentMismatch((rankOfArrayTy g ty), argtys.Length), m, m2)) + for argty in argtys do + do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace argty g.int_ty let ety = destArrayTy g ty - SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace rty ety ++ (fun () -> - ResultD TTraitBuiltIn))) + do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace rty ety + return TTraitBuiltIn | [], [ty], true, ("set_Item"), argtys - when isArrayTy g ty -> + when isArrayTy g ty -> - (if rankOfArrayTy g ty <> argtys.Length - 1 then ErrorD(ConstraintSolverError(FSComp.SR.csIndexArgumentMismatch((rankOfArrayTy g ty), (argtys.Length - 1)), m, m2)) else CompleteD) ++ (fun () -> + if rankOfArrayTy g ty <> argtys.Length - 1 then do! ErrorD(ConstraintSolverError(FSComp.SR.csIndexArgumentMismatch((rankOfArrayTy g ty), (argtys.Length - 1)), m, m2)) let argtys, ety = List.frontAndBack argtys - (argtys |> IterateD (fun argty -> SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace argty g.int_ty)) ++ (fun () -> + for argty in argtys do + do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace argty g.int_ty let etys = destArrayTy g ty - SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace ety etys ++ (fun () -> - ResultD TTraitBuiltIn))) + do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace ety etys + return TTraitBuiltIn | [], _, false, ("op_BitwiseAnd" | "op_BitwiseOr" | "op_ExclusiveOr"), [argty1;argty2] when (isIntegerOrIntegerEnumTy g argty1 || (isEnumTy g argty1)) && (permitWeakResolution || not (isTyparTy g argty2)) - || (isIntegerOrIntegerEnumTy g argty2 || (isEnumTy g argty2)) && (permitWeakResolution || not (isTyparTy g argty1)) -> + || (isIntegerOrIntegerEnumTy g argty2 || (isEnumTy g argty2)) && (permitWeakResolution || not (isTyparTy g argty1)) -> - SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace argty2 argty1 ++ (fun () -> - SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace rty argty1 ++ (fun () -> - SolveDimensionlessNumericType csenv ndeep m2 trace argty1 ++ (fun () -> - ResultD TTraitBuiltIn))); + do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace argty2 argty1 + do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace rty argty1 + do! SolveDimensionlessNumericType csenv ndeep m2 trace argty1 + return TTraitBuiltIn | [], _, false, ("op_LeftShift" | "op_RightShift"), [argty1;argty2] - when isIntegerOrIntegerEnumTy g argty1 -> + when isIntegerOrIntegerEnumTy g argty1 -> - SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace argty2 g.int_ty ++ (fun () -> - SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace rty argty1 ++ (fun () -> - SolveDimensionlessNumericType csenv ndeep m2 trace argty1 ++ (fun () -> - ResultD TTraitBuiltIn))) + do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace argty2 g.int_ty + do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace rty argty1 + do! SolveDimensionlessNumericType csenv ndeep m2 trace argty1 + return TTraitBuiltIn | _, _, false, ("op_UnaryPlus"), [argty] - when IsNumericOrIntegralEnumType g argty -> + when IsNumericOrIntegralEnumType g argty -> - SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace rty argty ++ (fun () -> - ResultD TTraitBuiltIn) + do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace rty argty + return TTraitBuiltIn | _, _, false, ("op_UnaryNegation"), [argty] - when isSignedIntegerTy g argty || isFpTy g argty || isDecimalTy g argty -> + when isSignedIntegerTy g argty || isFpTy g argty || isDecimalTy g argty -> - SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace rty argty ++ (fun () -> - ResultD TTraitBuiltIn) + do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace rty argty + return TTraitBuiltIn | _, _, true, ("get_Sign"), [] - when (let argty = tys.Head in isSignedIntegerTy g argty || isFpTy g argty || isDecimalTy g argty) -> + when (let argty = tys.Head in isSignedIntegerTy g argty || isFpTy g argty || isDecimalTy g argty) -> - SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace rty g.int32_ty ++ (fun () -> - ResultD TTraitBuiltIn) + do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace rty g.int32_ty + return TTraitBuiltIn | _, _, false, ("op_LogicalNot" | "op_OnesComplement"), [argty] - when isIntegerOrIntegerEnumTy g argty -> + when isIntegerOrIntegerEnumTy g argty -> - SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace rty argty ++ (fun () -> - SolveDimensionlessNumericType csenv ndeep m2 trace argty ++ (fun () -> - ResultD TTraitBuiltIn)) + do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace rty argty + do! SolveDimensionlessNumericType csenv ndeep m2 trace argty + return TTraitBuiltIn | _, _, false, ("Abs"), [argty] - when isSignedIntegerTy g argty || isFpTy g argty || isDecimalTy g argty -> + when isSignedIntegerTy g argty || isFpTy g argty || isDecimalTy g argty -> - SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace rty argty ++ (fun () -> - ResultD TTraitBuiltIn) + do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace rty argty + return TTraitBuiltIn | _, _, false, "Sqrt", [argty1] when isFpTy g argty1 -> match GetMeasureOfType g argty1 with - | Some (tcref, _) -> + | Some (tcref, _) -> let ms1 = freshMeasure () - SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace argty1 (mkAppTy tcref [TType_measure (Measure.Prod (ms1, ms1))]) ++ (fun () -> - SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace rty (mkAppTy tcref [TType_measure ms1]) ++ (fun () -> - ResultD TTraitBuiltIn)) - | None -> - SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace rty argty1 ++ (fun () -> - ResultD TTraitBuiltIn) + do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace argty1 (mkAppTy tcref [TType_measure (Measure.Prod (ms1, ms1))]) + do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace rty (mkAppTy tcref [TType_measure ms1]) + return TTraitBuiltIn + | None -> + do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace rty argty1 + return TTraitBuiltIn | _, _, false, ("Sin" | "Cos" | "Tan" | "Sinh" | "Cosh" | "Tanh" | "Atan" | "Acos" | "Asin" | "Exp" | "Ceiling" | "Floor" | "Round" | "Truncate" | "Log10" | "Log" | "Sqrt"), [argty] - when isFpTy g argty -> + when isFpTy g argty -> - SolveDimensionlessNumericType csenv ndeep m2 trace argty ++ (fun () -> - SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace rty argty ++ (fun () -> - ResultD TTraitBuiltIn)) + do! SolveDimensionlessNumericType csenv ndeep m2 trace argty + do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace rty argty + return TTraitBuiltIn | _, _, false, ("op_Explicit"), [argty] when (// The input type. @@ -1221,7 +1243,7 @@ and SolveMemberConstraint (csenv:ConstraintSolverEnv) ignoreUnresolvedOverload p // Exclusion: No conversion from char to decimal not (isCharTy g argty && isDecimalTy g rty)) -> - ResultD TTraitBuiltIn + return TTraitBuiltIn | _, _, false, ("op_Explicit"), [argty] @@ -1230,23 +1252,23 @@ and SolveMemberConstraint (csenv:ConstraintSolverEnv) ignoreUnresolvedOverload p // The output type (isDecimalTy g rty)) -> - ResultD TTraitBuiltIn + return TTraitBuiltIn | [], _, false, "Pow", [argty1; argty2] - when isFpTy g argty1 -> + when isFpTy g argty1 -> - SolveDimensionlessNumericType csenv ndeep m2 trace argty1 ++ (fun () -> - SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace argty2 argty1 ++ (fun () -> - SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace rty argty1 ++ (fun () -> - ResultD TTraitBuiltIn))) + do! SolveDimensionlessNumericType csenv ndeep m2 trace argty1 + do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace argty2 argty1 + do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace rty argty1 + return TTraitBuiltIn | _, _, false, ("Atan2"), [argty1; argty2] - when isFpTy g argty1 -> - SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace argty2 argty1 ++ (fun () -> + when isFpTy g argty1 -> + do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace argty2 argty1 match GetMeasureOfType g argty1 with - | None -> SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace rty argty1 - | Some (tcref, _) -> SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace rty (mkAppTy tcref [TType_measure Measure.One])) ++ (fun () -> - ResultD TTraitBuiltIn) + | None -> do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace rty argty1 + | Some (tcref, _) -> do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace rty (mkAppTy tcref [TType_measure Measure.One]) + return TTraitBuiltIn | _ -> // OK, this is not solved by a built-in constraint. @@ -1275,16 +1297,31 @@ and SolveMemberConstraint (csenv:ConstraintSolverEnv) ignoreUnresolvedOverload p else None + let anonRecdPropSearch = + let isGetProp = nm.StartsWith "get_" + if isGetProp && memFlags.IsInstance then + let propName = nm.[4..] + let props = + tys |> List.choose (fun ty -> + match NameResolution.TryFindAnonRecdFieldOfType g ty propName with + | Some (NameResolution.Item.AnonRecdField(anonInfo, tinst, i, _)) -> Some (anonInfo, tinst, i) + | _ -> None) + match props with + | [ prop ] -> Some prop + | _ -> None + else + None + // Now check if there are no feasible solutions at all - match minfos, recdPropSearch with - | [], None when not (tys |> List.exists (isAnyParTy g)) -> + match minfos, recdPropSearch, anonRecdPropSearch with + | [], None, None when not (tys |> List.exists (isAnyParTy g)) -> if tys |> List.exists (isFunTy g) then - ErrorD (ConstraintSolverError(FSComp.SR.csExpectTypeWithOperatorButGivenFunction(DecompileOpName nm), m, m2)) + return! ErrorD (ConstraintSolverError(FSComp.SR.csExpectTypeWithOperatorButGivenFunction(DecompileOpName nm), m, m2)) elif tys |> List.exists (isAnyTupleTy g) then - ErrorD (ConstraintSolverError(FSComp.SR.csExpectTypeWithOperatorButGivenTuple(DecompileOpName nm), m, m2)) + return! ErrorD (ConstraintSolverError(FSComp.SR.csExpectTypeWithOperatorButGivenTuple(DecompileOpName nm), m, m2)) else match nm, argtys with - | "op_Explicit", [argty] -> ErrorD (ConstraintSolverError(FSComp.SR.csTypeDoesNotSupportConversion((NicePrint.prettyStringOfTy denv argty), (NicePrint.prettyStringOfTy denv rty)), m, m2)) + | "op_Explicit", [argty] -> return! ErrorD (ConstraintSolverError(FSComp.SR.csTypeDoesNotSupportConversion((NicePrint.prettyStringOfTy denv argty), (NicePrint.prettyStringOfTy denv rty)), m, m2)) | _ -> let tyString = match tys with @@ -1301,10 +1338,9 @@ and SolveMemberConstraint (csenv:ConstraintSolverEnv) ignoreUnresolvedOverload p | _ -> if tys.Length = 1 then FSComp.SR.csTypeDoesNotSupportOperator(tyString, opName) else FSComp.SR.csTypesDoNotSupportOperator(tyString, opName) - ErrorD(ConstraintSolverError(err, m, m2)) + return! ErrorD(ConstraintSolverError(err, m, m2)) | _ -> - let dummyExpr = mkUnit g m let calledMethGroup = minfos @@ -1319,42 +1355,49 @@ and SolveMemberConstraint (csenv:ConstraintSolverEnv) ignoreUnresolvedOverload p let methOverloadResult, errors = trace.CollectThenUndoOrCommit (fun (a, _) -> Option.isSome a) (fun trace -> ResolveOverloading csenv (WithTrace trace) nm ndeep (Some traitInfo) (0, 0) AccessibleFromEverywhere calledMethGroup false (Some rty)) - match recdPropSearch, methOverloadResult with - | Some (rfinfo, isSetProp), None -> + match anonRecdPropSearch, recdPropSearch, methOverloadResult with + | Some (anonInfo, tinst, i), None, None -> + // OK, the constraint is solved by a record property. Assert that the return types match. + let rty2 = List.item i tinst + do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace rty rty2 + return TTraitSolvedAnonRecdProp(anonInfo, tinst, i) + + | None, Some (rfinfo, isSetProp), None -> // OK, the constraint is solved by a record property. Assert that the return types match. let rty2 = if isSetProp then g.unit_ty else rfinfo.FieldType - SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace rty rty2 ++ (fun () -> - ResultD (TTraitSolvedRecdProp(rfinfo, isSetProp))) - | None, Some (calledMeth:CalledMeth<_>) -> + do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace rty rty2 + return TTraitSolvedRecdProp(rfinfo, isSetProp) + + | None, None, Some (calledMeth:CalledMeth<_>) -> // OK, the constraint is solved. let minfo = calledMeth.Method - errors ++ (fun () -> - let isInstance = minfo.IsInstance - if isInstance <> memFlags.IsInstance then + do! errors + let isInstance = minfo.IsInstance + if isInstance <> memFlags.IsInstance then + return! if isInstance then ErrorD(ConstraintSolverError(FSComp.SR.csMethodFoundButIsNotStatic((NicePrint.minimalStringOfType denv minfo.ApparentEnclosingType), (DecompileOpName nm), nm), m, m2 )) else ErrorD(ConstraintSolverError(FSComp.SR.csMethodFoundButIsStatic((NicePrint.minimalStringOfType denv minfo.ApparentEnclosingType), (DecompileOpName nm), nm), m, m2 )) - else - CheckMethInfoAttributes g m None minfo ++ (fun () -> - ResultD (TTraitSolved (minfo, calledMeth.CalledTyArgs)))) + else + do! CheckMethInfoAttributes g m None minfo + return TTraitSolved (minfo, calledMeth.CalledTyArgs) - | _ -> + | _ -> let support = GetSupportOfMemberConstraint csenv traitInfo let frees = GetFreeTyparsOfMemberConstraint csenv traitInfo - // If there's nothing left to learn then raise the errors - (if (permitWeakResolution && isNil support) || isNil frees then errors - // Otherwise re-record the trait waiting for canonicalization - else AddMemberConstraint csenv ndeep m2 trace traitInfo support frees) ++ (fun () -> + if (permitWeakResolution && isNil support) || isNil frees then do! errors + // Otherwise re-record the trait waiting for canonicalization + else do! AddMemberConstraint csenv ndeep m2 trace traitInfo support frees + return! match errors with | ErrorResult (_, UnresolvedOverloading _) when not ignoreUnresolvedOverload && (not (nm = "op_Explicit" || nm = "op_Implicit")) -> ErrorD LocallyAbortOperationThatFailsToResolveOverload - | _ -> ResultD TTraitUnsolved) - ) - ++ - (fun res -> RecordMemberConstraintSolution csenv.SolverState m trace traitInfo res)) - + | _ -> ResultD TTraitUnsolved + } + return! RecordMemberConstraintSolution csenv.SolverState m trace traitInfo res + } /// Record the solution to a member constraint in the mutable reference cell attached to /// each member constraint. @@ -1372,8 +1415,13 @@ and RecordMemberConstraintSolution css m trace traitInfo res = TransactMemberConstraintSolution traitInfo trace BuiltInSln; ResultD true - | TTraitSolvedRecdProp (rfinfo, isSetProp) -> - let sln = MemberConstraintSolutionOfRecdFieldInfo rfinfo isSetProp + | TTraitSolvedRecdProp (rfinfo, isSet) -> + let sln = FSRecdFieldSln(rfinfo.TypeInst,rfinfo.RecdFieldRef,isSet) + TransactMemberConstraintSolution traitInfo trace sln; + ResultD true + + | TTraitSolvedAnonRecdProp (anonInfo, tinst, i) -> + let sln = FSAnonRecdFieldSln(anonInfo, tinst, i) TransactMemberConstraintSolution traitInfo trace sln; ResultD true @@ -1418,9 +1466,6 @@ and MemberConstraintSolutionOfMethInfo css m minfo minst = #endif -and MemberConstraintSolutionOfRecdFieldInfo rfinfo isSet = - FSRecdFieldSln(rfinfo.TypeInst, rfinfo.RecdFieldRef, isSet) - /// Write into the reference cell stored in the TAST and add to the undo trace if necessary and TransactMemberConstraintSolution traitInfo (trace:OptionalTrace) sln = let prev = traitInfo.Solution @@ -1446,7 +1491,14 @@ and GetRelevantMethodsForTrait (csenv:ConstraintSolverEnv) permitWeakResolution /// to a generic instantiation for an operator based on the right hand type. let minfos = List.reduce (ListSet.unionFavourLeft MethInfo.MethInfosUseIdenticalDefinitions) minfos + + /// Check that the available members aren't hiding a member from the parent (depth 1 only) + let relevantMinfos = minfos |> List.filter(fun minfo -> not minfo.IsDispatchSlot && not minfo.IsVirtual && minfo.IsInstance) minfos + |> List.filter(fun minfo1 -> + not(minfo1.IsDispatchSlot && + relevantMinfos + |> List.exists (fun minfo2 -> MethInfosEquivByNameAndSig EraseAll true csenv.g csenv.amap m minfo2 minfo1))) else [] // The trait name "op_Explicit" also covers "op_Implicit", so look for that one too. @@ -1458,7 +1510,7 @@ and GetRelevantMethodsForTrait (csenv:ConstraintSolverEnv) permitWeakResolution /// The nominal support of the member constraint and GetSupportOfMemberConstraint (csenv:ConstraintSolverEnv) (TTrait(tys, _, _, _, _, _)) = - tys |> List.choose (tryAnyParTy csenv.g) + tys |> List.choose (tryAnyParTyOption csenv.g) /// All the typars relevant to the member constraint *) and GetFreeTyparsOfMemberConstraint (csenv:ConstraintSolverEnv) (TTrait(tys, _, _, argtys, rty, _)) = @@ -1475,9 +1527,9 @@ and SolveRelevantMemberConstraints (csenv:ConstraintSolverEnv) ndeep permitWeakR /// Normalize the typar let ty = mkTyparTy tp match tryAnyParTy csenv.g ty with - | Some tp -> + | ValueSome tp -> SolveRelevantMemberConstraintsForTypar csenv ndeep permitWeakResolution trace tp - | None -> + | ValueNone -> ResultD false)) and SolveRelevantMemberConstraintsForTypar (csenv:ConstraintSolverEnv) ndeep permitWeakResolution (trace:OptionalTrace) tp = @@ -1518,7 +1570,10 @@ and AddMemberConstraint (csenv:ConstraintSolverEnv) ndeep m2 trace traitInfo sup // Associate the constraint with each type variable in the support, so if the type variable // gets generalized then this constraint is attached at the binding site. - support |> IterateD (fun tp -> AddConstraint csenv ndeep m2 trace tp (TyparConstraint.MayResolveMember(traitInfo, m2))) + trackErrors { + for tp in support do + do! AddConstraint csenv ndeep m2 trace tp (TyparConstraint.MayResolveMember(traitInfo, m2)) + } /// Record a constraint on an inference type variable. @@ -1548,9 +1603,11 @@ and AddConstraint (csenv:ConstraintSolverEnv) ndeep m2 trace tp newConstraint = let rty1 = GetFSharpViewOfReturnType g rty1 let rty2 = GetFSharpViewOfReturnType g rty2 - Iterate2D (SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace) argtys1 argtys2 ++ (fun () -> - SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace rty1 rty2 ++ (fun () -> - CompleteD)) + trackErrors { + do! Iterate2D (SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace) argtys1 argtys2 + do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace rty1 rty2 + () + } | (TyparConstraint.CoercesTo(ty1, _), TyparConstraint.CoercesTo(ty2, _)) -> @@ -1564,19 +1621,22 @@ and AddConstraint (csenv:ConstraintSolverEnv) ndeep m2 trace tp newConstraint = List.rev !res let parents1 = collect ty1 let parents2 = collect ty2 - parents1 |> IterateD (fun ty1Parent -> - parents2 |> IterateD (fun ty2Parent -> - if not (HaveSameHeadType g ty1Parent ty2Parent) then CompleteD else - SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace ty1Parent ty2Parent)) + trackErrors { + for ty1Parent in parents1 do + for ty2Parent in parents2 do + do! if not (HaveSameHeadType g ty1Parent ty2Parent) then CompleteD else + SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace ty1Parent ty2Parent + } | (TyparConstraint.IsEnum (u1, _), TyparConstraint.IsEnum (u2, m2)) -> SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace u1 u2 | (TyparConstraint.IsDelegate (aty1, bty1, _), - TyparConstraint.IsDelegate (aty2, bty2, m2)) -> - SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace aty1 aty2 ++ (fun () -> - SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace bty1 bty2) + TyparConstraint.IsDelegate (aty2, bty2, m2)) -> trackErrors { + do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace aty1 aty2 + return! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace bty1 bty2 + } | TyparConstraint.SupportsComparison _, TyparConstraint.IsDelegate _ | TyparConstraint.IsDelegate _ , TyparConstraint.SupportsComparison _ @@ -1635,36 +1695,34 @@ and AddConstraint (csenv:ConstraintSolverEnv) ndeep m2 trace tp newConstraint = let existingConstraints = tp.Constraints let allCxs = newConstraint :: List.rev existingConstraints - begin + trackErrors { let rec enforceMutualConsistency i cxs = match cxs with | [] -> CompleteD - | cx :: rest -> IterateIdxD (fun j cx2 -> if i = j then CompleteD else consistent cx cx2) allCxs ++ (fun () -> enforceMutualConsistency (i+1) rest) - - enforceMutualConsistency 0 allCxs - end ++ (fun () -> + | cx :: rest -> + trackErrors { + do! IterateIdxD (fun j cx2 -> if i = j then CompleteD else consistent cx cx2) allCxs + return! enforceMutualConsistency (i+1) rest + } + do! enforceMutualConsistency 0 allCxs - let impliedByExistingConstraints = existingConstraints |> List.exists (fun tpc2 -> implies tpc2 newConstraint) + let impliedByExistingConstraints = existingConstraints |> List.exists (fun tpc2 -> implies tpc2 newConstraint) - if impliedByExistingConstraints then - CompleteD - // "Default" constraints propagate softly and can be omitted from explicit declarations of type parameters - elif (match tp.Rigidity, newConstraint with - | (TyparRigidity.Rigid | TyparRigidity.WillBeRigid), TyparConstraint.DefaultsTo _ -> true - | _ -> false) then - CompleteD - elif tp.Rigidity = TyparRigidity.Rigid then - ErrorD (ConstraintSolverMissingConstraint(denv, tp, newConstraint, m, m2)) - else - (// It is important that we give a warning if a constraint is missing from a + if impliedByExistingConstraints then () + // "Default" constraints propagate softly and can be omitted from explicit declarations of type parameters + elif (match tp.Rigidity, newConstraint with + | (TyparRigidity.Rigid | TyparRigidity.WillBeRigid), TyparConstraint.DefaultsTo _ -> true + | _ -> false) then + () + elif tp.Rigidity = TyparRigidity.Rigid then + return! ErrorD (ConstraintSolverMissingConstraint(denv, tp, newConstraint, m, m2)) + else + // It is important that we give a warning if a constraint is missing from a // will-be-made-rigid type variable. This is because the existence of these warnings // is relevant to the overload resolution rules (see 'candidateWarnCount' in the overload resolution // implementation). See also FSharp 1.0 bug 5461 - (if tp.Rigidity.WarnIfMissingConstraint then - WarnD (ConstraintSolverMissingConstraint(denv, tp, newConstraint, m, m2)) - else - CompleteD) ++ (fun () -> - + if tp.Rigidity.WarnIfMissingConstraint then + do! WarnD (ConstraintSolverMissingConstraint(denv, tp, newConstraint, m, m2)) let newConstraints = // Eliminate any constraints where one constraint implies another // Keep constraints in the left-to-right form according to the order they are asserted. @@ -1676,23 +1734,23 @@ and AddConstraint (csenv:ConstraintSolverEnv) ndeep m2 trace tp newConstraint = eliminateRedundant rest (if List.exists (fun cx2 -> implies cx2 cx) acc then acc else (cx::acc)) eliminateRedundant allCxs [] - // Write the constraint into the type variable // Record a entry in the undo trace if one is provided let orig = tp.Constraints trace.Exec (fun () -> tp.SetConstraints newConstraints) (fun () -> tp.SetConstraints orig) + () + } - CompleteD))) and SolveTypeSupportsNull (csenv:ConstraintSolverEnv) ndeep m2 trace ty = let g = csenv.g let m = csenv.m let denv = csenv.DisplayEnv match tryDestTyparTy g ty with - | Some destTypar -> + | ValueSome destTypar -> AddConstraint csenv ndeep m2 trace destTypar (TyparConstraint.SupportsNull m) - | None -> + | ValueNone -> if TypeSatisfiesNullConstraint g m ty then CompleteD else match ty with | NullableTy g _ -> @@ -1706,12 +1764,12 @@ and SolveTypeSupportsComparison (csenv:ConstraintSolverEnv) ndeep m2 trace ty = let amap = csenv.amap let denv = csenv.DisplayEnv match tryDestTyparTy g ty with - | Some destTypar -> + | ValueSome destTypar -> AddConstraint csenv ndeep m2 trace destTypar (TyparConstraint.SupportsComparison m) - | None -> + | ValueNone -> // Check it isn't ruled out by the user match tryDestAppTy g ty with - | Some tcref when HasFSharpAttribute g g.attrib_NoComparisonAttribute tcref.Attribs -> + | ValueSome tcref when HasFSharpAttribute g g.attrib_NoComparisonAttribute tcref.Attribs -> ErrorD (ConstraintSolverError(FSComp.SR.csTypeDoesNotSupportComparison1(NicePrint.minimalStringOfType denv ty), m, m2)) | _ -> match ty with @@ -1750,11 +1808,11 @@ and SolveTypeSupportsEquality (csenv:ConstraintSolverEnv) ndeep m2 trace ty = let m = csenv.m let denv = csenv.DisplayEnv match tryDestTyparTy g ty with - | Some destTypar -> + | ValueSome destTypar -> AddConstraint csenv ndeep m2 trace destTypar (TyparConstraint.SupportsEquality m) - | None -> + | _ -> match tryDestAppTy g ty with - | Some tcref when HasFSharpAttribute g g.attrib_NoEqualityAttribute tcref.Attribs -> + | ValueSome tcref when HasFSharpAttribute g g.attrib_NoEqualityAttribute tcref.Attribs -> ErrorD (ConstraintSolverError(FSComp.SR.csTypeDoesNotSupportEquality1(NicePrint.minimalStringOfType denv ty), m, m2)) | _ -> match ty with @@ -1787,9 +1845,9 @@ and SolveTypeIsEnum (csenv:ConstraintSolverEnv) ndeep m2 trace ty underlying = let m = csenv.m let denv = csenv.DisplayEnv match tryDestTyparTy g ty with - | Some destTypar -> + | ValueSome destTypar -> return! AddConstraint csenv ndeep m2 trace destTypar (TyparConstraint.IsEnum(underlying, m)) - | None -> + | _ -> if isEnumTy g ty then do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace underlying (underlyingTypeOfEnumTy g ty) return! CompleteD @@ -1803,9 +1861,9 @@ and SolveTypeIsDelegate (csenv:ConstraintSolverEnv) ndeep m2 trace ty aty bty = let m = csenv.m let denv = csenv.DisplayEnv match tryDestTyparTy g ty with - | Some destTypar -> + | ValueSome destTypar -> return! AddConstraint csenv ndeep m2 trace destTypar (TyparConstraint.IsDelegate(aty, bty, m)) - | None -> + | _ -> if isDelegateTy g ty then match TryDestStandardDelegateType csenv.InfoReader m AccessibleFromSomewhere ty with | Some (tupledArgTy, rty) -> @@ -1823,9 +1881,9 @@ and SolveTypeIsNonNullableValueType (csenv:ConstraintSolverEnv) ndeep m2 trace t let m = csenv.m let denv = csenv.DisplayEnv match tryDestTyparTy g ty with - | Some destTypar -> + | ValueSome destTypar -> return! AddConstraint csenv ndeep m2 trace destTypar (TyparConstraint.IsNonNullableStruct m) - | None -> + | _ -> let underlyingTy = stripTyEqnsAndMeasureEqns g ty if isStructTy g underlyingTy then if tyconRefEq g g.system_Nullable_tcref (tcrefOfAppTy g underlyingTy) then @@ -1839,9 +1897,9 @@ and SolveTypeIsUnmanaged (csenv:ConstraintSolverEnv) ndeep m2 trace ty = let m = csenv.m let denv = csenv.DisplayEnv match tryDestTyparTy g ty with - | Some destTypar -> + | ValueSome destTypar -> AddConstraint csenv ndeep m2 trace destTypar (TyparConstraint.IsUnmanaged m) - | None -> + | _ -> if isUnmanagedTy g ty then CompleteD else @@ -1853,9 +1911,9 @@ and SolveTypeChoice (csenv:ConstraintSolverEnv) ndeep m2 trace ty tys = let m = csenv.m let denv = csenv.DisplayEnv match tryDestTyparTy g ty with - | Some destTypar -> + | ValueSome destTypar -> AddConstraint csenv ndeep m2 trace destTypar (TyparConstraint.SimpleChoice(tys, m)) - | None -> + | _ -> if List.exists (typeEquivAux Erasure.EraseMeasures g ty) tys then CompleteD else ErrorD (ConstraintSolverError(FSComp.SR.csTypeNotCompatibleBecauseOfPrintf((NicePrint.minimalStringOfType denv ty), (String.concat "," (List.map (NicePrint.prettyStringOfTy denv) tys))), m, m2)) @@ -1865,9 +1923,9 @@ and SolveTypeIsReferenceType (csenv:ConstraintSolverEnv) ndeep m2 trace ty = let m = csenv.m let denv = csenv.DisplayEnv match tryDestTyparTy g ty with - | Some destTypar -> + | ValueSome destTypar -> AddConstraint csenv ndeep m2 trace destTypar (TyparConstraint.IsReferenceType m) - | None -> + | _ -> if isRefTy g ty then CompleteD else ErrorD (ConstraintSolverError(FSComp.SR.csGenericConstructRequiresReferenceSemantics(NicePrint.minimalStringOfType denv ty), m, m)) @@ -1878,9 +1936,9 @@ and SolveTypeRequiresDefaultConstructor (csenv:ConstraintSolverEnv) ndeep m2 tra let denv = csenv.DisplayEnv let ty = stripTyEqnsAndMeasureEqns g origTy match tryDestTyparTy g ty with - | Some destTypar -> + | ValueSome destTypar -> AddConstraint csenv ndeep m2 trace destTypar (TyparConstraint.RequiresDefaultConstructor m) - | None -> + | _ -> if isStructTy g ty && TypeHasDefaultValue g m ty then CompleteD else @@ -1888,13 +1946,13 @@ and SolveTypeRequiresDefaultConstructor (csenv:ConstraintSolverEnv) ndeep m2 tra |> List.exists (fun x -> x.IsNullary && IsMethInfoAccessible amap m AccessibleFromEverywhere x) then match tryDestAppTy g ty with - | Some tcref when HasFSharpAttribute g g.attrib_AbstractClassAttribute tcref.Attribs -> + | ValueSome tcref when HasFSharpAttribute g g.attrib_AbstractClassAttribute tcref.Attribs -> ErrorD (ConstraintSolverError(FSComp.SR.csGenericConstructRequiresNonAbstract(NicePrint.minimalStringOfType denv origTy), m, m2)) | _ -> CompleteD else match tryDestAppTy g ty with - | Some tcref when + | ValueSome tcref when tcref.PreEstablishedHasDefaultConstructor || // F# 3.1 feature: records with CLIMutable attribute should satisfy 'default constructor' constraint (tcref.IsRecordTycon && HasFSharpAttribute g g.attrib_CLIMutableAttribute tcref.Attribs) -> @@ -2029,17 +2087,16 @@ and ArgsMustSubsumeOrConvert cxsln isConstraint (calledArg: CalledArg) - (callerArg: CallerArg<'T>) = + (callerArg: CallerArg<'T>) = trackErrors { let g = csenv.g let m = callerArg.Range let calledArgTy = AdjustCalledArgType csenv.InfoReader isConstraint calledArg callerArg - SolveTypeSubsumesTypeWithReport csenv ndeep m trace cxsln calledArgTy callerArg.Type ++ (fun () -> - + do! SolveTypeSubsumesTypeWithReport csenv ndeep m trace cxsln calledArgTy callerArg.Type if calledArg.IsParamArray && isArray1DTy g calledArgTy && not (isArray1DTy g callerArg.Type) then - ErrorD(Error(FSComp.SR.csMethodExpectsParams(), m)) - else - CompleteD) + return! ErrorD(Error(FSComp.SR.csMethodExpectsParams(), m)) + else () + } and MustUnify csenv ndeep trace cxsln ty1 ty2 = SolveTypeEqualsTypeWithReport csenv ndeep csenv.m trace cxsln ty1 ty2 @@ -2324,7 +2381,7 @@ and ResolveOverloading // Func<_> is always considered better than any other delegate type match tryDestAppTy csenv.g ty1 with - | Some tcref1 when + | ValueSome tcref1 when tcref1.DisplayName = "Func" && (match tcref1.PublicPath with Some p -> p.EnclosingPath = [| "System" |] | _ -> false) && isDelegateTy g ty1 && @@ -2462,11 +2519,12 @@ and ResolveOverloading match calledMethOpt with | Some calledMeth -> calledMethOpt, - errors ++ (fun () -> + trackErrors { + do! errors let cxsln = Option.map (fun traitInfo -> (traitInfo, MemberConstraintSolutionOfMethInfo csenv.SolverState m calledMeth.Method calledMeth.CalledTyArgs)) cx match calledMethTrace with | NoTrace -> - + return! // No trace available for CanMemberSigsMatchUpToCheck with ArgsMustSubsumeOrConvert CanMemberSigsMatchUpToCheck csenv @@ -2484,14 +2542,15 @@ and ResolveOverloading // Unify return type match reqdRetTyOpt with - | None -> CompleteD - | Some _ when calledMeth.Method.IsConstructor -> CompleteD + | None -> () + | Some _ when calledMeth.Method.IsConstructor -> () | Some reqdRetTy -> let actualRetTy = calledMeth.CalledReturnTypeAfterOutArgTupling if isByrefTy g reqdRetTy then - ErrorD(Error(FSComp.SR.tcByrefReturnImplicitlyDereferenced(), m)) + return! ErrorD(Error(FSComp.SR.tcByrefReturnImplicitlyDereferenced(), m)) else - MustUnify csenv ndeep trace cxsln reqdRetTy actualRetTy) + return! MustUnify csenv ndeep trace cxsln reqdRetTy actualRetTy + } | None -> None, errors @@ -2511,7 +2570,8 @@ let UnifyUniqueOverloading let candidates = calledMethGroup |> List.filter (fun cmeth -> cmeth.IsCandidate(m, ad)) let ndeep = 0 match calledMethGroup, candidates with - | _, [calledMeth] -> + | _, [calledMeth] -> trackErrors { + do! // Only one candidate found - we thus know the types we expect of arguments CanMemberSigsMatchUpToCheck csenv @@ -2522,13 +2582,15 @@ let UnifyUniqueOverloading (ArgsMustSubsumeOrConvert csenv ndeep NoTrace None false) // UnifyUniqueOverloading is not called in case of trait call - pass isConstraint=false (Some reqdRetTy) calledMeth - ++ (fun () -> ResultD true) + return true + } | [], _ -> ErrorD (Error (FSComp.SR.csMethodNotFound(methodName), m)) - | _, [] -> - ReportNoCandidatesErrorSynExpr csenv callerArgCounts methodName ad calledMethGroup - ++ (fun () -> ResultD false) + | _, [] -> trackErrors { + do! ReportNoCandidatesErrorSynExpr csenv callerArgCounts methodName ad calledMethGroup + return false + } | _ -> ResultD false @@ -2591,7 +2653,12 @@ let AddCxTypeMustSubsumeType contextInfo denv css m trace ty1 ty2 = |> RaiseOperationResult let AddCxMethodConstraint denv css m trace traitInfo = - TryD (fun () -> SolveMemberConstraint (MakeConstraintSolverEnv ContextInfo.NoContext css m denv) true false 0 m trace traitInfo ++ (fun _ -> CompleteD)) + TryD (fun () -> + trackErrors { + do! + SolveMemberConstraint (MakeConstraintSolverEnv ContextInfo.NoContext css m denv) true false 0 m trace traitInfo + |> OperationResult.ignore + }) (fun res -> ErrorD (ErrorFromAddingConstraint(denv, res, m))) |> RaiseOperationResult @@ -2640,7 +2707,7 @@ let AddCxTypeIsDelegate denv css m trace ty aty bty = (fun res -> ErrorD (ErrorFromAddingConstraint(denv, res, m))) |> RaiseOperationResult -let CodegenWitnessThatTypeSupportsTraitConstraint tcVal g amap m (traitInfo:TraitConstraintInfo) argExprs = +let CodegenWitnessThatTypeSupportsTraitConstraint tcVal g amap m (traitInfo:TraitConstraintInfo) argExprs = trackErrors { let css = { g = g amap = amap @@ -2649,15 +2716,15 @@ let CodegenWitnessThatTypeSupportsTraitConstraint tcVal g amap m (traitInfo:Trai InfoReader = new InfoReader(g, amap) } let csenv = MakeConstraintSolverEnv ContextInfo.NoContext css m (DisplayEnv.Empty g) - SolveMemberConstraint csenv true true 0 m NoTrace traitInfo ++ (fun _res -> - let sln = + let! _res = SolveMemberConstraint csenv true true 0 m NoTrace traitInfo + let sln = match traitInfo.Solution with - | None -> Choice4Of4() + | None -> Choice5Of5() | Some sln -> match sln with | ILMethSln(origTy, extOpt, mref, minst) -> let metadataTy = convertToTypeWithMetadataIfPossible g origTy - let tcref, _tinst = destAppTy g metadataTy + let tcref = tcrefOfAppTy g metadataTy let mdef = IL.resolveILMethodRef tcref.ILTyconRawMetadata mref let ilMethInfo = match extOpt with @@ -2665,17 +2732,20 @@ let CodegenWitnessThatTypeSupportsTraitConstraint tcVal g amap m (traitInfo:Trai | Some ilActualTypeRef -> let actualTyconRef = Import.ImportILTypeRef amap m ilActualTypeRef MethInfo.CreateILExtensionMeth(amap, m, origTy, actualTyconRef, None, mdef) - Choice1Of4 (ilMethInfo, minst) + Choice1Of5 (ilMethInfo, minst) | FSMethSln(ty, vref, minst) -> - Choice1Of4 (FSMeth(g, ty, vref, None), minst) + Choice1Of5 (FSMeth(g, ty, vref, None), minst) | FSRecdFieldSln(tinst, rfref, isSetProp) -> - Choice2Of4 (tinst, rfref, isSetProp) + Choice2Of5 (tinst, rfref, isSetProp) + | FSAnonRecdFieldSln(anonInfo, tinst, i) -> + Choice3Of5 (anonInfo, tinst, i) | BuiltInSln -> - Choice4Of4 () + Choice5Of5 () | ClosedExprSln expr -> - Choice3Of4 expr + Choice4Of5 expr + return! match sln with - | Choice1Of4(minfo, methArgTys) -> + | Choice1Of5(minfo, methArgTys) -> let argExprs = // FIX for #421894 - typechecker assumes that coercion can be applied for the trait calls arguments but codegen doesn't emit coercion operations // result - generation of non-verifyable code @@ -2706,7 +2776,7 @@ let CodegenWitnessThatTypeSupportsTraitConstraint tcVal g amap m (traitInfo:Trai else ResultD (Some (MakeMethInfoCall amap m minfo methArgTys argExprs )) - | Choice2Of4 (tinst, rfref, isSet) -> + | Choice2Of5 (tinst, rfref, isSet) -> let res = match isSet, rfref.RecdField.IsStatic, argExprs.Length with | true, true, 1 -> @@ -2729,8 +2799,19 @@ let CodegenWitnessThatTypeSupportsTraitConstraint tcVal g amap m (traitInfo:Trai Some (mkRecdFieldGet g (argExprs.[0], rfref, tinst, m)) | _ -> None ResultD res - | Choice3Of4 expr -> ResultD (Some (MakeApplicationAndBetaReduce g (expr, tyOfExpr g expr, [], argExprs, m))) - | Choice4Of4 () -> ResultD None) + | Choice3Of5 (anonInfo, tinst, i) -> + let res = + let tupInfo = anonInfo.TupInfo + if evalTupInfoIsStruct tupInfo && isByrefTy g (tyOfExpr g argExprs.[0]) then + Some (mkAnonRecdFieldGetViaExprAddr (anonInfo, argExprs.[0], tinst, i, m)) + else + Some (mkAnonRecdFieldGet g (anonInfo, argExprs.[0], tinst, i, m)) + ResultD res + + | Choice4Of5 expr -> ResultD (Some (MakeApplicationAndBetaReduce g (expr, tyOfExpr g expr, [], argExprs, m))) + + | Choice5Of5 () -> ResultD None + } let ChooseTyparSolutionAndSolve css denv tp = @@ -2769,6 +2850,7 @@ let IsApplicableMethApprox g amap m (minfo:MethInfo) availObjTy = let minst = FreshenMethInfo m minfo match minfo.GetObjArgTypes(amap, m, minst) with | [reqdObjTy] -> + let reqdObjTy = if isByrefTy g reqdObjTy then destByrefTy g reqdObjTy else reqdObjTy // This is to support byref extension methods. TryD (fun () -> SolveTypeSubsumesType csenv 0 m NoTrace None reqdObjTy availObjTy ++ (fun () -> ResultD true)) (fun _err -> ResultD false) |> CommitOperationResult diff --git a/src/fsharp/DetupleArgs.fs b/src/fsharp/DetupleArgs.fs index bf56deeeb7f..9a7f99e63a6 100644 --- a/src/fsharp/DetupleArgs.fs +++ b/src/fsharp/DetupleArgs.fs @@ -850,11 +850,11 @@ let postTransformExpr (penv:penv) expr = | _ -> None -let passImplFile penv ass = - ass |> RewriteImplFile {PreIntercept =None - PreInterceptBinding=None - PostTransform= postTransformExpr penv - IsUnderQuotations=false } +let passImplFile penv assembly = + assembly |> RewriteImplFile {PreIntercept =None + PreInterceptBinding=None + PostTransform= postTransformExpr penv + IsUnderQuotations=false } //------------------------------------------------------------------------- diff --git a/src/fsharp/Directory.Build.props b/src/fsharp/Directory.Build.props new file mode 100644 index 00000000000..151415117e4 --- /dev/null +++ b/src/fsharp/Directory.Build.props @@ -0,0 +1,12 @@ + + + + + + true + true + false + $(ArtifactsPackagesDir)\$(Configuration) + + + diff --git a/src/fsharp/Directory.Build.targets b/src/fsharp/Directory.Build.targets new file mode 100644 index 00000000000..068f4dc3c51 --- /dev/null +++ b/src/fsharp/Directory.Build.targets @@ -0,0 +1,4 @@ + + + + diff --git a/src/fsharp/Directory.Nuget.props b/src/fsharp/Directory.Nuget.props new file mode 100644 index 00000000000..6521936cfe3 --- /dev/null +++ b/src/fsharp/Directory.Nuget.props @@ -0,0 +1,27 @@ + + + + https://github.com/Microsoft/visualfsharp/blob/master/License.txt + https://github.com/Microsoft/visualfsharp + Microsoft and F# Software Foundation + Microsoft and F# Software Foundation + Visual F# Compiler FSharp functional programming + (C) Microsoft Corporation. All rights reserved. + + $(GitHeadSha) + [developer build] + + + licenseUrl=$(PackageLicenceUrl); + authors=$(PackageAuthors); + owners=$(PackageOwners); + projectUrl=$(PackageProjectUrl); + copyright=$(PackageCopyright); + tags=$(PackageTags); + githeadsha=$(NormalizedGitHeadSha); + configuration=$(Configuration); + artifactsbindir=$(ArtifactsBinDir); + + + + diff --git a/src/fsharp/Directory.Nuget.targets b/src/fsharp/Directory.Nuget.targets new file mode 100644 index 00000000000..e30b155faad --- /dev/null +++ b/src/fsharp/Directory.Nuget.targets @@ -0,0 +1,11 @@ + + + + + $(NuspecProperties); + packageId=$(PackageId); + version=$(PackageVersion); + + + + diff --git a/src/fsharp/ErrorLogger.fs b/src/fsharp/ErrorLogger.fs index d29874bb0d5..41be3768ed2 100755 --- a/src/fsharp/ErrorLogger.fs +++ b/src/fsharp/ErrorLogger.fs @@ -596,15 +596,27 @@ let rec Iterate2D f xs ys = | h1 :: t1, h2::t2 -> f h1 h2 ++ (fun () -> Iterate2D f t1 t2) | _ -> failwith "Iterate2D" +/// Keep the warnings, propagate the error to the exception continuation. let TryD f g = match f() with - | ErrorResult(warns, err) -> (OkResult(warns, ())) ++ (fun () -> g err) + | ErrorResult(warns, err) -> + trackErrors { + do! OkResult(warns, ()) + return! g err + } | res -> res let rec RepeatWhileD ndeep body = body ndeep ++ (fun x -> if x then RepeatWhileD (ndeep+1) body else CompleteD) let AtLeastOneD f l = MapD f l ++ (fun res -> ResultD (List.exists id res)) +[] +module OperationResult = + let inline ignore (res: OperationResult<'a>) = + match res with + | OkResult(warnings, _) -> OkResult(warnings, ()) + | ErrorResult(warnings, err) -> ErrorResult(warnings, err) + // Code below is for --flaterrors flag that is only used by the IDE let stringThatIsAProxyForANewlineInFlatErrors = new System.String [|char 29 |] diff --git a/src/fsharp/ErrorResolutionHints.fs b/src/fsharp/ErrorResolutionHints.fs index e674adb6f46..20bcb13fd21 100644 --- a/src/fsharp/ErrorResolutionHints.fs +++ b/src/fsharp/ErrorResolutionHints.fs @@ -43,6 +43,7 @@ let FilterPredictions (idText:string) (suggestionF:ErrorLogger.Suggestions) = name |> Seq.forall (fun c -> c <> ' ') if allSuggestions.Contains idText then [] else // some other parsing error occurred + let dotIdText = "." + idText allSuggestions |> Seq.choose (fun suggestion -> // Because beginning a name with _ is used both to indicate an unused @@ -53,7 +54,7 @@ let FilterPredictions (idText:string) (suggestionF:ErrorLogger.Suggestions) = let suggestion:string = demangle suggestion let suggestedText = suggestion.ToUpperInvariant() let similarity = EditDistance.JaroWinklerDistance uppercaseText suggestedText - if similarity >= highConfidenceThreshold || suggestion.EndsWithOrdinal("." + idText) then + if similarity >= highConfidenceThreshold || suggestion.EndsWithOrdinal(dotIdText) then Some(similarity, suggestion) elif similarity < minThresholdForSuggestions && suggestedText.Length > minStringLengthForThreshold then None diff --git a/src/fsharp/FSComp.txt b/src/fsharp/FSComp.txt index 86b76615525..cb5747f3c5d 100644 --- a/src/fsharp/FSComp.txt +++ b/src/fsharp/FSComp.txt @@ -440,6 +440,7 @@ parsParenFormIsForML,"In F# code you may use 'expr.[expr]'. A type annotation ma 602,parsUnmatched,"Unmatched '%s'" 603,parsUnmatchedBracketBar,"Unmatched '[|'" 604,parsUnmatchedBrace,"Unmatched '{{'" +605,parsUnmatchedBraceBar,"Unmatched '{{|'" 609,parsFieldBinding,"Field bindings must have the form 'id = expr;'" 610,parsMemberIllegalInObjectImplementation,"This member is not permitted in an object implementation" 611,parsMissingFunctionBody,"Missing function body" @@ -922,6 +923,7 @@ typeInfoProperty,"property" typeInfoExtension,"extension" typeInfoCustomOperation,"custom operation" typeInfoArgument,"argument" +typeInfoAnonRecdField,"anonymous record field" typeInfoPatternVariable,"patvar" typeInfoNamespace,"namespace" typeInfoModule,"module" @@ -1040,8 +1042,8 @@ lexHashBangMustBeFirstInFile,"#! may only appear as the first line at the start 1186,parsInvalidProperty,"Invalid property getter or setter" 1187,parsIndexerPropertyRequiresAtLeastOneArgument,"An indexer property must be given at least one argument" 1188,tastInvalidAddressOfMutableAcrossAssemblyBoundary,"This operation accesses a mutable top-level value defined in another assembly in an unsupported way. The value cannot be accessed through its address. Consider copying the expression to a mutable local, e.g. 'let mutable x = ...', and if necessary assigning the value back after the completion of the operation" -1189,parsNonAdjacentTypars,"Type parameters must be placed directly adjacent to the type name, e.g. \"type C<'T>\", not type \"C <'T>\"" -1190,parsNonAdjacentTyargs,"Type arguments must be placed directly adjacent to the type name, e.g. \"C<'T>\", not \"C <'T>\"" +1189,parsNonAdjacentTypars,"Remove spaces between the type name and type parameter, e.g. \"type C<'T>\", not type \"C <'T>\". Type parameters must be placed directly adjacent to the type name." +1190,parsNonAdjacentTyargs,"Remove spaces between the type name and type parameter, e.g. \"C<'T>\", not \"C <'T>\". Type parameters must be placed directly adjacent to the type name." parsNonAtomicType,"The use of the type syntax 'int C' and 'C ' is not permitted here. Consider adjusting this type to be written in the form 'C'" # 1191,tastUndefinedTyconItemField,"The type %s did not contain the field '%s'" # 1192,tastUndefinedTyconItemUnionCase,"The type %s did not contain the union case '%s'" @@ -1293,7 +1295,10 @@ descriptionUnavailable,"(description unavailable...)" 3171,tcGeneratedTypesShouldBeInternalOrPrivate,"The provided types generated by this use of a type provider may not be used from other F# assemblies and should be marked internal or private. Consider using 'type internal TypeName = ...' or 'type private TypeName = ...'." 3172,chkGetterAndSetterHaveSamePropertyType,"A property's getter and setter must have the same type. Property '%s' has getter of type '%s' but setter of type '%s'." 3173,tcRuntimeSuppliedMethodCannotBeUsedInUserCode,"Array method '%s' is supplied by the runtime and cannot be directly used in code. For operations with array elements consider using family of GetArray/SetArray functions from LanguagePrimitives.IntrinsicFunctions module." -3174,tcUnionCaseConstructorDoesNotHaveFieldWithGivenName,"Union case/exception '%s' does not have field named '%s'." +3174,tcUnionCaseConstructorDoesNotHaveFieldWithGivenName,"The union case '%s' does not have a field named '%s'." +3174,tcExceptionConstructorDoesNotHaveFieldWithGivenName,"The exception '%s' does not have a field named '%s'." +3174,tcActivePatternsDoNotHaveFields,"Active patterns do not have fields. This syntax is invalid." +3174,tcConstructorDoesNotHaveFieldWithGivenName,"The constructor does not have a field named '%s'." 3175,tcUnionCaseFieldCannotBeUsedMoreThanOnce,"Union case/exception field '%s' cannot be used more than once." 3176,tcFieldNameIsUsedModeThanOnce,"Named field '%s' is used more than once." 3176,tcFieldNameConflictsWithGeneratedNameForAnonymousField,"Named field '%s' conflicts with autogenerated name for anonymous field." @@ -1338,6 +1343,8 @@ tcGlobalsSystemTypeNotFound,"The system type '%s' was required but no referenced 3213,typrelMemberHasMultiplePossibleDispatchSlots,"The member '%s' matches multiple overloads of the same method.\nPlease restrict it to one of the following:%s." 3214,methodIsNotStatic,"Method or object constructor '%s' is not static" 3215,parsUnexpectedSymbolEqualsInsteadOfIn,"Unexpected symbol '=' in expression. Did you intend to use 'for x in y .. z do' instead?" +tcAnonRecdCcuMismatch,"Two anonymous record types are from different assemblies '%s' and '%s'" +tcAnonRecdFieldNameMismatch,"Two anonymous record types have mismatched sets of field names '%s' and '%s'" keywordDescriptionAbstract,"Indicates a method that either has no implementation in the type in which it is declared or that is virtual and has a default implementation." keyworkDescriptionAnd,"Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters." keywordDescriptionAs,"Used to give the current class object an object name. Also used to give a name to a whole pattern within a pattern match." @@ -1431,13 +1438,20 @@ notAFunctionButMaybeDeclaration,"This value is not a function and cannot be appl 3226,tcByrefReturnImplicitlyDereferenced,"A byref pointer returned by a function or method is implicitly dereferenced as of F# 4.5. To acquire the return value as a pointer, use the address-of operator, e.g. '&f(x)' or '&obj.Method(arg1, arg2)'." 3227,tcByRefLikeNotStruct,"A type annotated with IsByRefLike must also be a struct. Consider adding the [] attribute to the type." 3228,chkNoByrefAddressOfValueFromExpression,"The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope." -3229,chkNoReturnOfLimitedSpan,"The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope." -3230,chkNoWriteToLimitedSpan,"This value can't be assigned because the target '%s' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope." -3231,tastValueMustBeLocal,"A value defined in a module must be mutable in order to take its address, e.g. 'let mutable x = ...'" -3232,tcIsReadOnlyNotStruct,"A type annotated with IsReadOnly must also be a struct. Consider adding the [] attribute to the type." -3233,chkStructsMayNotReturnAddressesOfContents,"Struct members cannot return the address of fields of the struct by reference" -3234,chkNoByrefLikeFunctionCall,"The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope." -3235,chkNoSpanLikeVariable,"The Span or IsByRefLike variable '%s' cannot be used at this point. This is to ensure the address of the local value does not escape its scope." -3236,chkNoSpanLikeValueFromExpression,"A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope." -3237,tastCantTakeAddressOfExpression,"Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address." +3229,chkNoWriteToLimitedSpan,"This value can't be assigned because the target '%s' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope." +3230,tastValueMustBeLocal,"A value defined in a module must be mutable in order to take its address, e.g. 'let mutable x = ...'" +3231,tcIsReadOnlyNotStruct,"A type annotated with IsReadOnly must also be a struct. Consider adding the [] attribute to the type." +3232,chkStructsMayNotReturnAddressesOfContents,"Struct members cannot return the address of fields of the struct by reference" +3233,chkNoByrefLikeFunctionCall,"The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope." +3234,chkNoSpanLikeVariable,"The Span or IsByRefLike variable '%s' cannot be used at this point. This is to ensure the address of the local value does not escape its scope." +3235,chkNoSpanLikeValueFromExpression,"A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope." +3236,tastCantTakeAddressOfExpression,"Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address." +3237,tcCannotCallExtensionMethodInrefToByref,"Cannot call the byref extension method '%s. The first parameter requires the value to be mutable or a non-readonly byref type." +3238,tcByrefsMayNotHaveTypeExtensions,"Byref types are not allowed to have optional type extensions." +3239,tcCannotPartiallyApplyExtensionMethodForByref,"Cannot partially apply the extension method '%s' because the first parameter is a byref type." 3242,tcTypeDoesNotInheritAttribute,"This type does not inherit Attribute, it will not work correctly with other .NET languages." +3243,parsInvalidAnonRecdExpr,"Invalid anonymous record expression" +3244,parsInvalidAnonRecdType,"Invalid anonymous record type" +3245,tcCopyAndUpdateNeedsRecordType,"The input to a copy-and-update expression that creates an anonymous record must be either an anonymous record or a record" +3300,chkInvalidFunctionParameterType,"The parameter '%s' has an invalid type '%s'. This is not permitted by the rules of Common IL." +3301,chkInvalidFunctionReturnType,"The function or method has an invalid return type '%s'. This is not permitted by the rules of Common IL." diff --git a/src/fsharp/FSStrings.resx b/src/fsharp/FSStrings.resx index 5a99d5e9e74..05cd75cc669 100644 --- a/src/fsharp/FSStrings.resx +++ b/src/fsharp/FSStrings.resx @@ -396,6 +396,9 @@ symbol '[' + + symbol '{|' + symbol '[|' @@ -411,6 +414,9 @@ symbol '|]' + + symbol '|}' + symbol '>}' diff --git a/src/fsharp/FSharp.Build-proto/FSharp.Build-proto.fsproj b/src/fsharp/FSharp.Build-proto/FSharp.Build-proto.fsproj deleted file mode 100644 index 1bae3eda985..00000000000 --- a/src/fsharp/FSharp.Build-proto/FSharp.Build-proto.fsproj +++ /dev/null @@ -1,111 +0,0 @@ - - - - - $(MSBuildProjectDirectory)\..\.. - Proto - AnyCPU - - - - - - Library - FSharp.Build - true - LKG - {D8BC791F-C1A9-49DC-9432-0F3090537555} - - - - FSBuild.txt - - - CompilerLocationUtils.fs - - - CreateFSharpManifestResourceName.fs - - - FSharpCommandLineBuilder.fs - - - Fsc.fs - - - FSharpEmbedResourceText.fs - - - FSharpEmbedResXSource.fs - - - WriteCodeFragment.fs - - - Microsoft.FSharp.Targets - - - Microsoft.Portable.FSharp.Targets - - - Microsoft.FSharp.NetSdk.props - - - Microsoft.FSharp.NetSdk.targets - - - Microsoft.FSharp.Overrides.NetSdk.targets - - - Microsoft.VisualFSharp.Type.Providers.Redist - - - - - - - - - - - - $(FSharpSourcesRoot)\..\packages\Microsoft.Build.Framework.$(MicrosoftBuildFrameworkPackageVersion)\lib\net46\Microsoft.Build.Framework.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.Build.$(MicrosoftBuildPackageVersion)\lib\net46\Microsoft.Build.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.Build.Utilities.Core.$(MicrosoftBuildUtilitiesCorePackageVersion)\lib\net46\Microsoft.Build.Utilities.Core.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.Build.Tasks.Core.$(MicrosoftBuildTasksCorePackageVersion)\lib\net46\Microsoft.Build.Tasks.Core.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.Build.Tasks.Core.$(MicrosoftBuildTasksCorePackageVersion)\lib\net46\Microsoft.Build.Tasks.Core.dll - - - $(FSharpSourcesRoot)\..\packages\System.IO.Compression.$(SystemIoCompressionPackageVersion)\lib\net46\System.IO.Compression.dll - - - - - $(FSharpSourcesRoot)\..\packages\Microsoft.Build.Framework.14.3.0\lib\net45\Microsoft.Build.Framework.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.Build.14.3.0\lib\net45\Microsoft.Build.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.Build.Utilities.Core.14.3.0\lib\net45\Microsoft.Build.Utilities.Core.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.Build.Tasks.Core.14.3.0\lib\net45\Microsoft.Build.Tasks.Core.dll - - - - - {DED3BBD7-53F4-428A-8C9F-27968E768605} - FSharp.Core - - - - diff --git a/src/fsharp/FSharp.Build/FSBuild.txt b/src/fsharp/FSharp.Build/FSBuild.txt index 89840c0d725..10fdedb2151 100644 --- a/src/fsharp/FSharp.Build/FSBuild.txt +++ b/src/fsharp/FSharp.Build/FSBuild.txt @@ -1,2 +1,2 @@ # FSharp.Build resource strings -toolpathUnknown,"ToolPath is unknown; specify the path to fsc.exe as the ToolPath property." \ No newline at end of file +toolpathUnknown,"ToolPath is unknown; specify the path to the tool." \ No newline at end of file diff --git a/src/fsharp/FSharp.Build/FSharp.Build.fsproj b/src/fsharp/FSharp.Build/FSharp.Build.fsproj index 0046e733380..162c6bf3d31 100644 --- a/src/fsharp/FSharp.Build/FSharp.Build.fsproj +++ b/src/fsharp/FSharp.Build/FSharp.Build.fsproj @@ -1,36 +1,25 @@ - - - $(MSBuildProjectDirectory)\..\.. - FSharp - true - - - + - Debug - AnyCPU Library + net46;netstandard2.0 FSharp.Build + $(NoWarn);45;55;62;75;1204 true - {702A7979-BCF9-4C41-853E-3ADFC9897890} + $(OtherFlags) --maxerrors:20 --extraoptimizationloops:1 + true - - $(FSharpSourcesRoot)\..\loc\lcl\{Lang}\$(AssemblyName).dll.lcl - $(FSharpSourcesRoot)\..\loc\lci\$(AssemblyName).dll.lci - false - false - + @@ -42,54 +31,20 @@ - - - - - - - - - $(FSharpSourcesRoot)\..\packages\Microsoft.Build.Framework.$(MicrosoftBuildFrameworkPackageVersion)\lib\net46\Microsoft.Build.Framework.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.Build.$(MicrosoftBuildPackageVersion)\lib\net46\Microsoft.Build.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.Build.Utilities.Core.$(MicrosoftBuildUtilitiesCorePackageVersion)\lib\net46\Microsoft.Build.Utilities.Core.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.Build.Tasks.Core.$(MicrosoftBuildTasksCorePackageVersion)\lib\net46\Microsoft.Build.Tasks.Core.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.Build.Tasks.Core.$(MicrosoftBuildTasksCorePackageVersion)\lib\net46\Microsoft.Build.Tasks.Core.dll - - - $(FSharpSourcesRoot)\..\packages\System.IO.Compression.$(SystemIoCompressionPackageVersion)\lib\net46\System.IO.Compression.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualFSharp.Type.Providers.Redist.$(MicrosoftVisualFSharpTypeProvidersRedistPackageVersion)\content\4.3.0.0\FSharp.Data.TypeProviders.dll - + + - - - $(FSharpSourcesRoot)\..\packages\Microsoft.Build.Framework.14.3.0\lib\net45\Microsoft.Build.Framework.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.Build.14.3.0\lib\net45\Microsoft.Build.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.Build.Utilities.Core.14.3.0\lib\net45\Microsoft.Build.Utilities.Core.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.Build.Tasks.Core.14.3.0\lib\net45\Microsoft.Build.Tasks.Core.dll - + + + + - - {DED3BBD7-53F4-428A-8C9F-27968E768605} - FSharp.Core - + + + + + - + diff --git a/src/fsharp/FSharp.Build/Fsc.fs b/src/fsharp/FSharp.Build/Fsc.fs index 95f3ec2f98c..307261b3a21 100644 --- a/src/fsharp/FSharp.Build/Fsc.fs +++ b/src/fsharp/FSharp.Build/Fsc.fs @@ -121,6 +121,7 @@ type public Fsc () as this = builder.AppendSwitchIfNotNull("--define:", item.ItemSpec) // DocumentationFile builder.AppendSwitchIfNotNull("--doc:", documentationFile) + // GenerateInterfaceFile builder.AppendSwitchIfNotNull("--sig:", generateInterfaceFile) // KeyFile @@ -235,6 +236,8 @@ type public Fsc () as this = builder.AppendSwitchIfNotNull("--targetprofile:", targetProfile) + builder.AppendSwitch("--nocopyfsharpcore") + // OtherFlags - must be second-to-last builder.AppendSwitchUnquotedIfNotNull("", otherFlags) capturedArguments <- builder.CapturedArguments() @@ -485,7 +488,7 @@ type public Fsc () as this = override fsc.ToolName = "fsc.exe" override fsc.StandardErrorEncoding = if utf8output then System.Text.Encoding.UTF8 else base.StandardErrorEncoding override fsc.StandardOutputEncoding = if utf8output then System.Text.Encoding.UTF8 else base.StandardOutputEncoding - override fsc.GenerateFullPathToTool() = + override fsc.GenerateFullPathToTool() = if toolPath = "" then raise (new System.InvalidOperationException(FSBuild.SR.toolpathUnknown())) System.IO.Path.Combine(toolPath, fsc.ToolExe) override fsc.LogToolCommand (message:string) = @@ -524,24 +527,11 @@ type public Fsc () as this = -1 // ok, this is what happens when VS IDE cancels the build, no need to assert, just log the build-canceled error and return -1 to denote task failed | e -> reraise() - // Todo: Remove !FX_NO_CONVERTER code path for VS2017.7 - // Earlier buildtasks usesd System.Converter for cross platform we are moving to Func - // This is so that during the interim, earlier VS's will still load the OSS project let baseCallDelegate = Func(fun () -> fsc.BaseExecuteTool(pathToTool, responseFileCommands, commandLineCommands) ) try invokeCompiler baseCallDelegate with | e -> -#if !FX_NO_CONVERTER - try - let baseCall = fun (dummy : int) -> fsc.BaseExecuteTool(pathToTool, responseFileCommands, commandLineCommands) - // We are using a Converter rather than a "unit->int" because it is too hard to - // figure out how to pass an F# function object via reflection. - let baseCallDelegate = new System.Converter(baseCall) - invokeCompiler baseCallDelegate - with - | e -> -#endif Debug.Assert(false, "HostObject received by Fsc task did not have a Compile method or the compile method threw an exception. "+(e.ToString())) reraise() @@ -565,8 +555,7 @@ type public Fsc () as this = member internal fsc.InternalExecuteTool(pathToTool, responseFileCommands, commandLineCommands) = fsc.ExecuteTool(pathToTool, responseFileCommands, commandLineCommands) - member internal fsc.GetCapturedArguments() = - [| + member internal fsc.GetCapturedArguments() = [| yield! capturedArguments yield! capturedFilenames |] diff --git a/src/fsharp/FSharp.Build/Fsi.fs b/src/fsharp/FSharp.Build/Fsi.fs new file mode 100644 index 00000000000..f30a5bb2fb3 --- /dev/null +++ b/src/fsharp/FSharp.Build/Fsi.fs @@ -0,0 +1,339 @@ +// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. + +namespace Microsoft.FSharp.Build + +open System +open System.Diagnostics +open System.Globalization +open System.IO +open System.Reflection +open Microsoft.Build.Framework +open Microsoft.Build.Utilities +open Internal.Utilities + +#if FX_RESHAPED_REFLECTION +open Microsoft.FSharp.Core.ReflectionAdapters +#endif + +//There are a lot of flags on fsi.exe. +//For now, not all of them are represented in the "Fsi class" object model. +//The goal is to have the most common/important flags available via the Fsi class, and the +//rest can be "backdoored" through the .OtherFlags property. + +[] +type public Fsi () as this = + + inherit ToolTask () + + let mutable capturedArguments : string list = [] // list of individual args, to pass to HostObject Compile() + let mutable capturedFilenames : string list = [] // list of individual source filenames, to pass to HostObject Compile() + let mutable codePage : string = null + let mutable commandLineArgs : ITaskItem list = [] + let mutable defineConstants : ITaskItem[] = [||] + let mutable disabledWarnings : string = null + let mutable dotnetFsiCompilerPath : string = null + let mutable fsiExec = false + let mutable noFramework = false + let mutable optimize = true + let mutable otherFlags : string = null + let mutable preferredUILang = null + let mutable provideCommandLineArgs = false + let mutable references : ITaskItem[] = [||] + let mutable referencePath : string = null + let mutable resources : ITaskItem[] = [||] + let mutable skipCompilerExecution = false + let mutable sources : ITaskItem[] = [||] + let mutable loadSources : ITaskItem[] = [||] + let mutable useSources : ITaskItem[] = [||] + let mutable tailcalls : bool = true + let mutable targetProfile : string = null + let mutable targetType : string = null + let mutable toolExe : string = "fsi.exe" + let mutable toolPath : string = + let locationOfThisDll = + try Some(Path.GetDirectoryName(typeof.Assembly.Location)) + with _ -> None + match FSharpEnvironment.BinFolderOfDefaultFSharpCompiler(locationOfThisDll) with + | Some s -> s + | None -> "" + let mutable treatWarningsAsErrors : bool = false + let mutable warningsAsErrors : string = null + let mutable warningsNotAsErrors : string = null + let mutable warningLevel : string = null + let mutable vslcid : string = null + let mutable utf8output : bool = false + + // See bug 6483; this makes parallel build faster, and is fine to set unconditionally + do this.YieldDuringToolExecution <- true + + let generateCommandLineBuilder () = + let builder = new FSharpCommandLineBuilder() + + builder.AppendSwitchIfNotNull("--codepage:", codePage) + + if noFramework then builder.AppendSwitch("--noframework") + + if defineConstants <> null then + for item in defineConstants do + builder.AppendSwitchIfNotNull("--define:", item.ItemSpec) + + if optimize then builder.AppendSwitch("--optimize+") + else builder.AppendSwitch("--optimize-") + + if not tailcalls then + builder.AppendSwitch("--tailcalls-") + + if references <> null then + for item in references do + builder.AppendSwitchIfNotNull("-r:", item.ItemSpec) + + let referencePathArray = // create a array of strings + match referencePath with + | null -> null + | _ -> referencePath.Split([|';'; ','|], StringSplitOptions.RemoveEmptyEntries) + + // NoWarn + match disabledWarnings with + | null -> () + | _ -> builder.AppendSwitchIfNotNull("--nowarn:", disabledWarnings.Split([|' '; ';'; ','; '\r'; '\n'|], StringSplitOptions.RemoveEmptyEntries), ",") + + builder.AppendSwitchIfNotNull("--warn:", warningLevel) + + if treatWarningsAsErrors then builder.AppendSwitch("--warnaserror") + + // Change warning 76, HashReferenceNotAllowedInNonScript/HashDirectiveNotAllowedInNonScript/HashIncludeNotAllowedInNonScript, into an error + let warningsAsErrorsArray = + match warningsAsErrors with + | null -> [| "76" |] + | _ -> (warningsAsErrors + " 76 ").Split([|' '; ';'; ','|], StringSplitOptions.RemoveEmptyEntries) + + builder.AppendSwitchIfNotNull("--warnaserror:", warningsAsErrorsArray, ",") + + match warningsNotAsErrors with + | null -> () + | _ -> builder.AppendSwitchIfNotNull("--warnaserror-:", warningsNotAsErrors.Split([|' '; ';'; ','|], StringSplitOptions.RemoveEmptyEntries), ",") + + builder.AppendSwitchIfNotNull("--LCID:", vslcid) + + builder.AppendSwitchIfNotNull("--preferreduilang:", preferredUILang) + + if utf8output then builder.AppendSwitch("--utf8output") + + builder.AppendSwitch("--fullpaths") + builder.AppendSwitch("--flaterrors") + + builder.AppendSwitchIfNotNull("--targetprofile:", targetProfile) + + if loadSources <> null then + for item in loadSources do + builder.AppendSwitchIfNotNull("--load:", item.ItemSpec) + + if useSources <> null then + for item in useSources do + builder.AppendSwitchIfNotNull("--use:", item.ItemSpec) + + // OtherFlags - must be second-to-last + builder.AppendSwitchUnquotedIfNotNull("", otherFlags) + capturedArguments <- builder.CapturedArguments() + + if fsiExec then builder.AppendSwitch("--exec") + + // Sources - these have to go last + builder.AppendFileNamesIfNotNull(sources, " ") + capturedFilenames <- builder.CapturedFilenames() + + builder + + // --codepage : Specify the codepage to use when opening source files + member fsc.CodePage + with get() = codePage + and set(s) = codePage <- s + + // --nowarn : Do not report the given specific warning. + member fsi.DisabledWarnings + with get() = disabledWarnings + and set(a) = disabledWarnings <- a + + // --define : Define the given conditional compilation symbol. + member fsi.DefineConstants + with get() = defineConstants + and set(a) = defineConstants <- a + + member fsi.DotnetFsiCompilerPath + with get() = dotnetFsiCompilerPath + and set(p) = dotnetFsiCompilerPath <- p + + member fsi.FsiExec + with get() = fsiExec + and set(p) = fsiExec <- p + + member fsi.LCID + with get() = vslcid + and set(p) = vslcid <- p + + // --noframework + member fsi.NoFramework + with get() = noFramework + and set(b) = noFramework <- b + + // --optimize + member fsi.Optimize + with get() = optimize + and set(p) = optimize <- p + + // --tailcalls + member fsi.Tailcalls + with get() = tailcalls + and set(p) = tailcalls <- p + + member fsi.OtherFlags + with get() = otherFlags + and set(s) = otherFlags <- s + + member fsi.PreferredUILang + with get() = preferredUILang + and set(s) = preferredUILang <- s + + member fsi.ProvideCommandLineArgs + with get() = provideCommandLineArgs + and set(p) = provideCommandLineArgs <- p + + // -r : Reference an F# or .NET assembly. + member fsi.References + with get() = references + and set(a) = references <- a + + // --lib + member fsi.ReferencePath + with get() = referencePath + and set(s) = referencePath <- s + + // -load:: load an F# source file + member fsi.LoadSources + with get() = loadSources + and set(a) = loadSources <- a + + member fsi.SkipCompilerExecution + with get() = skipCompilerExecution + and set(p) = skipCompilerExecution <- p + + // source files + member fsi.Sources + with get() = sources + and set(a) = sources <- a + + member fsi.TargetProfile + with get() = targetProfile + and set(p) = targetProfile <- p + + member fsi.TreatWarningsAsErrors + with get() = treatWarningsAsErrors + and set(p) = treatWarningsAsErrors <- p + + // For targeting other folders for "fsi.exe" (or ToolExe if different) + member fsi.ToolPath + with get() = toolPath + and set(s) = toolPath <- s + + // --use:: execute an F# source file on startup + member fsi.UseSources + with get() = useSources + and set(a) = useSources <- a + + // For specifying the warning level (0-4) + member fsi.WarningLevel + with get() = warningLevel + and set(s) = warningLevel <- s + + member fsi.WarningsAsErrors + with get() = warningsAsErrors + and set(s) = warningsAsErrors <- s + + member fsi.WarningsNotAsErrors + with get() = warningsNotAsErrors + and set(s) = warningsNotAsErrors <- s + + member fsi.Utf8Output + with get() = utf8output + and set(p) = utf8output <- p + + [] + member fsi.CommandLineArgs + with get() = List.toArray commandLineArgs + and set(p) = commandLineArgs <- (List.ofArray p) + + // ToolTask methods + override fsi.ToolName = "fsi.exe" + override fsi.StandardErrorEncoding = if utf8output then System.Text.Encoding.UTF8 else base.StandardErrorEncoding + override fsi.StandardOutputEncoding = if utf8output then System.Text.Encoding.UTF8 else base.StandardOutputEncoding + override fsi.GenerateFullPathToTool() = + if toolPath = "" then raise (new System.InvalidOperationException(FSBuild.SR.toolpathUnknown())) + System.IO.Path.Combine(toolPath, fsi.ToolExe) + override fsi.LogToolCommand (message:string) = + fsi.Log.LogMessageFromText(message, MessageImportance.Normal) |>ignore + + member internal fsi.InternalGenerateFullPathToTool() = fsi.GenerateFullPathToTool() // expose for unit testing + member internal fsi.BaseExecuteTool(pathToTool, responseFileCommands, commandLineCommands) = // F# does not allow protected members to be captured by lambdas, this is the standard workaround + base.ExecuteTool(pathToTool, responseFileCommands, commandLineCommands) + + /// Intercept the call to ExecuteTool to handle the host compile case. + override fsi.ExecuteTool(pathToTool, responseFileCommands, commandLineCommands) = + if provideCommandLineArgs then + commandLineArgs <- + fsi.GetCapturedArguments() + |> Array.map (fun (arg: string) -> TaskItem(arg) :> ITaskItem) + |> Array.toList + + if skipCompilerExecution then + 0 + else + let host = box fsi.HostObject + match host with + | null -> base.ExecuteTool(pathToTool, responseFileCommands, commandLineCommands) + | _ -> + let sources = sources|>Array.map(fun i->i.ItemSpec) + let invokeCompiler baseCallDelegate = + try + let ret = + (host.GetType()).InvokeMember("Compile", BindingFlags.Public ||| BindingFlags.NonPublic ||| BindingFlags.InvokeMethod ||| BindingFlags.Instance, null, host, + [| baseCallDelegate; box (capturedArguments |> List.toArray); box (capturedFilenames |> List.toArray) |], + CultureInfo.InvariantCulture) + unbox ret + with + | :? TargetInvocationException as tie when (match tie.InnerException with | :? Microsoft.Build.Exceptions.BuildAbortedException -> true | _ -> false) -> + fsi.Log.LogError(tie.InnerException.Message, [| |]) + -1 // ok, this is what happens when VS IDE cancels the build, no need to assert, just log the build-canceled error and return -1 to denote task failed + | e -> reraise() + + let baseCallDelegate = Func(fun () -> fsi.BaseExecuteTool(pathToTool, responseFileCommands, commandLineCommands) ) + try + invokeCompiler baseCallDelegate + with + | e -> + Debug.Assert(false, "HostObject received by Fsi task did not have a Compile method or the compile method threw an exception. "+(e.ToString())) + reraise() + + override fsi.GenerateCommandLineCommands() = + let builder = new FSharpCommandLineBuilder() + if not (String.IsNullOrEmpty(dotnetFsiCompilerPath)) then builder.AppendSwitch(dotnetFsiCompilerPath) + builder.ToString() + + override fsi.GenerateResponseFileCommands() = + let builder = generateCommandLineBuilder () + builder.GetCapturedArguments() |> Seq.fold(fun acc f -> acc + f + Environment.NewLine) "" + + // expose this to internal components (for nunit testing) + member internal fsi.InternalGenerateCommandLineCommands() = + fsi.GenerateCommandLineCommands() + + // expose this to internal components (for nunit testing) + member internal fsi.InternalGenerateResponseFileCommands() = + fsi.GenerateResponseFileCommands() + + member internal fsi.InternalExecuteTool(pathToTool, responseFileCommands, commandLineCommands) = + fsi.ExecuteTool(pathToTool, responseFileCommands, commandLineCommands) + + member internal fsi.GetCapturedArguments() = [| + yield! capturedArguments + yield! capturedFilenames + |] diff --git a/src/fsharp/FSharp.Build/Microsoft.FSharp.NetSdk.props b/src/fsharp/FSharp.Build/Microsoft.FSharp.NetSdk.props index 97302e0bc96..1b905a5c2f3 100644 --- a/src/fsharp/FSharp.Build/Microsoft.FSharp.NetSdk.props +++ b/src/fsharp/FSharp.Build/Microsoft.FSharp.NetSdk.props @@ -41,6 +41,7 @@ WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and 3 3239;$(WarningsAsErrors) true + true @@ -55,14 +56,14 @@ WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and true - - $(MSBuildThisFileDirectory) - RunFsc.cmd - + + $([System.IO.Path]::GetDirectoryName($(DOTNET_HOST_PATH))) + $([System.IO.Path]::GetFileName($(DOTNET_HOST_PATH))) + "$(MSBuildThisFileDirectory)fsc.exe" - - $(MSBuildThisFileDirectory) - RunFsc.sh + $([System.IO.Path]::GetDirectoryName($(DOTNET_HOST_PATH))) + $([System.IO.Path]::GetFileName($(DOTNET_HOST_PATH))) + "$(MSBuildThisFileDirectory)fsi.exe" mscorlib netcore netstandard - $(OtherFlags) --simpleresolution --nocopyfsharpcore + $(OtherFlags) --simpleresolution diff --git a/src/fsharp/FSharp.Build/Microsoft.FSharp.Targets b/src/fsharp/FSharp.Build/Microsoft.FSharp.Targets index 8808c10ebc2..9bdd9868dc0 100644 --- a/src/fsharp/FSharp.Build/Microsoft.FSharp.Targets +++ b/src/fsharp/FSharp.Build/Microsoft.FSharp.Targets @@ -23,6 +23,7 @@ this file. + @@ -152,7 +153,6 @@ this file. - @@ -221,7 +221,9 @@ this file. $(Win32Manifest); @(CustomAdditionalCompileInputs); $(VersionFile); - $(KeyOriginatorFile)" + $(KeyOriginatorFile); + $(UseSource); + $(LoadSource)" Outputs="@(DocFileItem); @(IntermediateAssembly); @(_DebugSymbolsIntermediatePath); diff --git a/src/fsharp/FSharp.Build/WriteCodeFragment.fs b/src/fsharp/FSharp.Build/WriteCodeFragment.fs index a36193da547..fd92e6c6596 100644 --- a/src/fsharp/FSharp.Build/WriteCodeFragment.fs +++ b/src/fsharp/FSharp.Build/WriteCodeFragment.fs @@ -133,9 +133,7 @@ type WriteCodeFragment() = _outputFile let codeText = code.ToString() - let alreadyExists = (try File.Exists fileName && File.ReadAllText(fileName) = codeText with _ -> false) - if not alreadyExists then - File.WriteAllText(fileName, codeText) + File.WriteAllText(fileName, codeText) _outputFile <- outputFileItem true diff --git a/src/fsharp/FSharp.Build/project.json b/src/fsharp/FSharp.Build/project.json deleted file mode 100644 index 849f4f7f42f..00000000000 --- a/src/fsharp/FSharp.Build/project.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "dependencies": { - "Microsoft.Build": "15.6.85", - "Microsoft.Build.Framework": "15.6.85", - "Microsoft.Build.Tasks.Core": "15.6.85", - "Microsoft.Build.Utilities.Core": "15.6.85", - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.Win32.Registry": { - "version": "4.3.0", - "exclude": "Compile" - }, - "System.AppContext": "4.3.0", - "System.Diagnostics.Tools": "4.3.0", - "System.Reflection.Primitives": "4.3.0", - "System.Resources.ResourceManager": "4.3.0" - }, - "runtimes": { - "win7-x86": { }, - "win7-x64": { }, - "osx.10.11-x64": { }, - "ubuntu.14.04-x64": { } - }, - "frameworks": { - "netstandard1.6": { - "imports": "portable-net45+win8" - } - } -} \ No newline at end of file diff --git a/src/fsharp/FSharp.Build/xlf/FSBuild.txt.cs.xlf b/src/fsharp/FSharp.Build/xlf/FSBuild.txt.cs.xlf index d4e4bac23e6..c7540eaf089 100644 --- a/src/fsharp/FSharp.Build/xlf/FSBuild.txt.cs.xlf +++ b/src/fsharp/FSharp.Build/xlf/FSBuild.txt.cs.xlf @@ -1,10 +1,10 @@ - + - ToolPath is unknown; specify the path to fsc.exe as the ToolPath property. - Parametr ToolPath je neznámý; zadejte cestu k souboru fsc.exe jako vlastnost ToolPath. + ToolPath is unknown; specify the path to the tool. + ToolPath is unknown; specify the path to the tool. diff --git a/src/fsharp/FSharp.Build/xlf/FSBuild.txt.de.xlf b/src/fsharp/FSharp.Build/xlf/FSBuild.txt.de.xlf index 604ba262f77..381fc6afddf 100644 --- a/src/fsharp/FSharp.Build/xlf/FSBuild.txt.de.xlf +++ b/src/fsharp/FSharp.Build/xlf/FSBuild.txt.de.xlf @@ -1,10 +1,10 @@ - + - ToolPath is unknown; specify the path to fsc.exe as the ToolPath property. - ToolPath ist unbekannt. Geben Sie den Pfad zu "fsc.exe" als ToolPath-Eigenschaft an. + ToolPath is unknown; specify the path to the tool. + ToolPath is unknown; specify the path to the tool. diff --git a/src/fsharp/FSharp.Build/xlf/FSBuild.txt.en.xlf b/src/fsharp/FSharp.Build/xlf/FSBuild.txt.en.xlf index 1cd033f6d2c..50915d20e20 100644 --- a/src/fsharp/FSharp.Build/xlf/FSBuild.txt.en.xlf +++ b/src/fsharp/FSharp.Build/xlf/FSBuild.txt.en.xlf @@ -3,8 +3,8 @@ - ToolPath is unknown; specify the path to fsc.exe as the ToolPath property. - ToolPath is unknown; specify the path to fsc.exe as the ToolPath property. + ToolPath is unknown; specify the path to the tool. + ToolPath is unknown; specify the path to the tool. diff --git a/src/fsharp/FSharp.Build/xlf/FSBuild.txt.es.xlf b/src/fsharp/FSharp.Build/xlf/FSBuild.txt.es.xlf index 47f7b770a59..14821c6fc73 100644 --- a/src/fsharp/FSharp.Build/xlf/FSBuild.txt.es.xlf +++ b/src/fsharp/FSharp.Build/xlf/FSBuild.txt.es.xlf @@ -1,10 +1,10 @@ - + - ToolPath is unknown; specify the path to fsc.exe as the ToolPath property. - ToolPath desconocido; especifique la ruta de acceso del archivo fsc.exe como propiedad ToolPath. + ToolPath is unknown; specify the path to the tool. + ToolPath is unknown; specify the path to the tool. diff --git a/src/fsharp/FSharp.Build/xlf/FSBuild.txt.fr.xlf b/src/fsharp/FSharp.Build/xlf/FSBuild.txt.fr.xlf index 2d08c442466..8cb98ce31f2 100644 --- a/src/fsharp/FSharp.Build/xlf/FSBuild.txt.fr.xlf +++ b/src/fsharp/FSharp.Build/xlf/FSBuild.txt.fr.xlf @@ -1,10 +1,10 @@ - + - ToolPath is unknown; specify the path to fsc.exe as the ToolPath property. - ToolPath inconnu ; spécifiez le chemin d'accès de fsc.exe en tant que propriété ToolPath. + ToolPath is unknown; specify the path to the tool. + ToolPath is unknown; specify the path to the tool. diff --git a/src/fsharp/FSharp.Build/xlf/FSBuild.txt.it.xlf b/src/fsharp/FSharp.Build/xlf/FSBuild.txt.it.xlf index f4df6a25059..7f8dd0509fa 100644 --- a/src/fsharp/FSharp.Build/xlf/FSBuild.txt.it.xlf +++ b/src/fsharp/FSharp.Build/xlf/FSBuild.txt.it.xlf @@ -1,10 +1,10 @@ - + - ToolPath is unknown; specify the path to fsc.exe as the ToolPath property. - ToolPath sconosciuto. Specificare il percorso di fsc.exe come proprietà ToolPath. + ToolPath is unknown; specify the path to the tool. + ToolPath is unknown; specify the path to the tool. diff --git a/src/fsharp/FSharp.Build/xlf/FSBuild.txt.ja.xlf b/src/fsharp/FSharp.Build/xlf/FSBuild.txt.ja.xlf index 6c430cb50b0..b87334379e5 100644 --- a/src/fsharp/FSharp.Build/xlf/FSBuild.txt.ja.xlf +++ b/src/fsharp/FSharp.Build/xlf/FSBuild.txt.ja.xlf @@ -1,10 +1,10 @@ - + - ToolPath is unknown; specify the path to fsc.exe as the ToolPath property. - ToolPath が不明です。fsc.exe へのパスを ToolPath プロパティとして指定してください。 + ToolPath is unknown; specify the path to the tool. + ToolPath is unknown; specify the path to the tool. diff --git a/src/fsharp/FSharp.Build/xlf/FSBuild.txt.ko.xlf b/src/fsharp/FSharp.Build/xlf/FSBuild.txt.ko.xlf index 7b689385a7e..9e0c6d16dbb 100644 --- a/src/fsharp/FSharp.Build/xlf/FSBuild.txt.ko.xlf +++ b/src/fsharp/FSharp.Build/xlf/FSBuild.txt.ko.xlf @@ -1,10 +1,10 @@ - + - ToolPath is unknown; specify the path to fsc.exe as the ToolPath property. - ToolPath를 알 수 없습니다. fsc.exe의 경로를 ToolPath 속성으로 지정하세요. + ToolPath is unknown; specify the path to the tool. + ToolPath is unknown; specify the path to the tool. diff --git a/src/fsharp/FSharp.Build/xlf/FSBuild.txt.pl.xlf b/src/fsharp/FSharp.Build/xlf/FSBuild.txt.pl.xlf index d3a0e4f9761..a75fe926a6d 100644 --- a/src/fsharp/FSharp.Build/xlf/FSBuild.txt.pl.xlf +++ b/src/fsharp/FSharp.Build/xlf/FSBuild.txt.pl.xlf @@ -1,10 +1,10 @@ - + - ToolPath is unknown; specify the path to fsc.exe as the ToolPath property. - Właściwość ToolPath jest nieznana. Określ ścieżkę do pliku fsc.exe jako właściwość ToolPath. + ToolPath is unknown; specify the path to the tool. + ToolPath is unknown; specify the path to the tool. diff --git a/src/fsharp/FSharp.Build/xlf/FSBuild.txt.pt-BR.xlf b/src/fsharp/FSharp.Build/xlf/FSBuild.txt.pt-BR.xlf index 4bdb28cd9f7..b084cd8db2d 100644 --- a/src/fsharp/FSharp.Build/xlf/FSBuild.txt.pt-BR.xlf +++ b/src/fsharp/FSharp.Build/xlf/FSBuild.txt.pt-BR.xlf @@ -1,10 +1,10 @@ - + - ToolPath is unknown; specify the path to fsc.exe as the ToolPath property. - ToolPath é desconhecido; especifique o caminho para fsc.exe como propriedade de ToolPath. + ToolPath is unknown; specify the path to the tool. + ToolPath is unknown; specify the path to the tool. diff --git a/src/fsharp/FSharp.Build/xlf/FSBuild.txt.ru.xlf b/src/fsharp/FSharp.Build/xlf/FSBuild.txt.ru.xlf index ed2d4a5d09f..2b2f588c6ee 100644 --- a/src/fsharp/FSharp.Build/xlf/FSBuild.txt.ru.xlf +++ b/src/fsharp/FSharp.Build/xlf/FSBuild.txt.ru.xlf @@ -1,10 +1,10 @@ - + - ToolPath is unknown; specify the path to fsc.exe as the ToolPath property. - Неизвестное значение свойства ToolPath; укажите в качестве значения свойства ToolPath путь к файлу fsc.exe. + ToolPath is unknown; specify the path to the tool. + ToolPath is unknown; specify the path to the tool. diff --git a/src/fsharp/FSharp.Build/xlf/FSBuild.txt.tr.xlf b/src/fsharp/FSharp.Build/xlf/FSBuild.txt.tr.xlf index b2332af2b82..1653136e1ad 100644 --- a/src/fsharp/FSharp.Build/xlf/FSBuild.txt.tr.xlf +++ b/src/fsharp/FSharp.Build/xlf/FSBuild.txt.tr.xlf @@ -1,10 +1,10 @@ - + - ToolPath is unknown; specify the path to fsc.exe as the ToolPath property. - ToolPath bilinmiyor; fsc.exe yolunu ToolPath özelliği olarak belirtin. + ToolPath is unknown; specify the path to the tool. + ToolPath is unknown; specify the path to the tool. diff --git a/src/fsharp/FSharp.Build/xlf/FSBuild.txt.zh-Hans.xlf b/src/fsharp/FSharp.Build/xlf/FSBuild.txt.zh-Hans.xlf index d224ab41b5b..6d4f74c9d3f 100644 --- a/src/fsharp/FSharp.Build/xlf/FSBuild.txt.zh-Hans.xlf +++ b/src/fsharp/FSharp.Build/xlf/FSBuild.txt.zh-Hans.xlf @@ -3,8 +3,8 @@ - ToolPath is unknown; specify the path to fsc.exe as the ToolPath property. - ToolPath 未知;将 fsc.exe 的路径指定为 ToolPath 属性。 + ToolPath is unknown; specify the path to the tool. + ToolPath is unknown; specify the path to the tool. diff --git a/src/fsharp/FSharp.Build/xlf/FSBuild.txt.zh-Hant.xlf b/src/fsharp/FSharp.Build/xlf/FSBuild.txt.zh-Hant.xlf index 94447e27905..96863db1dda 100644 --- a/src/fsharp/FSharp.Build/xlf/FSBuild.txt.zh-Hant.xlf +++ b/src/fsharp/FSharp.Build/xlf/FSBuild.txt.zh-Hant.xlf @@ -1,10 +1,10 @@ - + - ToolPath is unknown; specify the path to fsc.exe as the ToolPath property. - 未知的 ToolPath,請指定 fsc.exe 的路徑做為 ToolPath 屬性。 + ToolPath is unknown; specify the path to the tool. + ToolPath is unknown; specify the path to the tool. diff --git a/src/fsharp/FSharp.Compiler.Interactive.Settings/FSharp.Compiler.Interactive.Settings.fsproj b/src/fsharp/FSharp.Compiler.Interactive.Settings/FSharp.Compiler.Interactive.Settings.fsproj index 5e0d312c22a..e077d488a16 100644 --- a/src/fsharp/FSharp.Compiler.Interactive.Settings/FSharp.Compiler.Interactive.Settings.fsproj +++ b/src/fsharp/FSharp.Compiler.Interactive.Settings/FSharp.Compiler.Interactive.Settings.fsproj @@ -1,19 +1,15 @@ - - - $(MSBuildProjectDirectory)\..\.. - FSharp - true - - + + - Debug - AnyCPU - {649FA588-F02E-457C-9FCF-87E46407481E} Library + net46;netstandard1.6 FSharp.Compiler.Interactive.Settings - 512 + $(NoWarn);45;55;62;75;1182;1204 + true + $(OtherFlags) --maxerrors:20 --extraoptimizationloops:1 + true @@ -30,19 +26,12 @@ - - - - - - - - + + + - - {DED3BBD7-53F4-428A-8C9F-27968E768605} - FSharp.Core - + + diff --git a/src/fsharp/FSharp.Compiler.Interactive.Settings/project.json b/src/fsharp/FSharp.Compiler.Interactive.Settings/project.json deleted file mode 100644 index 90a6faf3ff3..00000000000 --- a/src/fsharp/FSharp.Compiler.Interactive.Settings/project.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "dependencies": { - "NETStandard.Library": "1.6.1", - "System.Linq.Expressions": "4.3.0", - "System.Reflection.TypeExtensions": "4.3.0", - "System.Runtime.Loader": "4.3.0", - "System.Threading.Thread": "4.3.0" - }, - "runtimes": { - "win7-x86": { }, - "win7-x64": { }, - "osx.10.11-x64": { }, - "ubuntu.14.04-x64": { } - }, - "frameworks": { - "netstandard1.6": { } - } -} diff --git a/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj b/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj index 0c72713522c..2a38e3d10d1 100644 --- a/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj +++ b/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj @@ -1,40 +1,41 @@ - - - $(MSBuildProjectDirectory)\..\.. - FSharp - true - - + + - Debug - AnyCPU Library + net46;netstandard1.6 FSharp.Compiler.Private - COMPILER;$(DefineConstants) - $(NoWarn);62;9 - {2E4D67B4-522D-4CF7-97E4-BA940F0B18F3} + $(NoWarn);45;55;62;75;1204 true - 0x06800000 - $(OtherFlags) /warnon:1182 + $(DefineConstants);COMPILER + $(DefineConstants);MSBUILD_AT_LEAST_15 + $(OtherFlags) --warnon:1182 --maxerrors:20 --extraoptimizationloops:1 + true + true + true + + + + + full - - + + + $(BaseOutputPath)\$(Configuration)\$(TargetFramework) + - - - - - - - + + + + + + + - - - + @@ -55,6 +56,7 @@ + FSComp.txt @@ -223,7 +225,7 @@ AbsIL\ilmorph.fs - + AbsIL\ilsign.fs @@ -660,49 +662,45 @@ Misc/LegacyHostedCompilerForTesting.fs + - - - - + - - - - - + + - - ..\..\..\packages\System.Reflection.Metadata.$(SystemReflectionMetadataPackageVersion)\lib\portable-net45+win8\System.Reflection.Metadata.dll - - - ..\..\..\packages\System.Collections.Immutable.$(SystemCollectionsImmutablePackageVersion)\lib\netstandard1.0\System.Collections.Immutable.dll - - - ..\..\..\packages\System.ValueTuple.$(SystemValueTuplePackageVersion)\lib\netstandard1.0\System.ValueTuple.dll - - - ..\..\..\packages\System.IO.Compression.$(SystemIoCompressionPackageVersion)\lib\net46\System.IO.Compression.dll - + + + + + - - - $(FSharpSourcesRoot)\..\packages\Microsoft.Build.Framework.$(MicrosoftBuildFrameworkPackageVersion)\lib\net46\Microsoft.Build.Framework.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.Build.$(MicrosoftBuildPackageVersion)\lib\net46\Microsoft.Build.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.Build.Utilities.Core.$(MicrosoftBuildUtilitiesCorePackageVersion)\lib\net46\Microsoft.Build.Utilities.Core.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.Build.Tasks.Core.$(MicrosoftBuildTasksCorePackageVersion)\lib\net46\Microsoft.Build.Tasks.Core.dll - + + + + - - {DED3BBD7-53F4-428A-8C9F-27968E768605} - FSharp.Core - + + + + + + + + + + + + + + + + + + + + + diff --git a/src/fsharp/FSharp.Compiler.Private/project.json b/src/fsharp/FSharp.Compiler.Private/project.json deleted file mode 100644 index b9bf7861ae6..00000000000 --- a/src/fsharp/FSharp.Compiler.Private/project.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "dependencies": { - "NETStandard.Library": "1.6.1", - "System.Collections.Immutable": "1.5.0", - "System.Diagnostics.Process": "4.3.0", - "System.Diagnostics.TraceSource": "4.3.0", - "System.Linq.Expressions": "4.3.0", - "System.Linq.Queryable": "4.3.0", - "System.Net.Requests": "4.3.0", - "System.Reflection.Emit": "4.3.0", - "System.Reflection.Metadata": "1.6.0", - "System.Reflection.TypeExtensions": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.InteropServices": "4.3.0", - "System.Runtime.Loader": "4.3.0", - "System.Security.Cryptography.Algorithms": "4.3.0", - "System.Threading.Tasks.Parallel": "4.3.0", - "System.Threading.Thread": "4.3.0", - "System.Threading.ThreadPool": "4.3.0", - "System.ValueTuple": "4.3.0" - }, - "runtimes": { - "win7-x86": { }, - "win7-x64": { }, - "osx.10.11-x64": { }, - "ubuntu.14.04-x64": { } - }, - "frameworks": { - "netstandard1.6": { - "imports": "portable-net45+win8" - } - } -} - diff --git a/src/fsharp/FSharp.Compiler.Server.Shared/FSharp.Compiler.Server.Shared.fsproj b/src/fsharp/FSharp.Compiler.Server.Shared/FSharp.Compiler.Server.Shared.fsproj index 91eadb4875e..4feaf0da4e1 100644 --- a/src/fsharp/FSharp.Compiler.Server.Shared/FSharp.Compiler.Server.Shared.fsproj +++ b/src/fsharp/FSharp.Compiler.Server.Shared/FSharp.Compiler.Server.Shared.fsproj @@ -1,42 +1,30 @@ - + + - $(MSBuildProjectDirectory)\..\.. - FSharp - true - - - - Debug - AnyCPU - {d5870cf0-ed51-4cbc-b3d7-6f56da84ac06} - Library + net46 FSharp.Compiler.Server.Shared - v4.6 + true + + - - - - - - - + + + + - - {DED3BBD7-53F4-428A-8C9F-27968E768605} - FSharp.Core - + - + diff --git a/src/fsharp/FSharp.Compiler.nuget/Directory.Build.props b/src/fsharp/FSharp.Compiler.nuget/Directory.Build.props new file mode 100644 index 00000000000..8093275dba0 --- /dev/null +++ b/src/fsharp/FSharp.Compiler.nuget/Directory.Build.props @@ -0,0 +1,11 @@ + + + + + + + netcoreapp2.1 + Microsoft.FSharp.Compiler.nuspec + + + diff --git a/src/fsharp/FSharp.Compiler.nuget/Directory.Build.targets b/src/fsharp/FSharp.Compiler.nuget/Directory.Build.targets new file mode 100644 index 00000000000..2721c93a906 --- /dev/null +++ b/src/fsharp/FSharp.Compiler.nuget/Directory.Build.targets @@ -0,0 +1,18 @@ + + + + -rtm-$(NuGetPackageVersionSuffix) + $(FSPackageVersion)$(PreReleaseSuffix) + + + + + + + + + + + + + diff --git a/src/fsharp/FSharp.Compiler.nuget/FSharp.Compiler.Template.nuget.props b/src/fsharp/FSharp.Compiler.nuget/FSharp.Compiler.Template.nuget.props deleted file mode 100644 index 4bb58eff671..00000000000 --- a/src/fsharp/FSharp.Compiler.nuget/FSharp.Compiler.Template.nuget.props +++ /dev/null @@ -1,21 +0,0 @@ - - - $(MSBuildProjectDirectory)\..\.. - rc - obj\BuildVersionFile.props - - - - - - https://github.com/Microsoft/visualfsharp/blob/master/License.txt - https://github.com/Microsoft/visualfsharp - Microsoft and F# Software Foundation - Visual F# Compiler FSharp functional programming - $(FSharpSourcesRoot)\..\$(Configuration)\coreclr\bin - -rtm-$(NuGetPackageVersionSuffix) - $(FSPackageVersion)$(PreReleaseSuffix) - - - - diff --git a/src/fsharp/FSharp.Compiler.nuget/FSharp.Compiler.Template.nuget.targets b/src/fsharp/FSharp.Compiler.nuget/FSharp.Compiler.Template.nuget.targets deleted file mode 100644 index ec624f3287a..00000000000 --- a/src/fsharp/FSharp.Compiler.nuget/FSharp.Compiler.Template.nuget.targets +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - fsi - {d0e98c0d-490b-4c61-9329-0862f6e87645} - True - - - Fsc - {C94C257C-3C0A-4858-B5D8-D746498D1F08} - True - - - - - - - - - - - - - - - $(GitHeadSha) - [developer build] - -prop "licenseUrl=$(PackageLicenceUrl)" -prop "version=$(PackageVersion)" -prop "authors=$(PackageAuthors)" -prop "projectUrl=$(PackageProjectUrl)" -prop "tags=$(PackageTags)" -prop "githeadsha=$(NormalizedGitHeadSha)" - - - - - - - - - diff --git a/src/fsharp/FSharp.Compiler.nuget/Microsoft.FSharp.Compiler.Prerelease.csproj b/src/fsharp/FSharp.Compiler.nuget/Microsoft.FSharp.Compiler.Prerelease.csproj new file mode 100644 index 00000000000..692e5aba1b2 --- /dev/null +++ b/src/fsharp/FSharp.Compiler.nuget/Microsoft.FSharp.Compiler.Prerelease.csproj @@ -0,0 +1,8 @@ + + + + Microsoft.FSharp.Compiler + true + + + diff --git a/src/fsharp/FSharp.Compiler.nuget/Microsoft.FSharp.Compiler.csproj b/src/fsharp/FSharp.Compiler.nuget/Microsoft.FSharp.Compiler.csproj new file mode 100644 index 00000000000..abb19e418fe --- /dev/null +++ b/src/fsharp/FSharp.Compiler.nuget/Microsoft.FSharp.Compiler.csproj @@ -0,0 +1,8 @@ + + + + Microsoft.FSharp.Compiler + false + + + diff --git a/src/fsharp/FSharp.Compiler.nuget/Microsoft.FSharp.Compiler.nuget.proj b/src/fsharp/FSharp.Compiler.nuget/Microsoft.FSharp.Compiler.nuget.proj deleted file mode 100644 index 53ed79e8acb..00000000000 --- a/src/fsharp/FSharp.Compiler.nuget/Microsoft.FSharp.Compiler.nuget.proj +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/src/fsharp/FSharp.Compiler.nuget/Microsoft.FSharp.Compiler.nuspec b/src/fsharp/FSharp.Compiler.nuget/Microsoft.FSharp.Compiler.nuspec index 4130025ffbe..f10712a641e 100644 --- a/src/fsharp/FSharp.Compiler.nuget/Microsoft.FSharp.Compiler.nuspec +++ b/src/fsharp/FSharp.Compiler.nuget/Microsoft.FSharp.Compiler.nuspec @@ -1,10 +1,10 @@ - Microsoft.FSharp.Compiler + $packageId$ - .NET Core compatible version of the fsharp compiler fsc.exe. - Supported Platforms: - .NET Core (.netstandard1.6). + .NET Core compatible version of the F# compiler fsc.exe. + Supported Platforms: - .NET Core (.netstandard2.0). Commit hash: $githeadsha$. en-US @@ -15,70 +15,69 @@ $projectUrl$ $tags$ - - - + + + - - - - - - - + + + + + + - - - - - - - + + + + + + + - - - - - - + + + + + + - - - - - - + + + + + + - - - - - - + + + + + + - - - - - - + + + + + + - - - - + + + + diff --git a/src/fsharp/FSharp.Compiler.nuget/Program.fs b/src/fsharp/FSharp.Compiler.nuget/Program.fs deleted file mode 100644 index 4c6ddb51f96..00000000000 --- a/src/fsharp/FSharp.Compiler.nuget/Program.fs +++ /dev/null @@ -1,6 +0,0 @@ -namespace DummyMain - -module DummyMain = - -[] -let main _args = 0 \ No newline at end of file diff --git a/src/fsharp/FSharp.Compiler.nuget/Testing.FSharp.Compiler.csproj b/src/fsharp/FSharp.Compiler.nuget/Testing.FSharp.Compiler.csproj new file mode 100644 index 00000000000..aaee9c73942 --- /dev/null +++ b/src/fsharp/FSharp.Compiler.nuget/Testing.FSharp.Compiler.csproj @@ -0,0 +1,8 @@ + + + + Testing.FSharp.Compiler + true + + + diff --git a/src/fsharp/FSharp.Compiler.nuget/Testing.FSharp.Compiler.nuget.proj b/src/fsharp/FSharp.Compiler.nuget/Testing.FSharp.Compiler.nuget.proj deleted file mode 100644 index dc9f19add52..00000000000 --- a/src/fsharp/FSharp.Compiler.nuget/Testing.FSharp.Compiler.nuget.proj +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/src/fsharp/FSharp.Core.nuget/FSharp.Core.nuget.proj b/src/fsharp/FSharp.Core.nuget/FSharp.Core.nuget.proj deleted file mode 100644 index 550d2fb7245..00000000000 --- a/src/fsharp/FSharp.Core.nuget/FSharp.Core.nuget.proj +++ /dev/null @@ -1,76 +0,0 @@ - - - $(MSBuildProjectDirectory)\..\.. - rc - obj\BuildVersionFile.props - - - - - - https://github.com/Microsoft/visualfsharp/blob/master/License.txt - https://github.com/Microsoft/visualfsharp - Microsoft and F# Software Foundation - Visual F# Compiler FSharp functional programming - Microsoft and F# Software Foundation - (C) Microsoft Corporation. All rights reserved. - true - $(FSharpSourcesRoot)\..\$(Configuration)\artifacts - - - - - - - - - - FSharp.Core - {C94C257C-3C0A-4858-B5D8-D746498D1F08} - True - - - - - - - - - - - - - - - - - - - - X.X.XXX - - $(FSharpCoreFrozenPortableTargetPackageVersion) - $(FSharpCoreFrozenPortableTargetMajorVersion) - - $(FSCorePackageVersion) - $(FSCoreMajorVersion) - - - $(GitHeadSha) - [developer build] - -prop "licenseUrl=$(PackageLicenceUrl)" -prop "version=$(PackageVersion)" -prop "authors=$(PackageAuthors)" -prop "projectUrl=$(PackageProjectUrl)" -prop "tags=$(PackageTags)" -prop "githeadsha=$(NormalizedGitHeadSha)" -prop "owners=$(PackageOwners)" -prop "copyright=$(PackageCopyright)" -prop "requireLicenseAcceptance=$(PackageRequireLicenceAcceptence)" - - - - - - - - - - diff --git a/src/fsharp/FSharp.Core.nuget/Microsoft.Portable.FSharp.Core.nuspec b/src/fsharp/FSharp.Core.nuget/Microsoft.Portable.FSharp.Core.nuspec deleted file mode 100644 index 7ca41bb2168..00000000000 --- a/src/fsharp/FSharp.Core.nuget/Microsoft.Portable.FSharp.Core.nuspec +++ /dev/null @@ -1,27 +0,0 @@ - - - - - Microsoft.Portable.FSharp.Core - Frozen portable profiles - en-US - false - $version$ - $authors$ - $licenseUrl$ - $projectUrl$ - $tags$ - - - - - - - - - - - - - - diff --git a/src/fsharp/FSharp.Core/Directory.Build.props b/src/fsharp/FSharp.Core/Directory.Build.props new file mode 100644 index 00000000000..cee6fa763d9 --- /dev/null +++ b/src/fsharp/FSharp.Core/Directory.Build.props @@ -0,0 +1,14 @@ + + + + + + + + $(NuspecProperties); + fsCoreMajorVersion=$(FSCoreMajorVersion); + fsPackageMajorVersion=$(FSPackageMajorVersion); + + + + diff --git a/src/fsharp/FSharp.Core/Directory.Build.targets b/src/fsharp/FSharp.Core/Directory.Build.targets new file mode 100644 index 00000000000..8bf68e8bc7b --- /dev/null +++ b/src/fsharp/FSharp.Core/Directory.Build.targets @@ -0,0 +1,6 @@ + + + + + + diff --git a/src/fsharp/FSharp.Core/FSharp.Core.fsproj b/src/fsharp/FSharp.Core/FSharp.Core.fsproj index 8681b9c4fc5..6ddda3f2e7e 100644 --- a/src/fsharp/FSharp.Core/FSharp.Core.fsproj +++ b/src/fsharp/FSharp.Core/FSharp.Core.fsproj @@ -1,48 +1,24 @@ - + - $(MSBuildProjectDirectory)\..\.. - FSharp - LKG - v4.5 - - - - - - AnyCPU - {DED3BBD7-53F4-428A-8C9F-27968E768605} Library + net45;netstandard1.6 FSharp.Core - FSHARP_CORE;$(DefineConstants) - BUILDING_WITH_LKG;$(DefineConstants) + FSharp.Core + $(FSCorePackageVersion) + FSharp.Core.nuspec $(NoWarn);45;55;62;75;1204 - 0x05000000 - true true - $(OtherFlags) --warnon:1182 --compiling-fslib --extraoptimizationloops:1 - $(OtherFlags) --warnon:3218 - $(OtherFlags) --maxerrors:20 - $(OtherFlags) --warnon:1182 --compiling-fslib --maxerrors:20 --extraoptimizationloops:1 - $(OtherFlags) --compiling-fslib-40 + $(DefineConstants);FSHARP_CORE + BUILDING_WITH_LKG;$(DefineConstants) + $(OtherFlags) --warnon:1182 --compiling-fslib --compiling-fslib-40 --maxerrors:20 --extraoptimizationloops:1 + true - - - - PreserveNewest - - - - - false - - - - + true true false @@ -55,9 +31,6 @@ Primitives/prim-types-prelude.fs - - Primitives/SR.fs - Primitives/prim-types.fsi @@ -246,22 +219,17 @@ - - - - - false - + + + + - - + + + - - - - @@ -275,20 +243,4 @@ - - - - -prop "licenseUrl=$(PackageLicenceUrl)" -prop "version=$(FSharpCoreFrozenPortablePackageVersion)" -prop "authors=$(PackageAuthors)" -prop "projectUrl=$(PackageProjectUrl)" -prop "tags=$(PackageTags)" - - - - - - - diff --git a/src/fsharp/FSharp.Core.nuget/FSharp.Core.nuspec b/src/fsharp/FSharp.Core/FSharp.Core.nuspec similarity index 65% rename from src/fsharp/FSharp.Core.nuget/FSharp.Core.nuspec rename to src/fsharp/FSharp.Core/FSharp.Core.nuspec index d71634de277..443388a8278 100644 --- a/src/fsharp/FSharp.Core.nuget/FSharp.Core.nuspec +++ b/src/fsharp/FSharp.Core/FSharp.Core.nuspec @@ -1,12 +1,11 @@ - FSharp.Core - FSharp.Core for F# 4.5 - FSharp.Core for F# 4.5 + FSharp.Core for F# $fsCoreMajorVersion$ + FSharp.Core for F# $fsCoreMajorVersion$ - FSharp.Core redistributables from Visual F# Tools version 10.2 For F# 4.5 + FSharp.Core redistributables from Visual F# Tools version $fsPackageMajorVersion$ For F# $fsCoreMajorVersion$ Supported Platforms: .NET Framework 4.5+ (net45) netstandard1.6 (netstandard1.6) @@ -22,7 +21,7 @@ $projectUrl$ http://fsharp.org/img/logo.png $tags$ - $requireLicenseAcceptance$ + true en-US @@ -57,18 +56,18 @@ - - - - + + + + - - - - + + + + - - + + diff --git a/src/fsharp/FSharp.Core/array.fs b/src/fsharp/FSharp.Core/array.fs index 29713557fc9..5531a690038 100644 --- a/src/fsharp/FSharp.Core/array.fs +++ b/src/fsharp/FSharp.Core/array.fs @@ -1243,6 +1243,12 @@ namespace Microsoft.FSharp.Collections elif array.Length = 0 then invalidArg "array" LanguagePrimitives.ErrorStrings.InputSequenceEmptyString else invalidArg "array" (SR.GetString(SR.inputSequenceTooLong)) + [] + let tryExactlyOne (array:'T[]) = + checkNonNull "array" array + if array.Length = 1 then Some array.[0] + else None + let transposeArrays (array:'T[][]) = let len = array.Length if len = 0 then Microsoft.FSharp.Primitives.Basics.Array.zeroCreateUnchecked 0 else diff --git a/src/fsharp/FSharp.Core/array.fsi b/src/fsharp/FSharp.Core/array.fsi index ad9e82f27fb..5ede87a3c6d 100644 --- a/src/fsharp/FSharp.Core/array.fsi +++ b/src/fsharp/FSharp.Core/array.fsi @@ -243,6 +243,16 @@ namespace Microsoft.FSharp.Collections [] val exactlyOne: array:'T[] -> 'T + /// Returns the only element of the array or None if array is empty or contains more than one element. + /// + /// The input array. + /// + /// The only element of the array or None. + /// + /// Thrown when the input array is null. + [] + val tryExactlyOne: array:'T[] -> 'T option + /// Returns a new list with the distinct elements of the input array which do not appear in the itemsToExclude sequence, /// using generic hash and equality comparisons to compare values. /// diff --git a/src/fsharp/FSharp.Core/fslib-extra-pervasives.fs b/src/fsharp/FSharp.Core/fslib-extra-pervasives.fs index 63cb2d80718..b4271f4a267 100644 --- a/src/fsharp/FSharp.Core/fslib-extra-pervasives.fs +++ b/src/fsharp/FSharp.Core/fslib-extra-pervasives.fs @@ -43,7 +43,9 @@ module ExtraTopLevelOperators = [] [>)>] type DictImpl<'SafeKey,'Key,'T>(t : Dictionary<'SafeKey,'T>, makeSafeKey : 'Key->'SafeKey, getKey : 'SafeKey->'Key) = - +#if NETSTANDARD + static let emptyEnumerator = (Array.empty> :> seq<_>).GetEnumerator() +#endif member x.Count = t.Count // Give a read-only view of the dictionary @@ -110,8 +112,34 @@ module ExtraTopLevelOperators = member s.GetEnumerator() = // We use an array comprehension here instead of seq {} as otherwise we get incorrect // IEnumerator.Reset() and IEnumerator.Current semantics. + // Coreclr has a bug with SZGenericEnumerators --- implement a correct enumerator. On desktop use the desktop implementation because it's ngened. +#if !NETSTANDARD let kvps = [| for (KeyValue (k,v)) in t -> KeyValuePair (getKey k, v) |] :> seq<_> kvps.GetEnumerator() +#else + let endIndex = t.Count + if endIndex = 0 then emptyEnumerator + else + let kvps = [| for (KeyValue (k,v)) in t -> KeyValuePair (getKey k, v) |] + let mutable index = -1 + let current () = + if index < 0 then raise <| InvalidOperationException(SR.GetString(SR.enumerationNotStarted)) + if index >= endIndex then raise <| InvalidOperationException(SR.GetString(SR.enumerationAlreadyFinished)) + kvps.[index] + + {new IEnumerator<_> with + member __.Current = current () + interface System.Collections.IEnumerator with + member __.Current = box(current()) + member __.MoveNext() = + if index < endIndex then + index <- index + 1 + index < endIndex + else false + member __.Reset() = index <- -1 + interface System.IDisposable with + member self.Dispose() = () } +#endif interface System.Collections.IEnumerable with member s.GetEnumerator() = diff --git a/src/fsharp/FSharp.Core/list.fs b/src/fsharp/FSharp.Core/list.fs index f02ceffcff6..6092567f1f4 100644 --- a/src/fsharp/FSharp.Core/list.fs +++ b/src/fsharp/FSharp.Core/list.fs @@ -671,6 +671,12 @@ namespace Microsoft.FSharp.Collections | [] -> invalidArg "source" LanguagePrimitives.ErrorStrings.InputSequenceEmptyString | _ -> invalidArg "source" (SR.GetString(SR.inputSequenceTooLong)) + [] + let tryExactlyOne (list : list<_>) = + match list with + | [x] -> Some x + | _ -> None + [] let transpose (lists : seq<'T list>) = checkNonNull "lists" lists diff --git a/src/fsharp/FSharp.Core/list.fsi b/src/fsharp/FSharp.Core/list.fsi index d42186e73d9..aba9b3505b7 100644 --- a/src/fsharp/FSharp.Core/list.fsi +++ b/src/fsharp/FSharp.Core/list.fsi @@ -172,6 +172,14 @@ namespace Microsoft.FSharp.Collections [] val exactlyOne: list:'T list -> 'T + /// Returns the only element of the list or None if it is empty or contains more than one element. + /// + /// The input list. + /// + /// The only element of the list or None. + [] + val tryExactlyOne: list:'T list -> 'T option + /// Tests if any element of the list satisfies the given predicate. /// /// The predicate is applied to the elements of the input list. If any application diff --git a/src/fsharp/FSharp.Core/map.fs b/src/fsharp/FSharp.Core/map.fs index 8efc49a1a41..7ef250a0ee9 100644 --- a/src/fsharp/FSharp.Core/map.fs +++ b/src/fsharp/FSharp.Core/map.fs @@ -558,7 +558,7 @@ namespace Microsoft.FSharp.Collections for (KeyValue(x,y)) in this do res <- combineHash res (hash x) res <- combineHash res (Unchecked.hash y) - abs res + res override this.Equals(that) = match that with @@ -744,4 +744,4 @@ namespace Microsoft.FSharp.Collections let empty<'Key,'Value when 'Key : comparison> = Map<'Key,'Value>.Empty [] - let count (table:Map<_,_>) = table.Count \ No newline at end of file + let count (table:Map<_,_>) = table.Count diff --git a/src/fsharp/FSharp.Core/option.fs b/src/fsharp/FSharp.Core/option.fs index f963c01fc79..552d1c9231f 100644 --- a/src/fsharp/FSharp.Core/option.fs +++ b/src/fsharp/FSharp.Core/option.fs @@ -2,91 +2,177 @@ namespace Microsoft.FSharp.Core - open Microsoft.FSharp.Core.Operators +open Microsoft.FSharp.Core.Operators - [] - module Option = +[] +module Option = - [] - let get option = match option with None -> invalidArg "option" (SR.GetString(SR.optionValueWasNone)) | Some x -> x + [] + let get option = match option with None -> invalidArg "option" (SR.GetString(SR.optionValueWasNone)) | Some x -> x - [] - let inline isSome option = match option with None -> false | Some _ -> true + [] + let inline isSome option = match option with None -> false | Some _ -> true - [] - let inline isNone option = match option with None -> true | Some _ -> false + [] + let inline isNone option = match option with None -> true | Some _ -> false - [] - let defaultValue value option = match option with None -> value | Some v -> v + [] + let defaultValue value option = match option with None -> value | Some v -> v - [] - let defaultWith defThunk option = match option with None -> defThunk () | Some v -> v + [] + let defaultWith defThunk option = match option with None -> defThunk () | Some v -> v - [] - let orElse ifNone option = match option with None -> ifNone | Some _ -> option + [] + let orElse ifNone option = match option with None -> ifNone | Some _ -> option - [] - let orElseWith ifNoneThunk option = match option with None -> ifNoneThunk () | Some _ -> option + [] + let orElseWith ifNoneThunk option = match option with None -> ifNoneThunk () | Some _ -> option - [] - let count option = match option with None -> 0 | Some _ -> 1 + [] + let count option = match option with None -> 0 | Some _ -> 1 - [] - let fold<'T,'State> folder (state:'State) (option: option<'T>) = match option with None -> state | Some x -> folder state x + [] + let fold<'T,'State> folder (state:'State) (option: option<'T>) = match option with None -> state | Some x -> folder state x - [] - let foldBack<'T,'State> folder (option: option<'T>) (state:'State) = match option with None -> state | Some x -> folder x state + [] + let foldBack<'T,'State> folder (option: option<'T>) (state:'State) = match option with None -> state | Some x -> folder x state - [] - let exists predicate option = match option with None -> false | Some x -> predicate x + [] + let exists predicate option = match option with None -> false | Some x -> predicate x - [] - let forall predicate option = match option with None -> true | Some x -> predicate x + [] + let forall predicate option = match option with None -> true | Some x -> predicate x - [] - let inline contains value option = match option with None -> false | Some v -> v = value + [] + let inline contains value option = match option with None -> false | Some v -> v = value - [] - let iter action option = match option with None -> () | Some x -> action x + [] + let iter action option = match option with None -> () | Some x -> action x - [] - let map mapping option = match option with None -> None | Some x -> Some (mapping x) + [] + let map mapping option = match option with None -> None | Some x -> Some (mapping x) - [] - let map2 mapping option1 option2 = - match option1, option2 with - | Some x, Some y -> Some (mapping x y) - | _ -> None + [] + let map2 mapping option1 option2 = + match option1, option2 with + | Some x, Some y -> Some (mapping x y) + | _ -> None - [] - let map3 mapping option1 option2 option3 = - match option1, option2, option3 with - | Some x, Some y, Some z -> Some (mapping x y z) - | _ -> None + [] + let map3 mapping option1 option2 option3 = + match option1, option2, option3 with + | Some x, Some y, Some z -> Some (mapping x y z) + | _ -> None - [] - let bind binder option = match option with None -> None | Some x -> binder x + [] + let bind binder option = match option with None -> None | Some x -> binder x - [] - let flatten option = match option with None -> None | Some x -> x + [] + let flatten option = match option with None -> None | Some x -> x - [] - let filter predicate option = match option with None -> None | Some x -> if predicate x then Some x else None + [] + let filter predicate option = match option with None -> None | Some x -> if predicate x then Some x else None - [] - let toArray option = match option with None -> [| |] | Some x -> [| x |] + [] + let toArray option = match option with None -> [| |] | Some x -> [| x |] - [] - let toList option = match option with None -> [ ] | Some x -> [ x ] + [] + let toList option = match option with None -> [ ] | Some x -> [ x ] - [] - let toNullable option = match option with None -> System.Nullable() | Some v -> System.Nullable(v) + [] + let toNullable option = match option with None -> System.Nullable() | Some v -> System.Nullable(v) - [] - let ofNullable (value:System.Nullable<'T>) = if value.HasValue then Some value.Value else None + [] + let ofNullable (value:System.Nullable<'T>) = if value.HasValue then Some value.Value else None - [] - let ofObj value = match value with null -> None | _ -> Some value + [] + let ofObj value = match value with null -> None | _ -> Some value - [] - let toObj value = match value with None -> null | Some x -> x + [] + let toObj value = match value with None -> null | Some x -> x + +module ValueOption = + + [] + let get voption = match voption with ValueNone -> invalidArg "option" (SR.GetString(SR.optionValueWasNone)) | ValueSome x -> x + + [] + let inline isSome voption = match voption with ValueNone -> false | ValueSome _ -> true + + [] + let inline isNone voption = match voption with ValueNone -> true | ValueSome _ -> false + + [] + let defaultValue value voption = match voption with ValueNone -> value | ValueSome v -> v + + [] + let defaultWith defThunk voption = match voption with ValueNone -> defThunk () | ValueSome v -> v + + [] + let orElse ifNone voption = match voption with ValueNone -> ifNone | ValueSome _ -> voption + + [] + let orElseWith ifNoneThunk voption = match voption with ValueNone -> ifNoneThunk () | ValueSome _ -> voption + + [] + let count voption = match voption with ValueNone -> 0 | ValueSome _ -> 1 + + [] + let fold<'T,'State> folder (state:'State) (voption: voption<'T>) = match voption with ValueNone -> state | ValueSome x -> folder state x + + [] + let foldBack<'T,'State> folder (voption: voption<'T>) (state:'State) = match voption with ValueNone -> state | ValueSome x -> folder x state + + [] + let exists predicate voption = match voption with ValueNone -> false | ValueSome x -> predicate x + + [] + let forall predicate voption = match voption with ValueNone -> true | ValueSome x -> predicate x + + [] + let inline contains value voption = match voption with ValueNone -> false | ValueSome v -> v = value + + [] + let iter action voption = match voption with ValueNone -> () | ValueSome x -> action x + + [] + let map mapping voption = match voption with ValueNone -> ValueNone | ValueSome x -> ValueSome (mapping x) + + [] + let map2 mapping voption1 voption2 = + match voption1, voption2 with + | ValueSome x, ValueSome y -> ValueSome (mapping x y) + | _ -> ValueNone + + [] + let map3 mapping voption1 voption2 voption3 = + match voption1, voption2, voption3 with + | ValueSome x, ValueSome y, ValueSome z -> ValueSome (mapping x y z) + | _ -> ValueNone + + [] + let bind binder voption = match voption with ValueNone -> ValueNone | ValueSome x -> binder x + + [] + let flatten voption = match voption with ValueNone -> ValueNone | ValueSome x -> x + + [] + let filter predicate voption = match voption with ValueNone -> ValueNone | ValueSome x -> if predicate x then ValueSome x else ValueNone + + [] + let toArray voption = match voption with ValueNone -> [| |] | ValueSome x -> [| x |] + + [] + let toList voption = match voption with ValueNone -> [ ] | ValueSome x -> [ x ] + + [] + let toNullable voption = match voption with ValueNone -> System.Nullable() | ValueSome v -> System.Nullable(v) + + [] + let ofNullable (value:System.Nullable<'T>) = if value.HasValue then ValueSome value.Value else ValueNone + + [] + let ofObj value = match value with null -> ValueNone | _ -> ValueSome value + + [] + let toObj value = match value with ValueNone -> null | ValueSome x -> x diff --git a/src/fsharp/FSharp.Core/option.fsi b/src/fsharp/FSharp.Core/option.fsi index a8f7af2ffce..739484ae8cf 100644 --- a/src/fsharp/FSharp.Core/option.fsi +++ b/src/fsharp/FSharp.Core/option.fsi @@ -2,199 +2,387 @@ namespace Microsoft.FSharp.Core - open System - open Microsoft.FSharp.Core - open Microsoft.FSharp.Collections - open Microsoft.FSharp.Core.Operators - open Microsoft.FSharp.Collections - - [] - /// Basic operations on options. - module Option = - /// Returns true if the option is not None. - /// The input option. - /// True if the option is not None. - [] - val inline isSome: option:'T option -> bool - - /// Returns true if the option is None. - /// The input option. - /// True if the option is None. - [] - val inline isNone: option:'T option -> bool - - /// Gets the value of the option if the option is Some, otherwise returns the specified default value. - /// The specified default value. - /// The input option. - /// The option if the option is Some, else the default value. - /// Identical to the built-in operator, except with the arguments swapped. - [] - val defaultValue: value:'T -> option:'T option -> 'T - - /// Gets the value of the option if the option is Some, otherwise evaluates and returns the result. - /// A thunk that provides a default value when evaluated. - /// The input option. - /// The option if the option is Some, else the result of evaluating . - /// is not evaluated unless is None. - [] - val defaultWith: defThunk:(unit -> 'T) -> option:'T option -> 'T - - /// Returns if it is Some, otherwise returns . - /// The value to use if is None. - /// The input option. - /// The option if the option is Some, else the alternate option. - [] - val orElse: ifNone:'T option -> option:'T option -> 'T option - - /// Returns if it is Some, otherwise evaluates and returns the result. - /// A thunk that provides an alternate option when evaluated. - /// The input option. - /// The option if the option is Some, else the result of evaluating . - /// is not evaluated unless is None. - [] - val orElseWith: ifNoneThunk:(unit -> 'T option) -> option:'T option -> 'T option - - /// Gets the value associated with the option. - /// The input option. - /// The value within the option. - /// Thrown when the option is None. - [] - val get: option:'T option -> 'T - - /// count inp evaluates to match inp with None -> 0 | Some _ -> 1. - /// The input option. - /// A zero if the option is None, a one otherwise. - [] - val count: option:'T option -> int - - /// fold f s inp evaluates to match inp with None -> s | Some x -> f s x. - /// A function to update the state data when given a value from an option. - /// The initial state. - /// The input option. - /// The original state if the option is None, otherwise it returns the updated state with the folder - /// and the option value. - [] - val fold<'T,'State> : folder:('State -> 'T -> 'State) -> state:'State -> option:'T option -> 'State - - /// fold f inp s evaluates to match inp with None -> s | Some x -> f x s. - /// A function to update the state data when given a value from an option. - /// The input option. - /// The initial state. - /// The original state if the option is None, otherwise it returns the updated state with the folder - /// and the option value. - [] - val foldBack<'T,'State> : folder:('T -> 'State -> 'State) -> option:'T option -> state:'State -> 'State - - /// exists p inp evaluates to match inp with None -> false | Some x -> p x. - /// A function that evaluates to a boolean when given a value from the option type. - /// The input option. - /// False if the option is None, otherwise it returns the result of applying the predicate - /// to the option value. - [] - val exists: predicate:('T -> bool) -> option:'T option -> bool - - /// forall p inp evaluates to match inp with None -> true | Some x -> p x. - /// A function that evaluates to a boolean when given a value from the option type. - /// The input option. - /// True if the option is None, otherwise it returns the result of applying the predicate - /// to the option value. - [] - val forall: predicate:('T -> bool) -> option:'T option -> bool - - /// Evaluates to true if is Some and its value is equal to . - /// The value to test for equality. - /// The input option. - /// True if the option is Some and contains a value equal to , otherwise false. - [] - val inline contains: value:'T -> option:'T option -> bool when 'T : equality - - /// iter f inp executes match inp with None -> () | Some x -> f x. - /// A function to apply to the option value. - /// The input option. - /// Unit if the option is None, otherwise it returns the result of applying the predicate - /// to the option value. - [] - val iter: action:('T -> unit) -> option:'T option -> unit - - /// map f inp evaluates to match inp with None -> None | Some x -> Some (f x). - /// A function to apply to the option value. - /// The input option. - /// An option of the input value after applying the mapping function, or None if the input is None. - [] - val map: mapping:('T -> 'U) -> option:'T option -> 'U option - - /// map f option1 option2 evaluates to match option1, option2 with Some x, Some y -> Some (f x y) | _ -> None. - /// A function to apply to the option values. - /// The first option. - /// The second option. - /// An option of the input values after applying the mapping function, or None if either input is None. - [] - val map2: mapping:('T1 -> 'T2 -> 'U) -> 'T1 option -> 'T2 option -> 'U option - - /// map f option1 option2 option3 evaluates to match option1, option2, option3 with Some x, Some y, Some z -> Some (f x y z) | _ -> None. - /// A function to apply to the option values. - /// The first option. - /// The second option. - /// The third option. - /// An option of the input values after applying the mapping function, or None if any input is None. - [] - val map3: mapping:('T1 -> 'T2 -> 'T3 -> 'U) -> 'T1 option -> 'T2 option -> 'T3 option -> 'U option - - /// bind f inp evaluates to match inp with None -> None | Some x -> f x - /// A function that takes the value of type T from an option and transforms it into - /// an option containing a value of type U. - /// The input option. - /// An option of the output type of the binder. - [] - val bind: binder:('T -> 'U option) -> option:'T option -> 'U option - - /// flatten inp evaluates to match inp with None -> None | Some x -> x - /// The input option. - /// An option of the output type of the binder. - /// flatten is equivalent to bind id. - [] - val flatten: option:'T option option -> 'T option - - /// filter f inp evaluates to match inp with None -> None | Some x -> if f x then Some x else None. - /// A function that evaluates whether the value contained in the option should remain, or be filtered out. - /// The input option. - /// The input if the predicate evaluates to true; otherwise, None. - [] - val filter: predicate:('T -> bool) -> option:'T option -> 'T option - - /// Convert the option to an array of length 0 or 1. - /// The input option. - /// The result array. - [] - val toArray: option:'T option -> 'T[] - - /// Convert the option to a list of length 0 or 1. - /// The input option. - /// The result list. - [] - val toList: option:'T option -> 'T list - - - /// Convert the option to a Nullable value. - /// The input option. - /// The result value. - [] - val toNullable: option:'T option -> Nullable<'T> - - /// Convert a Nullable value to an option. - /// The input nullable value. - /// The result option. - [] - val ofNullable: value:Nullable<'T> -> 'T option - - /// Convert a potentially null value to an option. - /// The input value. - /// The result option. - [] - val ofObj: value: 'T -> 'T option when 'T : null - - /// Convert an option to a potentially null value. - /// The input value. - /// The result value, which is null if the input was None. - [] - val toObj: value: 'T option -> 'T when 'T : null +open System +open Microsoft.FSharp.Core +open Microsoft.FSharp.Collections + + +[] +/// Basic operations on options. +module Option = + /// Returns true if the option is not None. + /// The input option. + /// True if the option is not None. + [] + val inline isSome: option:'T option -> bool + + /// Returns true if the option is None. + /// The input option. + /// True if the option is None. + [] + val inline isNone: option:'T option -> bool + + /// Gets the value of the option if the option is Some, otherwise returns the specified default value. + /// The specified default value. + /// The input option. + /// The option if the option is Some, else the default value. + /// Identical to the built-in operator, except with the arguments swapped. + [] + val defaultValue: value:'T -> option:'T option -> 'T + + /// Gets the value of the option if the option is Some, otherwise evaluates and returns the result. + /// A thunk that provides a default value when evaluated. + /// The input option. + /// The option if the option is Some, else the result of evaluating . + /// is not evaluated unless is None. + [] + val defaultWith: defThunk:(unit -> 'T) -> option:'T option -> 'T + + /// Returns if it is Some, otherwise returns . + /// The value to use if is None. + /// The input option. + /// The option if the option is Some, else the alternate option. + [] + val orElse: ifNone:'T option -> option:'T option -> 'T option + + /// Returns if it is Some, otherwise evaluates and returns the result. + /// A thunk that provides an alternate option when evaluated. + /// The input option. + /// The option if the option is Some, else the result of evaluating . + /// is not evaluated unless is None. + [] + val orElseWith: ifNoneThunk:(unit -> 'T option) -> option:'T option -> 'T option + + /// Gets the value associated with the option. + /// The input option. + /// The value within the option. + /// Thrown when the option is None. + [] + val get: option:'T option -> 'T + + /// count inp evaluates to match inp with None -> 0 | Some _ -> 1. + /// The input option. + /// A zero if the option is None, a one otherwise. + [] + val count: option:'T option -> int + + /// fold f s inp evaluates to match inp with None -> s | Some x -> f s x. + /// A function to update the state data when given a value from an option. + /// The initial state. + /// The input option. + /// The original state if the option is None, otherwise it returns the updated state with the folder + /// and the option value. + [] + val fold<'T,'State> : folder:('State -> 'T -> 'State) -> state:'State -> option:'T option -> 'State + + /// fold f inp s evaluates to match inp with None -> s | Some x -> f x s. + /// A function to update the state data when given a value from an option. + /// The input option. + /// The initial state. + /// The original state if the option is None, otherwise it returns the updated state with the folder + /// and the option value. + [] + val foldBack<'T,'State> : folder:('T -> 'State -> 'State) -> option:'T option -> state:'State -> 'State + + /// exists p inp evaluates to match inp with None -> false | Some x -> p x. + /// A function that evaluates to a boolean when given a value from the option type. + /// The input option. + /// False if the option is None, otherwise it returns the result of applying the predicate + /// to the option value. + [] + val exists: predicate:('T -> bool) -> option:'T option -> bool + + /// forall p inp evaluates to match inp with None -> true | Some x -> p x. + /// A function that evaluates to a boolean when given a value from the option type. + /// The input option. + /// True if the option is None, otherwise it returns the result of applying the predicate + /// to the option value. + [] + val forall: predicate:('T -> bool) -> option:'T option -> bool + + /// Evaluates to true if is Some and its value is equal to . + /// The value to test for equality. + /// The input option. + /// True if the option is Some and contains a value equal to , otherwise false. + [] + val inline contains: value:'T -> option:'T option -> bool when 'T : equality + + /// iter f inp executes match inp with None -> () | Some x -> f x. + /// A function to apply to the option value. + /// The input option. + /// Unit if the option is None, otherwise it returns the result of applying the predicate + /// to the option value. + [] + val iter: action:('T -> unit) -> option:'T option -> unit + + /// map f inp evaluates to match inp with None -> None | Some x -> Some (f x). + /// A function to apply to the option value. + /// The input option. + /// An option of the input value after applying the mapping function, or None if the input is None. + [] + val map: mapping:('T -> 'U) -> option:'T option -> 'U option + + /// map f option1 option2 evaluates to match option1, option2 with Some x, Some y -> Some (f x y) | _ -> None. + /// A function to apply to the option values. + /// The first option. + /// The second option. + /// An option of the input values after applying the mapping function, or None if either input is None. + [] + val map2: mapping:('T1 -> 'T2 -> 'U) -> 'T1 option -> 'T2 option -> 'U option + + /// map f option1 option2 option3 evaluates to match option1, option2, option3 with Some x, Some y, Some z -> Some (f x y z) | _ -> None. + /// A function to apply to the option values. + /// The first option. + /// The second option. + /// The third option. + /// An option of the input values after applying the mapping function, or None if any input is None. + [] + val map3: mapping:('T1 -> 'T2 -> 'T3 -> 'U) -> 'T1 option -> 'T2 option -> 'T3 option -> 'U option + + /// bind f inp evaluates to match inp with None -> None | Some x -> f x + /// A function that takes the value of type T from an option and transforms it into + /// an option containing a value of type U. + /// The input option. + /// An option of the output type of the binder. + [] + val bind: binder:('T -> 'U option) -> option:'T option -> 'U option + + /// flatten inp evaluates to match inp with None -> None | Some x -> x + /// The input option. + /// An option of the output type of the binder. + /// flatten is equivalent to bind id. + [] + val flatten: option:'T option option -> 'T option + + /// filter f inp evaluates to match inp with None -> None | Some x -> if f x then Some x else None. + /// A function that evaluates whether the value contained in the option should remain, or be filtered out. + /// The input option. + /// The input if the predicate evaluates to true; otherwise, None. + [] + val filter: predicate:('T -> bool) -> option:'T option -> 'T option + + /// Convert the option to an array of length 0 or 1. + /// The input option. + /// The result array. + [] + val toArray: option:'T option -> 'T[] + + /// Convert the option to a list of length 0 or 1. + /// The input option. + /// The result list. + [] + val toList: option:'T option -> 'T list + + + /// Convert the option to a Nullable value. + /// The input option. + /// The result value. + [] + val toNullable: option:'T option -> Nullable<'T> + + /// Convert a Nullable value to an option. + /// The input nullable value. + /// The result option. + [] + val ofNullable: value:Nullable<'T> -> 'T option + + /// Convert a potentially null value to an option. + /// The input value. + /// The result option. + [] + val ofObj: value: 'T -> 'T option when 'T : null + + /// Convert an option to a potentially null value. + /// The input value. + /// The result value, which is null if the input was None. + [] + val toObj: value: 'T option -> 'T when 'T : null + +/// Basic operations on value options. +module ValueOption = + /// Returns true if the value option is not ValueNone. + /// The input value option. + /// True if the value option is not ValueNone. + [] + val inline isSome: voption:'T voption -> bool + + /// Returns true if the value option is ValueNone. + /// The input value option. + /// True if the voption is ValueNone. + [] + val inline isNone: voption:'T voption -> bool + + /// Gets the value of the value option if the option is ValueSome, otherwise returns the specified default value. + /// The specified default value. + /// The input voption. + /// The voption if the voption is ValueSome, else the default value. + /// Identical to the built-in operator, except with the arguments swapped. + [] + val defaultValue: value:'T -> voption:'T voption -> 'T + + /// Gets the value of the voption if the voption is ValueSome, otherwise evaluates and returns the result. + /// A thunk that provides a default value when evaluated. + /// The input voption. + /// The voption if the voption is ValueSome, else the result of evaluating . + /// is not evaluated unless is ValueNone. + [] + val defaultWith: defThunk:(unit -> 'T) -> voption:'T voption -> 'T + + /// Returns if it is Some, otherwise returns . + /// The value to use if is None. + /// The input option. + /// The option if the option is Some, else the alternate option. + [] + val orElse: ifNone:'T voption -> voption:'T voption -> 'T voption + + /// Returns if it is Some, otherwise evaluates and returns the result. + /// A thunk that provides an alternate value option when evaluated. + /// The input value option. + /// The voption if the voption is ValueSome, else the result of evaluating . + /// is not evaluated unless is ValueNone. + [] + val orElseWith: ifNoneThunk:(unit -> 'T voption) -> voption:'T voption -> 'T voption + + /// Gets the value associated with the option. + /// The input value option. + /// The value within the option. + /// Thrown when the option is ValueNone. + [] + val get: voption:'T voption -> 'T + + /// count inp evaluates to match inp with ValueNone -> 0 | ValueSome _ -> 1. + /// The input value option. + /// A zero if the option is ValueNone, a one otherwise. + [] + val count: voption:'T voption -> int + + /// fold f s inp evaluates to match inp with ValueNone -> s | ValueSome x -> f s x. + /// A function to update the state data when given a value from a value option. + /// The initial state. + /// The input value option. + /// The original state if the option is ValueNone, otherwise it returns the updated state with the folder + /// and the voption value. + [] + val fold<'T,'State> : folder:('State -> 'T -> 'State) -> state:'State -> voption:'T voption -> 'State + + /// fold f inp s evaluates to match inp with ValueNone -> s | ValueSome x -> f x s. + /// A function to update the state data when given a value from a value option. + /// The input value option. + /// The initial state. + /// The original state if the option is ValueNone, otherwise it returns the updated state with the folder + /// and the voption value. + [] + val foldBack<'T,'State> : folder:('T -> 'State -> 'State) -> voption:'T voption -> state:'State -> 'State + + /// exists p inp evaluates to match inp with ValueNone -> false | ValueSome x -> p x. + /// A function that evaluates to a boolean when given a value from the option type. + /// The input value option. + /// False if the option is ValueNone, otherwise it returns the result of applying the predicate + /// to the option value. + [] + val exists: predicate:('T -> bool) -> voption:'T voption -> bool + + /// forall p inp evaluates to match inp with ValueNone -> true | ValueSome x -> p x. + /// A function that evaluates to a boolean when given a value from the value option type. + /// The input value option. + /// True if the option is None, otherwise it returns the result of applying the predicate + /// to the option value. + [] + val forall: predicate:('T -> bool) -> voption:'T voption -> bool + + /// Evaluates to true if is ValueSome and its value is equal to . + /// The value to test for equality. + /// The input value option. + /// True if the option is ValueSome and contains a value equal to , otherwise false. + [] + val inline contains: value:'T -> voption:'T voption -> bool when 'T : equality + + /// iter f inp executes match inp with ValueNone -> () | ValueSome x -> f x. + /// A function to apply to the voption value. + /// The input value option. + /// Unit if the option is ValueNone, otherwise it returns the result of applying the predicate + /// to the voption value. + [] + val iter: action:('T -> unit) -> voption:'T voption -> unit + + /// map f inp evaluates to match inp with ValueNone -> ValueNone | ValueSome x -> ValueSome (f x). + /// A function to apply to the voption value. + /// The input value option. + /// A value option of the input value after applying the mapping function, or ValueNone if the input is ValueNone. + [] + val map: mapping:('T -> 'U) -> voption:'T voption -> 'U voption + + /// map f voption1 voption2 evaluates to match voption1, voption2 with ValueSome x, ValueSome y -> ValueSome (f x y) | _ -> ValueNone. + /// A function to apply to the voption values. + /// The first value option. + /// The second value option. + /// A value option of the input values after applying the mapping function, or ValueNone if either input is ValueNone. + [] + val map2: mapping:('T1 -> 'T2 -> 'U) -> voption1: 'T1 voption -> voption2: 'T2 voption -> 'U voption + + /// map f voption1 voption2 voption3 evaluates to match voption1, voption2, voption3 with ValueSome x, ValueSome y, ValueSome z -> ValueSome (f x y z) | _ -> ValueNone. + /// A function to apply to the value option values. + /// The first value option. + /// The second value option. + /// The third value option. + /// A value option of the input values after applying the mapping function, or ValueNone if any input is ValueNone. + [] + val map3: mapping:('T1 -> 'T2 -> 'T3 -> 'U) -> 'T1 voption -> 'T2 voption -> 'T3 voption -> 'U voption + + /// bind f inp evaluates to match inp with ValueNone -> ValueNone | ValueSome x -> f x + /// A function that takes the value of type T from a value option and transforms it into + /// a value option containing a value of type U. + /// The input value option. + /// An option of the output type of the binder. + [] + val bind: binder:('T -> 'U voption) -> voption:'T voption -> 'U voption + + /// flatten inp evaluates to match inp with ValueNone -> ValueNone | ValueSome x -> x + /// The input value option. + /// A value option of the output type of the binder. + /// flatten is equivalent to bind id. + [] + val flatten: voption:'T voption voption -> 'T voption + + /// filter f inp evaluates to match inp with ValueNone -> ValueNone | ValueSome x -> if f x then ValueSome x else ValueNone. + /// A function that evaluates whether the value contained in the value option should remain, or be filtered out. + /// The input value option. + /// The input if the predicate evaluates to true; otherwise, ValueNone. + [] + val filter: predicate:('T -> bool) -> voption:'T voption -> 'T voption + + /// Convert the value option to an array of length 0 or 1. + /// The input value option. + /// The result array. + [] + val toArray: voption:'T voption -> 'T[] + + /// Convert the value option to a list of length 0 or 1. + /// The input value option. + /// The result list. + [] + val toList: voption:'T voption -> 'T list + + /// Convert the value option to a Nullable value. + /// The input value option. + /// The result value. + [] + val toNullable: voption:'T voption -> Nullable<'T> + + /// Convert a Nullable value to a value option. + /// The input nullable value. + /// The result value option. + [] + val ofNullable: value:Nullable<'T> -> 'T voption + + /// Convert a potentially null value to a value option. + /// The input value. + /// The result value option. + [] + val ofObj: value: 'T -> 'T voption when 'T : null + + /// Convert an option to a potentially null value. + /// The input value. + /// The result value, which is null if the input was ValueNone. + [] + val toObj: value: 'T voption -> 'T when 'T : null diff --git a/src/fsharp/FSharp.Core/prim-types.fs b/src/fsharp/FSharp.Core/prim-types.fs index 7710318f50b..7929ef77581 100644 --- a/src/fsharp/FSharp.Core/prim-types.fs +++ b/src/fsharp/FSharp.Core/prim-types.fs @@ -1576,15 +1576,15 @@ namespace Microsoft.FSharp.Core when 'T : nativeint = (# "ceq" x y : bool #) when 'T : unativeint = (# "ceq" x y : bool #) when 'T : float = - if not (# "ceq" x x : bool #) && not (# "ceq" y y : bool #) then + if (# "ceq" x y : bool #) then true else - (# "ceq" x y : bool #) + not (# "ceq" x x : bool #) && not (# "ceq" y y : bool #) when 'T : float32 = - if not (# "ceq" x x : bool #) && not (# "ceq" y y : bool #) then + if (# "ceq" x y : bool #) then true else - (# "ceq" x y : bool #) + not (# "ceq" x x : bool #) && not (# "ceq" y y : bool #) when 'T : char = (# "ceq" x y : bool #) when 'T : string = System.String.Equals((# "" x : string #),(# "" y : string #)) when 'T : decimal = System.Decimal.op_Equality((# "" x:decimal #), (# "" y:decimal #)) @@ -3054,12 +3054,29 @@ namespace Microsoft.FSharp.Core [] [] [] + [] type ValueOption<'T> = | ValueNone : 'T voption | ValueSome : 'T -> 'T voption member x.Value = match x with ValueSome x -> x | ValueNone -> raise (new System.InvalidOperationException("ValueOption.Value")) + [] + static member None : 'T voption = ValueNone + + static member Some (value) : 'T voption = ValueSome(value) + + [] + member x.IsNone = match x with ValueNone -> true | _ -> false + + [] + member x.IsSome = match x with ValueSome _ -> true | _ -> false + + static member op_Implicit (value) : 'T option = Some(value) + + override x.ToString() = + // x is non-null, hence ValueSome + "ValueSome("^anyToStringShowingNull x.Value^")" and 'T voption = ValueOption<'T> diff --git a/src/fsharp/FSharp.Core/prim-types.fsi b/src/fsharp/FSharp.Core/prim-types.fsi index 61786826a20..a62b9d18783 100644 --- a/src/fsharp/FSharp.Core/prim-types.fsi +++ b/src/fsharp/FSharp.Core/prim-types.fsi @@ -1866,6 +1866,20 @@ namespace Microsoft.FSharp.Core /// Get the value of a 'ValueSome' option. An InvalidOperationException is raised if the option is 'ValueNone'. member Value : 'T + /// Create a value option value that is a 'ValueNone' value. + static member None : 'T voption + + /// Create a value option value that is a 'Some' value. + /// The input value + /// A value option representing the value. + static member Some : value:'T -> 'T voption + + /// Return 'true' if the value option is a 'ValueSome' value. + member IsSome : bool + + /// Return 'true' if the value option is a 'ValueNone' value. + member IsNone : bool + /// The type of optional values, represented as structs. /// /// Use the constructors ValueSome and ValueNone to create values of this type. diff --git a/src/fsharp/FSharp.Core/printf.fs b/src/fsharp/FSharp.Core/printf.fs index f3d47e1c0ab..535d87d491b 100644 --- a/src/fsharp/FSharp.Core/printf.fs +++ b/src/fsharp/FSharp.Core/printf.fs @@ -4,6 +4,8 @@ namespace Microsoft.FSharp.Core type PrintfFormat<'Printer,'State,'Residue,'Result>(value:string) = member x.Value = value + + override __.ToString() = value type PrintfFormat<'Printer,'State,'Residue,'Result,'Tuple>(value:string) = inherit PrintfFormat<'Printer,'State,'Residue,'Result>(value) diff --git a/src/fsharp/FSharp.Core/printf.fsi b/src/fsharp/FSharp.Core/printf.fsi index 011e4f0d9b9..c8f7b2dcaeb 100644 --- a/src/fsharp/FSharp.Core/printf.fsi +++ b/src/fsharp/FSharp.Core/printf.fsi @@ -15,10 +15,12 @@ open System.Text /// Value generated by the overall printf action (e.g. sprint generates a string) /// Value generated after post processing (e.g. failwithf generates a string internally then raises an exception) type PrintfFormat<'Printer,'State,'Residue,'Result> = + /// Construct a format string /// The input string. /// The PrintfFormat containing the formatted result. new : value:string -> PrintfFormat<'Printer,'State,'Residue,'Result> + /// The raw text of the format string. member Value : string @@ -29,7 +31,9 @@ type PrintfFormat<'Printer,'State,'Residue,'Result> = /// Value generated after post processing (e.g. failwithf generates a string internally then raises an exception) /// Tuple of values generated by scan or match. type PrintfFormat<'Printer,'State,'Residue,'Result,'Tuple> = + inherit PrintfFormat<'Printer,'State,'Residue,'Result> + /// Construct a format string /// The input string. /// The created format string. @@ -137,9 +141,11 @@ module Printf = /// Represents a statically-analyzed format associated with writing to a System.Text.StringBuilder. The first type parameter indicates the /// arguments of the format operation and the last the overall return type. type BuilderFormat<'T,'Result> = Format<'T, StringBuilder, unit, 'Result> + /// Represents a statically-analyzed format when formatting builds a string. The first type parameter indicates the /// arguments of the format operation and the last the overall return type. type StringFormat<'T,'Result> = Format<'T, unit, string, 'Result> + /// Represents a statically-analyzed format associated with writing to a System.IO.TextWriter. The first type parameter indicates the /// arguments of the format operation and the last the overall return type. type TextWriterFormat<'T,'Result> = Format<'T, TextWriter, unit, 'Result> @@ -147,15 +153,15 @@ module Printf = /// Represents a statically-analyzed format associated with writing to a System.Text.StringBuilder. The type parameter indicates the /// arguments and return type of the format operation. type BuilderFormat<'T> = BuilderFormat<'T,unit> + /// Represents a statically-analyzed format when formatting builds a string. The type parameter indicates the /// arguments and return type of the format operation. type StringFormat<'T> = StringFormat<'T,string> + /// Represents a statically-analyzed format associated with writing to a System.IO.TextWriter. The type parameter indicates the /// arguments and return type of the format operation. type TextWriterFormat<'T> = TextWriterFormat<'T,unit> - - /// Print to a System.Text.StringBuilder /// The StringBuilder to print to. /// The input formatter. diff --git a/src/fsharp/FSharp.Core/project.json b/src/fsharp/FSharp.Core/project.json deleted file mode 100644 index b2f99bd2a16..00000000000 --- a/src/fsharp/FSharp.Core/project.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "dependencies": { - "NETStandard.Library": "1.6.1", - "System.Collections": "4.3.0", - "System.Console": "4.3.0", - "System.Diagnostics.Debug": "4.3.0", - "System.Diagnostics.Tools": "4.3.0", - "System.Globalization": "4.3.0", - "System.IO": "4.3.0", - "System.Linq": "4.3.0", - "System.Linq.Expressions": "4.3.0", - "System.Linq.Queryable": "4.3.0", - "System.Net.Requests": "4.3.0", - "System.Reflection": "4.3.0", - "System.Reflection.Extensions": "4.3.0", - "System.Resources.ResourceManager":"4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Extensions": "4.3.0", - "System.Runtime.Numerics": "4.3.0", - "System.Text.RegularExpressions": "4.3.0", - "System.Threading": "4.3.0", - "System.Threading.Tasks": "4.3.0", - "System.Threading.Tasks.Parallel": "4.3.0", - "System.Threading.Thread": "4.3.0", - "System.Threading.ThreadPool": "4.3.0", - "System.Threading.Timer": "4.3.0" - }, - "frameworks": { - "netstandard1.6": { } - } -} diff --git a/src/fsharp/FSharp.Core/quotations.fs b/src/fsharp/FSharp.Core/quotations.fs index 992bbe54f62..6198357fa08 100644 --- a/src/fsharp/FSharp.Core/quotations.fs +++ b/src/fsharp/FSharp.Core/quotations.fs @@ -1322,19 +1322,19 @@ module Patterns = // typeof.MakeArrayType(1) returns "Int[*]" but we need "Int[]" | _ -> invalidArg "tys" (SR.GetString(SR.QexpectedOneType)) - let mkNamedTycon (tcName,ass:Assembly) = - match ass.GetType(tcName) with + let mkNamedTycon (tcName,assembly:Assembly) = + match assembly.GetType(tcName) with | null -> // For some reason we can get 'null' returned here even when a type with the right name exists... Hence search the slow way... - match (ass.GetTypes() |> Array.tryFind (fun a -> a.FullName = tcName)) with + match (assembly.GetTypes() |> Array.tryFind (fun a -> a.FullName = tcName)) with | Some ty -> ty - | None -> invalidArg "tcName" (String.Format(SR.GetString(SR.QfailedToBindTypeInAssembly), tcName, ass.FullName)) // "Available types are:\n%A" tcName ass (ass.GetTypes() |> Array.map (fun a -> a.FullName)) + | None -> invalidArg "tcName" (String.Format(SR.GetString(SR.QfailedToBindTypeInAssembly), tcName, assembly.FullName)) // "Available types are:\n%A" tcName assembly (assembly.GetTypes() |> Array.map (fun a -> a.FullName)) | ty -> ty let decodeNamedTy tc tsR = mkNamedType(tc,tsR) let mscorlib = typeof.Assembly - let u_assref st = u_string st + let u_assemblyRef st = u_string st let decodeAssemblyRef st a = if a = "" then mscorlib elif a = "." then st.localAssembly @@ -1345,10 +1345,10 @@ module Patterns = match System.Reflection.Assembly.Load(a) with #endif | null -> raise <| System.InvalidOperationException(String.Format(SR.GetString(SR.QfailedToBindAssembly), a.ToString())) - | ass -> ass + | assembly -> assembly let u_NamedType st = - let a,b = u_tup2 u_string u_assref st + let a,b = u_tup2 u_string u_assemblyRef st let mutable idx = 0 // From FSharp.Core for F# 4.0+ (4.4.0.0+), referenced type definitions can be integer indexes into a table of type definitions provided on quotation // deserialization, avoiding the need for System.Reflection.Assembly.Load @@ -1358,8 +1358,8 @@ module Patterns = // escape commas found in type name, which are not already escaped // '\' is not valid in a type name except as an escape character, so logic can be pretty simple let escapedTcName = System.Text.RegularExpressions.Regex.Replace(a, @"(?) (keyf:'T->'SafeKey) (getKey:'SafeKey->'Key) (seq:seq<'T>) = checkNonNull "seq" seq - if isEmpty seq then empty else - let dict = Dictionary<_,ResizeArray<_>> comparer // Previously this was 1, but I think this is rather stingy, considering that we are already paying @@ -1087,7 +1085,6 @@ namespace Microsoft.FSharp.Collections [] let distinct source = checkNonNull "source" source - if isEmpty source then empty else seq { let hashSet = HashSet<'T>(HashIdentity.Structural<'T>) for v in source do if hashSet.Add(v) then @@ -1096,7 +1093,6 @@ namespace Microsoft.FSharp.Collections [] let distinctBy projection source = checkNonNull "source" source - if isEmpty source then empty else seq { let hashSet = HashSet<_>(HashIdentity.Structural<_>) for v in source do if hashSet.Add(projection v) then @@ -1140,7 +1136,6 @@ namespace Microsoft.FSharp.Collections let inline countByImpl (comparer:IEqualityComparer<'SafeKey>) (keyf:'T->'SafeKey) (getKey:'SafeKey->'Key) (source:seq<'T>) = checkNonNull "source" source - if isEmpty source then empty else let dict = Dictionary comparer @@ -1421,6 +1416,19 @@ namespace Microsoft.FSharp.Collections else invalidArg "source" LanguagePrimitives.ErrorStrings.InputSequenceEmptyString + [] + let tryExactlyOne (source : seq<_>) = + checkNonNull "source" source + use e = source.GetEnumerator() + if e.MoveNext() then + let v = e.Current + if e.MoveNext() then + None + else + Some v + else + None + [] let rev source = checkNonNull "source" source diff --git a/src/fsharp/FSharp.Core/seq.fsi b/src/fsharp/FSharp.Core/seq.fsi index 045a22b84ab..9ed5bed0965 100644 --- a/src/fsharp/FSharp.Core/seq.fsi +++ b/src/fsharp/FSharp.Core/seq.fsi @@ -558,6 +558,16 @@ namespace Microsoft.FSharp.Collections [] val exactlyOne: source:seq<'T> -> 'T + /// Returns the only element of the sequence or None if sequence is empty or contains more than one element. + /// + /// The input sequence. + /// + /// The only element of the sequence or None. + /// + /// Thrown when the input sequence is null. + [] + val tryExactlyOne: source:seq<'T> -> 'T option + /// Returns true if the sequence contains no elements, false otherwise. /// /// The input sequence. diff --git a/src/fsharp/FSharp.Core/xlf/FSCore.cs.xlf b/src/fsharp/FSharp.Core/xlf/FSCore.cs.xlf index 7c8e97d6501..b5d21ee48fb 100644 --- a/src/fsharp/FSharp.Core/xlf/FSCore.cs.xlf +++ b/src/fsharp/FSharp.Core/xlf/FSCore.cs.xlf @@ -1,4 +1,4 @@ - + diff --git a/src/fsharp/FSharp.Core/xlf/FSCore.de.xlf b/src/fsharp/FSharp.Core/xlf/FSCore.de.xlf index cfcd71290fa..01d60b65b31 100644 --- a/src/fsharp/FSharp.Core/xlf/FSCore.de.xlf +++ b/src/fsharp/FSharp.Core/xlf/FSCore.de.xlf @@ -1,4 +1,4 @@ - + diff --git a/src/fsharp/FSharp.Core/xlf/FSCore.es.xlf b/src/fsharp/FSharp.Core/xlf/FSCore.es.xlf index 46a617777f6..86bcc129825 100644 --- a/src/fsharp/FSharp.Core/xlf/FSCore.es.xlf +++ b/src/fsharp/FSharp.Core/xlf/FSCore.es.xlf @@ -1,4 +1,4 @@ - + diff --git a/src/fsharp/FSharp.Core/xlf/FSCore.fr.xlf b/src/fsharp/FSharp.Core/xlf/FSCore.fr.xlf index 09dfb48a62c..3c12f6109a2 100644 --- a/src/fsharp/FSharp.Core/xlf/FSCore.fr.xlf +++ b/src/fsharp/FSharp.Core/xlf/FSCore.fr.xlf @@ -1,4 +1,4 @@ - + diff --git a/src/fsharp/FSharp.Core/xlf/FSCore.it.xlf b/src/fsharp/FSharp.Core/xlf/FSCore.it.xlf index 5598638a5f4..4991f7ffaf9 100644 --- a/src/fsharp/FSharp.Core/xlf/FSCore.it.xlf +++ b/src/fsharp/FSharp.Core/xlf/FSCore.it.xlf @@ -1,4 +1,4 @@ - + diff --git a/src/fsharp/FSharp.Core/xlf/FSCore.ja.xlf b/src/fsharp/FSharp.Core/xlf/FSCore.ja.xlf index 51440221431..ae165167480 100644 --- a/src/fsharp/FSharp.Core/xlf/FSCore.ja.xlf +++ b/src/fsharp/FSharp.Core/xlf/FSCore.ja.xlf @@ -1,4 +1,4 @@ - + diff --git a/src/fsharp/FSharp.Core/xlf/FSCore.ko.xlf b/src/fsharp/FSharp.Core/xlf/FSCore.ko.xlf index 76a111799a3..49b8be6efb8 100644 --- a/src/fsharp/FSharp.Core/xlf/FSCore.ko.xlf +++ b/src/fsharp/FSharp.Core/xlf/FSCore.ko.xlf @@ -1,4 +1,4 @@ - + diff --git a/src/fsharp/FSharp.Core/xlf/FSCore.pl.xlf b/src/fsharp/FSharp.Core/xlf/FSCore.pl.xlf index 3d869bc263b..d435fc3f80a 100644 --- a/src/fsharp/FSharp.Core/xlf/FSCore.pl.xlf +++ b/src/fsharp/FSharp.Core/xlf/FSCore.pl.xlf @@ -1,4 +1,4 @@ - + diff --git a/src/fsharp/FSharp.Core/xlf/FSCore.pt-BR.xlf b/src/fsharp/FSharp.Core/xlf/FSCore.pt-BR.xlf index 48c0450f629..43296899d7c 100644 --- a/src/fsharp/FSharp.Core/xlf/FSCore.pt-BR.xlf +++ b/src/fsharp/FSharp.Core/xlf/FSCore.pt-BR.xlf @@ -1,4 +1,4 @@ - + diff --git a/src/fsharp/FSharp.Core/xlf/FSCore.ru.xlf b/src/fsharp/FSharp.Core/xlf/FSCore.ru.xlf index 6daf52715c5..51162715a61 100644 --- a/src/fsharp/FSharp.Core/xlf/FSCore.ru.xlf +++ b/src/fsharp/FSharp.Core/xlf/FSCore.ru.xlf @@ -1,4 +1,4 @@ - + diff --git a/src/fsharp/FSharp.Core/xlf/FSCore.tr.xlf b/src/fsharp/FSharp.Core/xlf/FSCore.tr.xlf index 2baf7f4b07b..33601727b60 100644 --- a/src/fsharp/FSharp.Core/xlf/FSCore.tr.xlf +++ b/src/fsharp/FSharp.Core/xlf/FSCore.tr.xlf @@ -1,4 +1,4 @@ - + diff --git a/src/fsharp/FSharp.Core/xlf/FSCore.zh-Hant.xlf b/src/fsharp/FSharp.Core/xlf/FSCore.zh-Hant.xlf index e75ede8758c..de92b3ac758 100644 --- a/src/fsharp/FSharp.Core/xlf/FSCore.zh-Hant.xlf +++ b/src/fsharp/FSharp.Core/xlf/FSCore.zh-Hant.xlf @@ -1,4 +1,4 @@ - + diff --git a/src/fsharp/FindUnsolved.fs b/src/fsharp/FindUnsolved.fs index e78e41212dd..9c38f26a2a7 100644 --- a/src/fsharp/FindUnsolved.fs +++ b/src/fsharp/FindUnsolved.fs @@ -1,9 +1,7 @@ // Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. -//------------------------------------------------------------------------- -// Find unsolved, uninstantiated type variables -//------------------------------------------------------------------------- +/// Find unsolved, uninstantiated type variables module internal Microsoft.FSharp.Compiler.FindUnsolved open Microsoft.FSharp.Compiler @@ -16,24 +14,24 @@ open Microsoft.FSharp.Compiler.TypeRelations type env = Nix +/// The environment and collector type cenv = { g: TcGlobals amap: Import.ImportMap denv: DisplayEnv mutable unsolved: Typars } +/// Walk types, collecting type variables let accTy cenv _env ty = - (freeInType CollectTyparsNoCaching (tryNormalizeMeasureInType cenv.g ty)).FreeTypars |> Zset.iter (fun tp -> - if (tp.Rigidity <> TyparRigidity.Rigid) then - cenv.unsolved <- tp :: cenv.unsolved) + let normalizedTy = tryNormalizeMeasureInType cenv.g ty + (freeInType CollectTyparsNoCaching normalizedTy).FreeTypars |> Zset.iter (fun tp -> + if (tp.Rigidity <> TyparRigidity.Rigid) then + cenv.unsolved <- tp :: cenv.unsolved) let accTypeInst cenv env tyargs = - tyargs |> List.iter (accTy cenv env) + tyargs |> List.iter (accTy cenv env) -//-------------------------------------------------------------------------- -// walk exprs etc -//-------------------------------------------------------------------------- - +/// Walk expressions, collecting type variables let rec accExpr (cenv:cenv) (env:env) expr = let expr = stripExpr expr match expr with @@ -62,7 +60,6 @@ let rec accExpr (cenv:cenv) (env:env) expr = accTypeInst cenv env tyargs accExpr cenv env f accExprs cenv env argsl - // REVIEW: fold the next two cases together | Expr.Lambda(_,_ctorThisValOpt,_baseValOpt,argvs,_body,m,rty) -> let topValInfo = ValReprInfo ([],[argvs |> List.map (fun _ -> ValReprInfo.unnamedTopArg1)],ValReprInfo.unnamedRetVal) let ty = mkMultiLambdaTy m argvs rty @@ -136,6 +133,7 @@ and accLambdas cenv env topValInfo e ety = accExpr cenv env e and accExprs cenv env exprs = exprs |> List.iter (accExpr cenv env) + and accTargets cenv env m ty targets = Array.iter (accTarget cenv env m ty) targets and accTarget cenv env _m _ty (TTarget(_vs,e,_)) = accExpr cenv env e @@ -192,10 +190,6 @@ and accBind cenv env (bind:Binding) = and accBinds cenv env xs = xs |> List.iter (accBind cenv env) -//-------------------------------------------------------------------------- -// check tycons -//-------------------------------------------------------------------------- - let accTyconRecdField cenv env _tycon (rfield:RecdField) = accAttribs cenv env rfield.PropertyAttribs accAttribs cenv env rfield.FieldAttribs @@ -205,17 +199,12 @@ let accTycon cenv env (tycon:Tycon) = abstractSlotValsOfTycons [tycon] |> List.iter (accVal cenv env) tycon.AllFieldsArray |> Array.iter (accTyconRecdField cenv env tycon) if tycon.IsUnionTycon then (* This covers finite unions. *) - tycon.UnionCasesAsList |> List.iter (fun uc -> + tycon.UnionCasesArray |> Array.iter (fun uc -> accAttribs cenv env uc.Attribs - uc.RecdFields |> List.iter (accTyconRecdField cenv env tycon)) - + uc.RecdFieldsArray |> Array.iter (accTyconRecdField cenv env tycon)) let accTycons cenv env tycons = List.iter (accTycon cenv env) tycons -//-------------------------------------------------------------------------- -// check modules -//-------------------------------------------------------------------------- - let rec accModuleOrNamespaceExpr cenv env x = match x with | ModuleOrNamespaceExprWithSig(_mty, def, _m) -> accModuleOrNamespaceDef cenv env def @@ -231,7 +220,9 @@ and accModuleOrNamespaceDef cenv env x = | TMDefDo(e,_m) -> accExpr cenv env e | TMAbstract(def) -> accModuleOrNamespaceExpr cenv env def | TMDefs(defs) -> accModuleOrNamespaceDefs cenv env defs + and accModuleOrNamespaceBinds cenv env xs = List.iter (accModuleOrNamespaceBind cenv env) xs + and accModuleOrNamespaceBind cenv env x = match x with | ModuleOrNamespaceBinding.Binding bind -> accBind cenv env bind diff --git a/src/fsharp/Fsc-proto/Fsc-proto.fsproj b/src/fsharp/Fsc-proto/Fsc-proto.fsproj deleted file mode 100644 index 5cccf4f17a2..00000000000 --- a/src/fsharp/Fsc-proto/Fsc-proto.fsproj +++ /dev/null @@ -1,499 +0,0 @@ - - - - - $(MSBuildProjectDirectory)\..\.. - Proto - - - - x86 - Exe - $(NoWarn);62 - fsc - NO_EXTENSIONTYPING;$(DefineConstants) - COMPILER;$(DefineConstants) - $(NoWarn);35;44;62;9;60;86;47;1203 - LKG - {9D7C9060-9263-40EB-8FE3-1E4E3C6D941C} - true - $(OtherFlags) --warnon:1182 - $(OtherFlags) --stackReserveSize:4096000 - - - - FSComp.txt - - - - --unicode --lexlib Internal.Utilities.Text.Lexing - pplex.fsl - - - --module Microsoft.FSharp.Compiler.PPParser --open Microsoft.FSharp.Compiler --internal --lexlib Internal.Utilities.Text.Lexing --parslib Internal.Utilities.Text.Parsing - pppars.fsy - - - --unicode --lexlib Internal.Utilities.Text.Lexing - lex.fsl - - - --unicode --lexlib Internal.Utilities.Text.Lexing - illex.fsl - - - --module Microsoft.FSharp.Compiler.Parser --open Microsoft.FSharp.Compiler --internal --lexlib Internal.Utilities.Text.Lexing --parslib Internal.Utilities.Text.Parsing - pars.fsy - - - --module Microsoft.FSharp.Compiler.AbstractIL.Internal.AsciiParser --open Microsoft.FSharp.Compiler.AbstractIL --internal --lexlib Internal.Utilities.Text.Lexing --parslib Internal.Utilities.Text.Parsing - ilpars.fsy - - - Logger.fsi - - - Logger.fs - - - Reflection\reshapedreflection.fs - - - sformat.fsi - - - sformat.fs - - - sr.fsi - - - sr.fs - - - prim-lexing.fsi - - - prim-lexing.fs - - - prim-parsing.fsi - - - prim-parsing.fs - - - ResizeArray.fsi - - - ResizeArray.fs - - - HashMultiMap.fsi - - - HashMultiMap.fs - - - Utilities\EditDistance.fs - - - TaggedCollections.fsi - - - TaggedCollections.fs - - - Utilities\ildiag.fsi - - - Utilities\ildiag.fs - - - illib.fs - - - filename.fsi - - - filename.fs - - - zmap.fsi - - - zmap.fs - - - zset.fsi - - - zset.fs - - - bytes.fsi - - - bytes.fs - - - ReferenceResolver.fs - - - il.fsi - - - il.fs - - - ilx.fsi - - - ilx.fs - - - ilascii.fsi - - - ilascii.fs - - - ilprint.fsi - - - ilprint.fs - - - ilmorph.fsi - - - ilmorph.fs - - - ilsign.fs - - - ilsupp.fsi - - - ilsupp.fs - - - - - ilbinary.fsi - - - ilbinary.fs - - - lib.fs - - - range.fsi - - - range.fs - - - rational.fsi - - - rational.fs - - - ErrorLogger.fs - - - ErrorResolutionHints.fs - - - InternalCollections.fsi - - - InternalCollections.fs - - - ilread.fsi - - - ilread.fs - - - ilwrite.fsi - - - ilwritepdb.fsi - - - ilwritepdb.fs - - - ilwrite.fs - - - ilreflect.fs - - - CompilerLocationUtils.fs - - - PrettyNaming.fs - - - ilxsettings.fs - - - EraseClosures.fsi - - - EraseClosures.fs - - - EraseUnions.fsi - - - EraseUnions.fs - - - UnicodeLexing.fsi - - - UnicodeLexing.fs - - - layout.fsi - - - layout.fs - - - ast.fs - - - - - lexhelp.fsi - - - lexhelp.fs - - - - - QuotationPickler.fsi - - - QuotationPickler.fs - - - QueueList.fs - - - tast.fs - - - TcGlobals.fs - - - TastOps.fsi - - - TastOps.fs - - - TastPickle.fsi - - - TastPickle.fs - - - LexFilter.fs - - - import.fsi - - - import.fs - - - infos.fs - - - Logic\AccessibilityLogic.fs - - - Logic\AttributeChecking.fs - - - Logic\InfoReader.fs - - - NicePrint.fs - - - AugmentWithHashCompare.fsi - - - AugmentWithHashCompare.fs - - - NameResolution.fsi - - - NameResolution.fs - - - TypeRelations.fs - - - Logic\SignatureConformance.fs - - - Logic\MethodOverrides.fs - - - MethodCalls.fs - - - PatternMatchCompilation.fsi - - - PatternMatchCompilation.fs - - - ConstraintSolver.fsi - - - ConstraintSolver.fs - - - CheckFormatStrings.fsi - - - CheckFormatStrings.fs - - - FindUnsolved.fs - - - QuotationTranslator.fsi - - - QuotationTranslator.fs - - - PostInferenceChecks.fsi - - - PostInferenceChecks.fs - - - TypeChecker.fsi - - - TypeChecker.fs - - - Optimizer.fsi - - - Optimizer.fs - - - autobox.fs - - - DetupleArgs.fsi - - - DetupleArgs.fs - - - InnerLambdasToTopLevelFuncs.fsi - - - InnerLambdasToTopLevelFuncs.fs - - - LowerCallsAndSeqs.fs - - - IlxGen.fsi - - - IlxGen.fs - - - CompileOps.fsi - - - CompileOps.fs - - - CompileOptions.fsi - - - CompileOptions.fs - - - fsc.fsi - - - fsc.fs - - - Service/SimulatedMSBuildReferenceResolver.fs - - - MSBuildReferenceResolver.fs - - - fscmain.fs - - - - - - - - - - - - $(FSharpSourcesRoot)\..\packages\System.Reflection.Metadata.$(SystemReflectionMetadataPackageVersion)\lib\portable-net45+win8\System.Reflection.Metadata.dll - - - $(FSharpSourcesRoot)\..\packages\System.Collections.Immutable.$(SystemCollectionsImmutablePackageVersion)\lib\portable-net45+win8+wp8+wpa81\System.Collections.Immutable.dll - - - $(FSharpSourcesRoot)\..\packages\System.ValueTuple.$(SystemValueTuplePackageVersion)\lib\netstandard1.0\System.ValueTuple.dll - - - {DED3BBD7-53F4-428A-8C9F-27968E768605} - FSharp.Core - - - - - $(FSharpSourcesRoot)\..\packages\Microsoft.Build.Framework.$(MicrosoftBuildFrameworkPackageVersion)\lib\net46\Microsoft.Build.Framework.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.Build.$(MicrosoftBuildPackageVersion)\lib\net46\Microsoft.Build.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.Build.Utilities.Core.$(MicrosoftBuildUtilitiesCorePackageVersion)\lib\net46\Microsoft.Build.Utilities.Core.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.Build.Tasks.Core.$(MicrosoftBuildTasksCorePackageVersion)\lib\net46\Microsoft.Build.Tasks.Core.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.Build.Tasks.Core.$(MicrosoftBuildTasksCorePackageVersion)\lib\net46\Microsoft.Build.Tasks.Core.dll - - - $(FSharpSourcesRoot)\..\packages\System.IO.Compression.$(SystemIoCompressionPackageVersion)\lib\net46\System.IO.Compression.dll - - - - - diff --git a/src/fsharp/Fsc-proto/app.config b/src/fsharp/Fsc-proto/app.config deleted file mode 100644 index be4549ea2d2..00000000000 --- a/src/fsharp/Fsc-proto/app.config +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/src/fsharp/Fsc/Fsc.fsproj b/src/fsharp/Fsc/Fsc.fsproj deleted file mode 100644 index aa6c8eed8fb..00000000000 --- a/src/fsharp/Fsc/Fsc.fsproj +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - $(MSBuildProjectDirectory)\..\.. - FSharp - true - true - - - - Debug - - x86 - AnyCPU - {C94C257C-3C0A-4858-B5D8-D746498D1F08} - Exe - $(NoWarn);62 - fsc - true - true - $(OtherFlags) --warnon:1182 - - - - - - - - - fscmain.fs - - - - default.win32manifest - PreserveNewest - - - - - - - - - - - - - - - - {2E4D67B4-522D-4CF7-97E4-BA940F0B18F3} - FSharp.Compiler.Private - - - {DED3BBD7-53F4-428A-8C9F-27968E768605} - FSharp.Core - - - - diff --git a/src/fsharp/Fsc/project.json b/src/fsharp/Fsc/project.json deleted file mode 100644 index 09458a531ee..00000000000 --- a/src/fsharp/Fsc/project.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "NETStandard.Library": "1.6.1", - "System.Linq.Expressions": "4.3.0", - "System.Reflection.Metadata": "1.6.0", - "System.Runtime.Loader": "4.3.0" - }, - "runtimes": { - "win7-x86": { }, - "win7-x64": { }, - "osx.10.11-x64": { }, - "ubuntu.14.04-x64": { } - }, - "frameworks": { - "netcoreapp1.0": { - "dependencies": { - "Microsoft.NETCore.App": { - "type": "platform", - "version": "1.1.0" - } - }, - "imports": [ "netstandard1.6", "portable-net45+win8+wp8+wpa81" ] - } - } -} diff --git a/src/fsharp/IlxGen.fs b/src/fsharp/IlxGen.fs index 903a424a4e4..d027afabeb5 100644 --- a/src/fsharp/IlxGen.fs +++ b/src/fsharp/IlxGen.fs @@ -400,13 +400,15 @@ and GenTyAppAux amap m tyenv repr tinst = let ty = IL.instILType ilTypeInst ty ty | CompiledTypeRepr.ILAsmNamed (tref, boxity, ilTypeOpt) -> - match ilTypeOpt with - | None -> - let ilTypeInst = GenTypeArgsAux amap m tyenv tinst - mkILTy boxity (mkILTySpec (tref,ilTypeInst)) - | Some ilType -> - ilType // monomorphic types include a cached ilType to avoid reallocation of an ILType node + GenILTyAppAux amap m tyenv (tref, boxity, ilTypeOpt) tinst +and GenILTyAppAux amap m tyenv (tref, boxity, ilTypeOpt) tinst = + match ilTypeOpt with + | None -> + let ilTypeInst = GenTypeArgsAux amap m tyenv tinst + mkILTy boxity (mkILTySpec (tref,ilTypeInst)) + | Some ilType -> + ilType // monomorphic types include a cached ilType to avoid reallocation of an ILType node and GenNamedTyAppAux (amap:ImportMap) m tyenv ptrsOK tcref tinst = let g = amap.g @@ -439,6 +441,10 @@ and GenTypeAux amap m (tyenv: TypeReprEnv) voidOK ptrsOK ty = | TType_tuple (tupInfo, args) -> GenTypeAux amap m tyenv VoidNotOK ptrsOK (mkCompiledTupleTy g (evalTupInfoIsStruct tupInfo) args) | TType_fun (dty, returnTy) -> EraseClosures.mkILFuncTy g.ilxPubCloEnv (GenTypeArgAux amap m tyenv dty) (GenTypeArgAux amap m tyenv returnTy) + | TType_anon (anonInfo, tinst) -> + let tref = anonInfo.ILTypeRef + let boxity = if evalAnonInfoIsStruct anonInfo then ILBoxity.AsValue else ILBoxity.AsObject + GenILTyAppAux amap m tyenv (tref, boxity, None) tinst | TType_ucase (ucref, args) -> let cuspec,idx = GenUnionCaseSpec amap m tyenv ucref args @@ -471,8 +477,8 @@ and GenUnionRef (amap: ImportMap) m (tcref: TyconRef) = let tycon = tcref.Deref assert(not tycon.IsTypeAbbrev) match tycon.UnionTypeInfo with - | None -> failwith "GenUnionRef m" - | Some funion -> + | ValueNone -> failwith "GenUnionRef m" + | ValueSome funion -> cached funion.CompiledRepresentation (fun () -> let tyenvinner = TypeReprEnv.ForTycon tycon match tcref.CompiledRepresentation with @@ -541,14 +547,7 @@ and GenParamTypes amap m tyenv isSlotSig tys = tys |> List.map (GenParamType amap m tyenv isSlotSig) and GenTypeArgs amap m tyenv tyargs = GenTypeArgsAux amap m tyenv tyargs - -let GenericParamHasConstraint (gp: ILGenericParameterDef) = - gp.Constraints.Length <> 0 || - gp.Variance <> NonVariant || - gp.HasReferenceTypeConstraint || - gp.HasNotNullableValueTypeConstraint || - gp.HasDefaultConstructorConstraint - +and GenTypePermitVoidAux amap m tyenv ty = GenTypeAux amap m tyenv VoidOK PtrTypesNotOK ty // Static fields generally go in a private InitializationCodeAndBackingFields section. This is to ensure all static // fields are initialized only in their class constructors (we generate one primary @@ -580,8 +579,7 @@ let GenRecdFieldRef m cenv tyenv (rfref:RecdFieldRef) tyargs = GenType cenv.amap m tyenvinner rfref.RecdField.FormalType) let GenExnType amap m tyenv (ecref:TyconRef) = GenTyApp amap m tyenv ecref.CompiledRepresentation [] - - + //-------------------------------------------------------------------------- // Closure summaries //-------------------------------------------------------------------------- @@ -739,8 +737,8 @@ let AddStorageForVal (g: TcGlobals) (v,s) eenv = // Passing an empty remap is sufficient for FSharp.Core.dll because it turns out the remapped type signature can // still be resolved. match tryRescopeVal g.fslibCcu Remap.Empty v with - | None -> eenv - | Some vref -> + | ValueNone -> eenv + | ValueSome vref -> match vref.TryDeref with | ValueNone -> //let msg = sprintf "could not dereference external value reference to something in FSharp.Core.dll during code generation, v.MangledName = '%s', v.Range = %s" v.MangledName (stringOfRange v.Range) @@ -766,7 +764,7 @@ let StorageForVal m v eenv = try eenv.valsInScope.[v] with :? KeyNotFoundException -> assert false - errorR(Error(FSComp.SR.ilUndefinedValue(showL(vspecAtBindL v)),m)) + errorR(Error(FSComp.SR.ilUndefinedValue(showL(valAtBindL v)),m)) notlazy (Arg 668(* random value for post-hoc diagnostic analysis on generated tree *) ) v.Force() @@ -860,7 +858,6 @@ let ComputeFieldSpecForVal(optIntraAssemblyInfo:IlxGenIntraAssemblyInfo option, else generate() - let IsValCompiledAsMethod g (v:Val) = match v.ValReprInfo with | None -> false @@ -1029,7 +1026,7 @@ and AddBindingsForModuleTopVals _g allocVal _cloc eenv vs = let AddIncrementalLocalAssemblyFragmentToIlxGenEnv (amap:ImportMap, isIncrementalFragment, g, ccu, fragName, intraAssemblyInfo, eenv, typedImplFiles) = let cloc = CompLocForFragment fragName ccu let allocVal = ComputeAndAddStorageForLocalTopVal (amap, g, intraAssemblyInfo, true, NoShadowLocal) - (eenv, typedImplFiles) ||> List.fold (fun eenv (TImplFile(qname,_,mexpr,_,_)) -> + (eenv, typedImplFiles) ||> List.fold (fun eenv (TImplFile(qname, _, mexpr, _, _, _)) -> let cloc = { cloc with clocTopImplQualifiedName = qname.Text } if isIncrementalFragment then match mexpr with @@ -1166,7 +1163,7 @@ and TypeDefsBuilder() = || not tdef.Fields.AsList.IsEmpty || not tdef.Events.AsList.IsEmpty || not tdef.Properties.AsList.IsEmpty - || not tdef.Methods.AsList.IsEmpty then + || not (Array.isEmpty tdef.Methods.AsArray) then yield tdef ] member b.FindTypeDefBuilder(nm) = @@ -1183,14 +1180,20 @@ and TypeDefsBuilder() = let idx = if addAtEnd then (countDown <- countDown - 1; countDown) else tdefs.Count tdefs.Add (tdef.Name, (idx, (new TypeDefBuilder(tdef, tdefDiscards), eliminateIfEmpty))) +type AnonTypeGenerationTable() = + let dict = Dictionary(HashIdentity.Structural) + member __.Table = dict + /// Assembly generation buffers -type AssemblyBuilder(cenv:cenv) as mgbuf = +type AssemblyBuilder(cenv:cenv, anonTypeTable: AnonTypeGenerationTable) as mgbuf = // The Abstract IL table of types let gtdefs= new TypeDefsBuilder() // The definitions of top level values, as quotations. - let mutable reflectedDefinitions : System.Collections.Generic.Dictionary = System.Collections.Generic.Dictionary(HashIdentity.Reference) + let mutable reflectedDefinitions : Dictionary = Dictionary(HashIdentity.Reference) + let mutable extraBindingsToGenerate = [] + // A memoization table for generating value types for big constant arrays - let vtgenerator= + let rawDataValueTypeGenerator = new MemoizationTable<(CompileLocation * int) , ILTypeSpec> ((fun (cloc,size) -> let name = CompilerGeneratedName ("T" + string(newUnique()) + "_" + string size + "Bytes") // Type names ending ...$T_37Bytes @@ -1202,6 +1205,129 @@ type AssemblyBuilder(cenv:cenv) as mgbuf = vtspec), keyComparer=HashIdentity.Structural) + let generateAnonType genToStringMethod (isStruct, ilTypeRef, nms) = + + let flds = [ for (i,nm) in Array.indexed nms -> (nm, nm + "@", ILType.TypeVar (uint16 i)) ] + // Note that this alternative below would give the same names as C#, but the generated + // comparison/equality doesn't know about these names. + //let flds = [ for (i,nm) in Array.indexed nms -> (nm, "<" + nm + ">" + "i__Field", ILType.TypeVar (uint16 i)) ] + + let ilGenericParams = + [ for nm in nms -> + { Name = sprintf "<%s>j__TPar" nm + Constraints = [] + Variance=NonVariant + CustomAttrsStored = storeILCustomAttrs emptyILCustomAttrs + HasReferenceTypeConstraint=false + HasNotNullableValueTypeConstraint=false + HasDefaultConstructorConstraint= false + MetadataIndex = NoMetadataIdx } ] + + let ilTy = mkILFormalNamedTy (if isStruct then ILBoxity.AsValue else ILBoxity.AsObject) ilTypeRef ilGenericParams + + // Generate the IL fields + let ilFieldDefs = + mkILFields + [ for (_, fldName, fldTy) in flds -> + let fdef = mkILInstanceField (fldName, fldTy, None, ILMemberAccess.Private) + fdef.With(customAttrs = mkILCustomAttrs [ cenv.g.DebuggerBrowsableNeverAttribute ]) ] + + // Generate property definitions for the fields compiled as properties + let ilProperties = + mkILProperties + [ for (i,(propName, _fldName, fldTy)) in List.indexed flds -> + ILPropertyDef(name=propName, + attributes=PropertyAttributes.None, + setMethod=None, + getMethod=Some(mkILMethRef(ilTypeRef,ILCallingConv.Instance,"get_" + propName,0,[],fldTy )), + callingConv=ILCallingConv.Instance.ThisConv, + propertyType=fldTy, + init= None, + args=[], + customAttrs=mkILCustomAttrs [ mkCompilationMappingAttrWithSeqNum cenv.g (int SourceConstructFlags.Field) i ]) ] + + let ilMethods = + [ for (propName, fldName, fldTy) in flds -> + mkLdfldMethodDef ("get_" + propName,ILMemberAccess.Public,false,ilTy,fldName,fldTy) + yield! genToStringMethod ilTy ] + + let ilBaseTy = (if isStruct then cenv.g.iltyp_ValueType else cenv.g.ilg.typ_Object) + + let ilCtorDef = mkILSimpleStorageCtorWithParamNames(None, (if isStruct then None else Some ilBaseTy.TypeSpec), ilTy, [], flds, ILMemberAccess.Public) + let ilCtorRef = mkRefToILMethod(ilTypeRef, ilCtorDef) + let ilMethodRefs = [| for mdef in ilMethods -> mkRefToILMethod(ilTypeRef, mdef) |] + + if ilTypeRef.Scope.IsLocalRef then + + // Create a tycon that looks exactly like a record definition, to help drive the generation of equality/comparison code + let m = range0 + let tps = + [ for nm in nms -> + let stp = Typar(mkSynId m ("T"+nm),TyparStaticReq.NoStaticReq,true) + NewTypar (TyparKind.Type, TyparRigidity.WarnIfNotRigid,stp,false,TyparDynamicReq.Yes,[],true,true) ] + + let tycon = + let lmtyp = MaybeLazy.Strict (NewEmptyModuleOrNamespaceType ModuleOrType) + let cpath = CompPath(ilTypeRef.Scope,[]) + NewTycon(Some cpath, ilTypeRef.Name, m, taccessPublic, taccessPublic, TyparKind.Type, LazyWithContext.NotLazy tps, XmlDoc.Empty, false, false, false, lmtyp) + + if isStruct then + tycon.SetIsStructRecordOrUnion(true) + + tycon.entity_tycon_repr <- + TRecdRepr (MakeRecdFieldsTable + [ for (tp, (propName, _fldName, _fldTy)) in (List.zip tps flds) -> + NewRecdField false None (mkSynId m propName) false (mkTyparTy tp) true false [] [] XmlDoc.Empty taccessPublic false ]) + + let tcref = mkLocalTyconRef tycon + let _,typ = generalizeTyconRef tcref + let tcaug = tcref.TypeContents + + tcaug.tcaug_interfaces <- + [ (cenv.g.mk_IStructuralComparable_ty,true,m) + (cenv.g.mk_IComparable_ty,true,m) + (mkAppTy cenv.g.system_GenericIComparable_tcref [typ],true,m) + (cenv.g.mk_IStructuralEquatable_ty,true,m) + (mkAppTy cenv.g.system_GenericIEquatable_tcref [typ],true,m) ] + + let vspec1,vspec2 = AugmentWithHashCompare.MakeValsForEqualsAugmentation cenv.g tcref + let evspec1,evspec2,evspec3 = AugmentWithHashCompare.MakeValsForEqualityWithComparerAugmentation cenv.g tcref + let cvspec1,cvspec2 = AugmentWithHashCompare.MakeValsForCompareAugmentation cenv.g tcref + let cvspec3 = AugmentWithHashCompare.MakeValsForCompareWithComparerAugmentation cenv.g tcref + + tcaug.SetCompare (mkLocalValRef cvspec1, mkLocalValRef cvspec2) + tcaug.SetCompareWith (mkLocalValRef cvspec3) + tcaug.SetEquals (mkLocalValRef vspec1, mkLocalValRef vspec2) + tcaug.SetHashAndEqualsWith (mkLocalValRef evspec1, mkLocalValRef evspec2, mkLocalValRef evspec3) + + // Build the ILTypeDef. We don't rely on the normal record generation process because we want very specific field names + + let ilTypeDefAttribs = mkILCustomAttrs [ cenv.g.CompilerGeneratedAttribute; mkCompilationMappingAttr cenv.g (int SourceConstructFlags.RecordType) ] + + let ilInterfaceTys = [ for (ity,_,_) in tcaug.tcaug_interfaces -> GenType cenv.amap m (TypeReprEnv.ForTypars tps) ity ] + + let ilTypeDef = + mkILGenericClass (ilTypeRef.Name, ILTypeDefAccess.Public, ilGenericParams, ilBaseTy, ilInterfaceTys, + mkILMethods (ilCtorDef :: ilMethods), ilFieldDefs, emptyILTypeDefs, + ilProperties, mkILEvents [], ilTypeDefAttribs, + ILTypeInit.BeforeField) + + let ilTypeDef = ilTypeDef.WithSealed(true).WithSerializable(true) + + mgbuf.AddTypeDef(ilTypeRef, ilTypeDef, false, true, None) + + let extraBindings = + [ yield! AugmentWithHashCompare.MakeBindingsForCompareAugmentation cenv.g tycon + yield! AugmentWithHashCompare.MakeBindingsForCompareWithComparerAugmentation cenv.g tycon + yield! AugmentWithHashCompare.MakeBindingsForEqualityWithComparerAugmentation cenv.g tycon + yield! AugmentWithHashCompare.MakeBindingsForEqualsAugmentation cenv.g tycon ] + + let optimizedExtraBindings = extraBindings |> List.map (fun (TBind(a,b,c)) -> TBind(a,cenv.optimizeDuringCodeGen b,c)) + + extraBindingsToGenerate <- optimizedExtraBindings @ extraBindingsToGenerate + + (ilCtorRef,ilMethodRefs,ilTy) + let mutable explicitEntryPointInfo : ILTypeRef option = None /// static init fields on script modules. @@ -1221,14 +1347,32 @@ type AssemblyBuilder(cenv:cenv) as mgbuf = scriptInitFspecs |> List.iter IntializeCompiledScript | None -> () - - member mgbuf.GenerateRawDataValueType(cloc,size) = // Byte array literals require a ValueType of size the required number of bytes. // With fsi.exe, S.R.Emit TypeBuilder CreateType has restrictions when a ValueType VT is nested inside a type T, and T has a field of type VT. // To avoid this situation, these ValueTypes are generated under the private implementation rather than in the current cloc. [was bug 1532]. let cloc = CompLocForPrivateImplementationDetails cloc - vtgenerator.Apply((cloc,size)) + rawDataValueTypeGenerator.Apply((cloc,size)) + + member mgbuf.GenerateAnonType(genToStringMethod, anonInfo:AnonRecdTypeInfo) = + let isStruct = evalAnonInfoIsStruct anonInfo + let key = anonInfo.Stamp + match anonTypeTable.Table.TryGetValue key with + | true, res -> res + | _ -> + let info = generateAnonType genToStringMethod (isStruct,anonInfo.ILTypeRef,anonInfo.SortedNames) + anonTypeTable.Table.[key] <- info + info + + member mgbuf.LookupAnonType(anonInfo:AnonRecdTypeInfo) = + match anonTypeTable.Table.TryGetValue anonInfo.Stamp with + | true, res -> res + | _ -> failwithf "the anonymous record %A has not been generated in the pre-phase of generating this module" anonInfo.ILTypeRef + + member mgbuf.GrabExtraBindingsToGenerate() = + let result = extraBindingsToGenerate + extraBindingsToGenerate <- [] + result member mgbuf.AddTypeDef(tref:ILTypeRef, tdef, eliminateIfEmpty, addAtEnd, tdefDiscards) = gtdefs.FindNestedTypeDefsBuilder(tref.Enclosing).AddTypeDef(tdef, eliminateIfEmpty, addAtEnd, tdefDiscards) @@ -1281,7 +1425,6 @@ type AssemblyBuilder(cenv:cenv) as mgbuf = member mgbuf.cenv = cenv member mgbuf.GetExplicitEntryPointInfo() = explicitEntryPointInfo - /// Record the types of the things on the evaluation stack. /// Used for the few times we have to flush the IL evaluation stack and to compute maxStack. @@ -1895,13 +2038,17 @@ let rec GenExpr (cenv:cenv) (cgbuf:CodeGenBuffer) eenv sp expr sequel = | Expr.Val(v,_,m) -> GenGetVal cenv cgbuf eenv (v,m) sequel | Expr.Op(op,tyargs,args,m) -> - begin match op,args,tyargs with + match op,args,tyargs with | TOp.ExnConstr(c),_,_ -> GenAllocExn cenv cgbuf eenv (c,args,m) sequel | TOp.UnionCase(c),_,_ -> GenAllocUnionCase cenv cgbuf eenv (c,tyargs,args,m) sequel | TOp.Recd(isCtor,tycon),_,_ -> GenAllocRecd cenv cgbuf eenv isCtor (tycon,tyargs,args,m) sequel + | TOp.AnonRecd(anonInfo),_,_ -> + GenAllocAnonRecd cenv cgbuf eenv (anonInfo,tyargs,args,m) sequel + | TOp.AnonRecdGet (anonInfo,n),[e],_ -> + GenGetAnonRecdField cenv cgbuf eenv (anonInfo,e,tyargs,n,m) sequel | TOp.TupleFieldGet (tupInfo,n),[e],_ -> GenGetTupleField cenv cgbuf eenv (tupInfo,e,tyargs,n,m) sequel | TOp.ExnFieldGet(ecref,n),[e],_ -> @@ -1981,7 +2128,6 @@ let rec GenExpr (cenv:cenv) (cgbuf:CodeGenBuffer) eenv sp expr sequel = cgbuf.SetMarkToHere (Mark label) GenUnitThenSequel cenv eenv m eenv.cloc cgbuf sequel | _ -> error(InternalError("Unexpected operator node expression",expr.Range)) - end | Expr.StaticOptimization(constraints,e2,e3,m) -> GenStaticOptimization cenv cgbuf eenv (constraints,e2,e3,m) sequel | Expr.Obj(_,ty,_,_,[meth],[],m) when isDelegateTy cenv.g ty -> @@ -2226,6 +2372,24 @@ and GenAllocRecd cenv cgbuf eenv ctorInfo (tcref,argtys,args,m) sequel = (mkILCtorMethSpecForTy (ty,relevantFields |> List.map (fun f -> GenType cenv.amap m tyenvinner f.FormalType) ))) GenSequel cenv eenv.cloc cgbuf sequel +and GenAllocAnonRecd cenv cgbuf eenv (anonInfo: AnonRecdTypeInfo, tyargs, args, m) sequel = + let anonCtor, _anonMethods, anonType = cgbuf.mgbuf.LookupAnonType(anonInfo) + let boxity = anonType.Boxity + GenExprs cenv cgbuf eenv args + let ilTypeArgs = GenTypeArgs cenv.amap m eenv.tyenv tyargs + let anonTypeWithInst = mkILTy boxity (mkILTySpec(anonType.TypeSpec.TypeRef,ilTypeArgs)) + CG.EmitInstr cgbuf (pop args.Length) (Push [anonTypeWithInst]) (mkNormalNewobj (mkILMethSpec(anonCtor,boxity,ilTypeArgs,[]))) + GenSequel cenv eenv.cloc cgbuf sequel + +and GenGetAnonRecdField cenv cgbuf eenv (anonInfo: AnonRecdTypeInfo, e, tyargs, n, m) sequel = + let _anonCtor, anonMethods, anonType = cgbuf.mgbuf.LookupAnonType(anonInfo) + let boxity = anonType.Boxity + let ilTypeArgs = GenTypeArgs cenv.amap m eenv.tyenv tyargs + let anonMethod = anonMethods.[n] + let anonFieldType = ilTypeArgs.[n] + GenExpr cenv cgbuf eenv SPSuppress e Continue + CG.EmitInstr cgbuf (pop 1) (Push [anonFieldType]) (mkNormalCall (mkILMethSpec(anonMethod,boxity,ilTypeArgs,[]))) + GenSequel cenv eenv.cloc cgbuf sequel and GenNewArraySimple cenv cgbuf eenv (elems,elemTy,m) sequel = let ilElemTy = GenType cenv.amap m eenv.tyenv elemTy @@ -3425,21 +3589,21 @@ and GenDefaultValue cenv cgbuf eenv (ty,m) = CG.EmitInstr cgbuf (pop 0) (Push [ilTy]) AI_ldnull else match tryDestAppTy cenv.g ty with - | Some tcref when (tyconRefEq cenv.g cenv.g.system_SByte_tcref tcref || - tyconRefEq cenv.g cenv.g.system_Int16_tcref tcref || - tyconRefEq cenv.g cenv.g.system_Int32_tcref tcref || - tyconRefEq cenv.g cenv.g.system_Bool_tcref tcref || - tyconRefEq cenv.g cenv.g.system_Byte_tcref tcref || - tyconRefEq cenv.g cenv.g.system_Char_tcref tcref || - tyconRefEq cenv.g cenv.g.system_UInt16_tcref tcref || - tyconRefEq cenv.g cenv.g.system_UInt32_tcref tcref) -> + | ValueSome tcref when (tyconRefEq cenv.g cenv.g.system_SByte_tcref tcref || + tyconRefEq cenv.g cenv.g.system_Int16_tcref tcref || + tyconRefEq cenv.g cenv.g.system_Int32_tcref tcref || + tyconRefEq cenv.g cenv.g.system_Bool_tcref tcref || + tyconRefEq cenv.g cenv.g.system_Byte_tcref tcref || + tyconRefEq cenv.g cenv.g.system_Char_tcref tcref || + tyconRefEq cenv.g cenv.g.system_UInt16_tcref tcref || + tyconRefEq cenv.g cenv.g.system_UInt32_tcref tcref) -> CG.EmitInstr cgbuf (pop 0) (Push [ilTy]) iLdcZero - | Some tcref when (tyconRefEq cenv.g cenv.g.system_Int64_tcref tcref || - tyconRefEq cenv.g cenv.g.system_UInt64_tcref tcref) -> + | ValueSome tcref when (tyconRefEq cenv.g cenv.g.system_Int64_tcref tcref || + tyconRefEq cenv.g cenv.g.system_UInt64_tcref tcref) -> CG.EmitInstr cgbuf (pop 0) (Push [ilTy]) (iLdcInt64 0L) - | Some tcref when (tyconRefEq cenv.g cenv.g.system_Single_tcref tcref) -> + | ValueSome tcref when (tyconRefEq cenv.g cenv.g.system_Single_tcref tcref) -> CG.EmitInstr cgbuf (pop 0) (Push [ilTy]) (iLdcSingle 0.0f) - | Some tcref when (tyconRefEq cenv.g cenv.g.system_Double_tcref tcref) -> + | ValueSome tcref when (tyconRefEq cenv.g cenv.g.system_Double_tcref tcref) -> CG.EmitInstr cgbuf (pop 0) (Push [ilTy]) (iLdcDouble 0.0) | _ -> let ilTy = GenType cenv.amap m eenv.tyenv ty @@ -3634,7 +3798,6 @@ and GenObjectExpr cenv cgbuf eenvouter expr (baseType,baseValOpt,basecall,overri let eenvinner = bindBaseOrThisVarOpt cenv eenvinner baseValOpt let ilCtorBody = CodeGenMethodForExpr cenv cgbuf.mgbuf (SPAlways,[],cloName,eenvinner,1,basecall,discardAndReturnVoid) - let genMethodAndOptionalMethodImpl tmethod useMethodImpl = [ for ((useMethodImpl,methodImplGeneratorFunction,methTyparsOfOverridingMethod),mdef) in GenObjectMethod cenv eenvinner cgbuf useMethodImpl tmethod do let mimpl = (if useMethodImpl then Some(methodImplGeneratorFunction (ilTyForOverriding,methTyparsOfOverridingMethod)) else None) @@ -3697,12 +3860,6 @@ and GenSequenceExpr cenv (cgbuf:CodeGenBuffer) eenvouter (nextEnumeratorValRef:V CodeGenMethod cenv cgbuf.mgbuf ([],"GetFreshEnumerator",eenvinner,1, (fun cgbuf eenv -> for fv in cloFreeVars do -(* TODO: Emit CompareExchange - if (System.Threading.Interlocked.CompareExchange(&__state, 1, 0) = 0) then - (x :> IEnumerator<'T>) - else - ... -*) /// State variables always get zero-initialized if stateVarsSet.Contains fv then GenDefaultValue cenv cgbuf eenv (fv.Type,m) @@ -3799,12 +3956,13 @@ and GenLambdaClosure cenv (cgbuf:CodeGenBuffer) eenv isLocalTypeFunc selfv expr | Expr.Lambda (_,_,_,_,_,m,_) | Expr.TyLambda(_,_,_,m,_) -> - let cloinfo,body,eenvinner = GetIlxClosureInfo cenv m isLocalTypeFunc selfv eenv expr + let cloinfo,body,eenvinner = GetIlxClosureInfo cenv m isLocalTypeFunc selfv eenv expr let entryPointInfo = match selfv with | Some v -> [(v, BranchCallClosure (cloinfo.cloArityInfo))] | _ -> [] + let ilCloBody = CodeGenMethodForExpr cenv cgbuf.mgbuf (SPAlways,entryPointInfo,cloinfo.cloName,eenvinner,1,body,Return) let ilCloTypeRef = cloinfo.cloSpec.TypeRef let cloTypeDefs = @@ -3968,7 +4126,7 @@ and GetIlxClosureFreeVars cenv m selfv eenvouter takenNames expr = (cloAttribs,cloInternalFreeTyvars,cloContractFreeTyvars,cloFreeTyvars,cloFreeVars,ilCloTypeRef,Array.ofList ilCloFreeVars,eenvinner) -and GetIlxClosureInfo cenv m isLocalTypeFunc selfv eenvouter expr = +and GetIlxClosureInfo cenv m isLocalTypeFunc selfv eenvouter expr = let returnTy = match expr with | Expr.Lambda (_,_,_,_,_,_,returnTy) | Expr.TyLambda(_,_,_,_,returnTy) -> returnTy @@ -4622,7 +4780,7 @@ and GenLetRecFixup cenv cgbuf eenv (ilxCloSpec:IlxClosureSpec,e,ilField:ILFieldS GenExpr cenv cgbuf eenv SPSuppress e2 Continue CG.EmitInstrs cgbuf (pop 2) Push0 [ mkNormalStfld (mkILFieldSpec(ilField.FieldRef,ilxCloSpec.ILType)) ] -and GenLetRecBindings cenv cgbuf eenv (allBinds: Bindings,m) = +and GenLetRecBindings cenv (cgbuf:CodeGenBuffer) eenv (allBinds: Bindings,m) = // Fix up recursion for non-toplevel recursive bindings let bindsPossiblyRequiringFixup = allBinds |> List.filter (fun b -> @@ -5118,28 +5276,35 @@ and ComputeFlagFixupsForMemberBinding cenv (v:Val,memberInfo:ValMemberInfo) = else memberInfo.ImplementedSlotSigs |> List.map (fun slotsig -> let oty = slotsig.ImplementedType - let otcref,_ = destAppTy cenv.g oty + let otcref = tcrefOfAppTy cenv.g oty let tcref = v.MemberApparentEntity - let useMethodImpl = - // REVIEW: it would be good to get rid of this special casing of Compare and GetHashCode during code generation - let isCompare = - (Option.isSome tcref.GeneratedCompareToValues && typeEquiv cenv.g oty cenv.g.mk_IComparable_ty) || - (Option.isSome tcref.GeneratedCompareToValues && tyconRefEq cenv.g cenv.g.system_GenericIComparable_tcref otcref) - - let isGenericEquals = - (Option.isSome tcref.GeneratedHashAndEqualsWithComparerValues && tyconRefEq cenv.g cenv.g.system_GenericIEquatable_tcref otcref) - - let isStructural = - (Option.isSome tcref.GeneratedCompareToWithComparerValues && typeEquiv cenv.g oty cenv.g.mk_IStructuralComparable_ty) || - (Option.isSome tcref.GeneratedHashAndEqualsWithComparerValues && typeEquiv cenv.g oty cenv.g.mk_IStructuralEquatable_ty) - isInterfaceTy cenv.g oty && not isCompare && not isStructural && not isGenericEquals + let useMethodImpl = + // REVIEW: it would be good to get rid of this special casing of Compare and GetHashCode during code generation + isInterfaceTy cenv.g oty && + (let isCompare = + Option.isSome tcref.GeneratedCompareToValues && + (typeEquiv cenv.g oty cenv.g.mk_IComparable_ty || + tyconRefEq cenv.g cenv.g.system_GenericIComparable_tcref otcref) + + not isCompare) && + (let isGenericEquals = + Option.isSome tcref.GeneratedHashAndEqualsWithComparerValues && tyconRefEq cenv.g cenv.g.system_GenericIEquatable_tcref otcref + + not isGenericEquals) && + (let isStructural = + (Option.isSome tcref.GeneratedCompareToWithComparerValues && typeEquiv cenv.g oty cenv.g.mk_IStructuralComparable_ty) || + (Option.isSome tcref.GeneratedHashAndEqualsWithComparerValues && typeEquiv cenv.g oty cenv.g.mk_IStructuralEquatable_ty) + + not isStructural) let nameOfOverridingMethod = GenNameOfOverridingMethod cenv (useMethodImpl,slotsig) - (if useMethodImpl then fixupMethodImplFlags >> renameMethodDef nameOfOverridingMethod - else fixupVirtualSlotFlags >> renameMethodDef nameOfOverridingMethod)) + if useMethodImpl then + fixupMethodImplFlags >> renameMethodDef nameOfOverridingMethod + else + fixupVirtualSlotFlags >> renameMethodDef nameOfOverridingMethod) and ComputeMethodImplAttribs cenv (_v:Val) attrs = let implflags = @@ -5256,7 +5421,7 @@ and GenMethodForBinding let securityAttributes,attrs = attrs |> List.partition (fun a -> IsSecurityAttribute cenv.g cenv.amap cenv.casApplied a m) - let permissionSets = CreatePermissionSets cenv.g cenv.amap eenv securityAttributes + let permissionSets = CreatePermissionSets cenv eenv securityAttributes let secDecls = if List.isEmpty securityAttributes then emptyILSecurityDecls else mkILSecurityDecls permissionSets @@ -5817,18 +5982,18 @@ and GenCompilationArgumentCountsAttr cenv (v:Val) = () ] // Create a permission set for a list of security attributes -and CreatePermissionSets g amap eenv (securityAttributes : Attrib list) = +and CreatePermissionSets cenv eenv (securityAttributes : Attrib list) = [for ((Attrib(tcref,_,actions,_,_,_,_)) as attr) in securityAttributes do let action = match actions with | [AttribInt32Arg act] -> act | _ -> failwith "internal error: unrecognized security action" let secaction = (List.assoc action (Lazy.force ILSecurityActionRevMap)) let tref = tcref.CompiledRepresentationForNamedType - let ilattr = GenAttr amap g eenv attr + let ilattr = GenAttr cenv.amap cenv.g eenv attr let _, ilNamedArgs = - match TryDecodeILAttribute g tref (mkILCustomAttrs [ilattr]) with + match TryDecodeILAttribute cenv.g tref (mkILCustomAttrs [ilattr]) with | Some(ae,na) -> ae, na | _ -> [],[] let setArgs = ilNamedArgs |> List.map (fun (n,ilt,_,ilae) -> (n,ilt,ilae)) - yield IL.mkPermissionSet g.ilg (secaction, [(tref, setArgs)])] + yield IL.mkPermissionSet cenv.g.ilg (secaction, [(tref, setArgs)])] //-------------------------------------------------------------------------- // Generate the set of modules for an assembly, and the declarations in each module @@ -5934,7 +6099,14 @@ and GenModuleBinding cenv (cgbuf:CodeGenBuffer) (qname:QualifiedNameOfFile) lazy /// Generate the namespace fragments in a single file -and GenTopImpl cenv mgbuf mainInfoOpt eenv (TImplFile(qname, _, mexpr, hasExplicitEntryPoint, isScript), optimizeDuringCodeGen) = +and GenTopImpl cenv (mgbuf: AssemblyBuilder) mainInfoOpt eenv (TImplFile(qname, _, mexpr, hasExplicitEntryPoint, isScript, anonRecdTypes), optimizeDuringCodeGen) = + + let m = qname.Range + + // Generate all the anonymous record types mentioned anywhere in this module + for anonInfo in anonRecdTypes.Values do + mgbuf.GenerateAnonType((fun ilThisTy -> GenToStringMethod cenv eenv ilThisTy m), anonInfo) |> ignore + let eenv = {eenv with cloc = { eenv.cloc with clocTopImplQualifiedName = qname.Text } } cenv.optimizeDuringCodeGen <- optimizeDuringCodeGen @@ -5964,7 +6136,6 @@ and GenTopImpl cenv mgbuf mainInfoOpt eenv (TImplFile(qname, _, mexpr, hasExplic let lazyInitInfo = new ResizeArray ILInstr list -> ILInstr list -> unit>() // codegen .cctor/main for outer module - let m = qname.Range let clocCcu = CompLocForCcu cenv.viewCcu // This method name is only used internally in ilxgen.fs to aid debugging @@ -5990,8 +6161,6 @@ and GenTopImpl cenv mgbuf mainInfoOpt eenv (TImplFile(qname, _, mexpr, hasExplic // Library file (mainInfoOpt = None) : optional .cctor if topCode has initialization effect // Final file, explicit entry point (mainInfoOpt = Some _, GetExplicitEntryPointInfo() = Some) : main + optional .cctor if topCode has initialization effect // Final file, implicit entry point (mainInfoOpt = Some _, GetExplicitEntryPointInfo() = None) : main + initialize + optional .cctor calling initialize - - let doesSomething = CheckCodeDoesSomething topCode.Code // Make a FEEFEE instruction to mark hidden code regions @@ -6170,12 +6339,11 @@ and GenAbstractBinding cenv eenv tref (vref:ValRef) = else [],[],[] -and GenTypeDef cenv mgbuf lazyInitInfo eenv m (tycon:Tycon) = - let genToString ilThisTy = - [ - match (eenv.valsInScope.TryFind cenv.g.sprintf_vref.Deref, - eenv.valsInScope.TryFind cenv.g.new_format_vref.Deref) with - | Some(Lazy(Method(_,_,sprintfMethSpec,_,_,_,_))), Some(Lazy(Method(_,_,newFormatMethSpec,_,_,_,_))) -> +/// Generate a ToString method that calls 'sprintf "%A"' +and GenToStringMethod cenv eenv ilThisTy m = + [ match (eenv.valsInScope.TryFind cenv.g.sprintf_vref.Deref, + eenv.valsInScope.TryFind cenv.g.new_format_vref.Deref) with + | Some(Lazy(Method(_,_,sprintfMethSpec,_,_,_,_))), Some(Lazy(Method(_,_,newFormatMethSpec,_,_,_,_))) -> // The type returned by the 'sprintf' call let funcTy = EraseClosures.mkILFuncTy cenv.g.ilxPubCloEnv ilThisTy cenv.g.ilg.typ_String // Give the instantiation of the printf format object, i.e. a Format`5 object compatible with StringFormat @@ -6209,9 +6377,9 @@ and GenTypeDef cenv mgbuf lazyInitInfo eenv m (tycon:Tycon) = None)) let mdef = mdef.With(customAttrs = mkILCustomAttrs [ cenv.g.CompilerGeneratedAttribute ]) yield mdef - | None,_ -> () - | _,None -> () - | _ -> ()] + | _ -> () ] + +and GenTypeDef cenv mgbuf lazyInitInfo eenv m (tycon:Tycon) = let tcref = mkLocalTyconRef tycon if tycon.IsTypeAbbrev then () else match tycon.TypeReprInfo with @@ -6323,7 +6491,7 @@ and GenTypeDef cenv mgbuf lazyInitInfo eenv m (tycon:Tycon) = let generateDebugProxies = (not (tyconRefEq cenv.g tcref cenv.g.unit_tcr_canon) && not (HasFSharpAttribute cenv.g cenv.g.attrib_DebuggerTypeProxyAttribute tycon.Attribs)) - let permissionSets = CreatePermissionSets cenv.g cenv.amap eenv securityAttrs + let permissionSets = CreatePermissionSets cenv eenv securityAttrs let secDecls = if List.isEmpty securityAttrs then emptyILSecurityDecls else mkILSecurityDecls permissionSets let ilDebugDisplayAttributes = @@ -6359,7 +6527,7 @@ and GenTypeDef cenv mgbuf lazyInitInfo eenv m (tycon:Tycon) = (match ilTypeDefKind with ILTypeDefKind.ValueType -> true | _ -> false) && // All structs are sequential by default // Structs with no instance fields get size 1, pack 0 - tycon.AllFieldsAsList |> List.forall (fun f -> f.IsStatic) + tycon.AllFieldsArray |> Array.forall (fun f -> f.IsStatic) isEmptyStruct && cenv.opts.workAroundReflectionEmitBugs && not tycon.TyparsNoRange.IsEmpty @@ -6367,7 +6535,7 @@ and GenTypeDef cenv mgbuf lazyInitInfo eenv m (tycon:Tycon) = let isCLIMutable = (TryFindFSharpBoolAttribute cenv.g cenv.g.attrib_CLIMutableAttribute tycon.Attribs = Some true) let fieldSummaries = - [ for fspec in tycon.AllFieldsAsList do + [ for fspec in tycon.AllFieldsArray do let useGenuineField = useGenuineField tycon fspec @@ -6576,7 +6744,7 @@ and GenTypeDef cenv mgbuf lazyInitInfo eenv m (tycon:Tycon) = yield mkILSimpleStorageCtor(None, Some cenv.g.ilg.typ_Object.TypeSpec, ilThisTy, [], [], reprAccess) if not (tycon.HasMember cenv.g "ToString" []) then - yield! genToString ilThisTy + yield! GenToStringMethod cenv eenv ilThisTy m | TFSharpObjectRepr r when tycon.IsFSharpDelegateTycon -> // Build all the methods that go with a delegate type @@ -6591,12 +6759,11 @@ and GenTypeDef cenv mgbuf lazyInitInfo eenv m (tycon:Tycon) = | [[tsp]] when isUnitTy cenv.g tsp.Type -> [] (* suppress unit arg *) | paraml -> paraml GenActualSlotsig m cenv eenvinner (TSlotSig(nm,ty,ctps,mtps,paraml,returnTy)) [] [] - for ilMethodDef in mkILDelegateMethods reprAccess cenv.g.ilg (cenv.g.iltyp_AsyncCallback, cenv.g.iltyp_IAsyncResult) (p,r) do - yield ilMethodDef + yield! mkILDelegateMethods reprAccess cenv.g.ilg (cenv.g.iltyp_AsyncCallback, cenv.g.iltyp_IAsyncResult) (p,r) | _ -> () | TUnionRepr _ when not (tycon.HasMember cenv.g "ToString" []) -> - yield! genToString ilThisTy + yield! GenToStringMethod cenv eenv ilThisTy m | _ -> () ] let ilMethods = methodDefs @ augmentOverrideMethodDefs @ abstractMethodDefs @@ -6685,7 +6852,7 @@ and GenTypeDef cenv mgbuf lazyInitInfo eenv m (tycon:Tycon) = // All structs are sequential by default // Structs with no instance fields get size 1, pack 0 - if tycon.AllFieldsAsList |> List.exists (fun f -> not f.IsStatic) || + if tycon.AllFieldsArray |> Array.exists (fun f -> not f.IsStatic) || // Reflection emit doesn't let us emit 'pack' and 'size' for generic structs. // In that case we generate a dummy field instead (cenv.opts.workAroundReflectionEmitBugs && not tycon.TyparsNoRange.IsEmpty) @@ -6922,7 +7089,26 @@ let CodegenAssembly cenv eenv mgbuf fileImpls = if not (isNil fileImpls) then let a,b = List.frontAndBack fileImpls let eenv = List.fold (GenTopImpl cenv mgbuf None) eenv a - let _eenv = GenTopImpl cenv mgbuf cenv.opts.mainMethodInfo eenv b + let eenv = GenTopImpl cenv mgbuf cenv.opts.mainMethodInfo eenv b + + // Some constructs generate residue types and bindings. Generate these now. They don't result in any + // top-level initialization code. + begin + let extraBindings = mgbuf.GrabExtraBindingsToGenerate() + //printfn "#extraBindings = %d" extraBindings.Length + if extraBindings.Length > 0 then + let mexpr = TMDefs [ for b in extraBindings -> TMDefLet(b,range0) ] + let _emptyTopInstrs,_emptyTopCode = + CodeGenMethod cenv mgbuf ([],"unused",eenv,0, (fun cgbuf eenv -> + let lazyInitInfo = ResizeArray() + let qname = QualifiedNameOfFile(mkSynId range0 "unused") + LocalScope "module" cgbuf (fun scopeMarks -> + let eenv = AddBindingsForModuleDef (fun cloc v -> AllocTopValWithinExpr cenv cgbuf cloc scopeMarks v) eenv.cloc eenv mexpr + GenModuleDef cenv cgbuf qname lazyInitInfo eenv mexpr)),range0) + //printfn "#_emptyTopInstrs = %d" _emptyTopInstrs.Length + () + end + mgbuf.AddInitializeScriptsInOrderToEntryPoint() //------------------------------------------------------------------------- @@ -6947,15 +7133,17 @@ type IlxGenResults = { ilTypeDefs: ILTypeDef list ilAssemAttrs : ILAttribute list ilNetModuleAttrs: ILAttribute list + topAssemblyAttrs : Attribs + permissionSets : ILSecurityDecl list quotationResourceInfo: (ILTypeRef list * byte[]) list } -let GenerateCode (cenv, eenv, TypedAssemblyAfterOptimization fileImpls, assemAttribs, moduleAttribs) = +let GenerateCode (cenv, anonTypeTable, eenv, TypedAssemblyAfterOptimization fileImpls, assemAttribs, moduleAttribs) = use unwindBuildPhase = PushThreadBuildPhaseUntilUnwind BuildPhase.IlxGen // Generate the implementations into the mgbuf - let mgbuf= new AssemblyBuilder(cenv) + let mgbuf = new AssemblyBuilder(cenv, anonTypeTable) let eenv = { eenv with cloc = CompLocForFragment cenv.opts.fragName cenv.viewCcu } // Generate the PrivateImplementationDetails type @@ -6968,6 +7156,7 @@ let GenerateCode (cenv, eenv, TypedAssemblyAfterOptimization fileImpls, assemAtt let tdefs,reflectedDefinitions = mgbuf.Close() + // Generate the quotations let quotationResourceInfo = match reflectedDefinitions with @@ -7004,9 +7193,16 @@ let GenerateCode (cenv, eenv, TypedAssemblyAfterOptimization fileImpls, assemAtt let ilNetModuleAttrs = GenAttrs cenv eenv moduleAttribs + let casApplied = new Dictionary() + let securityAttrs, topAssemblyAttrs = assemAttribs |> List.partition (fun a -> IsSecurityAttribute cenv.g cenv.amap casApplied a rangeStartup) + // remove any security attributes from the top-level assembly attribute list + let permissionSets = CreatePermissionSets cenv eenv securityAttrs + { ilTypeDefs= tdefs ilAssemAttrs = ilAssemAttrs ilNetModuleAttrs = ilNetModuleAttrs + topAssemblyAttrs = topAssemblyAttrs + permissionSets = permissionSets quotationResourceInfo = quotationResourceInfo } @@ -7106,37 +7302,13 @@ let ClearGeneratedValue (ctxt: ExecutionContext) (_g:TcGlobals) eenv (v:Val) = #endif () -(* -let LookupGeneratedInfo (ctxt: ExecutionContext) (g:TcGlobals) eenv (v:Val) = - try - match StorageForVal v.Range v eenv with - | StaticField (fspec, _, hasLiteralAttr, ilContainerTy, _, _, ilGetterMethRef, _, _) -> - let staticTy = ctxt.LookupTypeRef ilContainerTy.TypeRef - if hasLiteralAttr then - Some (staticTy.GetField(fspec.Name) :> MemberInfo) - else - Some (staticTy.GetMethod(ilGetterMethRef.Name,[||]) :> MemberInfo) - | Null -> None - | Local _ -> None - | Method _ -> None - | Arg _ -> None - | Env _ -> None - with - e -> -#if DEBUG - printf "ilxGen.lookupGenertedInfo for v=%s caught exception:\n%A\n\n" v.LogicalName e -#endif - None - - -*) - /// The published API from the ILX code generator type IlxAssemblyGenerator(amap: ImportMap, tcGlobals: TcGlobals, tcVal : ConstraintSolver.TcValF, ccu: Tast.CcuThunk) = // The incremental state held by the ILX code generator let mutable ilxGenEnv = GetEmptyIlxGenEnv tcGlobals.ilg ccu + let anonTypeTable = AnonTypeGenerationTable() let intraAssemblyInfo = { StaticFieldInfo = new Dictionary<_,_>(HashIdentity.Structural) } let casApplied = new Dictionary() @@ -7161,7 +7333,7 @@ type IlxAssemblyGenerator(amap: ImportMap, tcGlobals: TcGlobals, tcVal : Constra intraAssemblyInfo = intraAssemblyInfo opts = codeGenOpts optimizeDuringCodeGen = (fun x -> x) } - GenerateCode (cenv, ilxGenEnv, typedAssembly, assemAttribs, moduleAttribs) + GenerateCode (cenv, anonTypeTable, ilxGenEnv, typedAssembly, assemAttribs, moduleAttribs) /// Invert the compilation of the given value and clear the storage of the value member __.ClearGeneratedValue (ctxt, v) = ClearGeneratedValue ctxt tcGlobals ilxGenEnv v @@ -7169,5 +7341,4 @@ type IlxAssemblyGenerator(amap: ImportMap, tcGlobals: TcGlobals, tcVal : Constra /// Invert the compilation of the given value and return its current dynamic value and its compiled System.Type member __.LookupGeneratedValue (ctxt, v) = LookupGeneratedValue amap ctxt ilxGenEnv v - /// Create the CAS permission sets for an assembly fragment - member __.CreatePermissionSets attribs = CreatePermissionSets tcGlobals amap ilxGenEnv attribs + diff --git a/src/fsharp/IlxGen.fsi b/src/fsharp/IlxGen.fsi index 25c727eca82..6d50da1bfd3 100644 --- a/src/fsharp/IlxGen.fsi +++ b/src/fsharp/IlxGen.fsi @@ -62,6 +62,10 @@ type public IlxGenResults = ilAssemAttrs : ILAttribute list /// The generated IL/ILX .NET module attributes ilNetModuleAttrs : ILAttribute list + /// The attributes for the assembly in F# form + topAssemblyAttrs : Attribs + /// The security attributes to attach to the assembly + permissionSets : ILSecurityDecl list /// The generated IL/ILX resources associated with F# quotations quotationResourceInfo : (ILTypeRef list * byte[]) list } @@ -88,9 +92,6 @@ type public IlxAssemblyGenerator = /// Generate ILX code for an assembly fragment member GenerateCode : IlxGenOptions * TypedAssemblyAfterOptimization * Attribs * Attribs -> IlxGenResults - /// Create the CAS permission sets for an assembly fragment - member CreatePermissionSets : Attrib list -> ILSecurityDecl list - /// Invert the compilation of the given value and clear the storage of the value member ClearGeneratedValue : ExecutionContext * Val -> unit diff --git a/src/fsharp/InfoReader.fs b/src/fsharp/InfoReader.fs index 3b9963bad9a..e04485887e1 100644 --- a/src/fsharp/InfoReader.fs +++ b/src/fsharp/InfoReader.fs @@ -81,8 +81,8 @@ let rec GetImmediateIntrinsicMethInfosOfTypeAux (optFilter,ad) g amap m origTy m |> List.filter (fun minfo -> not minfo.IsInstance) else match tryDestAppTy g metadataTy with - | None -> [] - | Some tcref -> + | ValueNone -> [] + | ValueSome tcref -> SelectImmediateMemberVals g optFilter (TrySelectMemberVal g optFilter origTy None) tcref let minfos = minfos |> List.filter (IsMethInfoAccessible amap m ad) minfos @@ -169,8 +169,8 @@ let rec GetImmediateIntrinsicPropInfosOfTypeAux (optFilter,ad) g amap m origTy m GetImmediateIntrinsicPropInfosOfTypeAux (optFilter,ad) g amap m origTy betterMetadataTy else match tryDestAppTy g metadataTy with - | None -> [] - | Some tcref -> + | ValueNone -> [] + | ValueSome tcref -> let propCollector = new PropertyCollector(g, amap, m, origTy, optFilter, ad) SelectImmediateMemberVals g None (fun membInfo vref -> propCollector.Collect(membInfo, vref); None) tcref |> ignore propCollector.Close() @@ -188,11 +188,11 @@ let IsIndexerType g amap ty = isArray1DTy g ty || isListTy g ty || match tryDestAppTy g ty with - | Some tcref -> + | ValueSome tcref -> let _, entityTy = generalizeTyconRef tcref let props = GetImmediateIntrinsicPropInfosOfType (None, AccessibleFromSomeFSharpCode) g amap range0 entityTy props |> List.exists (fun x -> x.PropertyName = "Item") - | None -> false + | ValueNone -> false /// Sets of methods up the hierarchy, ignoring duplicates by name and sig. @@ -268,8 +268,8 @@ type InfoReader(g: TcGlobals, amap: Import.ImportMap) = /// Get the F#-declared record fields or class 'val' fields of a type let GetImmediateIntrinsicRecdOrClassFieldsOfType (optFilter, _ad) _m ty = match tryDestAppTy g ty with - | None -> [] - | Some tcref -> + | ValueNone -> [] + | ValueSome tcref -> // Note;secret fields are not allowed in lookups here, as we're only looking // up user-visible fields in name resolution. match optFilter with @@ -417,17 +417,17 @@ type InfoReader(g: TcGlobals, amap: Import.ImportMap) = /// Try and find a record or class field for a type. member x.TryFindRecdOrClassFieldInfoOfType (nm,m,ty) = match recdOrClassFieldInfoCache.Apply((Some nm,AccessibleFromSomewhere),m,ty) with - | [] -> None - | [single] -> Some single + | [] -> ValueNone + | [single] -> ValueSome single | flds -> // multiple fields with the same name can come from different classes, // so filter them by the given type name match tryDestAppTy g ty with - | None -> None - | Some tcref -> + | ValueNone -> ValueNone + | ValueSome tcref -> match flds |> List.filter (fun rfinfo -> tyconRefEq g tcref rfinfo.TyconRef) with - | [] -> None - | [single] -> Some single + | [] -> ValueNone + | [single] -> ValueSome single | _ -> failwith "unexpected multiple fields with same name" // Because it should have been already reported as duplicate fields /// Try and find an item with the given name in a type. @@ -469,8 +469,8 @@ let rec GetIntrinsicConstructorInfosOfTypeAux (infoReader:InfoReader) m origTy m GetIntrinsicConstructorInfosOfTypeAux infoReader m origTy betterMetadataTy else match tryDestAppTy g metadataTy with - | None -> [] - | Some tcref -> + | ValueNone -> [] + | ValueSome tcref -> tcref.MembersOfFSharpTyconByName |> NameMultiMap.find ".ctor" |> List.choose(fun vref -> diff --git a/src/fsharp/InnerLambdasToTopLevelFuncs.fs b/src/fsharp/InnerLambdasToTopLevelFuncs.fs index da5c49f4bb7..c783c1efe1c 100644 --- a/src/fsharp/InnerLambdasToTopLevelFuncs.fs +++ b/src/fsharp/InnerLambdasToTopLevelFuncs.fs @@ -1280,9 +1280,9 @@ module Pass4_RewriteAssembly = let rhs,z = TransModuleDef penv z rhs ModuleOrNamespaceBinding.Module(nm,rhs),z - let TransImplFile penv z (TImplFile(fragName,pragmas,moduleExpr,hasExplicitEntryPoint,isScript)) = + let TransImplFile penv z (TImplFile(fragName,pragmas,moduleExpr,hasExplicitEntryPoint,isScript,anonRecdTypes)) = let moduleExpr,z = TransModuleExpr penv z moduleExpr - (TImplFile(fragName,pragmas,moduleExpr,hasExplicitEntryPoint,isScript)),z + (TImplFile(fragName,pragmas,moduleExpr,hasExplicitEntryPoint,isScript,anonRecdTypes)),z //------------------------------------------------------------------------- // pass5: copyExpr diff --git a/src/fsharp/LexFilter.fs b/src/fsharp/LexFilter.fs index f8b7f951c29..c67aa06cb42 100755 --- a/src/fsharp/LexFilter.fs +++ b/src/fsharp/LexFilter.fs @@ -342,7 +342,7 @@ let rec isSeqBlockElementContinuator token = // ... // ), <------- NOTE RPAREN HERE // Shortcut.CtrlO) - | END | AND | WITH | THEN | RPAREN | RBRACE | RBRACK | BAR_RBRACK | RQUOTE _ -> true + | END | AND | WITH | THEN | RPAREN | RBRACE | BAR_RBRACE | RBRACK | BAR_RBRACK | RQUOTE _ -> true // The following arise during reprocessing of the inserted tokens when we hit a DONE | ORIGHT_BLOCK_END | OBLOCKEND | ODECLEND -> true @@ -370,7 +370,7 @@ let isAtomicExprEndToken token = | UINT8 _ | UINT16 _ | UINT32 _ | UINT64 _ | UNATIVEINT _ | DECIMAL _ | BIGNUM _ | STRING _ | BYTEARRAY _ | CHAR _ | IEEE32 _ | IEEE64 _ - | RPAREN | RBRACK | RBRACE | BAR_RBRACK | END + | RPAREN | RBRACK | RBRACE | BAR_RBRACE | BAR_RBRACK | END | NULL | FALSE | TRUE | UNDERSCORE -> true | _ -> false @@ -381,6 +381,7 @@ let parenTokensBalance t1 t2 = match t1,t2 with | (LPAREN,RPAREN) | (LBRACE,RBRACE) + | (LBRACE_BAR,BAR_RBRACE) | (LBRACK,RBRACK) | (INTERFACE,END) | (CLASS,END) @@ -676,7 +677,6 @@ type LexFilterImpl (lightSyntaxStatus:LightSyntaxStatus, compilingFsLib, lexer, | _,(CtxtSeqBlock _ :: CtxtParen((LBRACE | LBRACK | LBRACK_BAR),_) :: CtxtVanilla _ :: CtxtSeqBlock _ :: rest) -> unindentationLimit false rest - // MAJOR PERMITTED UNDENTATION This is allowing: // if x then y else // let x = 3 + 4 @@ -752,8 +752,8 @@ type LexFilterImpl (lightSyntaxStatus:LightSyntaxStatus, compilingFsLib, lexer, // 'if ... else [' limited by 'if' // 'if ... else [|' limited by 'if' | _,(CtxtParen ((SIG | STRUCT | BEGIN),_) :: CtxtSeqBlock _ :: (CtxtModuleBody (_,false) as limitCtxt) :: _) - | _,(CtxtParen ((BEGIN | LPAREN | LBRACK | LBRACE | LBRACK_BAR) ,_) :: CtxtSeqBlock _ :: CtxtThen _ :: (CtxtIf _ as limitCtxt) :: _) - | _,(CtxtParen ((BEGIN | LPAREN | LBRACK | LBRACE | LBRACK_BAR) ,_) :: CtxtSeqBlock _ :: CtxtElse _ :: (CtxtIf _ as limitCtxt) :: _) + | _,(CtxtParen ((BEGIN | LPAREN | LBRACK | LBRACE | LBRACE_BAR | LBRACK_BAR) ,_) :: CtxtSeqBlock _ :: CtxtThen _ :: (CtxtIf _ as limitCtxt) :: _) + | _,(CtxtParen ((BEGIN | LPAREN | LBRACK | LBRACE | LBRACE_BAR | LBRACK_BAR | LBRACK_LESS) ,_) :: CtxtSeqBlock _ :: CtxtElse _ :: (CtxtIf _ as limitCtxt) :: _) // 'f ... (' in seqblock limited by 'f' // 'f ... {' in seqblock limited by 'f' NOTE: this is covered by the more generous case above @@ -770,7 +770,7 @@ type LexFilterImpl (lightSyntaxStatus:LightSyntaxStatus, compilingFsLib, lexer, // REVIEW: document these | _,(CtxtSeqBlock _ :: CtxtParen((BEGIN | LPAREN | LBRACK | LBRACK_BAR),_) :: CtxtVanilla _ :: (CtxtSeqBlock _ as limitCtxt) :: _) - | (CtxtSeqBlock _),(CtxtParen ((BEGIN | LPAREN | LBRACE | LBRACK | LBRACK_BAR) ,_) :: CtxtSeqBlock _ :: ((CtxtTypeDefns _ | CtxtLetDecl _ | CtxtMemberBody _ | CtxtWithAsLet _) as limitCtxt) :: _) + | (CtxtSeqBlock _),(CtxtParen ((BEGIN | LPAREN | LBRACE | LBRACE_BAR | LBRACK | LBRACK_BAR) ,_) :: CtxtSeqBlock _ :: ((CtxtTypeDefns _ | CtxtLetDecl _ | CtxtMemberBody _ | CtxtWithAsLet _) as limitCtxt) :: _) -> PositionWithColumn(limitCtxt.StartPos,limitCtxt.StartCol + 1) // Permitted inner-construct (e.g. "then" block and "else" block in overall @@ -917,10 +917,15 @@ type LexFilterImpl (lightSyntaxStatus:LightSyntaxStatus, compilingFsLib, lexer, // fx // fx // f x>x + // f<{| C : int |}>x // fx // fx | DEFAULT | COLON | COLON_GREATER | STRUCT | NULL | DELEGATE | AND | WHEN | DOT_DOT + | NEW + | LBRACE_BAR + | SEMICOLON + | BAR_RBRACE | INFIX_AT_HAT_OP "^" | INFIX_AT_HAT_OP "^-" | INFIX_STAR_DIV_MOD_OP "/" @@ -995,7 +1000,7 @@ type LexFilterImpl (lightSyntaxStatus:LightSyntaxStatus, compilingFsLib, lexer, // WITH balances except in the following contexts.... Phew - an overused keyword! | WITH , ( ((CtxtMatch _ | CtxtException _ | CtxtMemberHead _ | CtxtInterfaceHead _ | CtxtTry _ | CtxtTypeDefns _ | CtxtMemberBody _) :: _) // This is the nasty record/object-expression case - | (CtxtSeqBlock _ :: CtxtParen(LBRACE,_) :: _) ) + | (CtxtSeqBlock _ :: CtxtParen((LBRACE | LBRACE_BAR),_) :: _) ) | FINALLY , (CtxtTry _ :: _) -> true @@ -1166,6 +1171,7 @@ type LexFilterImpl (lightSyntaxStatus:LightSyntaxStatus, compilingFsLib, lexer, | RPAREN | GREATER true | RBRACE + | BAR_RBRACE | RBRACK | BAR_RBRACK | WITH @@ -1204,7 +1210,7 @@ type LexFilterImpl (lightSyntaxStatus:LightSyntaxStatus, compilingFsLib, lexer, while not offsideStack.IsEmpty && (not(nextOuterMostInterestingContextIsNamespaceOrModule(offsideStack))) && (match offsideStack.Head with // open-parens of sorts - | CtxtParen((LPAREN|LBRACK|LBRACE|LBRACK_BAR),_) -> true + | CtxtParen((LPAREN|LBRACK|LBRACE|LBRACE_BAR|LBRACK_BAR),_) -> true // seq blocks | CtxtSeqBlock _ -> true // vanillas @@ -1297,9 +1303,9 @@ type LexFilterImpl (lightSyntaxStatus:LightSyntaxStatus, compilingFsLib, lexer, hwTokenFetch(useBlockRule) // Balancing rule. Encountering a ')' or '}' balances with a '(' or '{', even if not offside - | ((END | RPAREN | RBRACE | RBRACK | BAR_RBRACK | RQUOTE _ | GREATER true) as t2), (CtxtParen (t1,_) :: _) + | ((END | RPAREN | RBRACE | BAR_RBRACE | RBRACK | BAR_RBRACK | RQUOTE _ | GREATER true) as t2), (CtxtParen (t1,_) :: _) when parenTokensBalance t1 t2 -> - if debug then dprintf "RPAREN/RBRACE/RBRACK/BAR_RBRACK/RQUOTE/END at %a terminates CtxtParen()\n" outputPos tokenStartPos + if debug then dprintf "RPAREN/RBRACE/BAR_RBRACE/RBRACK/BAR_RBRACK/RQUOTE/END at %a terminates CtxtParen()\n" outputPos tokenStartPos popCtxt() // Queue a dummy token at this position to check if any closing rules apply delayToken(tokenTup.UseLocation(ODUMMY(token))) @@ -1792,7 +1798,7 @@ type LexFilterImpl (lightSyntaxStatus:LightSyntaxStatus, compilingFsLib, lexer, // '{ id1 = 1 // M.id2 = ... ' ~~~> CtxtSeqBlock | EQUALS, ((CtxtWithAsLet _) :: _) // This detects 'with = '. - | EQUALS, ((CtxtVanilla (_,true)) :: (CtxtSeqBlock _) :: (CtxtWithAsLet _ | CtxtParen(LBRACE,_)) :: _) -> + | EQUALS, ((CtxtVanilla (_,true)) :: (CtxtSeqBlock _) :: (CtxtWithAsLet _ | CtxtParen((LBRACE | LBRACE_BAR),_)) :: _) -> if debug then dprintf "CtxtLetDecl/CtxtWithAsLet: EQUALS, pushing CtxtSeqBlock\n" // We don't insert begin/end block tokens for single-line bindings since we can't properly distinguish single-line *) // record update expressions such as "{ t with gbuckets=Array.copy t.gbuckets; gcount=t.gcount }" *) @@ -1816,7 +1822,7 @@ type LexFilterImpl (lightSyntaxStatus:LightSyntaxStatus, compilingFsLib, lexer, returnToken tokenLexbufState token // '(' tokens are balanced with ')' tokens and also introduce a CtxtSeqBlock - | (BEGIN | LPAREN | SIG | LBRACE | LBRACK | LBRACK_BAR | LQUOTE _ | LESS true), _ -> + | (BEGIN | LPAREN | SIG | LBRACE | LBRACE_BAR | LBRACK | LBRACK_BAR | LQUOTE _ | LESS true), _ -> if debug then dprintf "LPAREN etc., pushes CtxtParen, pushing CtxtSeqBlock, tokenStartPos = %a\n" outputPos tokenStartPos pushCtxt tokenTup (CtxtParen (token,tokenStartPos)) pushCtxtSeqBlock(false,NoAddBlockEnd) @@ -1842,7 +1848,7 @@ type LexFilterImpl (lightSyntaxStatus:LightSyntaxStatus, compilingFsLib, lexer, // comprehension/match | (CtxtWhile _ | CtxtFor _ | CtxtWhen _ | CtxtMatchClauses _ | CtxtFun _) :: _ -> true // comprehension - | (CtxtSeqBlock _ :: CtxtParen ((LBRACK | LBRACE | LBRACK_BAR), _) :: _) -> true + | (CtxtSeqBlock _ :: CtxtParen ((LBRACK | LBRACE | LBRACE_BAR | LBRACK_BAR), _) :: _) -> true // comprehension | (CtxtSeqBlock _ :: (CtxtDo _ | CtxtWhile _ | CtxtFor _ | CtxtWhen _ | CtxtMatchClauses _ | CtxtTry _ | CtxtThen _ | CtxtElse _) :: _) -> true | _ -> false) -> @@ -1893,7 +1899,7 @@ type LexFilterImpl (lightSyntaxStatus:LightSyntaxStatus, compilingFsLib, lexer, returnToken tokenLexbufState token | WITH, (((CtxtException _ | CtxtTypeDefns _ | CtxtMemberHead _ | CtxtInterfaceHead _ | CtxtMemberBody _) as limCtxt) :: _) - | WITH, ((CtxtSeqBlock _) as limCtxt :: CtxtParen(LBRACE,_) :: _) -> + | WITH, ((CtxtSeqBlock _) as limCtxt :: CtxtParen((LBRACE | LBRACE_BAR),_) :: _) -> let lookaheadTokenTup = peekNextTokenTup() let lookaheadTokenStartPos = startPosOfTokenTup lookaheadTokenTup match lookaheadTokenTup.Token with diff --git a/src/fsharp/LowerCallsAndSeqs.fs b/src/fsharp/LowerCallsAndSeqs.fs index 3bb5c3cbd4f..15904bfabd6 100644 --- a/src/fsharp/LowerCallsAndSeqs.fs +++ b/src/fsharp/LowerCallsAndSeqs.fs @@ -52,11 +52,11 @@ let InterceptExpr g cont expr = /// known arity to lambda expressions and beta-var-reduces to bind /// any known arguments. The results are later optimized by the peephole /// optimizer in opt.fs -let LowerImplFile g ass = +let LowerImplFile g assembly = RewriteImplFile { PreIntercept = Some(InterceptExpr g) PreInterceptBinding=None PostTransform= (fun _ -> None) - IsUnderQuotations=false } ass + IsUnderQuotations=false } assembly //---------------------------------------------------------------------------- @@ -512,12 +512,12 @@ let LowerSeqExpr g amap overallExpr = // Note, however, this leads to a loss of tailcalls: the case not // handled correctly yet is sequence expressions that use yield! in the last position // This can give rise to infinite iterator chains when implemented by the naive expansion to - // for x in e yield e. For example consider this: + // �for x in e yield e�. For example consider this: // // let rec rwalk x = { yield x // yield! rwalk (x + rand()) } // - // This is the moral equivalent of a tailcall optimization. These also dont compile well + // This is the moral equivalent of a tailcall optimization. These also don�t compile well // in the C# compilation model | arbitrarySeqExpr -> diff --git a/src/fsharp/MSBuildReferenceResolver.fs b/src/fsharp/MSBuildReferenceResolver.fs index 804c6b74088..c2a9d2133b7 100644 --- a/src/fsharp/MSBuildReferenceResolver.fs +++ b/src/fsharp/MSBuildReferenceResolver.fs @@ -41,62 +41,52 @@ module internal Microsoft.FSharp.Compiler.MSBuildReferenceResolver // ATTENTION!: the following code needs to be updated every time we are switching to the new MSBuild version because new .NET framework version was released // 1. List of frameworks // 2. DeriveTargetFrameworkDirectoriesFor45Plus - // 3. HighestInstalledNetFrameworkVersion + // 3. HighestInstalledRefAssembliesOrDotNETFramework // 4. GetPathToDotNetFrameworkImlpementationAssemblies [] - let private Net10 = "v1.0" + let private Net45 = "v4.5" [] - let private Net11 = "v1.1" + let private Net451 = "v4.5.1" [] - let private Net20 = "v2.0" + let private Net452 = "v4.5.2" // not available in Dev15 MSBuild version [] - let private Net30 = "v3.0" + let private Net46 = "v4.6" [] - let private Net35 = "v3.5" + let private Net461 = "v4.6.1" [] - let private Net40 = "v4.0" + let private Net462 = "v4.6.2" [] - let private Net45 = "v4.5" + let private Net47 = "v4.7" [] - let private Net451 = "v4.5.1" - - /// The list of supported .NET Framework version numbers, using the monikers of the Reference Assemblies folder. - let SupportedNetFrameworkVersions = set [ Net20; Net30; Net35; Net40; Net45; Net451; (*SL only*) "v5.0" ] - - //[] - //let private Net452 = "v4.5.2" // not available in Dev15 MSBuild version + let private Net471 = "v4.7.1" -#if MSBUILD_AT_LEAST_14 [] - let private Net46 = "v4.6" + let private Net472 = "v4.7.2" - [] - let private Net461 = "v4.6.1" -#endif + let SupportedDesktopFrameworkVersions = [ Net472; Net471; Net47; Net462; Net461; Net46; Net452; Net451; Net45 ] - /// Get the path to the .NET Framework implementation assemblies by using ToolLocationHelper.GetPathToDotNetFramework. + /// Get the path to the .NET Framework implementation assemblies by using ToolLocationHelper.GetPathToDotNetFramework /// This is only used to specify the "last resort" path for assembly resolution. let GetPathToDotNetFrameworkImlpementationAssemblies(v) = let v = match v with - | Net11 -> Some TargetDotNetFrameworkVersion.Version11 - | Net20 -> Some TargetDotNetFrameworkVersion.Version20 - | Net30 -> Some TargetDotNetFrameworkVersion.Version30 - | Net35 -> Some TargetDotNetFrameworkVersion.Version35 - | Net40 -> Some TargetDotNetFrameworkVersion.Version40 | Net45 -> Some TargetDotNetFrameworkVersion.Version45 | Net451 -> Some TargetDotNetFrameworkVersion.Version451 -#if MSBUILD_AT_LEAST_14 - //| Net452 -> Some TargetDotNetFrameworkVersion.Version452 // not available in Dev15 MSBuild version +#if MSBUILD_AT_LEAST_15 + | Net452 -> Some TargetDotNetFrameworkVersion.Version452 | Net46 -> Some TargetDotNetFrameworkVersion.Version46 | Net461 -> Some TargetDotNetFrameworkVersion.Version461 + | Net462 -> Some TargetDotNetFrameworkVersion.Version462 + | Net47 -> Some TargetDotNetFrameworkVersion.Version47 + | Net471 -> Some TargetDotNetFrameworkVersion.Version471 + | Net472 -> Some TargetDotNetFrameworkVersion.Version472 #endif | _ -> assert false; None match v with @@ -106,7 +96,6 @@ module internal Microsoft.FSharp.Compiler.MSBuildReferenceResolver | x -> [x] | _ -> [] - let GetPathToDotNetFrameworkReferenceAssemblies(version) = #if NETSTANDARD1_6 || NETSTANDARD2_0 ignore version @@ -118,41 +107,59 @@ module internal Microsoft.FSharp.Compiler.MSBuildReferenceResolver | x -> [x] #endif - /// Use MSBuild to determine the version of the highest installed framework. - let HighestInstalledNetFrameworkVersion() = - try -#if MSBUILD_AT_LEAST_14 - if box (ToolLocationHelper.GetPathToDotNetFramework(TargetDotNetFrameworkVersion.Version461)) <> null then Net461 - elif box (ToolLocationHelper.GetPathToDotNetFramework(TargetDotNetFrameworkVersion.Version46)) <> null then Net46 - // 4.5.2 enumeration is not available in Dev15 MSBuild version - //elif box (ToolLocationHelper.GetPathToDotNetFramework(TargetDotNetFrameworkVersion.Version452)) <> null then Net452 - elif box (ToolLocationHelper.GetPathToDotNetFramework(TargetDotNetFrameworkVersion.Version451)) <> null then Net451 + /// Use MSBuild to determine the version of the highest installed set of reference assemblies, failing that grab the highest installed framework version + let HighestInstalledRefAssembliesOrDotNETFramework () = + let getHighestInstalledDotNETFramework () = + try +// The Mono build still uses an ancient version of msbuild from around Dev 14 +#if MSBUILD_AT_LEAST_15 + if box (ToolLocationHelper.GetPathToDotNetFramework(TargetDotNetFrameworkVersion.Version472)) <> null then Net472 + elif box (ToolLocationHelper.GetPathToDotNetFramework(TargetDotNetFrameworkVersion.Version471)) <> null then Net471 + elif box (ToolLocationHelper.GetPathToDotNetFramework(TargetDotNetFrameworkVersion.Version47)) <> null then Net47 + elif box (ToolLocationHelper.GetPathToDotNetFramework(TargetDotNetFrameworkVersion.Version462)) <> null then Net462 + elif box (ToolLocationHelper.GetPathToDotNetFramework(TargetDotNetFrameworkVersion.Version461)) <> null then Net461 + elif box (ToolLocationHelper.GetPathToDotNetFramework(TargetDotNetFrameworkVersion.Version461)) <> null then Net461 + elif box (ToolLocationHelper.GetPathToDotNetFramework(TargetDotNetFrameworkVersion.Version46)) <> null then Net46 + elif box (ToolLocationHelper.GetPathToDotNetFramework(TargetDotNetFrameworkVersion.Version452)) <> null then Net452 + elif box (ToolLocationHelper.GetPathToDotNetFramework(TargetDotNetFrameworkVersion.Version451)) <> null then Net451 #else - if box (ToolLocationHelper.GetPathToDotNetFramework(TargetDotNetFrameworkVersion.Version451)) <> null then Net451 + if box (ToolLocationHelper.GetPathToDotNetFramework(TargetDotNetFrameworkVersion.Version451)) <> null then Net451 +#endif + elif box (ToolLocationHelper.GetPathToDotNetFramework(TargetDotNetFrameworkVersion.Version45)) <> null then Net45 + else Net45 // version is 4.5 assumed since this code is running. + with _ -> Net45 + +#if !FX_RESHAPED_REFLECTION + // 1. First look to see if we can find the highest installed set of dotnet reference assemblies, if yes then select that framework + // 2. Otherwise ask msbuild for the highestinstalled framework + let checkFrameworkForReferenceAssemblies (dotNetVersion:string) = + if not (String.IsNullOrEmpty(dotNetVersion)) then + try + let v = if dotNetVersion.StartsWith("v") then dotNetVersion.Substring(1) else dotNetVersion + let frameworkName = new System.Runtime.Versioning.FrameworkName(".NETFramework", new Version(v)) + match ToolLocationHelper.GetPathToReferenceAssemblies(frameworkName) |> Seq.tryHead with + | Some p -> if Directory.Exists(p) then true else false + | None -> false + with _ -> false + else false + match SupportedDesktopFrameworkVersions |> Seq.tryFind(fun v -> checkFrameworkForReferenceAssemblies v) with + | Some v -> v + | None -> getHighestInstalledDotNETFramework() +#else + getHighestInstalledDotNETFramework() #endif - elif box (ToolLocationHelper.GetPathToDotNetFramework(TargetDotNetFrameworkVersion.Version45)) <> null then Net45 - else Net45 // version is 4.5 assumed since this code is running. - with _ -> Net45 - /// Derive the target framework directories. + /// Derive the target framework directories. let DeriveTargetFrameworkDirectories (targetFrameworkVersion:string, logMessage) = let targetFrameworkVersion = if not(targetFrameworkVersion.StartsWith("v",StringComparison.Ordinal)) then "v"+targetFrameworkVersion else targetFrameworkVersion - let result = - if targetFrameworkVersion.StartsWith(Net10, StringComparison.Ordinal) then ReplaceVariablesForLegacyFxOnWindows([@"{WindowsFramework}\v1.0.3705"]) - elif targetFrameworkVersion.StartsWith(Net11, StringComparison.Ordinal) then ReplaceVariablesForLegacyFxOnWindows([@"{WindowsFramework}\v1.1.4322"]) - elif targetFrameworkVersion.StartsWith(Net20, StringComparison.Ordinal) then ReplaceVariablesForLegacyFxOnWindows([@"{WindowsFramework}\v2.0.50727"]) - elif targetFrameworkVersion.StartsWith(Net30, StringComparison.Ordinal) then ReplaceVariablesForLegacyFxOnWindows([@"{ReferenceAssemblies}\v3.0"; @"{WindowsFramework}\v3.0"; @"{WindowsFramework}\v2.0.50727"]) - elif targetFrameworkVersion.StartsWith(Net35, StringComparison.Ordinal) then ReplaceVariablesForLegacyFxOnWindows([@"{ReferenceAssemblies}\v3.5"; @"{WindowsFramework}\v3.5"; @"{ReferenceAssemblies}\v3.0"; @"{WindowsFramework}\v3.0"; @"{WindowsFramework}\v2.0.50727"]) - else GetPathToDotNetFrameworkReferenceAssemblies(targetFrameworkVersion) - - let result = result |> Array.ofList - logMessage (sprintf "Derived target framework directories for version %s are: %s" targetFrameworkVersion (String.Join(",", result))) + let result = GetPathToDotNetFrameworkReferenceAssemblies(targetFrameworkVersion) |> Array.ofList + logMessage (sprintf "Derived target framework directories for version %s are: %s" targetFrameworkVersion (String.Join(",", result))) result - + /// Describes the location where the reference was found, used only for debug and tooltip output type ResolvedFrom = | AssemblyFolders @@ -364,7 +371,7 @@ module internal Microsoft.FSharp.Compiler.MSBuildReferenceResolver let Resolver = { new ReferenceResolver.Resolver with - member __.HighestInstalledNetFrameworkVersion() = HighestInstalledNetFrameworkVersion() + member __.HighestInstalledNetFrameworkVersion() = HighestInstalledRefAssembliesOrDotNETFramework() member __.DotNetFrameworkReferenceAssembliesRootDirectory = DotNetFrameworkReferenceAssembliesRootDirectory /// Perform the resolution on rooted and unrooted paths, and then combine the results. diff --git a/src/fsharp/MethodCalls.fs b/src/fsharp/MethodCalls.fs index d51bbe953c0..de5271eb674 100644 --- a/src/fsharp/MethodCalls.fs +++ b/src/fsharp/MethodCalls.fs @@ -346,9 +346,9 @@ type CalledMeth<'T> Choice1Of2(AssignedItemSetter(id, AssignedILFieldSetter(finfo), e)) | _ -> match infoReader.TryFindRecdOrClassFieldInfoOfType(nm, m, returnedObjTy) with - | Some rfinfo -> + | ValueSome rfinfo -> Choice1Of2(AssignedItemSetter(id, AssignedRecdFieldSetter(rfinfo), e)) - | None -> + | _ -> Choice2Of2(arg)) let names = namedCallerArgs |> List.map (fun (CallerNamedArg(nm, _)) -> nm.idText) @@ -585,7 +585,7 @@ let TakeObjAddrForMethodCall g amap (minfo:MethInfo) isMutable m objArgs f = let hasCallInfo = ccallInfo.IsSome let mustTakeAddress = hasCallInfo || minfo.ObjArgNeedsAddress(amap, m) let objArgTy = tyOfExpr g objArgExpr - let wrap, objArgExpr', _readonly, _writeonly = mkExprAddrOfExpr g mustTakeAddress hasCallInfo isMutable objArgExpr None m + let wrap, objArgExpr', isReadOnly, _isWriteOnly = mkExprAddrOfExpr g mustTakeAddress hasCallInfo isMutable objArgExpr None m // Extension members and calls to class constraints may need a coercion for their object argument let objArgExpr' = @@ -595,6 +595,16 @@ let TakeObjAddrForMethodCall g amap (minfo:MethInfo) isMutable m objArgs f = else objArgExpr' + // Check to see if the extension member uses the extending type as a byref. + // If so, make sure we don't allow readonly/immutable values to be passed byref from an extension member. + // An inref will work though. + if isReadOnly && mustTakeAddress && minfo.IsExtensionMember then + minfo.TryObjArgByrefType(amap, m, minfo.FormalMethodInst) + |> Option.iter (fun ty -> + if not (isInByrefTy g ty) then + errorR(Error(FSComp.SR.tcCannotCallExtensionMethodInrefToByref(minfo.DisplayName), m))) + + wrap, [objArgExpr'] | _ -> diff --git a/src/fsharp/NameResolution.fs b/src/fsharp/NameResolution.fs index 27247c34735..96def4abf94 100644 --- a/src/fsharp/NameResolution.fs +++ b/src/fsharp/NameResolution.fs @@ -155,6 +155,9 @@ type Item = /// Represents the resolution of a name to an F# record field. | RecdField of RecdFieldInfo + /// Represents the resolution of a name to a field of an anonymous record type. + | AnonRecdField of AnonRecdTypeInfo * TTypes * int * range + // The following are never in the items table but are valid results of binding // an identifier in different circumstances. @@ -226,6 +229,7 @@ type Item = | Item.UnionCase(uinfo,_) -> DecompileOpName uinfo.UnionCase.DisplayName | Item.ExnCase tcref -> tcref.LogicalName | Item.RecdField rfinfo -> DecompileOpName rfinfo.RecdField.Name + | Item.AnonRecdField (anonInfo, _tys, i, _m) -> anonInfo.SortedNames.[i] | Item.NewDef id -> id.idText | Item.ILField finfo -> finfo.FieldName | Item.Event einfo -> einfo.EventName @@ -430,8 +434,7 @@ let private GetCSharpStyleIndexedExtensionMembersForTyconRef (amap:Import.Import // Method must be static, have 'Extension' attribute, must not be curried, must have at least one argument if not minfo.IsInstance && not minfo.IsExtensionMember && - minfo.NumArgs.Length = 1 && - minfo.NumArgs.Head >= 1 && + (match minfo.NumArgs with [x] when x >= 1 -> true | _ -> false) && MethInfoHasAttribute g m g.attrib_ExtensionAttribute minfo then let ilExtMem = ILExtMem (tcrefOfStaticClass, minfo, pri) @@ -693,9 +696,6 @@ let private AddPartsOfTyconRefToNameEnv bulkAddMode ownDefinition (g:TcGlobals) eIndexedExtensionMembers = eIndexedExtensionMembers eUnindexedExtensionMembers = eUnindexedExtensionMembers } -let TryFindPatternByName name {ePatItems = patternMap} = - NameMap.tryFind name patternMap - /// Add a set of type definitions to the name resolution environment let AddTyconRefsToNameEnv bulkAddMode ownDefinition g amap m root nenv tcrefs = if isNil tcrefs then nenv else @@ -985,10 +985,8 @@ type TypeNameResolutionStaticArgsInfo = // Get the first possible mangled name of the type, assuming the args are generic args member x.MangledNameForType nm = - if IsMangledGenericName nm || x.NumStaticArgs = 0 then nm - else nm+"`"+string x.NumStaticArgs - - + if x.NumStaticArgs = 0 || TryDemangleGenericNameAndPos nm <> ValueNone then nm + else nm + "`" + string x.NumStaticArgs [] /// Represents information which guides name resolution of types. @@ -1011,17 +1009,21 @@ type TypeNameResolutionInfo = /// be used to qualify access if needed let LookupTypeNameInEntityHaveArity nm (staticResInfo: TypeNameResolutionStaticArgsInfo) (mty:ModuleOrNamespaceType) = let attempt1 = mty.TypesByMangledName.TryFind (staticResInfo.MangledNameForType nm) - match attempt1 with - | Some _ as r -> r + match attempt1 with | None -> mty.TypesByMangledName.TryFind nm + | _ -> attempt1 /// Unqualified lookups of type names where the number of generic arguments is known /// from context, e.g. List. Rebindings due to 'open' may have rebound identifiers. let LookupTypeNameInEnvHaveArity fq nm numTyArgs (nenv:NameResolutionEnv) = - let key = if IsMangledGenericName nm then DecodeGenericTypeName nm else NameArityPair(nm,numTyArgs) - match nenv.TyconsByDemangledNameAndArity(fq).TryFind(key) with - | Some res -> Some res + let key = + match TryDemangleGenericNameAndPos nm with + | ValueSome pos -> DecodeGenericTypeName pos nm + | _ -> NameArityPair(nm,numTyArgs) + + match nenv.TyconsByDemangledNameAndArity(fq).TryFind key with | None -> nenv.TyconsByAccessNames(fq).TryFind nm |> Option.map List.head + | res -> res /// Implements unqualified lookups of type names where the number of generic arguments is NOT known /// from context. @@ -1040,16 +1042,18 @@ let LookupTypeNameInEnvHaveArity fq nm numTyArgs (nenv:NameResolutionEnv) = // In theory the full names such as ``RecordType`1`` can // also be used to qualify access if needed, though this is almost never needed. -let LookupTypeNameNoArity nm (byDemangledNameAndArity: LayeredMap) (byAccessNames: LayeredMultiMap) = - if IsMangledGenericName nm then - match byDemangledNameAndArity.TryFind (DecodeGenericTypeName nm) with - | Some res -> [res] - | None -> - match byAccessNames.TryFind nm with - | Some res -> res - | None -> [] - else - byAccessNames.[nm] +let LookupTypeNameNoArity nm (byDemangledNameAndArity: LayeredMap) (byAccessNames: LayeredMultiMap) = + match TryDemangleGenericNameAndPos nm with + | ValueSome pos -> + let demangled = DecodeGenericTypeName pos nm + match byDemangledNameAndArity.TryGetValue demangled with + | true, res -> [res] + | _ -> + match byAccessNames.TryGetValue nm with + | true, res -> res + | _ -> [] + | _ -> + byAccessNames.[nm] /// Qualified lookup of type names in the environment let LookupTypeNameInEnvNoArity fq nm (nenv: NameResolutionEnv) = @@ -1096,7 +1100,7 @@ let AddEntityForProvidedType (amap: Import.ImportMap, modref: ModuleOrNamespaceR let tycon = Construct.NewProvidedTycon(resolutionEnvironment, st, importProvidedType, isSuppressRelocate, m) modref.ModuleOrNamespaceType.AddProvidedTypeEntity(tycon) let tcref = modref.NestedTyconRef tycon - System.Diagnostics.Debug.Assert modref.TryDeref.IsSome + System.Diagnostics.Debug.Assert(ValueOptionInternal.isSome modref.TryDeref) tcref @@ -1208,7 +1212,7 @@ let GetNestedTypesOfType (ad, ncenv:NameResolver, optFilter, staticResInfo, chec //------------------------------------------------------------------------- /// Represents the kind of the occurrence when reporting a name in name resolution -[] +[] type ItemOccurence = /// This is a binding / declaration of the item | Binding @@ -1247,8 +1251,8 @@ type OpenDeclaration = IsOwnNamespace = isOwnNamespace } type FormatStringCheckContext = - { NormalizedSource: string - LineEndPositions: int[] } + { Source: string + LineStartPositions: int[] } /// An abstract type for reporting the results of name resolution and type checking. type ITypecheckResultsSink = @@ -1411,6 +1415,8 @@ let ItemsAreEffectivelyEqual g orig other = | (Item.ArgName (id,_, _), ValUse vref) | (ValUse vref, Item.ArgName (id, _, _)) -> ((id.idRange = vref.DefinitionRange || id.idRange = vref.SigRange) && id.idText = vref.DisplayName) + | Item.AnonRecdField(anon1, _, i1, _), Item.AnonRecdField(anon2, _, i2, _) -> Tastops.anonInfoEquiv anon1 anon2 && i1 = i2 + | ILFieldUse f1, ILFieldUse f2 -> ILFieldInfo.ILFieldInfosUseIdenticalDefinitions f1 f2 @@ -1490,17 +1496,24 @@ type TcSymbolUseData = /// This is a memory-critical data structure - allocations of this data structure and its immediate contents /// is one of the highest memory long-lived data structures in typical uses of IDEs. Not many of these objects /// are allocated (one per file), but they are large because the allUsesOfAllSymbols array is large. -type TcSymbolUses(g, capturedNameResolutions : ResizeArray, formatSpecifierLocations: (range * int)[]) = - +type TcSymbolUses(g, capturedNameResolutions : ResizeArray, formatSpecifierLocations: (range * int)[]) = + // Make sure we only capture the information we really need to report symbol uses - let allUsesOfSymbols = [| for cnr in capturedNameResolutions -> { Item=cnr.Item; ItemOccurence=cnr.ItemOccurence; DisplayEnv=cnr.DisplayEnv; Range=cnr.Range } |] + let allUsesOfSymbols = + capturedNameResolutions + |> ResizeArray.mapToSmallArrayChunks (fun cnr -> { Item=cnr.Item; ItemOccurence=cnr.ItemOccurence; DisplayEnv=cnr.DisplayEnv; Range=cnr.Range }) + let capturedNameResolutions = () do ignore capturedNameResolutions // don't capture this! member this.GetUsesOfSymbol(item) = - [| for symbolUse in allUsesOfSymbols do - if protectAssemblyExploration false (fun () -> ItemsAreEffectivelyEqual g item symbolUse.Item) then - yield symbolUse |] + // This member returns what is potentially a very large array, which may approach the size constraints of the Large Object Heap. + // This is unlikely in practice, though, because we filter down the set of all symbol uses to those specifically for the given `item`. + // Consequently we have a much lesser chance of ending up with an array large enough to be promoted to the LOH. + [| for symbolUseChunk in allUsesOfSymbols do + for symbolUse in symbolUseChunk do + if protectAssemblyExploration false (fun () -> ItemsAreEffectivelyEqual g item symbolUse.Item) then + yield symbolUse |] member this.AllUsesOfSymbols = allUsesOfSymbols @@ -1532,14 +1545,18 @@ type TcResultsSinkImpl(g, ?source: string) = let formatStringCheckContext = lazy source |> Option.map (fun source -> - let source = source.Replace("\r\n", "\n").Replace("\r", "\n") let positions = - source.Split('\n') - |> Seq.map (fun s -> String.length s + 1) - |> Seq.scan (+) 0 - |> Seq.toArray - { NormalizedSource = source - LineEndPositions = positions }) + [| + yield 0 + for i in 1..source.Length do + let c = source.[i-1] + if c = '\r' && i < source.Length && source.[i] = '\n' then () + elif c = '\r' then yield i + elif c = '\n' then yield i + yield source.Length + |] + { Source = source + LineStartPositions = positions }) member this.GetResolutions() = TcResolutions(capturedEnvs, capturedExprTypings, capturedNameResolutions, capturedMethodGroupResolutions) @@ -1693,6 +1710,7 @@ let CheckAllTyparsInferrable amap m item = | Item.UnionCase _ | Item.ExnCase _ | Item.RecdField _ + | Item.AnonRecdField _ | Item.NewDef _ | Item.ILField _ | Item.Event _ @@ -1846,15 +1864,15 @@ let rec ResolveLongIndentAsModuleOrNamespace sink atMostOne amap m first fullyQu let occurence = if isOpenDecl then ItemOccurence.Open else ItemOccurence.Use CallNameResolutionSink sink (m, nenv, item, item, emptyTyparInst, occurence, nenv.DisplayEnv, ad) - match moduleOrNamespaces.TryFind id.idText with - | Some modrefs -> + match moduleOrNamespaces.TryGetValue id.idText with + | true, modrefs -> /// Look through the sub-namespaces and/or modules let rec look depth (modref: ModuleOrNamespaceRef) (mty:ModuleOrNamespaceType) (lid:Ident list) = match lid with | [] -> success (depth,modref,mty) | id :: rest -> - match mty.ModulesAndNamespacesByDemangledName.TryFind id.idText with - | Some mspec -> + match mty.ModulesAndNamespacesByDemangledName.TryGetValue id.idText with + | true, mspec -> let subref = modref.NestedTyconRef mspec if IsEntityAccessible amap m ad subref then notifyNameResolution subref id.idRange @@ -1870,7 +1888,7 @@ let rec ResolveLongIndentAsModuleOrNamespace sink atMostOne amap m first fullyQu look 1 modref modref.ModuleOrNamespaceType rest else raze (namespaceNotFound.Force())) - | None -> raze (namespaceNotFound.Force()) + | _ -> raze (namespaceNotFound.Force()) let ResolveLongIndentAsModuleOrNamespaceThen sink atMostOne amap m fullyQualified (nenv:NameResolutionEnv) ad id rest isOpenDecl f = @@ -2046,13 +2064,22 @@ type LookupKind = /// Try to find a union case of a type, with the given name let TryFindUnionCaseOfType g ty nm = - if isAppTy g ty then - let tcref,tinst = destAppTy g ty + match tryAppTy g ty with + | ValueSome(tcref,tinst) -> match tcref.GetUnionCaseByName nm with + | None -> ValueNone + | Some ucase -> ValueSome(UnionCaseInfo(tinst,tcref.MakeNestedUnionCaseRef ucase)) + | _ -> + ValueNone + +/// Try to find a union case of a type, with the given name +let TryFindAnonRecdFieldOfType g typ nm = + match tryDestAnonRecdTy g typ with + | ValueSome (anonInfo, tys) -> + match anonInfo.SortedIds |> Array.tryFindIndex (fun x -> x.idText = nm) with + | Some i -> Some (Item.AnonRecdField(anonInfo, tys, i, anonInfo.SortedIds.[i].idRange)) | None -> None - | Some ucase -> Some(UnionCaseInfo(tinst,tcref.MakeNestedUnionCaseRef ucase)) - else - None + | ValueNone -> None let CoreDisplayName(pinfo:PropInfo) = match pinfo with @@ -2104,14 +2131,22 @@ let rec ResolveLongIdentInTypePrim (ncenv:NameResolver) nenv lookupKind (resInfo let unionCaseSearch = match lookupKind with | LookupKind.Expr | LookupKind.Pattern -> TryFindUnionCaseOfType g ty nm - | _ -> None + | _ -> ValueNone // Lookup: datatype constructors take precedence match unionCaseSearch with - | Some ucase -> + | ValueSome ucase -> OneResult (success(resInfo,Item.UnionCase(ucase,false),rest)) - | None -> - let isLookUpExpr = lookupKind = LookupKind.Expr + | ValueNone -> + let anonRecdSearch = + match lookupKind with + | LookupKind.Expr -> TryFindAnonRecdFieldOfType g ty nm + | _ -> None + match anonRecdSearch with + | Some item -> + OneResult (success(resInfo, item, rest)) + | None -> + let isLookUpExpr = (lookupKind = LookupKind.Expr) match TryFindIntrinsicNamedItemOfType ncenv.InfoReader (nm,ad) findFlag m ty with | Some (PropertyItem psets) when isLookUpExpr -> let pinfos = psets |> ExcludeHiddenOfPropInfos g ncenv.amap m @@ -2124,6 +2159,7 @@ let rec ResolveLongIdentInTypePrim (ncenv:NameResolver) nenv lookupKind (resInfo match DecodeFSharpEvent (pinfos@extensionPropInfos) ad g ncenv m with | Some x -> success [resInfo, x, rest] | None -> raze (UndefinedName (depth,FSComp.SR.undefinedNameFieldConstructorOrMember, id,NoSuggestions)) + | Some(MethodItem msets) when isLookUpExpr -> let minfos = msets |> ExcludeHiddenOfMethInfos g ncenv.amap m @@ -2136,8 +2172,10 @@ let rec ResolveLongIdentInTypePrim (ncenv:NameResolver) nenv lookupKind (resInfo | Some (EventItem (einfo :: _)) when isLookUpExpr -> success [resInfo,Item.Event einfo,rest] + | Some (RecdFieldItem (rfinfo)) when (match lookupKind with LookupKind.Expr | LookupKind.RecdField | LookupKind.Pattern -> true | _ -> false) -> success [resInfo,Item.RecdField(rfinfo),rest] + | _ -> let pinfos = ExtensionPropInfosOfTypeInScope ncenv.InfoReader nenv (optFilter, ad) m ty @@ -2199,7 +2237,7 @@ let rec ResolveLongIdentInTypePrim (ncenv:NameResolver) nenv lookupKind (resInfo match lookupKind with | LookupKind.Expr | LookupKind.Pattern -> if isAppTy g ty then - let tcref,_ = destAppTy g ty + let tcref = tcrefOfAppTy g ty tcref.UnionCasesArray |> Array.map (fun uc -> uc.DisplayName) else @@ -2257,12 +2295,12 @@ let (|AccessibleEntityRef|_|) amap m ad (modref: ModuleOrNamespaceRef) mspec = let rec ResolveExprLongIdentInModuleOrNamespace (ncenv:NameResolver) nenv (typeNameResInfo: TypeNameResolutionInfo) ad resInfo depth m modref (mty:ModuleOrNamespaceType) (id:Ident) (rest :Ident list) = // resInfo records the modules or namespaces actually relevant to a resolution let m = unionRanges m id.idRange - match mty.AllValsByLogicalName.TryFind(id.idText) with - | Some vspec when IsValAccessible ad (mkNestedValRef modref vspec) -> + match mty.AllValsByLogicalName.TryGetValue id.idText with + | true, vspec when IsValAccessible ad (mkNestedValRef modref vspec) -> success(resInfo,Item.Value (mkNestedValRef modref vspec),rest) | _-> - match mty.ExceptionDefinitionsByDemangledName.TryFind(id.idText) with - | Some excon when IsTyconReprAccessible ncenv.amap m ad (modref.NestedTyconRef excon) -> + match mty.ExceptionDefinitionsByDemangledName.TryGetValue id.idText with + | true, excon when IsTyconReprAccessible ncenv.amap m ad (modref.NestedTyconRef excon) -> success (resInfo,Item.ExnCase (modref.NestedTyconRef excon),rest) | _ -> // Something in a discriminated union without RequireQualifiedAccess attribute? @@ -2308,8 +2346,8 @@ let rec ResolveExprLongIdentInModuleOrNamespace (ncenv:NameResolver) nenv (typeN let moduleSearch() = match rest with | id2::rest2 -> - match mty.ModulesAndNamespacesByDemangledName.TryFind(id.idText) with - | Some(AccessibleEntityRef ncenv.amap m ad modref submodref) -> + match mty.ModulesAndNamespacesByDemangledName.TryGetValue id.idText with + | true, AccessibleEntityRef ncenv.amap m ad modref submodref -> let resInfo = resInfo.AddEntity(id.idRange,submodref) OneResult (ResolveExprLongIdentInModuleOrNamespace ncenv nenv typeNameResInfo ad resInfo (depth+1) m submodref submodref.ModuleOrNamespaceType id2 rest2) @@ -2394,10 +2432,10 @@ let rec ResolveExprLongIdentPrim sink (ncenv:NameResolver) first fullyQualified let typeError = ref None // Single identifier. Lookup the unqualified names in the environment let envSearch = - match nenv.eUnqualifiedItems.TryFind(id.idText) with + match nenv.eUnqualifiedItems.TryGetValue id.idText with // The name is a type name and it has not been clobbered by some other name - | Some (Item.UnqualifiedType tcrefs) -> + | true, Item.UnqualifiedType tcrefs -> // Do not use type names from the environment if an explicit type instantiation is // given and the number of type parameters do not match @@ -2414,9 +2452,9 @@ let rec ResolveExprLongIdentPrim sink (ncenv:NameResolver) first fullyQualified Some(item,rest) | Exception e -> typeError := Some e; None - | Some res -> + | true, res -> Some (FreshenUnqualifiedItem ncenv m res, []) - | None -> + | _ -> None match envSearch with @@ -2498,8 +2536,8 @@ let rec ResolveExprLongIdentPrim sink (ncenv:NameResolver) first fullyQualified match fullyQualified with | FullyQualified -> false | _ -> - match nenv.eUnqualifiedItems.TryFind(nm) with - | Some(Item.Value _) -> true + match nenv.eUnqualifiedItems.TryGetValue nm with + | true, Item.Value _ -> true | _ -> false if ValIsInEnv id.idText then @@ -2530,10 +2568,10 @@ let rec ResolveExprLongIdentPrim sink (ncenv:NameResolver) first fullyQualified | FullyQualified -> NoResultsOrUsefulErrors | OpenQualified -> - match nenv.eUnqualifiedItems.TryFind id.idText with - | Some (Item.UnqualifiedType _) - | None -> NoResultsOrUsefulErrors - | Some res -> OneSuccess (resInfo,FreshenUnqualifiedItem ncenv m res,rest) + match nenv.eUnqualifiedItems.TryGetValue id.idText with + | true, Item.UnqualifiedType _ + | false, _ -> NoResultsOrUsefulErrors + | true, res -> OneSuccess (resInfo,FreshenUnqualifiedItem ncenv m res,rest) moduleSearch ad () +++ tyconSearch ad +++ envSearch @@ -2597,17 +2635,17 @@ let rec ResolvePatternLongIdentInModuleOrNamespace (ncenv:NameResolver) nenv num let ucinfo = FreshenUnionCaseRef ncenv m ucref success (resInfo,Item.UnionCase(ucinfo,showDeprecated),rest) | _ -> - match mty.ExceptionDefinitionsByDemangledName.TryFind(id.idText) with - | Some exnc when IsEntityAccessible ncenv.amap m ad (modref.NestedTyconRef exnc) -> + match mty.ExceptionDefinitionsByDemangledName.TryGetValue id.idText with + | true, exnc when IsEntityAccessible ncenv.amap m ad (modref.NestedTyconRef exnc) -> success (resInfo,Item.ExnCase (modref.NestedTyconRef exnc),rest) | _ -> // An active pattern constructor in a module - match (ActivePatternElemsOfModuleOrNamespace modref).TryFind(id.idText) with - | Some ( APElemRef(_,vref,_) as apref) when IsValAccessible ad vref -> + match (ActivePatternElemsOfModuleOrNamespace modref).TryGetValue id.idText with + | true, (APElemRef(_,vref,_) as apref) when IsValAccessible ad vref -> success (resInfo,Item.ActivePatternCase apref,rest) | _ -> - match mty.AllValsByLogicalName.TryFind(id.idText) with - | Some vspec when IsValAccessible ad (mkNestedValRef modref vspec) -> + match mty.AllValsByLogicalName.TryGetValue id.idText with + | true, vspec when IsValAccessible ad (mkNestedValRef modref vspec) -> success(resInfo,Item.Value (mkNestedValRef modref vspec),rest) | _ -> let tcrefs = lazy ( @@ -2637,8 +2675,8 @@ let rec ResolvePatternLongIdentInModuleOrNamespace (ncenv:NameResolver) nenv num let moduleSearch() = match rest with | id2::rest2 -> - match mty.ModulesAndNamespacesByDemangledName.TryFind(id.idText) with - | Some(AccessibleEntityRef ncenv.amap m ad modref submodref) -> + match mty.ModulesAndNamespacesByDemangledName.TryGetValue id.idText with + | true, AccessibleEntityRef ncenv.amap m ad modref submodref -> let resInfo = resInfo.AddEntity(id.idRange,submodref) OneResult (ResolvePatternLongIdentInModuleOrNamespace ncenv nenv numTyArgsOpt ad resInfo (depth+1) m submodref submodref.ModuleOrNamespaceType id2 rest2) | _ -> @@ -2685,8 +2723,8 @@ let rec ResolvePatternLongIdentPrim sink (ncenv:NameResolver) fullyQualified war // Single identifiers in patterns - bind to constructors and active patterns // For the special case of // let C = x - match nenv.ePatItems.TryFind(id.idText) with - | Some res when not newDef -> FreshenUnqualifiedItem ncenv m res + match nenv.ePatItems.TryGetValue id.idText with + | true, res when not newDef -> FreshenUnqualifiedItem ncenv m res | _ -> // Single identifiers in patterns - variable bindings if not newDef && @@ -2832,8 +2870,8 @@ let rec private ResolveTypeLongIdentInModuleOrNamespace sink nenv (ncenv:NameRes | id2::rest2 -> let m = unionRanges m id.idRange let modulSearch = - match modref.ModuleOrNamespaceType.ModulesAndNamespacesByDemangledName.TryFind(id.idText) with - | Some(AccessibleEntityRef ncenv.amap m ad modref submodref) -> + match modref.ModuleOrNamespaceType.ModulesAndNamespacesByDemangledName.TryGetValue id.idText with + | true, AccessibleEntityRef ncenv.amap m ad modref submodref -> let item = Item.ModuleOrNamespaces [submodref] CallNameResolutionSink sink (id.idRange, nenv, item, item, emptyTyparInst, ItemOccurence.Use, nenv.DisplayEnv, ad) let resInfo = resInfo.AddEntity(id.idRange,submodref) @@ -2998,8 +3036,8 @@ let rec ResolveFieldInModuleOrNamespace (ncenv:NameResolver) nenv ad (resInfo:Re let modulSearch() = match rest with | id2::rest2 -> - match modref.ModuleOrNamespaceType.ModulesAndNamespacesByDemangledName.TryFind(id.idText) with - | Some(AccessibleEntityRef ncenv.amap m ad modref submodref) -> + match modref.ModuleOrNamespaceType.ModulesAndNamespacesByDemangledName.TryGetValue id.idText with + | true, AccessibleEntityRef ncenv.amap m ad modref submodref -> let resInfo = resInfo.AddEntity(id.idRange,submodref) ResolveFieldInModuleOrNamespace ncenv nenv ad resInfo (depth+1) m submodref submodref.ModuleOrNamespaceType id2 rest2 |> OneResult @@ -3033,9 +3071,9 @@ let SuggestLabelsOfRelatedRecords g (nenv:NameResolutionEnv) (id:Ident) (allFiel else let possibleRecords = [for fld in givenFields do - match Map.tryFind fld nenv.eFieldLabels with - | None -> () - | Some recordTypes -> yield! (recordTypes |> List.map (fun r -> r.TyconRef.DisplayName, fld)) ] + match nenv.eFieldLabels.TryGetValue fld with + | true, recordTypes -> yield! (recordTypes |> List.map (fun r -> r.TyconRef.DisplayName, fld)) + | _ -> () ] |> List.groupBy fst |> List.map (fun (r,fields) -> r, fields |> List.map snd) |> List.filter (fun (_,fields) -> givenFields.IsSubsetOf fields) @@ -3093,8 +3131,8 @@ let ResolveFieldPrim sink (ncenv:NameResolver) nenv ad ty (mp,id:Ident) allField if isAppTy g ty then match ncenv.InfoReader.TryFindRecdOrClassFieldInfoOfType(id.idText,m,ty) with - | Some (RecdFieldInfo(_,rfref)) -> [ResolutionInfo.Empty, FieldResolution(rfref,false)] - | None -> + | ValueSome (RecdFieldInfo(_,rfref)) -> [ResolutionInfo.Empty, FieldResolution(rfref,false)] + | _ -> if isRecdTy g ty then // record label doesn't belong to record type -> suggest other labels of same record let suggestLabels() = SuggestOtherLabelsOfSameRecordType g nenv ty id allFields @@ -3275,8 +3313,8 @@ let private ResolveExprDotLongIdent (ncenv:NameResolver) m ad nenv ty (id:Ident) if isAppTy ncenv.g ty then NoResultsOrUsefulErrors else - match nenv.eFieldLabels |> Map.tryFind id.idText with - | Some(rfref :: _) -> + match nenv.eFieldLabels.TryGetValue id.idText with + | true, rfref :: _ -> // NOTE (instantiationGenerator cleanup): we need to freshen here because we don't know the type. // But perhaps the caller should freshen?? let item = FreshenRecdFieldRef ncenv m rfref @@ -3513,17 +3551,17 @@ let rec PartialResolveLookupInModuleOrNamespaceAsModuleOrNamespaceThen f plid (m match plid with | [] -> f modref | id:: rest -> - match mty.ModulesAndNamespacesByDemangledName.TryFind(id) with - | Some mty -> PartialResolveLookupInModuleOrNamespaceAsModuleOrNamespaceThen f rest (modref.NestedTyconRef mty) - | None -> [] + match mty.ModulesAndNamespacesByDemangledName.TryGetValue id with + | true, mty -> PartialResolveLookupInModuleOrNamespaceAsModuleOrNamespaceThen f rest (modref.NestedTyconRef mty) + | _ -> [] let PartialResolveLongIndentAsModuleOrNamespaceThen (nenv:NameResolutionEnv) plid f = - match plid with + match plid with | id:: rest -> - match Map.tryFind id nenv.eModulesAndNamespaces with - | Some modrefs -> + match nenv.eModulesAndNamespaces.TryGetValue id with + | true, modrefs -> List.collect (PartialResolveLookupInModuleOrNamespaceAsModuleOrNamespaceThen f rest) modrefs - | None -> + | _ -> [] | [] -> [] @@ -3552,12 +3590,14 @@ let ResolveCompletionsInType (ncenv: NameResolver) nenv (completionTargets: Reso ncenv.InfoReader.GetRecordOrClassFieldsOfType(None,ad,m,ty) |> List.filter (fun rfref -> rfref.IsStatic = statics && IsFieldInfoAccessible ad rfref) - let ucinfos = - if completionTargets.ResolveAll && statics && isAppTy g ty then - let tc,tinst = destAppTy g ty - tc.UnionCasesAsRefList - |> List.filter (IsUnionCaseUnseen ad g ncenv.amap m >> not) - |> List.map (fun ucref -> Item.UnionCase(UnionCaseInfo(tinst,ucref),false)) + let ucinfos = + if completionTargets.ResolveAll && statics then + match tryAppTy g ty with + | ValueSome (tc,tinst) -> + tc.UnionCasesAsRefList + |> List.filter (IsUnionCaseUnseen ad g ncenv.amap m >> not) + |> List.map (fun ucref -> Item.UnionCase(UnionCaseInfo(tinst,ucref),false)) + | _ -> [] else [] let einfos = @@ -3609,13 +3649,11 @@ let ResolveCompletionsInType (ncenv: NameResolver) nenv (completionTargets: Reso yield einfo.RemoveMethod.DisplayName ] else [] - let suppressedMethNames = Zset.ofList String.order (pinfoMethNames @ einfoMethNames) - let pinfos = pinfosIncludingUnseen |> List.filter (fun x -> not (PropInfoIsUnseen m x)) - let minfoFilter (minfo:MethInfo) = + let minfoFilter (suppressedMethNames:Zset<_>) (minfo:MethInfo) = let isApplicableMeth = match completionTargets with | ResolveCompletionTargets.All x -> x @@ -3676,45 +3714,55 @@ let ResolveCompletionsInType (ncenv: NameResolver) nenv (completionTargets: Reso // REVIEW: add a name filter here in the common cases? let minfos = if completionTargets.ResolveAll then - let minfos = - AllMethInfosOfTypeInScope ncenv.InfoReader nenv (None,ad) PreferOverrides m ty - |> List.filter minfoFilter - - let minfos = - if isNil minfos then [] else - let addersAndRemovers = - let hashSet = HashSet() - for item in pinfoItems do - match item with - | Item.Event(FSEvent(_,_,addValRef,removeValRef)) -> - hashSet.Add addValRef.LogicalName |> ignore - hashSet.Add removeValRef.LogicalName |> ignore - | _ -> () - hashSet + let minfos = AllMethInfosOfTypeInScope ncenv.InfoReader nenv (None,ad) PreferOverrides m ty + if isNil minfos then + [] + else + let suppressedMethNames = Zset.ofList String.order (pinfoMethNames @ einfoMethNames) - if addersAndRemovers.Count = 0 then minfos - else minfos |> List.filter (fun minfo -> not (addersAndRemovers.Contains minfo.LogicalName)) + let minfos = + minfos + |> List.filter (minfoFilter suppressedMethNames) + + if isNil minfos then + [] + else + let minfos = + let addersAndRemovers = + let hashSet = HashSet() + for item in pinfoItems do + match item with + | Item.Event(FSEvent(_,_,addValRef,removeValRef)) -> + hashSet.Add addValRef.LogicalName |> ignore + hashSet.Add removeValRef.LogicalName |> ignore + | _ -> () + hashSet + + if addersAndRemovers.Count = 0 then minfos + else minfos |> List.filter (fun minfo -> not (addersAndRemovers.Contains minfo.LogicalName)) #if !NO_EXTENSIONTYPING - // Filter out the ones with mangled names from applying static parameters - let minfos = - let methsWithStaticParams = - minfos - |> List.filter (fun minfo -> - match minfo.ProvidedStaticParameterInfo with - | Some (_methBeforeArguments, staticParams) -> staticParams.Length <> 0 - | _ -> false) - |> List.map (fun minfo -> minfo.DisplayName) - - if methsWithStaticParams.IsEmpty then minfos - else minfos |> List.filter (fun minfo -> - let nm = minfo.LogicalName - not (nm.Contains "," && methsWithStaticParams |> List.exists (fun m -> nm.StartsWithOrdinal(m)))) + // Filter out the ones with mangled names from applying static parameters + let minfos = + let methsWithStaticParams = + minfos + |> List.filter (fun minfo -> + match minfo.ProvidedStaticParameterInfo with + | Some (_methBeforeArguments, staticParams) -> staticParams.Length <> 0 + | _ -> false) + |> List.map (fun minfo -> minfo.DisplayName) + + if methsWithStaticParams.IsEmpty then minfos + else minfos |> List.filter (fun minfo -> + let nm = minfo.LogicalName + not (nm.Contains "," && methsWithStaticParams |> List.exists (fun m -> nm.StartsWithOrdinal(m)))) #endif - minfos + minfos + + else + [] - else [] // Partition methods into overload sets let rec partitionl (l:MethInfo list) acc = match l with @@ -3723,10 +3771,20 @@ let ResolveCompletionsInType (ncenv: NameResolver) nenv (completionTargets: Reso let nm = h.LogicalName partitionl t (NameMultiMap.add nm h acc) + let anonFields = + if statics then [] + else + match tryDestAnonRecdTy g ty with + | ValueSome (anonInfo, tys) -> + [ for (i,id) in Array.indexed anonInfo.SortedIds do + yield Item.AnonRecdField(anonInfo, tys, i, id.idRange) ] + | _ -> [] + // Build the results ucinfos @ List.map Item.RecdField rfinfos @ pinfoItems @ + anonFields @ List.map Item.ILField finfos @ List.map Item.Event einfos @ List.map (ItemOfTy g) nestedTypes @ @@ -3762,6 +3820,12 @@ let rec ResolvePartialLongIdentInType (ncenv: NameResolver) nenv isApplicableMet |> List.filter (fun pinfo -> pinfo.IsStatic = statics && IsPropInfoAccessible g amap m ad pinfo) |> List.collect (fun pinfo -> (FullTypeOfPinfo pinfo) |> ResolvePartialLongIdentInType ncenv nenv isApplicableMeth m ad false rest)) @ + (if statics then [] + else + match TryFindAnonRecdFieldOfType g ty id with + | Some (Item.AnonRecdField(_anonInfo, tys, i, _)) -> ResolvePartialLongIdentInType ncenv nenv isApplicableMeth m ad false rest tys.[i] + | _ -> []) @ + // e.g. .. (ncenv.InfoReader.GetEventInfosOfType(Some id,ad,m,ty) |> List.collect (PropTypOfEventInfo ncenv.InfoReader m ad >> ResolvePartialLongIdentInType ncenv nenv isApplicableMeth m ad false rest)) @ @@ -3793,9 +3857,10 @@ let InfosForTyconConstructors (ncenv:NameResolver) m ad (tcref:TyconRef) = | Item.CtorGroup(nm,ctorInfos) -> let ctors = ctorInfos - |> List.filter (IsMethInfoAccessible amap m ad) - |> List.filter (MethInfoIsUnseen g m ty >> not) - match ctors with + |> List.filter (fun minfo -> + IsMethInfoAccessible amap m ad minfo && + not (MethInfoIsUnseen g m ty minfo)) + match ctors with | [] -> [] | _ -> [Item.MakeCtorGroup(nm,ctors)] | item -> @@ -3863,9 +3928,9 @@ let rec ResolvePartialLongIdentInModuleOrNamespace (ncenv: NameResolver) nenv is match plid with | [] -> let tycons = - mty.TypeDefinitions - |> List.filter (fun tcref -> not (tcref.LogicalName.Contains(","))) - |> List.filter (fun tycon -> not (IsTyconUnseen ad g ncenv.amap m (modref.NestedTyconRef tycon))) + mty.TypeDefinitions |> List.filter (fun tcref -> + not (tcref.LogicalName.Contains(",")) && + not (IsTyconUnseen ad g ncenv.amap m (modref.NestedTyconRef tcref))) let accessibleSubModules = let moduleOrNamespaces = @@ -3881,16 +3946,16 @@ let rec ResolvePartialLongIdentInModuleOrNamespace (ncenv: NameResolver) nenv is let demangledName = x.DemangledModuleOrNamespaceName notFakeContainerModule ilTyconNames demangledName && IsInterestingModuleName demangledName) |> List.map modref.NestedTyconRef - |> List.filter (IsTyconUnseen ad g ncenv.amap m >> not) - |> List.filter (EntityRefContainsSomethingAccessible ncenv m ad) + |> List.filter (fun tyref -> + not (IsTyconUnseen ad g ncenv.amap m tyref) && + EntityRefContainsSomethingAccessible ncenv m ad tyref) |> List.map ItemForModuleOrNamespaceRef // Collect up the accessible values in the module, excluding the members (mty.AllValsAndMembers |> Seq.toList |> List.choose (TryMkValRefInModRef modref) // if the assembly load set is incomplete and we get a None value here, then ignore the value - |> List.filter (fun v -> not v.IsMember) - |> List.filter (IsValUnseen ad g m >> not) + |> List.filter (fun vref -> not vref.IsMember && not (IsValUnseen ad g m vref)) |> List.map Item.Value) // Collect up the accessible discriminated union cases in the module @@ -3923,8 +3988,8 @@ let rec ResolvePartialLongIdentInModuleOrNamespace (ncenv: NameResolver) nenv is | id :: rest -> - (match mty.ModulesAndNamespacesByDemangledName.TryFind(id) with - | Some mspec -> + (match mty.ModulesAndNamespacesByDemangledName.TryGetValue id with + | true, mspec -> let nested = modref.NestedTyconRef mspec if IsTyconUnseenObsoleteSpec ad g ncenv.amap m nested allowObsolete then [] else let allowObsolete = allowObsolete && not (isNil rest) @@ -3948,16 +4013,16 @@ let TryToResolveLongIdentAsType (ncenv: NameResolver) (nenv: NameResolutionEnv) | Some id -> // Look for values called 'id' that accept the dot-notation let ty = - match nenv.eUnqualifiedItems |> Map.tryFind id with + match nenv.eUnqualifiedItems.TryGetValue id with // v.lookup : member of a value - | Some v -> + | true, v -> match v with | Item.Value x -> let ty = x.Type let ty = if x.BaseOrThisInfo = CtorThisVal && isRefCellTy g ty then destRefCellTy g ty else ty Some ty | _ -> None - | None -> None + | _ -> None match ty with | Some _ -> ty @@ -4012,18 +4077,19 @@ let rec ResolvePartialLongIdentPrim (ncenv: NameResolver) (nenv: NameResolutionE let ilTyconNames = getFakeContainerModulesFromTyconRefs (nenv.TyconsByAccessNames(fullyQualified).Values) moduleOrNamespaceRefs - |> List.filter (fun x -> - let demangledName = x.DemangledModuleOrNamespaceName - IsInterestingModuleName demangledName && notFakeContainerModule ilTyconNames demangledName) - |> List.filter (EntityRefContainsSomethingAccessible ncenv m ad) - |> List.filter (IsTyconUnseen ad g ncenv.amap m >> not) + |> List.filter (fun modref -> + let demangledName = modref.DemangledModuleOrNamespaceName + IsInterestingModuleName demangledName && notFakeContainerModule ilTyconNames demangledName && + EntityRefContainsSomethingAccessible ncenv m ad modref && + not (IsTyconUnseen ad g ncenv.amap m modref)) |> List.map ItemForModuleOrNamespaceRef let tycons = nenv.TyconsByDemangledNameAndArity(fullyQualified).Values - |> List.filter (fun tcref -> not (tcref.LogicalName.Contains(","))) - |> List.filter (fun tcref -> not tcref.IsExceptionDecl) - |> List.filter (IsTyconUnseen ad g ncenv.amap m >> not) + |> List.filter (fun tcref -> + not (tcref.LogicalName.Contains(",")) && + not tcref.IsExceptionDecl && + not (IsTyconUnseen ad g ncenv.amap m tcref)) |> List.map (ItemOfTyconRef ncenv m) // Get all the constructors accessible from here @@ -4046,16 +4112,16 @@ let rec ResolvePartialLongIdentPrim (ncenv: NameResolver) (nenv: NameResolutionE []) // Look for values called 'id' that accept the dot-notation let values, isItemVal = - (match nenv.eUnqualifiedItems |> Map.tryFind id with + (match nenv.eUnqualifiedItems.TryGetValue id with // v.lookup : member of a value - | Some v -> + | true, v -> match v with | Item.Value x -> let ty = x.Type let ty = if x.BaseOrThisInfo = CtorThisVal && isRefCellTy g ty then destRefCellTy g ty else ty (ResolvePartialLongIdentInType ncenv nenv isApplicableMeth m ad false rest ty), true | _ -> [], false - | None -> [], false) + | _ -> [], false) let staticSometingInType = [ if not isItemVal then @@ -4081,9 +4147,10 @@ let rec ResolvePartialLongIdentInModuleOrNamespaceForRecordFields (ncenv: NameRe // get record type constructors let tycons = mty.TypeDefinitions - |> List.filter (fun tcref -> not (tcref.LogicalName.Contains(","))) - |> List.filter (fun tycon -> tycon.IsRecordTycon) - |> List.filter (fun tycon -> not (IsTyconUnseen ad g ncenv.amap m (modref.NestedTyconRef tycon))) + |> List.filter (fun tcref -> + not (tcref.LogicalName.Contains(",")) && + tcref.IsRecordTycon && + not (IsTyconUnseen ad g ncenv.amap m (modref.NestedTyconRef tcref))) let accessibleSubModules = @@ -4096,12 +4163,13 @@ let rec ResolvePartialLongIdentInModuleOrNamespaceForRecordFields (ncenv: NameRe let ilTyconNames = getFakeContainerModulesFromTycons mty.TypesByAccessNames.Values moduleOrNamespaces - |> List.filter (fun x -> + |> List.filter (fun x -> let demangledName = x.DemangledModuleOrNamespaceName notFakeContainerModule ilTyconNames demangledName && IsInterestingModuleName demangledName) |> List.map modref.NestedTyconRef - |> List.filter (IsTyconUnseen ad g ncenv.amap m >> not) - |> List.filter (EntityRefContainsSomethingAccessible ncenv m ad) + |> List.filter (fun tcref -> + not (IsTyconUnseen ad g ncenv.amap m tcref) && + EntityRefContainsSomethingAccessible ncenv m ad tcref) |> List.map ItemForModuleOrNamespaceRef accessibleSubModules @@ -4119,8 +4187,8 @@ let rec ResolvePartialLongIdentInModuleOrNamespaceForRecordFields (ncenv: NameRe ] | id :: rest -> - (match mty.ModulesAndNamespacesByDemangledName.TryFind(id) with - | Some mspec -> + (match mty.ModulesAndNamespacesByDemangledName.TryGetValue id with + | true, mspec -> let nested = modref.NestedTyconRef mspec if IsTyconUnseenObsoleteSpec ad g ncenv.amap m nested allowObsolete then [] else let allowObsolete = allowObsolete && not (isNil rest) @@ -4168,18 +4236,19 @@ and ResolvePartialLongIdentToClassOrRecdFieldsImpl (ncenv: NameResolver) (nenv: let ilTyconNames = getFakeContainerModulesFromTyconRefs (nenv.TyconsByAccessNames(fullyQualified).Values) moduleOrNamespaceRefs - |> List.filter (fun x -> - let demangledName = x.DemangledModuleOrNamespaceName - IsInterestingModuleName demangledName && notFakeContainerModule ilTyconNames demangledName) - |> List.filter (EntityRefContainsSomethingAccessible ncenv m ad) - |> List.filter (IsTyconUnseen ad g ncenv.amap m >> not) + |> List.filter (fun modref -> + let demangledName = modref.DemangledModuleOrNamespaceName + IsInterestingModuleName demangledName && notFakeContainerModule ilTyconNames demangledName && + EntityRefContainsSomethingAccessible ncenv m ad modref && + not (IsTyconUnseen ad g ncenv.amap m modref)) |> List.map ItemForModuleOrNamespaceRef let recdTyCons = nenv.TyconsByDemangledNameAndArity(fullyQualified).Values - |> List.filter (fun tcref -> not (tcref.LogicalName.Contains(","))) - |> List.filter (fun tcref -> tcref.IsRecordTycon) - |> List.filter (IsTyconUnseen ad g ncenv.amap m >> not) + |> List.filter (fun tcref -> + not (tcref.LogicalName.Contains(",")) && + tcref.IsRecordTycon && + not (IsTyconUnseen ad g ncenv.amap m tcref)) |> List.map (ItemOfTyconRef ncenv m) let recdFields = @@ -4226,12 +4295,14 @@ let ResolveCompletionsInTypeForItem (ncenv: NameResolver) nenv m ad statics ty ( |> List.filter (fun rfref -> rfref.IsStatic = statics && IsFieldInfoAccessible ad rfref) |> List.map Item.RecdField | Item.UnionCase _ -> - if statics && isAppTy g ty then - let tc, tinst = destAppTy g ty - yield! - tc.UnionCasesAsRefList - |> List.filter (IsUnionCaseUnseen ad g ncenv.amap m >> not) - |> List.map (fun ucref -> Item.UnionCase(UnionCaseInfo(tinst,ucref),false)) + if statics then + match tryAppTy g ty with + | ValueSome(tc, tinst) -> + yield! + tc.UnionCasesAsRefList + |> List.filter (IsUnionCaseUnseen ad g ncenv.amap m >> not) + |> List.map (fun ucref -> Item.UnionCase(UnionCaseInfo(tinst,ucref),false)) + | _ -> () | Item.Event _ -> yield! ncenv.InfoReader.GetEventInfosOfType(None,ad,m,ty) @@ -4251,6 +4322,13 @@ let ResolveCompletionsInTypeForItem (ncenv: NameResolver) nenv m ad statics ty ( if statics then yield! ty |> GetNestedTypesOfType (ad, ncenv, None, TypeNameResolutionStaticArgsInfo.Indefinite, false, m) |> List.map (ItemOfTy g) | _ -> + if not statics then + match tryDestAnonRecdTy g ty with + | ValueSome (anonInfo, tys) -> + for (i,id) in Array.indexed anonInfo.SortedIds do + yield Item.AnonRecdField(anonInfo, tys, i, id.idRange) + | _ -> () + let pinfosIncludingUnseen = AllPropInfosOfTypeInScope ncenv.InfoReader nenv (None,ad) PreferOverrides m ty |> List.filter (fun x -> @@ -4282,13 +4360,12 @@ let ResolveCompletionsInTypeForItem (ncenv: NameResolver) nenv m ad statics ty ( yield einfo.AddMethod.DisplayName yield einfo.RemoveMethod.DisplayName ] - let suppressedMethNames = Zset.ofList String.order (pinfoMethNames @ einfoMethNames) let pinfos = pinfosIncludingUnseen |> List.filter (fun x -> not (PropInfoIsUnseen m x)) - let minfoFilter (minfo: MethInfo) = + let minfoFilter (suppressedMethNames:Zset<_>) (minfo: MethInfo) = // Only show the Finalize, MemberwiseClose etc. methods on System.Object for values whose static type really is // System.Object. Few of these are typically used from F#. // @@ -4339,37 +4416,49 @@ let ResolveCompletionsInTypeForItem (ncenv: NameResolver) nenv m ad statics ty ( | Item.MethodGroup _ -> // REVIEW: add a name filter here in the common cases? let minfos = - let minfos = - AllMethInfosOfTypeInScope ncenv.InfoReader nenv (None,ad) PreferOverrides m ty - |> List.filter minfoFilter - + let minfos = AllMethInfosOfTypeInScope ncenv.InfoReader nenv (None,ad) PreferOverrides m ty + if isNil minfos then [] else + + let suppressedMethNames = Zset.ofList String.order (pinfoMethNames @ einfoMethNames) let minfos = - let addersAndRemovers = - pinfoItems - |> List.collect (function Item.Event(FSEvent(_,_,addValRef,removeValRef)) -> [addValRef.LogicalName;removeValRef.LogicalName] | _ -> []) - |> set + minfos + |> List.filter (minfoFilter suppressedMethNames) - if addersAndRemovers.IsEmpty then minfos - else minfos |> List.filter (fun minfo -> not (addersAndRemovers.Contains minfo.LogicalName)) + if isNil minfos then + [] + else + let minfos = + let addersAndRemovers = + let hashSet = HashSet() + for item in pinfoItems do + match item with + | Item.Event(FSEvent(_,_,addValRef,removeValRef)) -> + hashSet.Add addValRef.LogicalName |> ignore + hashSet.Add removeValRef.LogicalName |> ignore + | _ -> () + hashSet + + if addersAndRemovers.Count = 0 then minfos + else minfos |> List.filter (fun minfo -> not (addersAndRemovers.Contains minfo.LogicalName)) #if !NO_EXTENSIONTYPING - // Filter out the ones with mangled names from applying static parameters - let minfos = - let methsWithStaticParams = - minfos - |> List.filter (fun minfo -> - match minfo.ProvidedStaticParameterInfo with - | Some (_methBeforeArguments, staticParams) -> staticParams.Length <> 0 - | _ -> false) - |> List.map (fun minfo -> minfo.DisplayName) + // Filter out the ones with mangled names from applying static parameters + let minfos = + let methsWithStaticParams = + minfos + |> List.filter (fun minfo -> + match minfo.ProvidedStaticParameterInfo with + | Some (_methBeforeArguments, staticParams) -> staticParams.Length <> 0 + | _ -> false) + |> List.map (fun minfo -> minfo.DisplayName) - if methsWithStaticParams.IsEmpty then minfos - else minfos |> List.filter (fun minfo -> - let nm = minfo.LogicalName - not (nm.Contains "," && methsWithStaticParams |> List.exists (fun m -> nm.StartsWithOrdinal(m)))) + if methsWithStaticParams.IsEmpty then minfos + else minfos |> List.filter (fun minfo -> + let nm = minfo.LogicalName + not (nm.Contains "," && methsWithStaticParams |> List.exists (fun m -> nm.StartsWithOrdinal(m)))) #endif - minfos + minfos // Partition methods into overload sets let rec partitionl (l:MethInfo list) acc = @@ -4416,6 +4505,12 @@ let rec ResolvePartialLongIdentInTypeForItem (ncenv: NameResolver) nenv m ad sta for pinfo in pinfos do yield! (fullTypeOfPinfo pinfo) |> ResolvePartialLongIdentInTypeForItem ncenv nenv m ad false rest item + match TryFindAnonRecdFieldOfType g ty id with + | Some (Item.AnonRecdField(_anonInfo, tys, i, _)) -> + let tyinfo = tys.[i] + yield! ResolvePartialLongIdentInTypeForItem ncenv nenv m ad false rest item tyinfo + | _ -> () + // e.g. .. for einfo in ncenv.InfoReader.GetEventInfosOfType(Some id, ad, m, ty) do let tyinfo = PropTypOfEventInfo ncenv.InfoReader m ad einfo @@ -4445,8 +4540,7 @@ let rec ResolvePartialLongIdentInModuleOrNamespaceForItem (ncenv: NameResolver) mty.AllValsAndMembers |> Seq.toList |> List.choose (TryMkValRefInModRef modref) // if the assembly load set is incomplete and we get a None value here, then ignore the value - |> List.filter (fun v -> not v.IsMember) - |> List.filter (IsValUnseen ad g m >> not) + |> List.filter (fun vref -> not vref.IsMember && not (IsValUnseen ad g m vref)) |> List.map Item.Value | Item.UnionCase _ -> // Collect up the accessible discriminated union cases in the module @@ -4486,14 +4580,16 @@ let rec ResolvePartialLongIdentInModuleOrNamespaceForItem (ncenv: NameResolver) let demangledName = x.DemangledModuleOrNamespaceName notFakeContainerModule ilTyconNames demangledName && IsInterestingModuleName demangledName) |> List.map modref.NestedTyconRef - |> List.filter (IsTyconUnseen ad g ncenv.amap m >> not) - |> List.filter (EntityRefContainsSomethingAccessible ncenv m ad) + |> List.filter (fun tcref -> + not (IsTyconUnseen ad g ncenv.amap m tcref) && + EntityRefContainsSomethingAccessible ncenv m ad tcref) |> List.map ItemForModuleOrNamespaceRef let tycons = mty.TypeDefinitions - |> List.filter (fun tcref -> not (tcref.LogicalName.Contains(","))) - |> List.filter (fun tycon -> not (IsTyconUnseen ad g ncenv.amap m (modref.NestedTyconRef tycon))) + |> List.filter (fun tcref -> + not (tcref.LogicalName.Contains(",")) && + not (IsTyconUnseen ad g ncenv.amap m (modref.NestedTyconRef tcref))) // Get all the types and .NET constructor groups accessible from here let nestedTycons = tycons |> List.map modref.NestedTyconRef @@ -4502,8 +4598,8 @@ let rec ResolvePartialLongIdentInModuleOrNamespaceForItem (ncenv: NameResolver) | id :: rest -> - match mty.ModulesAndNamespacesByDemangledName.TryFind id with - | Some mspec -> + match mty.ModulesAndNamespacesByDemangledName.TryGetValue id with + | true, mspec -> let nested = modref.NestedTyconRef mspec if not (IsTyconUnseenObsoleteSpec ad g ncenv.amap m nested true) then yield! ResolvePartialLongIdentInModuleOrNamespaceForItem ncenv nenv m ad nested rest item @@ -4520,20 +4616,20 @@ let rec PartialResolveLookupInModuleOrNamespaceAsModuleOrNamespaceThenLazy f pli match plid with | [] -> f modref | id :: rest -> - match mty.ModulesAndNamespacesByDemangledName.TryFind id with - | Some mty -> + match mty.ModulesAndNamespacesByDemangledName.TryGetValue id with + | true, mty -> PartialResolveLookupInModuleOrNamespaceAsModuleOrNamespaceThenLazy f rest (modref.NestedTyconRef mty) - | None -> Seq.empty + | _ -> Seq.empty let PartialResolveLongIndentAsModuleOrNamespaceThenLazy (nenv:NameResolutionEnv) plid f = seq { match plid with | id :: rest -> - match Map.tryFind id nenv.eModulesAndNamespaces with - | Some modrefs -> + match nenv.eModulesAndNamespaces.TryGetValue id with + | true, modrefs -> for modref in modrefs do yield! PartialResolveLookupInModuleOrNamespaceAsModuleOrNamespaceThenLazy f rest modref - | None -> () + | _ -> () | [] -> () } @@ -4606,8 +4702,8 @@ let rec GetCompletionForItem (ncenv: NameResolver) (nenv: NameResolutionEnv) m a else Seq.empty) // Look for values called 'id' that accept the dot-notation - match Map.tryFind id nenv.eUnqualifiedItems with - | Some (Item.Value x) -> + match nenv.eUnqualifiedItems.TryGetValue id with + | true, Item.Value x -> let ty = x.Type let ty = if x.BaseOrThisInfo = CtorThisVal && isRefCellTy g ty then destRefCellTy g ty else ty yield! ResolvePartialLongIdentInTypeForItem ncenv nenv m ad false rest item ty diff --git a/src/fsharp/NameResolution.fsi b/src/fsharp/NameResolution.fsi index 3a5e5983258..3284a11a6a8 100755 --- a/src/fsharp/NameResolution.fsi +++ b/src/fsharp/NameResolution.fsi @@ -64,6 +64,9 @@ type Item = /// Represents the resolution of a name to an F# record field. | RecdField of RecdFieldInfo + /// Represents the resolution of a name to a field of an anonymous record type. + | AnonRecdField of AnonRecdTypeInfo * TTypes * int * range + // The following are never in the items table but are valid results of binding // an identifier in different circumstances. @@ -166,8 +169,8 @@ type FullyQualifiedFlag = [] type BulkAdd = Yes | No -/// Lookup patterns in name resolution environment -val internal TryFindPatternByName : string -> NameResolutionEnv -> Item option +/// Find a field in anonymous record type +val internal TryFindAnonRecdFieldOfType : TcGlobals -> TType -> string -> Item option /// Add extra items to the environment for Visual Studio, e.g. static members val internal AddFakeNamedValRefToNameEnv : string -> NameResolutionEnv -> ValRef -> NameResolutionEnv @@ -237,7 +240,7 @@ type TypeNameResolutionInfo = static member ResolveToTypeRefs : TypeNameResolutionStaticArgsInfo -> TypeNameResolutionInfo /// Represents the kind of the occurrence when reporting a name in name resolution -[] +[] type internal ItemOccurence = | Binding | Use @@ -316,7 +319,7 @@ type internal TcSymbolUses = member GetUsesOfSymbol : Item -> TcSymbolUseData[] /// All the uses of all items within the file - member AllUsesOfSymbols : TcSymbolUseData[] + member AllUsesOfSymbols : TcSymbolUseData[][] /// Get the locations of all the printf format specifiers in the file member GetFormatSpecifierLocationsAndArity : unit -> (range * int)[] @@ -341,12 +344,12 @@ type internal OpenDeclaration = /// Create a new instance of OpenDeclaration. static member Create : longId: Ident list * modules: ModuleOrNamespaceRef list * appliedScope: range * isOwnNamespace: bool -> OpenDeclaration -/// Line-end normalized source text and an array of line end positions, used for format string parsing +/// Source text and an array of line end positions, used for format string parsing type FormatStringCheckContext = - { /// Line-end normalized source text - NormalizedSource: string - /// Array of line end positions - LineEndPositions: int[] } + { /// Source text + Source: string + /// Array of line start positions + LineStartPositions: int[] } /// An abstract type for reporting the results of name resolution and type checking type ITypecheckResultsSink = diff --git a/src/fsharp/NicePrint.fs b/src/fsharp/NicePrint.fs index ca5fd8c674c..142ccbae076 100755 --- a/src/fsharp/NicePrint.fs +++ b/src/fsharp/NicePrint.fs @@ -33,6 +33,7 @@ module internal PrintUtilities = let squareAngleL x = LeftL.leftBracketAngle ^^ x ^^ RightL.rightBracketAngle let angleL x = sepL Literals.leftAngle ^^ x ^^ rightL Literals.rightAngle let braceL x = leftL Literals.leftBrace ^^ x ^^ rightL Literals.rightBrace + let braceBarL x = leftL Literals.leftBraceBar ^^ x ^^ rightL Literals.rightBraceBar let comment str = wordL (tagText (sprintf "(* %s *)" str)) @@ -102,7 +103,7 @@ module private PrintIL = open Microsoft.FSharp.Compiler.AbstractIL.IL let fullySplitILTypeRef (tref:ILTypeRef) = - (List.collect IL.splitNamespace (tref.Enclosing @ [IL.ungenericizeTypeName tref.Name])) + (List.collect IL.splitNamespace (tref.Enclosing @ [PrettyNaming.DemangleGenericTypeName tref.Name])) let layoutILTypeRefName denv path = let path = @@ -193,7 +194,7 @@ module private PrintIL = let args = signatur.ArgTypes |> List.map (layoutILType denv ilTyparSubst) let res = match cons with - | Some className -> layoutILTypeRefName denv (SplitNamesForILPath (ungenericizeTypeName className)) ^^ (pruneParms className ilTyparSubst |> paramsL) // special case for constructor return-type (viz., the class itself) + | Some className -> layoutILTypeRefName denv (SplitNamesForILPath (PrettyNaming.DemangleGenericTypeName className)) ^^ (pruneParms className ilTyparSubst |> paramsL) // special case for constructor return-type (viz., the class itself) | None -> signatur.ReturnType |> layoutILType denv ilTyparSubst match args with | [] -> WordL.structUnit ^^ WordL.arrow ^^ res @@ -226,7 +227,7 @@ module private PrintIL = // return type be passed along as the `cons` parameter.) let res = match cons with - | Some className -> layoutILTypeRefName denv (SplitNamesForILPath (ungenericizeTypeName className)) ^^ (pruneParms className ilTyparSubst |> paramsL) // special case for constructor return-type (viz., the class itself) + | Some className -> layoutILTypeRefName denv (SplitNamesForILPath (PrettyNaming.DemangleGenericTypeName className)) ^^ (pruneParms className ilTyparSubst |> paramsL) // special case for constructor return-type (viz., the class itself) | None -> retType |> layoutILType denv ilTyparSubst match parameters with | [] -> WordL.structUnit ^^ WordL.arrow ^^ res @@ -934,6 +935,14 @@ module private PrintTypes = | TType_ucase (UCRef(tc,_),args) -> layoutTypeAppWithInfoAndPrec denv env (layoutTyconRef denv tc) prec tc.IsPrefixDisplay args + // Layout a tuple type + | TType_anon (anonInfo,tys) -> + let core = sepListL (wordL (tagPunctuation ";")) (List.map2 (fun nm ty -> wordL (tagField nm) ^^ wordL (tagPunctuation ":") ^^ layoutTypeWithInfoAndPrec denv env prec ty) (Array.toList anonInfo.SortedNames) tys) + if evalAnonInfoIsStruct anonInfo then + WordL.keywordStruct --- braceBarL core + else + braceBarL core + // Layout a tuple type | TType_tuple (tupInfo,t) -> if evalTupInfoIsStruct tupInfo then @@ -991,7 +1000,7 @@ module private PrintTypes = let isParamArray = HasFSharpAttribute denv.g denv.g.attrib_ParamArrayAttribute argInfo.Attribs match argInfo.Name, isOptionalArg, isParamArray, tryDestOptionTy denv.g ty with // Layout an optional argument - | Some(id), true, _, Some ty -> + | Some(id), true, _, ValueSome ty -> leftL (tagPunctuation "?") ^^ sepL (tagParameter id.idText) ^^ SepL.colon ^^ layoutTypeWithInfoAndPrec denv env 2 ty // Layout an unnamed argument | None, _,_, _ -> @@ -1056,7 +1065,7 @@ module private PrintTypes = let prettyLayoutOfCurriedMemberSig denv typarInst argInfos retTy parentTyparTys = let (prettyTyparInst, parentTyparTys,argInfos,retTy),cxs = PrettyTypes.PrettifyInstAndCurriedSig denv.g (typarInst, parentTyparTys, argInfos, retTy) // Filter out the parent typars, which don't get shown in the member signature - let cxs = cxs |> List.filter (fun (tp,_) -> not (parentTyparTys |> List.exists (fun ty -> match tryDestTyparTy denv.g ty with Some destTypar -> typarEq tp destTypar | None -> false))) + let cxs = cxs |> List.filter (fun (tp,_) -> not (parentTyparTys |> List.exists (fun ty -> match tryDestTyparTy denv.g ty with ValueSome destTypar -> typarEq tp destTypar | _ -> false))) prettyTyparInst, prettyLayoutOfTopTypeInfoAux denv argInfos retTy cxs // Layout: type spec - class, datatype, record, abbrev @@ -1247,7 +1256,7 @@ module InfoMemberPrinting = // Layout an optional argument | _, Some nm, true, ptyOpt -> // detect parameter type, if ptyOpt is None - this is .NET style optional argument - let pty = defaultArg ptyOpt pty + let pty = match ptyOpt with ValueSome x -> x | _ -> pty SepL.questionMark ^^ wordL (tagParameter nm.idText) ^^ RightL.colon ^^ @@ -1513,7 +1522,7 @@ module private TastDefinitionPrinting = /// Another re-implementation of type printing, this time based off provided info objects. let layoutProvidedTycon (denv:DisplayEnv) (infoReader:InfoReader) ad m start lhsL ty = let g = denv.g - let tcref,_ = destAppTy g ty + let tcref = tcrefOfAppTy g ty if isEnumTy g ty then let fieldLs = diff --git a/src/fsharp/Optimizer.fs b/src/fsharp/Optimizer.fs index b2baed1a7a4..5e345822675 100644 --- a/src/fsharp/Optimizer.fs +++ b/src/fsharp/Optimizer.fs @@ -157,17 +157,20 @@ let braceL x = leftL (tagText "{") ^^ x ^^ rightL (tagText "}") let seqL xL xs = Seq.fold (fun z x -> z @@ xL x) emptyL xs let namemapL xL xmap = NameMap.foldBack (fun nm x z -> xL nm x @@ z) xmap emptyL -let rec exprValueInfoL g = function - | ConstValue (x, ty) -> NicePrint.layoutConst g ty x - | UnknownValue -> wordL (tagText "?") - | SizeValue (_, vinfo) -> exprValueInfoL g vinfo - | ValValue (vr, vinfo) -> bracketL ((valRefL vr ^^ wordL (tagText "alias")) --- exprValueInfoL g vinfo) - | TupleValue vinfos -> bracketL (exprValueInfosL g vinfos) - | RecdValue (_, vinfos) -> braceL (exprValueInfosL g vinfos) - | UnionCaseValue (ucr, vinfos) -> unionCaseRefL ucr ^^ bracketL (exprValueInfosL g vinfos) - | CurriedLambdaValue(_lambdaId, _arities, _bsize, expr', _ety) -> wordL (tagText "lam") ++ exprL expr' (* (sprintf "lam(size=%d)" bsize) *) - | ConstExprValue (_size, x) -> exprL x +let rec exprValueInfoL g exprVal = + match exprVal with + | ConstValue (x, ty) -> NicePrint.layoutConst g ty x + | UnknownValue -> wordL (tagText "?") + | SizeValue (_, vinfo) -> exprValueInfoL g vinfo + | ValValue (vr, vinfo) -> bracketL ((valRefL vr ^^ wordL (tagText "alias")) --- exprValueInfoL g vinfo) + | TupleValue vinfos -> bracketL (exprValueInfosL g vinfos) + | RecdValue (_, vinfos) -> braceL (exprValueInfosL g vinfos) + | UnionCaseValue (ucr, vinfos) -> unionCaseRefL ucr ^^ bracketL (exprValueInfosL g vinfos) + | CurriedLambdaValue(_lambdaId, _arities, _bsize, expr', _ety) -> wordL (tagText "lam") ++ exprL expr' (* (sprintf "lam(size=%d)" bsize) *) + | ConstExprValue (_size, x) -> exprL x + and exprValueInfosL g vinfos = commaListL (List.map (exprValueInfoL g) (Array.toList vinfos)) + and moduleInfoL g (x:LazyModuleInfo) = let x = x.Force() braceL ((wordL (tagText "Modules: ") @@ (x.ModuleOrNamespaceInfos |> namemapL (fun nm x -> wordL (tagText nm) ^^ moduleInfoL g x) ) ) @@ -455,8 +458,8 @@ let BindExternalLocalVal cenv (v:Val) vval env = // Passing an empty remap is sufficient for FSharp.Core.dll because it turns out the remapped type signature can // still be resolved. match tryRescopeVal cenv.g.fslibCcu Remap.Empty v with - | Some vref -> BindValueForFslib vref.nlr v vval env - | None -> env + | ValueSome vref -> BindValueForFslib vref.nlr v vval env + | _ -> env else env env @@ -973,11 +976,11 @@ let AbstractLazyModulInfoByHiding isAssemblyBoundary mhi = // Under those checks, the further hidden* checks may be subsumed (meaning, not required anymore). let hiddenTycon, hiddenTyconRepr, hiddenVal, hiddenRecdField, hiddenUnionCase = - Zset.memberOf mhi.mhiTycons, - Zset.memberOf mhi.mhiTyconReprs, - Zset.memberOf mhi.mhiVals, - Zset.memberOf mhi.mhiRecdFields, - Zset.memberOf mhi.mhiUnionCases + Zset.memberOf mhi.HiddenTycons, + Zset.memberOf mhi.HiddenTyconReprs, + Zset.memberOf mhi.HiddenVals, + Zset.memberOf mhi.HiddenRecdFields, + Zset.memberOf mhi.HiddenUnionCases let rec abstractExprInfo ivalue = match ivalue with @@ -1277,6 +1280,7 @@ and BindingHasEffect g bind = bind.Expr |> ExprHasEffect g and OpHasEffect g m op = match op with | TOp.Tuple _ -> false + | TOp.AnonRecd _ -> false | TOp.Recd (ctor, tcref) -> match ctor with | RecdExprIsObjInit -> true @@ -1291,7 +1295,8 @@ and OpHasEffect g m op = | TOp.TupleFieldGet(_) -> false | TOp.ExnFieldGet(ecref, n) -> isExnFieldMutable ecref n | TOp.RefAddrGet _ -> false - | TOp.ValFieldGet rfref -> rfref.RecdField.IsMutable || (TryFindTyconRefBoolAttribute g Range.range0 g.attrib_AllowNullLiteralAttribute rfref.TyconRef = Some true) + | TOp.AnonRecdGet _ -> true // conservative + | TOp.ValFieldGet rfref -> rfref.RecdField.IsMutable || (TryFindTyconRefBoolAttribute g Range.range0 g.attrib_AllowNullLiteralAttribute rfref.TyconRef = Some(true)) | TOp.ValFieldGetAddr (rfref, _readonly) -> rfref.RecdField.IsMutable | TOp.UnionCaseFieldGetAddr _ -> false // union case fields are immutable | TOp.LValueOp (LAddrOf _, _) -> false // addresses of values are always constants @@ -1759,7 +1764,15 @@ let TryDetectQueryQuoteAndRun cenv (expr:Expr) = //printfn "Not eliminating because no Run found" None - +let IsSystemStringConcatOverload (methRef: ILMethodRef) = + methRef.Name = "Concat" && methRef.DeclaringTypeRef.FullName = "System.String" && + methRef.ReturnType.BasicQualifiedName = "System.String" && + methRef.ArgTypes |> List.forall(fun ilty -> ilty.BasicQualifiedName = "System.String") + +let IsSystemStringConcatArray (methRef: ILMethodRef) = + methRef.Name = "Concat" && methRef.DeclaringTypeRef.FullName = "System.String" && + methRef.ReturnType.BasicQualifiedName = "System.String" && + methRef.ArgTypes.Length = 1 && methRef.ArgTypes.Head.BasicQualifiedName = "System.String[]" //------------------------------------------------------------------------- // The traversal @@ -1819,7 +1832,6 @@ let rec OptimizeExpr cenv (env:IncrementalOptimizationEnv) expr = assert ("unexpected reclink" = "") failwith "Unexpected reclink" - //------------------------------------------------------------------------- // Optimize/analyze an object expression //------------------------------------------------------------------------- @@ -1869,9 +1881,54 @@ and OptimizeInterfaceImpl cenv env baseValOpt (ty, overrides) = Info=UnknownValue} //------------------------------------------------------------------------- -// Optimize/analyze an application of an intrinsic operator to arguments +// Make and optimize String.Concat calls //------------------------------------------------------------------------- +and MakeOptimizedSystemStringConcatCall cenv env m args = + let rec optimizeArg e accArgs = + match e, accArgs with + | Expr.Op(TOp.ILCall(_, _, _, _, _, _, _, methRef, _, _, _), _, [ Expr.Op(TOp.Array, _, args, _) ], _), _ when IsSystemStringConcatArray methRef -> + optimizeArgs args accArgs + + | Expr.Op(TOp.ILCall(_, _, _, _, _, _, _, methRef, _, _, _), _, args, _), _ when IsSystemStringConcatOverload methRef -> + optimizeArgs args accArgs + + // Optimize string constants, e.g. "1" + "2" will turn into "12" + | Expr.Const(Const.String str1, _, _), Expr.Const(Const.String str2, _, _) :: accArgs -> + mkString cenv.g m (str1 + str2) :: accArgs + + | arg, _ -> arg :: accArgs + + and optimizeArgs args accArgs = + (args, accArgs) + ||> List.foldBack (fun arg accArgs -> optimizeArg arg accArgs) + + let args = optimizeArgs args [] + + let e = + match args with + | [ arg ] -> + arg + | [ arg1; arg2 ] -> + mkStaticCall_String_Concat2 cenv.g m arg1 arg2 + | [ arg1; arg2; arg3 ] -> + mkStaticCall_String_Concat3 cenv.g m arg1 arg2 arg3 + | [ arg1; arg2; arg3; arg4 ] -> + mkStaticCall_String_Concat4 cenv.g m arg1 arg2 arg3 arg4 + | args -> + let arg = mkArray (cenv.g.string_ty, args, m) + mkStaticCall_String_Concat_Array cenv.g m arg + + match e with + | Expr.Op(TOp.ILCall(_, _, _, _, _, _, _, methRef, _, _, _) as op, tyargs, args, m) when IsSystemStringConcatOverload methRef || IsSystemStringConcatArray methRef -> + OptimizeExprOpReductions cenv env (op, tyargs, args, m) + | _ -> + OptimizeExpr cenv env e + +//------------------------------------------------------------------------- +// Optimize/analyze an application of an intrinsic operator to arguments +//------------------------------------------------------------------------- + and OptimizeExprOp cenv env (op, tyargs, args, m) = // Special cases @@ -1935,22 +1992,30 @@ and OptimizeExprOp cenv env (op, tyargs, args, m) = // if the types match up. | TOp.ILAsm([], [ty]), _, [a] when typeEquiv cenv.g (tyOfExpr cenv.g a) ty -> OptimizeExpr cenv env a - | _ -> - // Reductions - let args', arginfos = OptimizeExprsThenConsiderSplits cenv env args - let knownValue = - match op, arginfos with - | TOp.ValFieldGet (rf), [e1info] -> TryOptimizeRecordFieldGet cenv env (e1info, rf, tyargs, m) - | TOp.TupleFieldGet (tupInfo, n), [e1info] -> TryOptimizeTupleFieldGet cenv env (tupInfo, e1info, tyargs, n, m) - | TOp.UnionCaseFieldGet (cspec, n), [e1info] -> TryOptimizeUnionCaseGet cenv env (e1info, cspec, tyargs, n, m) - | _ -> None - match knownValue with - | Some valu -> - match TryOptimizeVal cenv env (false, valu, m) with - | Some res -> OptimizeExpr cenv env res (* discard e1 since guard ensures it has no effects *) - | None -> OptimizeExprOpFallback cenv env (op, tyargs, args', m) arginfos valu - | None -> OptimizeExprOpFallback cenv env (op, tyargs, args', m) arginfos UnknownValue + // Optimize calls when concatenating strings, e.g. "1" + "2" + "3" + "4" .. etc. + | TOp.ILCall(_, _, _, _, _, _, _, methRef, _, _, _), _, [ Expr.Op(TOp.Array, _, args, _) ] when IsSystemStringConcatArray methRef -> + MakeOptimizedSystemStringConcatCall cenv env m args + | TOp.ILCall(_, _, _, _, _, _, _, methRef, _, _, _), _, args when IsSystemStringConcatOverload methRef -> + MakeOptimizedSystemStringConcatCall cenv env m args + | _ -> + // Reductions + OptimizeExprOpReductions cenv env (op, tyargs, args, m) + +and OptimizeExprOpReductions cenv env (op, tyargs, args, m) = + let args', arginfos = OptimizeExprsThenConsiderSplits cenv env args + let knownValue = + match op, arginfos with + | TOp.ValFieldGet (rf), [e1info] -> TryOptimizeRecordFieldGet cenv env (e1info, rf, tyargs, m) + | TOp.TupleFieldGet (tupInfo, n), [e1info] -> TryOptimizeTupleFieldGet cenv env (tupInfo, e1info, tyargs, n, m) + | TOp.UnionCaseFieldGet (cspec, n), [e1info] -> TryOptimizeUnionCaseGet cenv env (e1info, cspec, tyargs, n, m) + | _ -> None + match knownValue with + | Some valu -> + match TryOptimizeVal cenv env (false, valu, m) with + | Some res -> OptimizeExpr cenv env res (* discard e1 since guard ensures it has no effects *) + | None -> OptimizeExprOpFallback cenv env (op, tyargs, args', m) arginfos valu + | None -> OptimizeExprOpFallback cenv env (op, tyargs, args', m) arginfos UnknownValue and OptimizeExprOpFallback cenv env (op, tyargs, args', m) arginfos valu = // The generic case - we may collect information, but the construction/projection doesn't disappear @@ -1966,7 +2031,12 @@ and OptimizeExprOpFallback cenv env (op, tyargs, args', m) arginfos valu = | TOp.Tuple tupInfo -> let isStruct = evalTupInfoIsStruct tupInfo if isStruct then 0, valu - else 1, MakeValueInfoForTuple (Array.ofList argValues) + else 1,MakeValueInfoForTuple (Array.ofList argValues) + | TOp.AnonRecd anonInfo -> + let isStruct = evalAnonInfoIsStruct anonInfo + if isStruct then 0, valu + else 1, valu + | TOp.AnonRecdGet _ | TOp.ValFieldGet _ | TOp.TupleFieldGet _ | TOp.UnionCaseFieldGet _ @@ -2364,11 +2434,13 @@ and OptimizeVal cenv env expr (v:ValRef, m) = //------------------------------------------------------------------------- and StripToNominalTyconRef cenv ty = - if isAppTy cenv.g ty then destAppTy cenv.g ty - elif isRefTupleTy cenv.g ty then - let tyargs = destRefTupleTy cenv.g ty - mkCompiledTupleTyconRef cenv.g false (List.length tyargs), tyargs - else failwith "StripToNominalTyconRef: unreachable" + match tryAppTy cenv.g ty with + | ValueSome x -> x + | _ -> + if isRefTupleTy cenv.g ty then + let tyargs = destRefTupleTy cenv.g ty + mkCompiledTupleTyconRef cenv.g false (List.length tyargs), tyargs + else failwith "StripToNominalTyconRef: unreachable" and CanDevirtualizeApplication cenv v vref ty args = valRefEq cenv.g v vref @@ -2670,7 +2742,7 @@ and TryInlineApplication cenv env finfo (tyargs: TType list, args: Expr list, m) // Inlining: beta reducing let expr' = MakeApplicationAndBetaReduce cenv.g (f2', f2ty, [tyargs], args', m) // Inlining: reoptimizing - Some (OptimizeExpr cenv {env with dontInline= Zset.add lambdaId env.dontInline} expr') + Some(OptimizeExpr cenv {env with dontInline= Zset.add lambdaId env.dontInline} expr') | _ -> None @@ -3090,7 +3162,7 @@ and OptimizeBinding cenv isRec env (TBind(vref, expr, spBind)) = | None -> false | Some mbrTyconRef -> // Check we can deref system_MarshalByRefObject_tcref. When compiling against the Silverlight mscorlib we can't - if mbrTyconRef.TryDeref.IsSome then + if ValueOptionInternal.isSome mbrTyconRef.TryDeref then // Check if this is a subtype of MarshalByRefObject assert (cenv.g.system_MarshalByRefObject_ty.IsSome) ExistsSameHeadTypeInHierarchy cenv.g cenv.amap vref.Range (generalizedTyconRef tcref) cenv.g.system_MarshalByRefObject_ty.Value @@ -3157,7 +3229,7 @@ and OptimizeModuleExpr cenv env x = not (ValueIsUsedOrHasEffect cenv (fun () -> fvs.FreeLocals) (bind, binfo)) && // Check the thing is hidden by the signature (if any) - hidden.mhiVals.Contains bind.Var && + hidden.HiddenVals.Contains bind.Var && // Check the thing is not compiled as a static field or property, since reflected definitions and other reflective stuff might need it not (IsCompiledAsStaticProperty cenv.g bind.Var)) @@ -3267,7 +3339,7 @@ and OptimizeModuleDefs cenv (env, bindInfosColl) defs = let defs, minfos = List.unzip defs (defs, UnionOptimizationInfos minfos), (env, bindInfosColl) -and OptimizeImplFileInternal cenv env isIncrementalFragment hidden (TImplFile(qname, pragmas, mexpr, hasExplicitEntryPoint, isScript)) = +and OptimizeImplFileInternal cenv env isIncrementalFragment hidden (TImplFile(qname, pragmas, mexpr, hasExplicitEntryPoint, isScript, anonRecdTypes)) = let env, mexpr', minfo = match mexpr with // FSI: FSI compiles everything as if you're typing incrementally into one module @@ -3286,7 +3358,7 @@ and OptimizeImplFileInternal cenv env isIncrementalFragment hidden (TImplFile(qn let hidden = ComputeHidingInfoAtAssemblyBoundary mexpr.Type hidden let minfo = AbstractLazyModulInfoByHiding true hidden minfo - env, TImplFile(qname, pragmas, mexpr', hasExplicitEntryPoint, isScript), minfo, hidden + env, TImplFile(qname, pragmas, mexpr', hasExplicitEntryPoint, isScript, anonRecdTypes), minfo, hidden //------------------------------------------------------------------------- // Entry point diff --git a/src/fsharp/PatternMatchCompilation.fs b/src/fsharp/PatternMatchCompilation.fs index f0be350d1e2..625b23a70d0 100644 --- a/src/fsharp/PatternMatchCompilation.fs +++ b/src/fsharp/PatternMatchCompilation.fs @@ -257,7 +257,7 @@ let RefuteDiscrimSet g m path discrims = | None -> raise CannotRefute | Some c -> match tryDestAppTy g ty with - | Some tcref when tcref.IsEnumTycon -> + | ValueSome tcref when tcref.IsEnumTycon -> // We must distinguish between F#-defined enums and other .NET enums, as they are represented differently in the TAST let enumValues = if tcref.IsILEnumTycon then @@ -907,6 +907,11 @@ let CompilePatternBasic else None,true) + and IsCopyableInputExpr origInputExpr = + match origInputExpr with + | Expr.Op (TOp.LValueOp (LByrefGet, v), [], [], _) when not v.IsMutable -> true + | _ -> false + and ChoosePreBinder simulSetOfEdgeDiscrims subexpr = match simulSetOfEdgeDiscrims with // Very simple 'isinst' tests: put the result of 'isinst' in a local variable @@ -939,7 +944,7 @@ let CompilePatternBasic let argExpr = GetSubExprOfInput subexpr let argExpr = match argExpr, _origInputExprOpt with - | Expr.Val(v1, _, _), Some origInputExpr when valEq origInputVal v1.Deref -> origInputExpr + | Expr.Val(v1, _, _), Some origInputExpr when valEq origInputVal v1.Deref && IsCopyableInputExpr origInputExpr -> origInputExpr | _ -> argExpr let vOpt, addrExp, _readonly, _writeonly = mkExprAddrOfExprAux g true false NeverMutates argExpr None matchm match vOpt with diff --git a/src/fsharp/PostInferenceChecks.fs b/src/fsharp/PostInferenceChecks.fs index 761d5395e88..acc3c0c03a2 100644 --- a/src/fsharp/PostInferenceChecks.fs +++ b/src/fsharp/PostInferenceChecks.fs @@ -106,7 +106,10 @@ type env = external : bool /// Current return scope of the expr. - returnScope : int } + returnScope : int + + /// Are we in an app expression (Expr.App)? + isInAppExpr: bool } let BindTypar env (tp:Typar) = { env with @@ -198,6 +201,7 @@ type cenv = { boundVals: Dictionary // really a hash set limitVals: Dictionary mutable potentialUnboundUsesOfVals: StampMap + mutable anonRecdTypes: StampMap g: TcGlobals amap: Import.ImportMap /// For reading metadata @@ -301,7 +305,7 @@ let BindVals cenv env vs = List.iter (BindVal cenv env) vs // approx walk of type //-------------------------------------------------------------------------- -let rec CheckTypeDeep ((visitTy,visitTyconRefOpt,visitAppTyOpt,visitTraitSolutionOpt, visitTyarOpt) as f) g env isInner ty = +let rec CheckTypeDeep (cenv: cenv) ((visitTy,visitTyconRefOpt,visitAppTyOpt,visitTraitSolutionOpt, visitTyparOpt) as f) g env isInner ty = // We iterate the _solved_ constraints as well, to pick up any record of trait constraint solutions // This means we walk _all_ the constraints _everywhere_ in a type, including // those attached to _solved_ type variables. This is used by PostTypeCheckSemanticChecks to detect uses of @@ -326,40 +330,54 @@ let rec CheckTypeDeep ((visitTy,visitTyconRefOpt,visitAppTyOpt,visitTraitSolutio match ty with | TType_forall (tps,body) -> let env = BindTypars g env tps - CheckTypeDeep f g env isInner body - tps |> List.iter (fun tp -> tp.Constraints |> List.iter (CheckTypeConstraintDeep f g env)) + CheckTypeDeep cenv f g env isInner body + tps |> List.iter (fun tp -> tp.Constraints |> List.iter (CheckTypeConstraintDeep cenv f g env)) | TType_measure _ -> () | TType_app (tcref,tinst) -> match visitTyconRefOpt with | Some visitTyconRef -> visitTyconRef isInner tcref | None -> () - CheckTypesDeep f g env tinst + + // If it's a 'byref<'T>', don't check 'T as an inner. This allows byref>. + // 'byref>' is invalid and gets checked in visitAppTy. + if isByrefTyconRef g tcref then + CheckTypesDeepNoInner cenv f g env tinst + else + CheckTypesDeep cenv f g env tinst + match visitAppTyOpt with | Some visitAppTy -> visitAppTy (tcref, tinst) | None -> () - - | TType_ucase (_,tinst) -> CheckTypesDeep f g env tinst - | TType_tuple (_,tys) -> CheckTypesDeep f g env tys - | TType_fun (s,t) -> CheckTypeDeep f g env true s; CheckTypeDeep f g env true t + | TType_anon (anonInfo,tys) -> + if not (cenv.anonRecdTypes.ContainsKey anonInfo.Stamp) then + cenv.anonRecdTypes <- cenv.anonRecdTypes.Add(anonInfo.Stamp, anonInfo) + CheckTypesDeep cenv f g env tys + + | TType_ucase (_,tinst) -> CheckTypesDeep cenv f g env tinst + | TType_tuple (_,tys) -> CheckTypesDeep cenv f g env tys + | TType_fun (s,t) -> CheckTypeDeep cenv f g env true s; CheckTypeDeep cenv f g env true t | TType_var tp -> if not tp.IsSolved then - match visitTyarOpt with + match visitTyparOpt with | None -> () | Some visitTyar -> visitTyar (env,tp) -and CheckTypesDeep f g env tys = - tys |> List.iter (CheckTypeDeep f g env true) +and CheckTypesDeep cenv f g env tys = + tys |> List.iter (CheckTypeDeep cenv f g env true) -and CheckTypeConstraintDeep f g env x = +and CheckTypesDeepNoInner cenv f g env tys = + tys |> List.iter (CheckTypeDeep cenv f g env false) + +and CheckTypeConstraintDeep cenv f g env x = match x with - | TyparConstraint.CoercesTo(ty,_) -> CheckTypeDeep f g env true ty - | TyparConstraint.MayResolveMember(traitInfo,_) -> CheckTraitInfoDeep f g env traitInfo - | TyparConstraint.DefaultsTo(_,ty,_) -> CheckTypeDeep f g env true ty - | TyparConstraint.SimpleChoice(tys,_) -> CheckTypesDeep f g env tys - | TyparConstraint.IsEnum(uty,_) -> CheckTypeDeep f g env true uty - | TyparConstraint.IsDelegate(aty,bty,_) -> CheckTypeDeep f g env true aty; CheckTypeDeep f g env true bty + | TyparConstraint.CoercesTo(ty,_) -> CheckTypeDeep cenv f g env true ty + | TyparConstraint.MayResolveMember(traitInfo,_) -> CheckTraitInfoDeep cenv f g env traitInfo + | TyparConstraint.DefaultsTo(_,ty,_) -> CheckTypeDeep cenv f g env true ty + | TyparConstraint.SimpleChoice(tys,_) -> CheckTypesDeep cenv f g env tys + | TyparConstraint.IsEnum(uty,_) -> CheckTypeDeep cenv f g env true uty + | TyparConstraint.IsDelegate(aty,bty,_) -> CheckTypeDeep cenv f g env true aty; CheckTypeDeep cenv f g env true bty | TyparConstraint.SupportsComparison _ | TyparConstraint.SupportsEquality _ | TyparConstraint.SupportsNull _ @@ -368,21 +386,21 @@ and CheckTypeConstraintDeep f g env x = | TyparConstraint.IsReferenceType _ | TyparConstraint.RequiresDefaultConstructor _ -> () -and CheckTraitInfoDeep ((_,_,_,visitTraitSolutionOpt,_) as f) g env (TTrait(tys,_,_,argtys,rty,soln)) = - CheckTypesDeep f g env tys - CheckTypesDeep f g env argtys - Option.iter (CheckTypeDeep f g env true ) rty +and CheckTraitInfoDeep cenv ((_,_,_,visitTraitSolutionOpt,_) as f) g env (TTrait(tys,_,_,argtys,rty,soln)) = + CheckTypesDeep cenv f g env tys + CheckTypesDeep cenv f g env argtys + Option.iter (CheckTypeDeep cenv f g env true ) rty match visitTraitSolutionOpt, !soln with | Some visitTraitSolution, Some sln -> visitTraitSolution sln | _ -> () /// Check for byref-like types let CheckForByrefLikeType cenv env m ty check = - CheckTypeDeep (ignore, Some (fun _deep tcref -> if isByrefLikeTyconRef cenv.g m tcref then check()), None, None, None) cenv.g env false ty + CheckTypeDeep cenv (ignore, Some (fun _deep tcref -> if isByrefLikeTyconRef cenv.g m tcref then check()), None, None, None) cenv.g env false ty /// Check for byref types let CheckForByrefType cenv env ty check = - CheckTypeDeep (ignore, Some (fun _deep tcref -> if isByrefTyconRef cenv.g tcref then check()), None, None, None) cenv.g env false ty + CheckTypeDeep cenv (ignore, Some (fun _deep tcref -> if isByrefTyconRef cenv.g tcref then check()), None, None, None) cenv.g env false ty /// check captures under lambdas /// @@ -440,28 +458,28 @@ let AccessInternalsVisibleToAsInternal thisCompPath internalsVisibleToPaths acce let CheckTypeForAccess (cenv:cenv) env objName valAcc m ty = if cenv.reportErrors then - let visitTye ty = + let visitType ty = // We deliberately only check the fully stripped type for accessibility, // because references to private type abbreviations are permitted match tryDestAppTy cenv.g ty with - | None -> () - | Some tcref -> + | ValueNone -> () + | ValueSome tcref -> let thisCompPath = compPathOfCcu cenv.viewCcu let tyconAcc = tcref.Accessibility |> AccessInternalsVisibleToAsInternal thisCompPath cenv.internalsVisibleToPaths if isLessAccessible tyconAcc valAcc then errorR(Error(FSComp.SR.chkTypeLessAccessibleThanType(tcref.DisplayName, (objName())), m)) - CheckTypeDeep (visitTye, None, None, None, None) cenv.g env false ty + CheckTypeDeep cenv (visitType, None, None, None, None) cenv.g env false ty let WarnOnWrongTypeForAccess (cenv:cenv) env objName valAcc m ty = if cenv.reportErrors then - let visitTye ty = + let visitType ty = // We deliberately only check the fully stripped type for accessibility, // because references to private type abbreviations are permitted match tryDestAppTy cenv.g ty with - | None -> () - | Some tcref -> + | ValueNone -> () + | ValueSome tcref -> let thisCompPath = compPathOfCcu cenv.viewCcu let tyconAcc = tcref.Accessibility |> AccessInternalsVisibleToAsInternal thisCompPath cenv.internalsVisibleToPaths if isLessAccessible tyconAcc valAcc then @@ -469,13 +487,16 @@ let WarnOnWrongTypeForAccess (cenv:cenv) env objName valAcc m ty = let warningText = errorText + System.Environment.NewLine + FSComp.SR.tcTypeAbbreviationsCheckedAtCompileTime() warning(AttributeChecking.ObsoleteWarning(warningText, m)) - CheckTypeDeep (visitTye, None, None, None, None) cenv.g env false ty + CheckTypeDeep cenv (visitType, None, None, None, None) cenv.g env false ty /// Indicates whether a byref or byref-like type is permitted at a particular location [] type PermitByRefType = /// Don't permit any byref or byref-like types - | None + | None + + /// Don't permit any byref or byref-like types on inner types. + | NoInnerByRefLike /// Permit only a Span or IsByRefLike type | SpanLike @@ -552,7 +573,7 @@ let rec mkArgsForAppliedExpr isBaseCall argsl x = | _ -> [] /// Check types occurring in the TAST. -let CheckType permitByRefLike (cenv:cenv) env m ty = +let CheckTypeAux permitByRefLike (cenv:cenv) env m ty onInnerByrefError = if cenv.reportErrors then let visitTyar (env,tp) = if not (env.boundTypars.ContainsKey tp) then @@ -561,13 +582,17 @@ let CheckType permitByRefLike (cenv:cenv) env m ty = else errorR (Error(FSComp.SR.checkNotSufficientlyGenericBecauseOfScope(tp.DisplayName),m)) - let visitTyconRef _isInner tcref = + let visitTyconRef isInner tcref = + + let isInnerByRefLike = isInner && isByrefLikeTyconRef cenv.g m tcref match permitByRefLike with | PermitByRefType.None when isByrefLikeTyconRef cenv.g m tcref -> errorR(Error(FSComp.SR.chkErrorUseOfByref(), m)) - | PermitByRefType.SpanLike when isByrefTyconRef cenv.g tcref -> - errorR(Error(FSComp.SR.chkErrorUseOfByref(), m)) + | PermitByRefType.NoInnerByRefLike when isInnerByRefLike -> + onInnerByrefError () + | PermitByRefType.SpanLike when isByrefTyconRef cenv.g tcref || isInnerByRefLike -> + onInnerByrefError () | _ -> () if tyconRefEq cenv.g cenv.g.system_Void_tcref tcref then @@ -576,13 +601,13 @@ let CheckType permitByRefLike (cenv:cenv) env m ty = // check if T contains byref types in case of byref let visitAppTy (tcref,tinst) = if isByrefLikeTyconRef cenv.g m tcref then - let visitTye ty0 = + let visitType ty0 = match tryDestAppTy cenv.g ty0 with - | None -> () - | Some tcref2 -> + | ValueNone -> () + | ValueSome tcref2 -> if isByrefTyconRef cenv.g tcref2 then errorR(Error(FSComp.SR.chkNoByrefsOfByrefs(NicePrint.minimalStringOfType cenv.denv ty), m)) - CheckTypesDeep (visitTye, None, None, None, None) cenv.g env tinst + CheckTypesDeep cenv (visitType, None, None, None, None) cenv.g env tinst let visitTraitSolution info = match info with @@ -593,8 +618,10 @@ let CheckType permitByRefLike (cenv:cenv) env m ty = cenv.potentialUnboundUsesOfVals <- cenv.potentialUnboundUsesOfVals.Add(vref.Stamp,m) | _ -> () - CheckTypeDeep (ignore, Some visitTyconRef, Some visitAppTy, Some visitTraitSolution, Some visitTyar) cenv.g env false ty + CheckTypeDeep cenv (ignore, Some visitTyconRef, Some visitAppTy, Some visitTraitSolution, Some visitTyar) cenv.g env false ty +let CheckType permitByRefLike cenv env m ty = + CheckTypeAux permitByRefLike cenv env m ty (fun () -> errorR(Error(FSComp.SR.chkErrorUseOfByref(), m))) /// Check types occurring in TAST (like CheckType) and additionally reject any byrefs. /// The additional byref checks are to catch "byref instantiations" - one place were byref are not permitted. @@ -606,12 +633,18 @@ let CheckTypePermitSpanLike (cenv:cenv) env m ty = CheckType PermitByRefType.Spa /// Check types occurring in TAST but allow all byrefs. Only used on internally-generated types let CheckTypePermitAllByrefs (cenv:cenv) env m ty = CheckType PermitByRefType.All cenv env m ty +/// Check types ocurring in TAST but disallow inner types to be byref or byref-like types. +let CheckTypeNoInnerByrefs cenv env m ty = CheckType PermitByRefType.NoInnerByRefLike cenv env m ty + let CheckTypeInstNoByrefs cenv env m tyargs = tyargs |> List.iter (CheckTypeNoByrefs cenv env m) let CheckTypeInstPermitAllByrefs cenv env m tyargs = tyargs |> List.iter (CheckTypePermitAllByrefs cenv env m) +let CheckTypeInstNoInnerByrefs cenv env m tyargs = + tyargs |> List.iter (CheckTypeNoInnerByrefs cenv env m) + /// Applied functions get wrapped in coerce nodes for subsumption coercions let (|OptionalCoerce|) = function | Expr.Op(TOp.Coerce _, _, [Expr.App(f, _, _, [], _)], _) -> f @@ -663,7 +696,10 @@ and CheckValRef (cenv:cenv) (env:env) v m (context: PermitByRefExpr) = if context.Disallow && isByrefLikeTy cenv.g m v.Type then errorR(Error(FSComp.SR.chkNoByrefAtThisPoint(v.DisplayName), m)) - CheckTypePermitAllByrefs cenv env m v.Type // the byref checks are done at the actual binding of the value + if env.isInAppExpr then + CheckTypePermitAllByrefs cenv env m v.Type // we do checks for byrefs elsewhere + else + CheckTypeNoInnerByrefs cenv env m v.Type /// Check a use of a value and CheckValUse (cenv: cenv) (env: env) (vref: ValRef, vFlags, m) (context: PermitByRefExpr) = @@ -857,6 +893,7 @@ and CheckExpr (cenv:cenv) (env:env) origExpr (context:PermitByRefExpr) : Limit = match expr with | Expr.Sequential (e1,e2,dir,_,_) -> CheckExprNoByrefs cenv env e1 + match dir with | NormalSeq -> CheckExpr cenv env e2 context // carry context into _;RHS (normal sequencing only) @@ -879,7 +916,7 @@ and CheckExpr (cenv:cenv) (env:env) origExpr (context:PermitByRefExpr) : Limit = CheckExpr cenv env body context | Expr.Const (_,m,ty) -> - CheckTypePermitAllByrefs cenv env m ty + CheckTypeNoInnerByrefs cenv env m ty NoLimit | Expr.Val (vref,vFlags,m) -> @@ -930,9 +967,13 @@ and CheckExpr (cenv:cenv) (env:env) origExpr (context:PermitByRefExpr) : Limit = errorR(Error(FSComp.SR.tcCannotCallAbstractBaseMember(v.DisplayName),m)) NoLimit else + let env = { env with isInAppExpr = true } + let returnTy = tyOfExpr g expr + CheckValRef cenv env v m PermitByRefExpr.No CheckValRef cenv env baseVal m PermitByRefExpr.No CheckTypeInstNoByrefs cenv env m tyargs + CheckTypeNoInnerByrefs cenv env m returnTy CheckExprs cenv env rest (mkArgsForAppliedExpr true rest f) // Allow base calls to IL methods @@ -941,7 +982,7 @@ and CheckExpr (cenv:cenv) (env:env) origExpr (context:PermitByRefExpr) : Limit = // Disallow calls to abstract base methods on IL types. match tryDestAppTy g baseVal.Type with - | Some tcref when tcref.IsILTycon -> + | ValueSome tcref when tcref.IsILTycon -> try // This is awkward - we have to explicitly re-resolve back to the IL metadata to determine if the method is abstract. // We believe this may be fragile in some situations, since we are using the Abstract IL code to compare @@ -973,12 +1014,20 @@ and CheckExpr (cenv:cenv) (env:env) origExpr (context:PermitByRefExpr) : Limit = // Allow '%expr' in quotations | Expr.App(Expr.Val(vref,_,_),_,tinst,[arg],m) when isSpliceOperator g vref && env.quote -> - CheckTypeInstPermitAllByrefs cenv env m tinst // it's the splice operator, a byref instantiation is allowed + CheckTypeInstNoInnerByrefs cenv env m tinst // it's the splice operator, a byref instantiation is allowed CheckExprNoByrefs cenv env arg NoLimit // Check an application | Expr.App(f,_fty,tyargs,argsl,m) -> + let returnTy = tyOfExpr g expr + + // This is to handle recursive cases. Don't check 'returnTy' again if we are still inside a app expression. + if not env.isInAppExpr then + CheckTypeNoInnerByrefs cenv env m returnTy + + let env = { env with isInAppExpr = true } + CheckTypeInstNoByrefs cenv env m tyargs CheckExprNoByrefs cenv env f @@ -987,7 +1036,6 @@ and CheckExpr (cenv:cenv) (env:env) origExpr (context:PermitByRefExpr) : Limit = | Expr.Val(vref, _, _) when vref.IsInstanceMember && not argsl.IsEmpty -> true | _ -> false - let returnTy = tyOfExpr g expr let contexts = mkArgsForAppliedExpr false argsl f if hasReceiver then CheckCallWithReceiver cenv env m returnTy argsl contexts context @@ -1010,7 +1058,7 @@ and CheckExpr (cenv:cenv) (env:env) origExpr (context:PermitByRefExpr) : Limit = NoLimit | Expr.Match(_,_,dtree,targets,m,ty) -> - CheckTypePermitAllByrefs cenv env m ty // computed byrefs allowed at each branch + CheckTypeNoInnerByrefs cenv env m ty // computed byrefs allowed at each branch CheckDecisionTree cenv env dtree CheckDecisionTreeTargets cenv env targets context @@ -1065,7 +1113,7 @@ and CheckExprOp cenv env (op,tyargs,args,m) context expr = CheckExprsNoByRefLike cenv env [e1;e2] | TOp.TryFinally _,[_],[Expr.Lambda(_,_,_,[_],e1,_,_); Expr.Lambda(_,_,_,[_],e2,_,_)] -> - CheckTypeInstPermitAllByrefs cenv env m tyargs // result of a try/finally can be a byref + CheckTypeInstNoInnerByrefs cenv env m tyargs // result of a try/finally can be a byref ctorLimitedZoneCheck() let limit = CheckExpr cenv env e1 context // result of a try/finally can be a byref if in a position where the overall expression is can be a byref CheckExprNoByrefs cenv env e2 @@ -1076,7 +1124,7 @@ and CheckExprOp cenv env (op,tyargs,args,m) context expr = CheckExprsNoByRefLike cenv env [e1;e2;e3] | TOp.TryCatch _,[_],[Expr.Lambda(_,_,_,[_],e1,_,_); Expr.Lambda(_,_,_,[_],_e2,_,_); Expr.Lambda(_,_,_,[_],e3,_,_)] -> - CheckTypeInstPermitAllByrefs cenv env m tyargs // result of a try/catch can be a byref + CheckTypeInstNoInnerByrefs cenv env m tyargs // result of a try/catch can be a byref ctorLimitedZoneCheck() let limit1 = CheckExpr cenv env e1 context // result of a try/catch can be a byref if in a position where the overall expression is can be a byref // [(* e2; -- don't check filter body - duplicates logic in 'catch' body *) e3] @@ -1087,7 +1135,7 @@ and CheckExprOp cenv env (op,tyargs,args,m) context expr = CheckTypeInstNoByrefs cenv env m tyargs CheckTypeInstNoByrefs cenv env m enclTypeArgs CheckTypeInstNoByrefs cenv env m methTypeArgs - CheckTypeInstPermitAllByrefs cenv env m tys // permit byref returns + CheckTypeInstNoInnerByrefs cenv env m tys // permit byref returns let hasReceiver = (methRef.CallingConv.IsInstance || methRef.CallingConv.IsInstanceExplicit) && @@ -1176,6 +1224,7 @@ and CheckExprOp cenv env (op,tyargs,args,m) context expr = errorR(Error(FSComp.SR.chkNoWriteToLimitedSpan(vref.DisplayName), m)) NoLimit + | TOp.AnonRecdGet _,_,[arg1] | TOp.TupleFieldGet _,_,[arg1] -> CheckTypeInstNoByrefs cenv env m tyargs CheckExprsPermitByRefLike cenv env [arg1] (* Compiled pattern matches on immutable value structs come through here. *) @@ -1263,7 +1312,7 @@ and CheckExprOp cenv env (op,tyargs,args,m) context expr = CheckExpr cenv env obj context | TOp.ILAsm (instrs,tys),_,_ -> - CheckTypeInstPermitAllByrefs cenv env m tys + CheckTypeInstNoInnerByrefs cenv env m tys CheckTypeInstNoByrefs cenv env m tyargs match instrs,args with // Write a .NET instance field @@ -1323,7 +1372,7 @@ and CheckExprOp cenv env (op,tyargs,args,m) context expr = CheckTypeInstNoByrefs cenv env m tyargs CheckExprsNoByRefLike cenv env args -and CheckLambdas isTop (memInfo: ValMemberInfo option) cenv env inlined topValInfo alwaysCheckNoReraise e m ety context = +and CheckLambdas isTop (memInfo: ValMemberInfo option) cenv env inlined topValInfo alwaysCheckNoReraise e mOrig ety context = let g = cenv.g // The topValInfo here says we are _guaranteeing_ to compile a function value // as a .NET method with precisely the corresponding argument counts. @@ -1353,7 +1402,28 @@ and CheckLambdas isTop (memInfo: ValMemberInfo option) cenv env inlined topValIn // any byRef arguments are considered used, as they may be 'out's restArgs |> List.iter (fun arg -> if isByrefTy g arg.Type then arg.SetHasBeenReferenced()) - syntacticArgs |> List.iter (CheckValSpec cenv env) + let permitByRefType = + if isTop then + PermitByRefType.NoInnerByRefLike + else + PermitByRefType.None + + // Check argument types + syntacticArgs + |> List.iter (fun arg -> + CheckValSpecAux permitByRefType cenv env arg (fun () -> + if arg.IsCompilerGenerated then + errorR(Error(FSComp.SR.chkErrorUseOfByref(), arg.Range)) + else + errorR(Error(FSComp.SR.chkInvalidFunctionParameterType(arg.DisplayName, NicePrint.minimalStringOfType cenv.denv arg.Type), arg.Range)) + ) + ) + + // Check return type + CheckTypeAux permitByRefType cenv env mOrig bodyty (fun () -> + errorR(Error(FSComp.SR.chkInvalidFunctionReturnType(NicePrint.minimalStringOfType cenv.denv bodyty), mOrig)) + ) + syntacticArgs |> List.iter (BindVal cenv env) // Trigger a test hook @@ -1393,8 +1463,10 @@ and CheckLambdas isTop (memInfo: ValMemberInfo option) cenv env inlined topValIn // This path is for expression bindings that are not actually lambdas | _ -> + let m = mOrig // Permit byrefs for let x = ... - CheckTypePermitAllByrefs cenv env m ety + CheckTypeNoInnerByrefs cenv env m ety + let limit = if not inlined && (isByrefLikeTy g m ety || isNativePtrTy g ety) then // allow byref to occur as RHS of byref binding. @@ -1441,7 +1513,7 @@ and CheckDecisionTreeTargets cenv env targets context = and CheckDecisionTreeTarget cenv env context (TTarget(vs,e,_)) = BindVals cenv env vs - vs |> List.iter (CheckValSpec cenv env) + vs |> List.iter (CheckValSpec PermitByRefType.All cenv env) CheckExpr cenv env e context and CheckDecisionTree cenv env x = @@ -1461,11 +1533,11 @@ and CheckDecisionTreeSwitch cenv env (e,cases,dflt,m) = and CheckDecisionTreeTest cenv env m discrim = match discrim with - | DecisionTreeTest.UnionCase (_,tinst) -> CheckTypeInstPermitAllByrefs cenv env m tinst - | DecisionTreeTest.ArrayLength (_,ty) -> CheckTypePermitAllByrefs cenv env m ty + | DecisionTreeTest.UnionCase (_,tinst) -> CheckTypeInstNoInnerByrefs cenv env m tinst + | DecisionTreeTest.ArrayLength (_,ty) -> CheckTypeNoInnerByrefs cenv env m ty | DecisionTreeTest.Const _ -> () | DecisionTreeTest.IsNull -> () - | DecisionTreeTest.IsInst (srcTy,tgtTy) -> CheckTypePermitAllByrefs cenv env m srcTy; CheckTypePermitAllByrefs cenv env m tgtTy + | DecisionTreeTest.IsInst (srcTy,tgtTy) -> CheckTypeNoInnerByrefs cenv env m srcTy; CheckTypeNoInnerByrefs cenv env m tgtTy | DecisionTreeTest.ActivePatternCase (exp,_,_,_,_) -> CheckExprNoByrefs cenv env exp and CheckAttrib cenv env (Attrib(_,_,args,props,_,_,_)) = @@ -1549,10 +1621,13 @@ and CheckValInfo cenv env (ValReprInfo(_,args,ret)) = and CheckArgInfo cenv env (argInfo : ArgReprInfo) = CheckAttribs cenv env argInfo.Attribs -and CheckValSpec cenv env (v:Val) = +and CheckValSpecAux permitByRefLike cenv env (v:Val) onInnerByrefError = v.Attribs |> CheckAttribs cenv env v.ValReprInfo |> Option.iter (CheckValInfo cenv env) - v.Type |> CheckTypePermitAllByrefs cenv env v.Range + CheckTypeAux permitByRefLike cenv env v.Range v.Type onInnerByrefError + +and CheckValSpec permitByRefLike cenv env v = + CheckValSpecAux permitByRefLike cenv env v (fun () -> errorR(Error(FSComp.SR.chkErrorUseOfByref(), v.Range))) and AdjustAccess isHidden (cpath: unit -> CompilationPath) access = if isHidden then @@ -1583,7 +1658,6 @@ and CheckBinding cenv env alwaysCheckNoReraise context (TBind(v,bindRhs,_) as bi let nm = v.DisplayName errorR(Error(FSComp.SR.chkMemberUsedInInvalidWay(nm, nm, stringOfRange m), v.Range)) - // Byrefs allowed for x in 'let x = ...' v.Type |> CheckTypePermitAllByrefs cenv env v.Range v.Attribs |> CheckAttribs cenv env v.ValReprInfo |> Option.iter (CheckValInfo cenv env) @@ -1603,7 +1677,9 @@ and CheckBinding cenv env alwaysCheckNoReraise context (TBind(v,bindRhs,_) as bi CheckForByrefLikeType cenv env v.Range v.Type (fun () -> errorR(Error(FSComp.SR.chkNoByrefAsTopValue(),v.Range))) | _ -> () - if Option.isSome v.PublicPath then + match v.PublicPath with + | None -> () + | _ -> if // Don't support implicit [] on generated members, except the implicit members // for 'let' bound functions in classes. @@ -1776,8 +1852,6 @@ let CheckModuleBinding cenv env (TBind(v,e,_) as bind) = MethInfosEquivByNameAndSig EraseAll true g cenv.amap v.Range minfo1 minfo2 then errorR(Duplicate(kind,v.DisplayName,v.Range))) - - // Properties get 'get_X', only if there are no args // Properties get 'get_X' match v.ValReprInfo with @@ -2055,8 +2129,8 @@ let CheckEntityDefn cenv env (tycon:Entity) = let env = BindTypars g env tps for argtys in argtysl do for (argty, _) in argtys do - CheckTypePermitAllByrefs cenv env m argty - CheckTypePermitAllByrefs cenv env m rty + CheckTypeNoInnerByrefs cenv env vref.Range argty + CheckTypeNoInnerByrefs cenv env vref.Range rty | None -> () @@ -2066,20 +2140,20 @@ let CheckEntityDefn cenv env (tycon:Entity) = superOfTycon g tycon |> CheckTypeNoByrefs cenv env m if tycon.IsUnionTycon then - tycon.UnionCasesAsList |> List.iter (fun uc -> + tycon.UnionCasesArray |> Array.iter (fun uc -> CheckAttribs cenv env uc.Attribs - uc.RecdFields |> List.iter (CheckRecdField true cenv env tycon)) + uc.RecdFieldsArray |> Array.iter (CheckRecdField true cenv env tycon)) // Access checks let access = AdjustAccess (IsHiddenTycon env.sigToImplRemapInfo tycon) (fun () -> tycon.CompilationPath) tycon.Accessibility - let visitTye ty = CheckTypeForAccess cenv env (fun () -> tycon.DisplayNameWithStaticParametersAndUnderscoreTypars) access tycon.Range ty + let visitType ty = CheckTypeForAccess cenv env (fun () -> tycon.DisplayNameWithStaticParametersAndUnderscoreTypars) access tycon.Range ty - abstractSlotValsOfTycons [tycon] |> List.iter (typeOfVal >> visitTye) + abstractSlotValsOfTycons [tycon] |> List.iter (typeOfVal >> visitType) - superOfTycon g tycon |> visitTye + superOfTycon g tycon |> visitType // We do not have to check access of interface implementations. See FSharp 1.0 5042 - //implements_of_tycon g tycon |> List.iter visitTye + //implements_of_tycon g tycon |> List.iter visitType if tycon.IsFSharpDelegateTycon then match tycon.TypeReprInfo with | TFSharpObjectRepr r -> @@ -2087,8 +2161,8 @@ let CheckEntityDefn cenv env (tycon:Entity) = | TTyconDelegate ss -> //ss.ClassTypars //ss.MethodTypars - ss.FormalReturnType |> Option.iter visitTye - ss.FormalParams |> List.iterSquared (fun (TSlotParam(_,ty,_,_,_,_)) -> visitTye ty) + ss.FormalReturnType |> Option.iter visitType + ss.FormalParams |> List.iterSquared (fun (TSlotParam(_,ty,_,_,_,_)) -> visitType ty) | _ -> () | _ -> () @@ -2098,7 +2172,7 @@ let CheckEntityDefn cenv env (tycon:Entity) = |> List.filter (isInterfaceTy g) if tycon.IsFSharpInterfaceTycon then - List.iter visitTye interfaces // Check inherited interface is as accessible + List.iter visitType interfaces // Check inherited interface is as accessible if not (isRecdOrStructTyconRefAssumedImmutable g tcref) && isRecdOrStructTyconRefReadOnly g m tcref then errorR(Error(FSComp.SR.readOnlyAttributeOnStructWithMutableField(),m)) @@ -2185,6 +2259,7 @@ let CheckTopImpl (g,amap,reportErrors,infoReader,internalsVisibleToPaths,viewCcu boundVals= new Dictionary<_,_>(100, HashIdentity.Structural) limitVals= new Dictionary<_,_>(100, HashIdentity.Structural) potentialUnboundUsesOfVals=Map.empty + anonRecdTypes = StampMap.Empty usesQuotations=false infoReader=infoReader internalsVisibleToPaths=internalsVisibleToPaths @@ -2215,10 +2290,11 @@ let CheckTopImpl (g,amap,reportErrors,infoReader,internalsVisibleToPaths,viewCcu boundTypars= TyparMap.Empty reflect=false external=false - returnScope = 0 } + returnScope = 0 + isInAppExpr = false } CheckModuleExpr cenv env mexpr CheckAttribs cenv env extraAttribs if cenv.usesQuotations && QuotationTranslator.QuotationGenerationScope.ComputeQuotationFormat(g) = QuotationTranslator.QuotationSerializationFormat.FSharp_20_Plus then viewCcu.UsesFSharp20PlusQuotations <- true - cenv.entryPointGiven + cenv.entryPointGiven, cenv.anonRecdTypes diff --git a/src/fsharp/PostInferenceChecks.fsi b/src/fsharp/PostInferenceChecks.fsi index 970c1431551..62ad52d4495 100644 --- a/src/fsharp/PostInferenceChecks.fsi +++ b/src/fsharp/PostInferenceChecks.fsi @@ -11,4 +11,6 @@ open Microsoft.FSharp.Compiler.Tastops open Microsoft.FSharp.Compiler.TcGlobals val testFlagMemberBody : bool ref -val CheckTopImpl : TcGlobals * ImportMap * bool * InfoReader * CompilationPath list * CcuThunk * DisplayEnv * ModuleOrNamespaceExprWithSig * Attribs * (bool * bool) * isInternalTestSpanStackReferring: bool -> bool + +/// Perform the checks on the TAST for a file after type inference is complete. +val CheckTopImpl : TcGlobals * ImportMap * bool * InfoReader * CompilationPath list * CcuThunk * DisplayEnv * ModuleOrNamespaceExprWithSig * Attribs * (bool * bool) * isInternalTestSpanStackReferring: bool -> bool * StampMap diff --git a/src/fsharp/PrettyNaming.fs b/src/fsharp/PrettyNaming.fs index 4756eddc5f6..923be2ccea3 100755 --- a/src/fsharp/PrettyNaming.fs +++ b/src/fsharp/PrettyNaming.fs @@ -484,30 +484,36 @@ module public Microsoft.FSharp.Compiler.PrettyNaming let [] private mangledGenericTypeNameSym = '`' - let IsMangledGenericName (n:string) = - n.IndexOf mangledGenericTypeNameSym <> -1 && + let TryDemangleGenericNameAndPos (n:string) = (* check what comes after the symbol is a number *) - let m = n.LastIndexOf mangledGenericTypeNameSym - let mutable res = m < n.Length - 1 - for i = m + 1 to n.Length - 1 do - res <- res && n.[i] >= '0' && n.[i] <= '9' - res + let pos = n.LastIndexOf mangledGenericTypeNameSym + if pos = -1 then ValueNone else + let mutable res = pos < n.Length - 1 + let mutable i = pos + 1 + while res && i < n.Length do + let char = n.[i] + if not (char >= '0' && char <= '9') then + res <- false + i <- i + 1 + if res then + ValueSome pos + else + ValueNone type NameArityPair = NameArityPair of string * int - let DecodeGenericTypeName n = - if IsMangledGenericName n then - let pos = n.LastIndexOf mangledGenericTypeNameSym - let res = n.Substring(0,pos) - let num = n.Substring(pos+1,n.Length - pos - 1) - NameArityPair(res, int32 num) - else NameArityPair(n,0) - - let DemangleGenericTypeName n = - if IsMangledGenericName n then - let pos = n.LastIndexOf mangledGenericTypeNameSym - n.Substring(0,pos) - else n + let DecodeGenericTypeName pos (mangledName:string) = + let res = mangledName.Substring(0,pos) + let num = mangledName.Substring(pos+1,mangledName.Length - pos - 1) + NameArityPair(res, int32 num) + + let DemangleGenericTypeNameWithPos pos (mangledName:string) = + mangledName.Substring(0,pos) + + let DemangleGenericTypeName (mangledName:string) = + match TryDemangleGenericNameAndPos mangledName with + | ValueSome pos -> DemangleGenericTypeNameWithPos pos mangledName + | _ -> mangledName let private chopStringTo (s:string) (c:char) = match s.IndexOf c with diff --git a/src/fsharp/QuotationPickler.fs b/src/fsharp/QuotationPickler.fs index ea9ba920772..79c2ac27968 100644 --- a/src/fsharp/QuotationPickler.fs +++ b/src/fsharp/QuotationPickler.fs @@ -304,12 +304,12 @@ module SimplePickle = open SimplePickle -let p_assref x st = p_string x st +let p_assemblyref x st = p_string x st let p_NamedType x st = match x with - | Idx n -> p_tup2 p_string p_assref (string n, "") st - | Named (nm,ass) -> p_tup2 p_string p_assref (nm, ass) st + | Idx n -> p_tup2 p_string p_assemblyref (string n, "") st + | Named (nm,a) -> p_tup2 p_string p_assemblyref (nm, a) st let p_tycon x st = match x with diff --git a/src/fsharp/QuotationTranslator.fs b/src/fsharp/QuotationTranslator.fs index 9c7bc53e333..b0f1e7ce4c7 100644 --- a/src/fsharp/QuotationTranslator.fs +++ b/src/fsharp/QuotationTranslator.fs @@ -66,7 +66,7 @@ type QuotationGenerationScope = static member ComputeQuotationFormat g = let deserializeExValRef = ValRefForIntrinsic g.deserialize_quoted_FSharp_40_plus_info - if deserializeExValRef.TryDeref.IsSome then + if ValueOptionInternal.isSome deserializeExValRef.TryDeref then QuotationSerializationFormat.FSharp_40_Plus else QuotationSerializationFormat.FSharp_20_Plus @@ -424,6 +424,20 @@ and private ConvExprCore cenv (env : QuotationTranslationEnv) (expr: Expr) : QP. let argsR = ConvExprs cenv env args QP.mkRecdMk(rgtypR,tyargsR,argsR) + | TOp.AnonRecd anonInfo, _, _ -> + let tref = anonInfo.ILTypeRef + let rgtypR = ConvILTypeRef cenv tref + let tyargsR = ConvTypes cenv env m tyargs + let argsR = ConvExprs cenv env args + QP.mkRecdMk(rgtypR,tyargsR,argsR) + + | TOp.AnonRecdGet (anonInfo, n), _, _ -> + let tref = anonInfo.ILTypeRef + let rgtypR = ConvILTypeRef cenv tref + let tyargsR = ConvTypes cenv env m tyargs + let argsR = ConvExprs cenv env args + QP.mkRecdGet((rgtypR,anonInfo.SortedNames.[n]),tyargsR,argsR) + | TOp.UnionCaseFieldGet (ucref,n),tyargs,[e] -> ConvUnionFieldGet cenv env m ucref n tyargs e @@ -807,6 +821,10 @@ and ConvType cenv env m ty = | TType_fun(a,b) -> QP.mkFunTy(ConvType cenv env m a,ConvType cenv env m b) | TType_tuple(tupInfo,l) -> ConvType cenv env m (mkCompiledTupleTy cenv.g (evalTupInfoIsStruct tupInfo) l) + | TType_anon(anonInfo,tinst) -> + let tref = anonInfo.ILTypeRef + let tinstR = ConvTypes cenv env m tinst + QP.mkILNamedTy(ConvILTypeRefUnadjusted cenv m tref, tinstR) | TType_var(tp) -> QP.mkVarTy(ConvTyparRef cenv env m tp) | TType_forall(_spec,_ty) -> wfail(Error(FSComp.SR.crefNoInnerGenericsInQuotations(),m)) | _ -> wfail(Error (FSComp.SR.crefQuotationsCantContainThisType(),m)) @@ -960,12 +978,12 @@ and ConvILTypeRef cenv (tr:ILTypeRef) = QP.Idx idx | QuotationSerializationFormat.FSharp_20_Plus -> - let assref = + let assemblyRef = match tr.Scope with | ILScopeRef.Local -> "." | _ -> tr.Scope.QualifiedName - QP.Named(tr.BasicQualifiedName, assref) + QP.Named(tr.BasicQualifiedName, assemblyRef) and ConvVoidType cenv m = QP.mkILNamedTy(ConvTyconRef cenv cenv.g.system_Void_tcref m, []) diff --git a/src/fsharp/SignatureConformance.fs b/src/fsharp/SignatureConformance.fs index 8b0981451ef..ac0c23e9709 100644 --- a/src/fsharp/SignatureConformance.fs +++ b/src/fsharp/SignatureConformance.fs @@ -37,8 +37,8 @@ type Checker(g, amap, denv, remapInfo: SignatureRepackageInfo, checkingSig) = // Used when checking attributes. let sigToImplRemap = let remap = Remap.Empty - let remap = (remapInfo.mrpiEntities,remap) ||> List.foldBack (fun (implTcref ,signTcref) acc -> addTyconRefRemap signTcref implTcref acc) - let remap = (remapInfo.mrpiVals ,remap) ||> List.foldBack (fun (implValRef,signValRef) acc -> addValRemap signValRef.Deref implValRef.Deref acc) + let remap = (remapInfo.RepackagedEntities,remap) ||> List.foldBack (fun (implTcref ,signTcref) acc -> addTyconRefRemap signTcref implTcref acc) + let remap = (remapInfo.RepackagedVals ,remap) ||> List.foldBack (fun (implValRef,signValRef) acc -> addValRemap signValRef.Deref implValRef.Deref acc) remap // For all attributable elements (types, modules, exceptions, record fields, unions, parameters, generic type parameters) @@ -177,46 +177,62 @@ type Checker(g, amap, denv, remapInfo: SignatureRepackageInfo, checkingSig) = |> ListSet.setify (typeEquiv g) |> List.filter (isInterfaceTy g) let aintfs = flatten aintfs - let aintfsUser = flatten aintfsUser let fintfs = flatten fintfs let unimpl = ListSet.subtract (fun fity aity -> typeAEquiv g aenv aity fity) fintfs aintfs - (unimpl |> List.forall (fun ity -> errorR (Error (FSComp.SR.DefinitionsInSigAndImplNotCompatibleMissingInterface(implTycon.TypeOrMeasureKind.ToString(),implTycon.DisplayName, NicePrint.minimalStringOfType denv ity),m)); false)) && + (unimpl + |> List.forall (fun ity -> + let errorMessage = FSComp.SR.DefinitionsInSigAndImplNotCompatibleMissingInterface(implTycon.TypeOrMeasureKind.ToString(),implTycon.DisplayName, NicePrint.minimalStringOfType denv ity) + errorR (Error(errorMessage,m)); false)) && + + let aintfsUser = flatten aintfsUser + let hidden = ListSet.subtract (typeAEquiv g aenv) aintfsUser fintfs - let warningOrError = if implTycon.IsFSharpInterfaceTycon then error else warning - hidden |> List.iter (fun ity -> warningOrError (InterfaceNotRevealed(denv,ity,implTycon.Range))) + let continueChecks,warningOrError = if implTycon.IsFSharpInterfaceTycon then false,errorR else true,warning + (hidden |> List.forall (fun ity -> warningOrError (InterfaceNotRevealed(denv,ity,implTycon.Range)); continueChecks)) && let aNull = IsUnionTypeWithNullAsTrueValue g implTycon let fNull = IsUnionTypeWithNullAsTrueValue g sigTycon if aNull && not fNull then - errorR(Error(FSComp.SR.DefinitionsInSigAndImplNotCompatibleImplementationSaysNull(implTycon.TypeOrMeasureKind.ToString(),implTycon.DisplayName),m)) + errorR(Error(FSComp.SR.DefinitionsInSigAndImplNotCompatibleImplementationSaysNull(implTycon.TypeOrMeasureKind.ToString(),implTycon.DisplayName),m)) + false elif fNull && not aNull then - errorR(Error(FSComp.SR.DefinitionsInSigAndImplNotCompatibleSignatureSaysNull(implTycon.TypeOrMeasureKind.ToString(),implTycon.DisplayName),m)) + errorR(Error(FSComp.SR.DefinitionsInSigAndImplNotCompatibleSignatureSaysNull(implTycon.TypeOrMeasureKind.ToString(),implTycon.DisplayName),m)) + false + else let aNull2 = TypeNullIsExtraValue g m (generalizedTyconRef (mkLocalTyconRef implTycon)) let fNull2 = TypeNullIsExtraValue g m (generalizedTyconRef (mkLocalTyconRef implTycon)) if aNull2 && not fNull2 then errorR(Error(FSComp.SR.DefinitionsInSigAndImplNotCompatibleImplementationSaysNull2(implTycon.TypeOrMeasureKind.ToString(),implTycon.DisplayName),m)) + false elif fNull2 && not aNull2 then errorR(Error(FSComp.SR.DefinitionsInSigAndImplNotCompatibleSignatureSaysNull2(implTycon.TypeOrMeasureKind.ToString(),implTycon.DisplayName),m)) + false + else let aSealed = isSealedTy g (generalizedTyconRef (mkLocalTyconRef implTycon)) let fSealed = isSealedTy g (generalizedTyconRef (mkLocalTyconRef sigTycon)) - if aSealed && not fSealed then + if aSealed && not fSealed then errorR(Error(FSComp.SR.DefinitionsInSigAndImplNotCompatibleImplementationSealed(implTycon.TypeOrMeasureKind.ToString(),implTycon.DisplayName),m)) - if not aSealed && fSealed then + false + elif not aSealed && fSealed then errorR(Error(FSComp.SR.DefinitionsInSigAndImplNotCompatibleImplementationIsNotSealed(implTycon.TypeOrMeasureKind.ToString(),implTycon.DisplayName),m)) + false + else let aPartial = isAbstractTycon implTycon let fPartial = isAbstractTycon sigTycon if aPartial && not fPartial then errorR(Error(FSComp.SR.DefinitionsInSigAndImplNotCompatibleImplementationIsAbstract(implTycon.TypeOrMeasureKind.ToString(),implTycon.DisplayName),m)) - - if not aPartial && fPartial then + false + elif not aPartial && fPartial then errorR(Error(FSComp.SR.DefinitionsInSigAndImplNotCompatibleSignatureIsAbstract(implTycon.TypeOrMeasureKind.ToString(),implTycon.DisplayName),m)) - - if not (typeAEquiv g aenv (superOfTycon g implTycon) (superOfTycon g sigTycon)) then + false + elif not (typeAEquiv g aenv (superOfTycon g implTycon) (superOfTycon g sigTycon)) then errorR (Error(FSComp.SR.DefinitionsInSigAndImplNotCompatibleTypesHaveDifferentBaseTypes(implTycon.TypeOrMeasureKind.ToString(),implTycon.DisplayName),m)) + false + else checkTypars m aenv implTypars sigTypars && checkTypeRepr m aenv implTycon sigTycon.TypeReprInfo && diff --git a/src/fsharp/SimulatedMSBuildReferenceResolver.fs b/src/fsharp/SimulatedMSBuildReferenceResolver.fs index 1668cdc09d0..6fd5fc53120 100644 --- a/src/fsharp/SimulatedMSBuildReferenceResolver.fs +++ b/src/fsharp/SimulatedMSBuildReferenceResolver.fs @@ -186,8 +186,8 @@ let internal GetBestAvailableResolver() = let tryMSBuild v = // Detect if MSBuild is on the machine, if so use the resolver from there let mb = try Assembly.Load(sprintf "Microsoft.Build.Framework, Version=%s.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" v) |> Option.ofObj with _ -> None - let ass = mb |> Option.bind (fun _ -> try Assembly.Load(sprintf "FSharp.Compiler.Service.MSBuild.v%s" v) |> Option.ofObj with _ -> None) - let ty = ass |> Option.bind (fun ass -> ass.GetType("Microsoft.FSharp.Compiler.MSBuildReferenceResolver") |> Option.ofObj) + let assembly = mb |> Option.bind (fun _ -> try Assembly.Load(sprintf "FSharp.Compiler.Service.MSBuild.v%s" v) |> Option.ofObj with _ -> None) + let ty = assembly |> Option.bind (fun a -> a.GetType("Microsoft.FSharp.Compiler.MSBuildReferenceResolver") |> Option.ofObj) let obj = ty |> Option.bind (fun ty -> ty.InvokeMember("get_Resolver",BindingFlags.Static ||| BindingFlags.Public ||| BindingFlags.InvokeMethod ||| BindingFlags.NonPublic, null, null, [| |]) |> Option.ofObj) let resolver = obj |> Option.bind (fun obj -> match obj with :? Resolver as r -> Some r | _ -> None) resolver diff --git a/src/fsharp/TastOps.fs b/src/fsharp/TastOps.fs index 4b161ac1d27..23242b1aff6 100644 --- a/src/fsharp/TastOps.fs +++ b/src/fsharp/TastOps.fs @@ -181,6 +181,12 @@ let rec remapTypeAux (tyenv : Remap) (ty:TType) = | Some tcr' -> TType_ucase (UCRef(tcr', n), remapTypesAux tyenv tinst) | None -> TType_ucase (UCRef(tcr, n), remapTypesAux tyenv tinst) + | TType_anon (anonInfo, l) as ty -> + let tupInfo' = remapTupInfoAux tyenv anonInfo.TupInfo + let l' = remapTypesAux tyenv l + if anonInfo.TupInfo === tupInfo' && l === l' then ty else + TType_anon (AnonRecdTypeInfo.Create(anonInfo.Assembly, tupInfo', anonInfo.SortedIds), l') + | TType_tuple (tupInfo, l) as ty -> let tupInfo' = remapTupInfoAux tyenv tupInfo let l' = remapTypesAux tyenv l @@ -229,7 +235,7 @@ and remapTupInfoAux _tyenv unt = and remapTypesAux tyenv types = List.mapq (remapTypeAux tyenv) types and remapTyparConstraintsAux tyenv cs = - cs |> List.choose (fun x -> + cs |> List.choose (fun x -> match x with | TyparConstraint.CoercesTo(ty, m) -> Some(TyparConstraint.CoercesTo (remapTypeAux tyenv ty, m)) @@ -263,6 +269,8 @@ and remapTraitAux tyenv (TTrait(tys, nm, mf, argtys, rty, slnCell)) = FSMethSln(remapTypeAux tyenv ty, remapValRef tyenv vref, remapTypesAux tyenv minst) | FSRecdFieldSln(tinst, rfref, isSet) -> FSRecdFieldSln(remapTypesAux tyenv tinst, remapRecdFieldRef tyenv.tyconRefRemap rfref, isSet) + | FSAnonRecdFieldSln(anonInfo, tinst, n) -> + FSAnonRecdFieldSln(anonInfo, remapTypesAux tyenv tinst, n) | BuiltInSln -> BuiltInSln | ClosedExprSln e -> @@ -667,7 +675,7 @@ let mkOuterCompiledTupleTy g isStruct tupElemTys = let marker = TType_app (mkCompiledTupleTyconRef g isStruct 1, [tyB]) TType_app (tcref, tysA@[marker]) | _ -> - TType_app (tcref, tysA@[TType_tuple (TupInfo.Const isStruct, tysB)]) + TType_app (tcref, tysA@[TType_tuple (mkTupInfo isStruct, tysB)]) //--------------------------------------------------------------------------- // Remove inference equations and abbreviations from types @@ -733,6 +741,9 @@ let evalTupInfoIsStruct aexpr = match aexpr with | TupInfo.Const b -> b +let evalAnonInfoIsStruct (anonInfo: AnonRecdTypeInfo) = + evalTupInfoIsStruct anonInfo.TupInfo + /// This erases outermost occurrences of inference equations, type abbreviations, non-generated provided types /// and measureable types (float<_>). /// It also optionally erases all "compilation representations", i.e. function and @@ -783,6 +794,8 @@ let isForallTy g ty = ty |> stripTyEqns g |> (function TType_forall _ -> tru let isAnyTupleTy g ty = ty |> stripTyEqns g |> (function TType_tuple _ -> true | _ -> false) let isRefTupleTy g ty = ty |> stripTyEqns g |> (function TType_tuple (tupInfo, _) -> not (evalTupInfoIsStruct tupInfo) | _ -> false) let isStructTupleTy g ty = ty |> stripTyEqns g |> (function TType_tuple (tupInfo, _) -> evalTupInfoIsStruct tupInfo | _ -> false) +let isAnonRecdTy g ty = ty |> stripTyEqns g |> (function TType_anon _ -> true | _ -> false) +let isStructAnonRecdTy g ty = ty |> stripTyEqns g |> (function TType_anon (anonInfo, _) -> evalAnonInfoIsStruct anonInfo | _ -> false) let isUnionTy g ty = ty |> stripTyEqns g |> (function TType_app(tcr, _) -> tcr.IsUnionTycon | _ -> false) let isReprHiddenTy g ty = ty |> stripTyEqns g |> (function TType_app(tcr, _) -> tcr.IsHiddenReprTycon | _ -> false) let isFSharpObjModelTy g ty = ty |> stripTyEqns g |> (function TType_app(tcr, _) -> tcr.IsFSharpObjectModelTycon | _ -> false) @@ -799,39 +812,48 @@ let isProvenUnionCaseTy ty = match ty with TType_ucase _ -> true | _ -> false let mkAppTy tcref tyargs = TType_app(tcref, tyargs) let mkProvenUnionCaseTy ucref tyargs = TType_ucase(ucref, tyargs) let isAppTy g ty = ty |> stripTyEqns g |> (function TType_app _ -> true | _ -> false) +let tryAppTy g ty = ty |> stripTyEqns g |> (function TType_app(tcref, tinst) -> ValueSome (tcref, tinst) | _ -> ValueNone) let destAppTy g ty = ty |> stripTyEqns g |> (function TType_app(tcref, tinst) -> tcref, tinst | _ -> failwith "destAppTy") let tcrefOfAppTy g ty = ty |> stripTyEqns g |> (function TType_app(tcref, _) -> tcref | _ -> failwith "tcrefOfAppTy") let argsOfAppTy g ty = ty |> stripTyEqns g |> (function TType_app(_, tinst) -> tinst | _ -> []) -let tryDestTyparTy g ty = ty |> stripTyEqns g |> (function TType_var v -> Some v | _ -> None) -let tryDestFunTy g ty = ty |> stripTyEqns g |> (function TType_fun (tyv, tau) -> Some(tyv, tau) | _ -> None) -let tryDestAppTy g ty = ty |> stripTyEqns g |> (function TType_app(tcref, _) -> Some tcref | _ -> None) +let tryDestTyparTy g ty = ty |> stripTyEqns g |> (function TType_var v -> ValueSome v | _ -> ValueNone) +let tryDestFunTy g ty = ty |> stripTyEqns g |> (function TType_fun (tyv, tau) -> ValueSome(tyv, tau) | _ -> ValueNone) +let tryDestAppTy g ty = ty |> stripTyEqns g |> (function TType_app(tcref, _) -> ValueSome tcref | _ -> ValueNone) +let tryDestAnonRecdTy g ty = ty |> stripTyEqns g |> (function TType_anon (anonInfo, tys) -> ValueSome (anonInfo, tys) | _ -> ValueNone) -let tryAnyParTy g ty = ty |> stripTyEqns g |> (function TType_var v -> Some v | TType_measure unt when isUnitParMeasure g unt -> Some(destUnitParMeasure g unt) | _ -> None) +let tryAnyParTy g ty = ty |> stripTyEqns g |> (function TType_var v -> ValueSome v | TType_measure unt when isUnitParMeasure g unt -> ValueSome(destUnitParMeasure g unt) | _ -> ValueNone) +let tryAnyParTyOption g ty = ty |> stripTyEqns g |> (function TType_var v -> Some v | TType_measure unt when isUnitParMeasure g unt -> Some(destUnitParMeasure g unt) | _ -> None) let (|AppTy|_|) g ty = ty |> stripTyEqns g |> (function TType_app(tcref, tinst) -> Some (tcref, tinst) | _ -> None) let (|RefTupleTy|_|) g ty = ty |> stripTyEqns g |> (function TType_tuple(tupInfo, tys) when not (evalTupInfoIsStruct tupInfo) -> Some tys | _ -> None) let (|FunTy|_|) g ty = ty |> stripTyEqns g |> (function TType_fun(dty, rty) -> Some (dty, rty) | _ -> None) let tryNiceEntityRefOfTy ty = let ty = stripTyparEqnsAux false ty - match ty with + match ty with + | TType_app (tcref, _) -> ValueSome tcref + | TType_measure (Measure.Con tcref) -> ValueSome tcref + | _ -> ValueNone + +let tryNiceEntityRefOfTyOption ty = + let ty = stripTyparEqnsAux false ty + match ty with | TType_app (tcref, _) -> Some tcref | TType_measure (Measure.Con tcref) -> Some tcref | _ -> None - -let (|NullableTy|_|) g ty = - match ty with - | AppTy g (tcr, [tyarg]) when tyconRefEq g tcr g.system_Nullable_tcref -> Some tyarg +let (|NullableTy|_|) g ty = + match tryAppTy g ty with + | ValueSome (tcr, [tyarg]) when tyconRefEq g tcr g.system_Nullable_tcref -> Some tyarg | _ -> None let (|StripNullableTy|) g ty = - match ty with - | AppTy g (tcr, [tyarg]) when tyconRefEq g tcr g.system_Nullable_tcref -> tyarg + match tryAppTy g ty with + | ValueSome (tcr, [tyarg]) when tyconRefEq g tcr g.system_Nullable_tcref -> tyarg | _ -> ty let mkInstForAppTy g ty = - match ty with - | AppTy g (tcref, tinst) -> mkTyconRefInst tcref tinst + match tryAppTy g ty with + | ValueSome (tcref, tinst) -> mkTyconRefInst tcref tinst | _ -> [] let domainOfFunTy g ty = fst (destFunTy g ty) @@ -958,6 +980,9 @@ and typeAEquivAux erasureFlag g aenv ty1 ty2 = typesAEquivAux erasureFlag g aenv b1 b2 | TType_tuple (s1, l1), TType_tuple (s2, l2) -> structnessAEquiv s1 s2 && typesAEquivAux erasureFlag g aenv l1 l2 + | TType_anon (anonInfo1, l1), TType_anon (anonInfo2, l2) -> + anonInfoEquiv anonInfo1 anonInfo2 && + typesAEquivAux erasureFlag g aenv l1 l2 | TType_fun (dtys1, rty1), TType_fun (dtys2, rty2) -> typeAEquivAux erasureFlag g aenv dtys1 dtys2 && typeAEquivAux erasureFlag g aenv rty1 rty2 | TType_measure m1, TType_measure m2 -> @@ -966,6 +991,12 @@ and typeAEquivAux erasureFlag g aenv ty1 ty2 = | _ -> true | _ -> false + +and anonInfoEquiv (anonInfo1: AnonRecdTypeInfo) (anonInfo2: AnonRecdTypeInfo) = + ccuEq anonInfo1.Assembly anonInfo2.Assembly && + structnessAEquiv anonInfo1.TupInfo anonInfo2.TupInfo && + anonInfo1.SortedNames = anonInfo2.SortedNames + and structnessAEquiv un1 un2 = match un1, un2 with | TupInfo.Const b1, TupInfo.Const b2 -> (b1 = b2) @@ -1012,7 +1043,7 @@ let rec getErasedTypes g ty = getErasedTypes g rty | TType_var tp -> if tp.IsErased then [ty] else [] - | TType_app (_, b) | TType_ucase(_, b) | TType_tuple (_, b) -> + | TType_app (_, b) | TType_ucase(_, b) | TType_anon (_, b) | TType_tuple (_, b) -> List.foldBack (fun ty tys -> getErasedTypes g ty @ tys) b [] | TType_fun (dty, rty) -> getErasedTypes g dty @ getErasedTypes g rty @@ -1228,8 +1259,8 @@ let NormalizeDeclaredTyparsForEquiRecursiveInference g tps = tps |> List.map (fun tp -> let ty = mkTyparTy tp match tryAnyParTy g ty with - | Some anyParTy -> anyParTy - | None -> tp) + | ValueSome anyParTy -> anyParTy + | ValueNone -> tp) type TypeScheme = TypeScheme of Typars * TType @@ -1271,6 +1302,7 @@ let mkAsmExpr(code, tinst, args, rettys, m) = Expr.Op (TOp.ILAsm let mkUnionCaseExpr(uc, tinst, args, m) = Expr.Op (TOp.UnionCase uc, tinst, args, m) let mkExnExpr(uc, args, m) = Expr.Op (TOp.ExnConstr uc, [], args, m) let mkTupleFieldGetViaExprAddr(tupInfo, e, tinst, i, m) = Expr.Op (TOp.TupleFieldGet(tupInfo, i), tinst, [e], m) +let mkAnonRecdFieldGetViaExprAddr(anonInfo, e, tinst, i, m) = Expr.Op (TOp.AnonRecdGet(anonInfo, i), tinst, [e], m) let mkRecdFieldGetViaExprAddr(e, fref, tinst, m) = Expr.Op (TOp.ValFieldGet(fref), tinst, [e], m) let mkRecdFieldGetAddrViaExprAddr(readonly, e, fref, tinst, m) = Expr.Op (TOp.ValFieldGetAddr(fref, readonly), tinst, [e], m) @@ -1392,14 +1424,13 @@ type TyconRefMultiMap<'T>(contents: TyconRefMap<'T list>) = //-------------------------------------------------------------------------- /// Try to create a EntityRef suitable for accessing the given Entity from another assembly -let tryRescopeEntity viewedCcu (entity:Entity) : EntityRef option = +let tryRescopeEntity viewedCcu (entity:Entity) : ValueOption = match entity.PublicPath with - | Some pubpath -> Some (ERefNonLocal (rescopePubPath viewedCcu pubpath)) - | None -> None - + | Some pubpath -> ValueSome (ERefNonLocal (rescopePubPath viewedCcu pubpath)) + | None -> ValueNone /// Try to create a ValRef suitable for accessing the given Val from another assembly -let tryRescopeVal viewedCcu (entityRemap:Remap) (vspec:Val) : ValRef option = +let tryRescopeVal viewedCcu (entityRemap:Remap) (vspec:Val) : ValueOption = match vspec.PublicPath with | Some (ValPubPath(p, fullLinkageKey)) -> // The type information in the val linkage doesn't need to keep any information to trait solutions. @@ -1414,9 +1445,8 @@ let tryRescopeVal viewedCcu (entityRemap:Remap) (vspec:Val) : ValRef option = mkNonLocalValRef (rescopePubPathToParent viewedCcu p) fullLinkageKey else mkNonLocalValRef (rescopePubPath viewedCcu p) fullLinkageKey - Some vref - | None -> None - + ValueSome vref + | _ -> ValueNone //--------------------------------------------------------------------------- // Type information about records, constructors etc. @@ -1570,13 +1600,13 @@ let rankOfArrayTyconRef (g:TcGlobals) tcr = //------------------------------------------------------------------------- let destArrayTy (g:TcGlobals) ty = - match ty with - | AppTy g (tcref, [ty]) when isArrayTyconRef g tcref -> ty + match tryAppTy g ty with + | ValueSome (tcref, [ty]) when isArrayTyconRef g tcref -> ty | _ -> failwith "destArrayTy" let destListTy (g:TcGlobals) ty = - match ty with - | AppTy g (tcref, [ty]) when tyconRefEq g tcref g.list_tcr_canon -> ty + match tryAppTy g ty with + | ValueSome (tcref, [ty]) when tyconRefEq g tcref g.list_tcr_canon -> ty | _ -> failwith "destListTy" let tyconRefEqOpt g tcOpt tc = @@ -1668,24 +1698,24 @@ let rankOfArrayTy g ty = rankOfArrayTyconRef g (tcrefOfAppTy g ty) let isFSharpObjModelRefTy g ty = isFSharpObjModelTy g ty && - let tcr, _ = destAppTy g ty + let tcr = tcrefOfAppTy g ty match tcr.FSharpObjectModelTypeInfo.fsobjmodel_kind with | TTyconClass | TTyconInterface | TTyconDelegate _ -> true | TTyconStruct | TTyconEnum -> false let isFSharpClassTy g ty = match tryDestAppTy g ty with - | Some tcref -> tcref.Deref.IsFSharpClassTycon + | ValueSome tcref -> tcref.Deref.IsFSharpClassTycon | _ -> false let isFSharpStructTy g ty = match tryDestAppTy g ty with - | Some tcref -> tcref.Deref.IsFSharpStructOrEnumTycon + | ValueSome tcref -> tcref.Deref.IsFSharpStructOrEnumTycon | _ -> false let isFSharpInterfaceTy g ty = match tryDestAppTy g ty with - | Some tcref -> tcref.Deref.IsFSharpInterfaceTycon + | ValueSome tcref -> tcref.Deref.IsFSharpInterfaceTycon | _ -> false let isDelegateTy g ty = @@ -1696,7 +1726,7 @@ let isDelegateTy g ty = | ILTypeMetadata (TILObjectReprData(_, _, td)) -> td.IsDelegate | FSharpOrArrayOrByrefOrTupleOrExnTypeMetadata -> match tryDestAppTy g ty with - | Some tcref -> tcref.Deref.IsFSharpDelegateTycon + | ValueSome tcref -> tcref.Deref.IsFSharpDelegateTycon | _ -> false let isInterfaceTy g ty = @@ -1717,20 +1747,21 @@ let isClassTy g ty = let isStructOrEnumTyconTy g ty = match tryDestAppTy g ty with - | Some tcref -> tcref.Deref.IsStructOrEnumTycon + | ValueSome tcref -> tcref.Deref.IsStructOrEnumTycon | _ -> false let isStructRecordOrUnionTyconTy g ty = match tryDestAppTy g ty with - | Some tcref -> tcref.Deref.IsStructRecordOrUnionTycon + | ValueSome tcref -> tcref.Deref.IsStructRecordOrUnionTycon | _ -> false let isStructTy g ty = match tryDestAppTy g ty with - | Some tcref -> + | ValueSome tcref -> let tycon = tcref.Deref tycon.IsStructRecordOrUnionTycon || tycon.IsStructOrEnumTycon - | _ -> isStructTupleTy g ty + | _ -> + isStructAnonRecdTy g ty || isStructTupleTy g ty let isRefTy g ty = not (isStructOrEnumTyconTy g ty) && @@ -1757,7 +1788,7 @@ let isRefTy g ty = let rec isUnmanagedTy g ty = let ty = stripTyEqnsAndMeasureEqns g ty match tryDestAppTy g ty with - | Some tcref -> + | ValueSome tcref -> let isEq tcref2 = tyconRefEq g tcref tcref2 if isEq g.nativeptr_tcr || isEq g.nativeint_tcr || isEq g.sbyte_tcr || isEq g.byte_tcr || @@ -1779,7 +1810,7 @@ let rec isUnmanagedTy g ty = | [] -> tycon.AllInstanceFieldsAsList |> List.forall (fun r -> isUnmanagedTy g r.rfield_type) | _ -> false // generic structs are never else false - | None -> + | ValueNone -> false let isInterfaceTycon x = @@ -1789,8 +1820,8 @@ let isInterfaceTyconRef (tcref: TyconRef) = isInterfaceTycon tcref.Deref let isEnumTy g ty = match tryDestAppTy g ty with - | None -> false - | Some tcref -> tcref.IsEnumTycon + | ValueNone -> false + | ValueSome tcref -> tcref.IsEnumTycon let actualReturnTyOfSlotSig parentTyInst methTyInst (TSlotSig(_, _, parentFormalTypars, methFormalTypars, _, formalRetTy)) = let methTyInst = mkTyparInst methFormalTypars methTyInst @@ -2012,6 +2043,8 @@ and accFreeInTraitSln opts sln acc = accFreeInType opts ty (accFreeValRefInTraitSln opts vref (accFreeInTypes opts minst acc)) + | FSAnonRecdFieldSln(_anonInfo, tinst, _n) -> + accFreeInTypes opts tinst acc | FSRecdFieldSln(tinst, _rfref, _isSet) -> accFreeInTypes opts tinst acc | BuiltInSln -> acc @@ -2038,6 +2071,7 @@ and accFreeTyparRef opts (tp:Typar) acc = and accFreeInType opts ty acc = match stripTyparEqns ty with | TType_tuple (tupInfo, l) -> accFreeInTypes opts l (accFreeInTupInfo opts tupInfo acc) + | TType_anon (anonInfo, l) -> accFreeInTypes opts l (accFreeInTupInfo opts anonInfo.TupInfo acc) | TType_app (tc, tinst) -> let acc = accFreeTycon opts tc acc match tinst with @@ -2127,6 +2161,9 @@ and accFreeTyparRefLeftToRight g cxFlag thruFlag acc (tp:Typar) = and accFreeInTypeLeftToRight g cxFlag thruFlag acc ty = if verbose then dprintf "--> accFreeInTypeLeftToRight \n" match (if thruFlag then stripTyEqns g ty else stripTyparEqns ty) with + | TType_anon (anonInfo, l) -> + let acc = accFreeInTupInfoLeftToRight g cxFlag thruFlag acc anonInfo.TupInfo + accFreeInTypesLeftToRight g cxFlag thruFlag acc l | TType_tuple (tupInfo, l) -> let acc = accFreeInTupInfoLeftToRight g cxFlag thruFlag acc tupInfo accFreeInTypesLeftToRight g cxFlag thruFlag acc l @@ -2454,7 +2491,7 @@ module PrettyTypes = // Badly formed code may instantiate rigid declared typars to types. // Hence we double check here that the thing is really a type variable - let safeDestAnyParTy orig g ty = match tryAnyParTy g ty with None -> orig | Some x -> x + let safeDestAnyParTy orig g ty = match tryAnyParTy g ty with ValueNone -> orig | ValueSome x -> x let tee f x = f x x let foldUnurriedArgInfos f z (x: UncurriedArgInfos) = List.fold (fold1Of2 f) z x @@ -2519,8 +2556,9 @@ module SimplifyTypes = let z = f z ty match ty with | TType_forall (_, body) -> foldTypeButNotConstraints f z body - | TType_app (_, tinst) -> List.fold (foldTypeButNotConstraints f) z tinst - | TType_ucase (_, tinst) -> List.fold (foldTypeButNotConstraints f) z tinst + | TType_app (_, tys) + | TType_ucase (_, tys) + | TType_anon (_, tys) | TType_tuple (_, tys) -> List.fold (foldTypeButNotConstraints f) z tys | TType_fun (s, t) -> foldTypeButNotConstraints f (foldTypeButNotConstraints f z s) t | TType_var _ -> z @@ -2651,30 +2689,30 @@ let layoutOfPath p = let fullNameOfParentOfPubPath pp = match pp with - | PubPath([| _ |]) -> None - | pp -> Some(textOfPath pp.EnclosingPath) + | PubPath([| _ |]) -> ValueNone + | pp -> ValueSome(textOfPath pp.EnclosingPath) let fullNameOfParentOfPubPathAsLayout pp = match pp with - | PubPath([| _ |]) -> None - | pp -> Some(layoutOfPath (Array.toList pp.EnclosingPath)) + | PubPath([| _ |]) -> ValueNone + | pp -> ValueSome(layoutOfPath (Array.toList pp.EnclosingPath)) let fullNameOfPubPath (PubPath(p)) = textOfPath p let fullNameOfPubPathAsLayout (PubPath(p)) = layoutOfPath (Array.toList p) let fullNameOfParentOfNonLocalEntityRef (nlr: NonLocalEntityRef) = - if nlr.Path.Length < 2 then None - else Some (textOfPath nlr.EnclosingMangledPath) // <--- BAD BAD BAD: this is a mangled path. This is wrong for nested modules + if nlr.Path.Length < 2 then ValueNone + else ValueSome (textOfPath nlr.EnclosingMangledPath) // <--- BAD BAD BAD: this is a mangled path. This is wrong for nested modules let fullNameOfParentOfNonLocalEntityRefAsLayout (nlr: NonLocalEntityRef) = - if nlr.Path.Length < 2 then None - else Some (layoutOfPath (List.ofArray nlr.EnclosingMangledPath)) // <--- BAD BAD BAD: this is a mangled path. This is wrong for nested modules + if nlr.Path.Length < 2 then ValueNone + else ValueSome (layoutOfPath (List.ofArray nlr.EnclosingMangledPath)) // <--- BAD BAD BAD: this is a mangled path. This is wrong for nested modules let fullNameOfParentOfEntityRef eref = match eref with | ERefLocal x -> match x.PublicPath with - | None -> None + | None -> ValueNone | Some ppath -> fullNameOfParentOfPubPath ppath | ERefNonLocal nlr -> fullNameOfParentOfNonLocalEntityRef nlr @@ -2682,14 +2720,14 @@ let fullNameOfParentOfEntityRefAsLayout eref = match eref with | ERefLocal x -> match x.PublicPath with - | None -> None + | None -> ValueNone | Some ppath -> fullNameOfParentOfPubPathAsLayout ppath | ERefNonLocal nlr -> fullNameOfParentOfNonLocalEntityRefAsLayout nlr let fullNameOfEntityRef nmF xref = - match fullNameOfParentOfEntityRef xref with - | None -> nmF xref - | Some pathText -> pathText +.+ nmF xref + match fullNameOfParentOfEntityRef xref with + | ValueNone -> nmF xref + | ValueSome pathText -> pathText +.+ nmF xref let tagEntityRefName (xref: EntityRef) name = if xref.IsNamespace then tagNamespace name @@ -2711,26 +2749,26 @@ let fullNameOfEntityRefAsLayout nmF (xref: EntityRef) = |> mkNav xref.DefinitionRange |> wordL match fullNameOfParentOfEntityRefAsLayout xref with - | None -> navigableText - | Some pathText -> pathText ^^ SepL.dot ^^ navigableText + | ValueNone -> navigableText + | ValueSome pathText -> pathText ^^ SepL.dot ^^ navigableText let fullNameOfParentOfValRef vref = match vref with | VRefLocal x -> match x.PublicPath with - | None -> None - | Some (ValPubPath(pp, _)) -> Some(fullNameOfPubPath pp) + | None -> ValueNone + | Some (ValPubPath(pp, _)) -> ValueSome(fullNameOfPubPath pp) | VRefNonLocal nlr -> - Some (fullNameOfEntityRef (fun (x:EntityRef) -> x.DemangledModuleOrNamespaceName) nlr.EnclosingEntity) + ValueSome (fullNameOfEntityRef (fun (x:EntityRef) -> x.DemangledModuleOrNamespaceName) nlr.EnclosingEntity) let fullNameOfParentOfValRefAsLayout vref = match vref with | VRefLocal x -> match x.PublicPath with - | None -> None - | Some (ValPubPath(pp, _)) -> Some(fullNameOfPubPathAsLayout pp) + | None -> ValueNone + | Some (ValPubPath(pp, _)) -> ValueSome(fullNameOfPubPathAsLayout pp) | VRefNonLocal nlr -> - Some (fullNameOfEntityRefAsLayout (fun (x:EntityRef) -> x.DemangledModuleOrNamespaceName) nlr.EnclosingEntity) + ValueSome (fullNameOfEntityRefAsLayout (fun (x:EntityRef) -> x.DemangledModuleOrNamespaceName) nlr.EnclosingEntity) let fullDisplayTextOfParentOfModRef r = fullNameOfParentOfEntityRef r @@ -2743,12 +2781,12 @@ let fullDisplayTextOfExnRefAsLayout r = fullNameOfEntityRefAsLayout (fun (tc:Ty let fullDisplayTextOfUnionCaseRef (ucref:UnionCaseRef) = fullDisplayTextOfTyconRef ucref.TyconRef +.+ ucref.CaseName let fullDisplayTextOfRecdFieldRef (rfref:RecdFieldRef) = fullDisplayTextOfTyconRef rfref.TyconRef +.+ rfref.FieldName -let fullDisplayTextOfValRef (vref:ValRef) = +let fullDisplayTextOfValRef (vref:ValRef) = match fullNameOfParentOfValRef vref with - | None -> vref.DisplayName - | Some pathText -> pathText +.+ vref.DisplayName + | ValueNone -> vref.DisplayName + | ValueSome pathText -> pathText +.+ vref.DisplayName -let fullDisplayTextOfValRefAsLayout (vref:ValRef) = +let fullDisplayTextOfValRefAsLayout (vref:ValRef) = let n = match vref.MemberInfo with | None -> @@ -2763,8 +2801,8 @@ let fullDisplayTextOfValRefAsLayout (vref:ValRef) = | MemberKind.Constructor -> tagMethod vref.DisplayName | MemberKind.Member -> tagMember vref.DisplayName match fullNameOfParentOfValRefAsLayout vref with - | None -> wordL n - | Some pathText -> + | ValueNone -> wordL n + | ValueSome pathText -> pathText ^^ SepL.dot ^^ wordL n //pathText +.+ vref.DisplayName @@ -2989,8 +3027,8 @@ let destNativePtrTy g ty = let isRefCellTy g ty = match tryDestAppTy g ty with - | None -> false - | Some tcref -> tyconRefEq g g.refcell_tcr_canon tcref + | ValueNone -> false + | ValueSome tcref -> tyconRefEq g g.refcell_tcr_canon tcref let destRefCellTy g ty = match ty |> stripTyEqns g with @@ -3014,23 +3052,23 @@ let mkListTy (g:TcGlobals) ty = TType_app (g.list_tcr_nice, [ty]) let isOptionTy (g:TcGlobals) ty = match tryDestAppTy g ty with - | None -> false - | Some tcref -> tyconRefEq g g.option_tcr_canon tcref + | ValueNone -> false + | ValueSome tcref -> tyconRefEq g g.option_tcr_canon tcref let tryDestOptionTy g ty = match argsOfAppTy g ty with - | [ty1] when isOptionTy g ty -> Some ty1 - | _ -> None + | [ty1] when isOptionTy g ty -> ValueSome ty1 + | _ -> ValueNone let destOptionTy g ty = match tryDestOptionTy g ty with - | Some ty -> ty - | None -> failwith "destOptionTy: not an option type" + | ValueSome ty -> ty + | ValueNone -> failwith "destOptionTy: not an option type" let isLinqExpressionTy g ty = match tryDestAppTy g ty with - | None -> false - | Some tcref -> tyconRefEq g g.system_LinqExpression_tcref tcref + | ValueNone -> false + | ValueSome tcref -> tyconRefEq g g.system_LinqExpression_tcref tcref let tryDestLinqExpressionTy g ty = match argsOfAppTy g ty with @@ -3143,6 +3181,7 @@ module DebugPrint = begin let squareAngleL x = LeftL.leftBracketAngle ^^ x ^^ RightL.rightBracketAngle let angleL x = sepL Literals.leftAngle ^^ x ^^ rightL Literals.rightAngle let braceL x = leftL Literals.leftBrace ^^ x ^^ rightL Literals.rightBrace + let braceBarL x = leftL Literals.leftBraceBar ^^ x ^^ rightL Literals.rightBraceBar let boolL = function true -> WordL.keywordTrue | false -> WordL.keywordFalse let intL (n:int) = wordL (tagNumericLiteral (string n )) @@ -3204,6 +3243,7 @@ module DebugPrint = begin let prefix = tcref.IsPrefixDisplay let tcL = layoutTyconRef tcref auxTyparsL env tcL prefix tinst + | TType_anon (anonInfo, tys) -> braceBarL (sepListL (wordL (tagText ";")) (List.map2 (fun nm ty -> wordL (tagField nm) --- auxTypeAtomL env ty) (Array.toList anonInfo.SortedNames) tys)) | TType_tuple (_tupInfo, tys) -> sepListL (wordL (tagText "*")) (List.map (auxTypeAtomL env) tys) |> wrap | TType_fun (f, x) -> ((auxTypeAtomL env f ^^ wordL (tagText "->")) --- auxTypeL env x) |> wrap | TType_var typar -> auxTyparWrapL env isAtomic typar @@ -3402,7 +3442,7 @@ module DebugPrint = begin let rec MemberL (v:Val) (membInfo:ValMemberInfo) = (aboveListL [ wordL(tagText "compiled_name! = ") ^^ wordL (tagText v.CompiledName) ; wordL(tagText "membInfo-slotsig! = ") ^^ listL slotSigL membInfo.ImplementedSlotSigs ]) - and vspecAtBindL v = + and valAtBindL v = let vL = valL v in let mutL = (if v.IsMutable then wordL(tagText "mutable") ++ vL else vL) mutL --- (aboveListL (List.concat [[wordL(tagText ":") ^^ typeL v.Type]; @@ -3472,7 +3512,7 @@ module DebugPrint = begin then emptyL else let iimplsLs = iimpls |> List.map (fun (ty, _, _) -> wordL(tagText "interface") --- typeL ty) - let adhocLs = adhoc |> List.map (fun vref -> vspecAtBindL vref.Deref) + let adhocLs = adhoc |> List.map (fun vref -> valAtBindL vref.Deref) (wordL(tagText "with") @@-- aboveListL (iimplsLs @ adhocLs)) @@ wordL(tagText "end") let layoutUnionCaseArgTypes argtys = sepListL (wordL(tagText "*")) (List.map typeL argtys) @@ -3519,7 +3559,7 @@ module DebugPrint = begin let vsprs = tycon.MembersOfFSharpTyconSorted |> List.filter (fun v -> v.IsDispatchSlot) - |> List.map (fun vref -> vspecAtBindL vref.Deref) + |> List.map (fun vref -> valAtBindL vref.Deref) let vals = tycon.TrueFieldsAsList |> List.map (fun f -> (if f.IsStatic then wordL(tagText "static") else emptyL) ^^ wordL(tagText "val") ^^ layoutRecdField f) let alldecls = inherits @ vsprs @ vals let emptyMeasure = match tycon.TypeOrMeasureKind with TyparKind.Measure -> isNil alldecls | _ -> false @@ -3550,7 +3590,7 @@ module DebugPrint = begin //-------------------------------------------------------------------------- and bindingL (TBind(v, repr, _)) = - vspecAtBindL v --- (wordL(tagText "=") ^^ exprL repr) + valAtBindL v --- (wordL(tagText "=") ^^ exprL repr) and exprL expr = exprWrapL false expr and atomL expr = exprWrapL true expr // true means bracket if needed to be atomic expr @@ -3588,11 +3628,11 @@ module DebugPrint = begin | ThenDoSeq -> "; (*ThenDo*)" ((exprL x0 ^^ rightL (tagText flag)) @@ exprL x1) |> wrap | Expr.Lambda(_, _, baseValOpt, argvs, body, _, _) -> - let formalsL = spaceListL (List.map vspecAtBindL argvs) in + let formalsL = spaceListL (List.map valAtBindL argvs) in let bindingL = match baseValOpt with | None -> wordL(tagText "lam") ^^ formalsL ^^ rightL(tagText ".") - | Some basev -> wordL(tagText "lam") ^^ (leftL(tagText "base=") ^^ vspecAtBindL basev) --- formalsL ^^ rightL(tagText ".") in + | Some basev -> wordL(tagText "lam") ^^ (leftL(tagText "base=") ^^ valAtBindL basev) --- formalsL ^^ rightL(tagText ".") in (bindingL ++ exprL body) |> wrap | Expr.TyLambda(_, argtyvs, body, _, _) -> ((wordL(tagText "LAM") ^^ spaceListL (List.map typarL argtyvs) ^^ rightL(tagText ".")) ++ exprL body) |> wrap @@ -3687,7 +3727,7 @@ module DebugPrint = begin | Expr.Obj (_lambdaId, ty, basev, ccall, overrides, iimpls, _) -> wordL(tagText "OBJ:") ^^ aboveListL [typeL ty; exprL ccall; - optionL vspecAtBindL basev; + optionL valAtBindL basev; aboveListL (List.map overrideL overrides); aboveListL (List.map iimplL iimpls)] @@ -3709,8 +3749,8 @@ module DebugPrint = begin let z = z --- sepL(tagText "`") --- (spaceListL (List.map atomL args)) z - and implFileL (TImplFile(_, _, e, _, _)) = - aboveListL [(wordL(tagText "top implementation ")) @@-- mexprL e] + and implFileL (TImplFile(_, _, mexpr, _, _, _)) = + aboveListL [(wordL(tagText "top implementation ")) @@-- mexprL mexpr] and mexprL x = match x with @@ -3772,7 +3812,7 @@ module DebugPrint = begin and tmethodL (TObjExprMethod(TSlotSig(nm, _, _, _, _, _), _, tps, vs, e, _)) = (wordL(tagText "TObjExprMethod") --- (wordL (tagText nm)) ^^ wordL(tagText "=")) -- (wordL(tagText "METH-LAM") --- angleBracketListL (List.map typarL tps) ^^ rightL(tagText ".")) --- - (wordL(tagText "meth-lam") --- tupleL (List.map (List.map vspecAtBindL >> tupleL) vs) ^^ rightL(tagText ".")) --- + (wordL(tagText "meth-lam") --- tupleL (List.map (List.map valAtBindL >> tupleL) vs) ^^ rightL(tagText ".")) --- (atomL e) and overrideL tmeth = wordL(tagText "with") ^^ tmethodL tmeth and iimplL (ty, tmeths) = wordL(tagText "impl") ^^ aboveListL (typeL ty :: List.map tmethodL tmeths) @@ -3801,7 +3841,7 @@ let wrapModuleOrNamespaceExprInNamespace (id :Ident) cpath mexpr = TMDefRec (false, [], [ModuleOrNamespaceBinding.Module(mspec, mexpr)], id.idRange) // cleanup: make this a property -let SigTypeOfImplFile (TImplFile(_, _, mexpr, _, _)) = mexpr.Type +let SigTypeOfImplFile (TImplFile(_, _, mexpr, _, _, _)) = mexpr.Type //-------------------------------------------------------------------------- @@ -3810,33 +3850,33 @@ let SigTypeOfImplFile (TImplFile(_, _, mexpr, _, _)) = mexpr.Type //-------------------------------------------------------------------------- type SignatureRepackageInfo = - { mrpiVals : (ValRef * ValRef) list; - mrpiEntities: (TyconRef * TyconRef) list } + { RepackagedVals : (ValRef * ValRef) list; + RepackagedEntities: (TyconRef * TyconRef) list } - member remapInfo.ImplToSigMapping = { TypeEquivEnv.Empty with EquivTycons = TyconRefMap.OfList remapInfo.mrpiEntities } - static member Empty = { mrpiVals = []; mrpiEntities= [] } + member remapInfo.ImplToSigMapping = { TypeEquivEnv.Empty with EquivTycons = TyconRefMap.OfList remapInfo.RepackagedEntities } + static member Empty = { RepackagedVals = []; RepackagedEntities= [] } type SignatureHidingInfo = - { mhiTycons : Zset; - mhiTyconReprs : Zset; - mhiVals : Zset; - mhiRecdFields : Zset; - mhiUnionCases : Zset } + { HiddenTycons : Zset; + HiddenTyconReprs : Zset; + HiddenVals : Zset; + HiddenRecdFields : Zset; + HiddenUnionCases : Zset } static member Empty = - { mhiTycons = Zset.empty tyconOrder; - mhiTyconReprs = Zset.empty tyconOrder; - mhiVals = Zset.empty valOrder; - mhiRecdFields = Zset.empty recdFieldRefOrder; - mhiUnionCases = Zset.empty unionCaseRefOrder } + { HiddenTycons = Zset.empty tyconOrder; + HiddenTyconReprs = Zset.empty tyconOrder; + HiddenVals = Zset.empty valOrder; + HiddenRecdFields = Zset.empty recdFieldRefOrder; + HiddenUnionCases = Zset.empty unionCaseRefOrder } let addValRemap v v' tmenv = { tmenv with valRemap= tmenv.valRemap.Add v (mkLocalValRef v') } let mkRepackageRemapping mrpi = - { valRemap = ValMap.OfList (mrpi.mrpiVals |> List.map (fun (vref, x) -> vref.Deref, x)); + { valRemap = ValMap.OfList (mrpi.RepackagedVals |> List.map (fun (vref, x) -> vref.Deref, x)); tpinst = emptyTyparInst; - tyconRefRemap = TyconRefMap.OfList mrpi.mrpiEntities + tyconRefRemap = TyconRefMap.OfList mrpi.RepackagedEntities removeTraitSolutions = false } //-------------------------------------------------------------------------- @@ -3848,18 +3888,18 @@ let accEntityRemap (msigty:ModuleOrNamespaceType) (entity:Entity) (mrpi, mhi) = match sigtyconOpt with | None -> // The type constructor is not present in the signature. Hence it is hidden. - let mhi = { mhi with mhiTycons = Zset.add entity mhi.mhiTycons } + let mhi = { mhi with HiddenTycons = Zset.add entity mhi.HiddenTycons } (mrpi, mhi) | Some sigtycon -> // The type constructor is in the signature. Hence record the repackage entry let sigtcref = mkLocalTyconRef sigtycon let tcref = mkLocalTyconRef entity - let mrpi = { mrpi with mrpiEntities = ((tcref, sigtcref) :: mrpi.mrpiEntities) } + let mrpi = { mrpi with RepackagedEntities = ((tcref, sigtcref) :: mrpi.RepackagedEntities) } // OK, now look for hidden things let mhi = if (match entity.TypeReprInfo with TNoRepr -> false | _ -> true) && (match sigtycon.TypeReprInfo with TNoRepr -> true | _ -> false) then // The type representation is absent in the signature, hence it is hidden - { mhi with mhiTyconReprs = Zset.add entity mhi.mhiTyconReprs } + { mhi with HiddenTyconReprs = Zset.add entity mhi.HiddenTyconReprs } else // The type representation is present in the signature. // Find the fields that have been hidden or which were non-public anyway. @@ -3872,7 +3912,7 @@ let accEntityRemap (msigty:ModuleOrNamespaceType) (entity:Entity) (mrpi, mhi) = | _ -> // The field is not in the signature. Hence it is regarded as hidden. let rfref = tcref.MakeNestedRecdFieldRef rfield - { mhi with mhiRecdFields = Zset.add rfref mhi.mhiRecdFields }) + { mhi with HiddenRecdFields = Zset.add rfref mhi.HiddenRecdFields }) entity.AllFieldsArray |> List.foldBack (fun (ucase:UnionCase) mhi -> match sigtycon.GetUnionCaseByName ucase.DisplayName with @@ -3882,7 +3922,7 @@ let accEntityRemap (msigty:ModuleOrNamespaceType) (entity:Entity) (mrpi, mhi) = | _ -> // The constructor is not in the signature. Hence it is regarded as hidden. let ucref = tcref.MakeNestedUnionCaseRef ucase - { mhi with mhiUnionCases = Zset.add ucref mhi.mhiUnionCases }) + { mhi with HiddenUnionCases = Zset.add ucref mhi.HiddenUnionCases }) (entity.UnionCasesAsList) (mrpi, mhi) @@ -3891,13 +3931,13 @@ let accSubEntityRemap (msigty:ModuleOrNamespaceType) (entity:Entity) (mrpi, mhi) match sigtyconOpt with | None -> // The type constructor is not present in the signature. Hence it is hidden. - let mhi = { mhi with mhiTycons = Zset.add entity mhi.mhiTycons } + let mhi = { mhi with HiddenTycons = Zset.add entity mhi.HiddenTycons } (mrpi, mhi) | Some sigtycon -> // The type constructor is in the signature. Hence record the repackage entry let sigtcref = mkLocalTyconRef sigtycon let tcref = mkLocalTyconRef entity - let mrpi = { mrpi with mrpiEntities = ((tcref, sigtcref) :: mrpi.mrpiEntities) } + let mrpi = { mrpi with RepackagedEntities = ((tcref, sigtcref) :: mrpi.RepackagedEntities) } (mrpi, mhi) let valLinkageAEquiv g aenv (v1:Val) (v2:Val) = @@ -3915,11 +3955,11 @@ let accValRemap g aenv (msigty:ModuleOrNamespaceType) (implVal:Val) (mrpi, mhi) match sigValOpt with | None -> if verbose then dprintf "accValRemap, hide = %s#%d\n" implVal.LogicalName implVal.Stamp - let mhi = { mhi with mhiVals = Zset.add implVal mhi.mhiVals } + let mhi = { mhi with HiddenVals = Zset.add implVal mhi.HiddenVals } (mrpi, mhi) | Some (sigVal:Val) -> // The value is in the signature. Add the repackage entry. - let mrpi = { mrpi with mrpiVals = (vref, mkLocalValRef sigVal) :: mrpi.mrpiVals } + let mrpi = { mrpi with RepackagedVals = (vref, mkLocalValRef sigVal) :: mrpi.RepackagedVals } (mrpi, mhi) let getCorrespondingSigTy nm (msigty:ModuleOrNamespaceType) = @@ -4013,9 +4053,9 @@ let ComputeRemappingFromImplementationToSignature g mdef msigty = let accTyconHidingInfoAtAssemblyBoundary (tycon:Tycon) mhi = if not (canAccessFromEverywhere tycon.Accessibility) then // The type constructor is not public, hence hidden at the assembly boundary. - { mhi with mhiTycons = Zset.add tycon mhi.mhiTycons } + { mhi with HiddenTycons = Zset.add tycon mhi.HiddenTycons } elif not (canAccessFromEverywhere tycon.TypeReprAccessibility) then - { mhi with mhiTyconReprs = Zset.add tycon mhi.mhiTyconReprs } + { mhi with HiddenTyconReprs = Zset.add tycon mhi.HiddenTyconReprs } else mhi |> Array.foldBack @@ -4023,7 +4063,7 @@ let accTyconHidingInfoAtAssemblyBoundary (tycon:Tycon) mhi = if not (canAccessFromEverywhere rfield.Accessibility) then let tcref = mkLocalTyconRef tycon let rfref = tcref.MakeNestedRecdFieldRef rfield - { mhi with mhiRecdFields = Zset.add rfref mhi.mhiRecdFields } + { mhi with HiddenRecdFields = Zset.add rfref mhi.HiddenRecdFields } else mhi) tycon.AllFieldsArray |> List.foldBack @@ -4031,7 +4071,7 @@ let accTyconHidingInfoAtAssemblyBoundary (tycon:Tycon) mhi = if not (canAccessFromEverywhere ucase.Accessibility) then let tcref = mkLocalTyconRef tycon let ucref = tcref.MakeNestedUnionCaseRef ucase - { mhi with mhiUnionCases = Zset.add ucref mhi.mhiUnionCases } + { mhi with HiddenUnionCases = Zset.add ucref mhi.HiddenUnionCases } else mhi) (tycon.UnionCasesAsList) @@ -4046,7 +4086,7 @@ let accValHidingInfoAtAssemblyBoundary (vspec:Val) mhi = // anything that's not a module or member binding gets assembly visibility not vspec.IsMemberOrModuleBinding then // The value is not public, hence hidden at the assembly boundary. - { mhi with mhiVals = Zset.add vspec mhi.mhiVals } + { mhi with HiddenVals = Zset.add vspec mhi.HiddenVals } else mhi @@ -4081,10 +4121,10 @@ let IsHidden setF accessF remapF debugF = if verbose then dprintf "IsHidden, #mrmi = %d, %s = %b\n" mrmi.Length (showL (debugF x)) res; res -let IsHiddenTycon mrmi x = IsHidden (fun mhi -> mhi.mhiTycons) (fun tc -> tc.Accessibility) (fun rpi x -> (remapTyconRef rpi.tyconRefRemap (mkLocalTyconRef x)).Deref) DebugPrint.tyconL mrmi x -let IsHiddenTyconRepr mrmi x = IsHidden (fun mhi -> mhi.mhiTyconReprs) (fun v -> v.TypeReprAccessibility) (fun rpi x -> (remapTyconRef rpi.tyconRefRemap (mkLocalTyconRef x)).Deref) DebugPrint.tyconL mrmi x -let IsHiddenVal mrmi x = IsHidden (fun mhi -> mhi.mhiVals) (fun v -> v.Accessibility) (fun rpi x -> (remapValRef rpi (mkLocalValRef x)).Deref) DebugPrint.valL mrmi x -let IsHiddenRecdField mrmi x = IsHidden (fun mhi -> mhi.mhiRecdFields) (fun rfref -> rfref.RecdField.Accessibility) (fun rpi x -> remapRecdFieldRef rpi.tyconRefRemap x) DebugPrint.recdFieldRefL mrmi x +let IsHiddenTycon mrmi x = IsHidden (fun mhi -> mhi.HiddenTycons) (fun tc -> tc.Accessibility) (fun rpi x -> (remapTyconRef rpi.tyconRefRemap (mkLocalTyconRef x)).Deref) DebugPrint.tyconL mrmi x +let IsHiddenTyconRepr mrmi x = IsHidden (fun mhi -> mhi.HiddenTyconReprs) (fun v -> v.TypeReprAccessibility) (fun rpi x -> (remapTyconRef rpi.tyconRefRemap (mkLocalTyconRef x)).Deref) DebugPrint.tyconL mrmi x +let IsHiddenVal mrmi x = IsHidden (fun mhi -> mhi.HiddenVals) (fun v -> v.Accessibility) (fun rpi x -> (remapValRef rpi (mkLocalValRef x)).Deref) DebugPrint.valL mrmi x +let IsHiddenRecdField mrmi x = IsHidden (fun mhi -> mhi.HiddenRecdFields) (fun rfref -> rfref.RecdField.Accessibility) (fun rpi x -> remapRecdFieldRef rpi.tyconRefRemap x) DebugPrint.recdFieldRefL mrmi x //-------------------------------------------------------------------------- @@ -4405,7 +4445,9 @@ and accFreeInOp opts op acc = | TOp.Goto _ | TOp.Label _ | TOp.Return | TOp.TupleFieldGet _ -> acc - | TOp.Tuple tupInfo -> accFreeTyvars opts accFreeInTupInfo tupInfo acc + | TOp.Tuple tupInfo -> accFreeTyvars opts accFreeInTupInfo tupInfo acc + | TOp.AnonRecd anonInfo + | TOp.AnonRecdGet (anonInfo, _) -> accFreeTyvars opts accFreeInTupInfo anonInfo.TupInfo acc | TOp.UnionCaseTagGet tr -> accUsedRecdOrUnionTyconRepr opts tr.Deref acc @@ -4660,8 +4702,8 @@ let decideStaticOptimizationConstraint g c = | TTyconIsStruct a -> let a = normalizeEnumTy g (stripTyEqnsAndMeasureEqns g a) match tryDestAppTy g a with - | Some tcref1 -> if tcref1.IsStructOrEnumTycon then StaticOptimizationAnswer.Yes else StaticOptimizationAnswer.No - | None -> StaticOptimizationAnswer.Unknown + | ValueSome tcref1 -> if tcref1.IsStructOrEnumTycon then StaticOptimizationAnswer.Yes else StaticOptimizationAnswer.No + | ValueNone -> StaticOptimizationAnswer.Unknown let rec DecideStaticOptimizations g cs = match cs with @@ -5370,8 +5412,8 @@ let ComputeFieldName tycon f = // Helpers for building code contained in the initial environment //------------------------------------------------------------------------- -let isQuotedExprTy g ty = match ty with AppTy g (tcref, _) -> tyconRefEq g tcref g.expr_tcr | _ -> false -let destQuotedExprTy g ty = match ty with AppTy g (_, [ty]) -> ty | _ -> failwith "destQuotedExprTy" +let isQuotedExprTy g ty = match tryAppTy g ty with ValueSome (tcref, _) -> tyconRefEq g tcref g.expr_tcr | _ -> false +let destQuotedExprTy g ty = match tryAppTy g ty with ValueSome (_, [ty]) -> ty | _ -> failwith "destQuotedExprTy" let mkQuotedExprTy (g:TcGlobals) ty = TType_app(g.expr_tcr, [ty]) let mkRawQuotedExprTy (g:TcGlobals) = TType_app(g.raw_expr_tcr, []) @@ -5382,6 +5424,9 @@ let mkAnyTupledTy (g:TcGlobals) tupInfo tys = | [h] -> h | _ -> TType_tuple(tupInfo, tys) +let mkAnyAnonRecdTy (_g:TcGlobals) anonInfo tys = + TType_anon(anonInfo, tys) + let mkRefTupledTy g tys = mkAnyTupledTy g tupInfoRef tys let mkRefTupledVarsTy g vs = mkRefTupledTy g (typesOfVals vs) @@ -5420,8 +5465,10 @@ let rec tyOfExpr g e = | TOp.ExnConstr _ -> g.exn_ty | TOp.Bytes _ -> mkByteArrayTy g | TOp.UInt16s _ -> mkArrayType g g.uint16_ty + | TOp.AnonRecdGet(_, i) -> List.item i tinst | TOp.TupleFieldGet(_, i) -> List.item i tinst | TOp.Tuple tupInfo -> mkAnyTupledTy g tupInfo tinst + | TOp.AnonRecd anonInfo -> mkAnyAnonRecdTy g anonInfo tinst | (TOp.For _ | TOp.While _) -> g.unit_ty | TOp.Array -> (match tinst with [ty] -> mkArrayType g ty | _ -> failwith "bad TOp.Array node") | (TOp.TryCatch _ | TOp.TryFinally _) -> (match tinst with [ty] -> ty | _ -> failwith "bad TOp_try node") @@ -5681,8 +5728,8 @@ let isRecdOrStructTyconRefReadOnly (g: TcGlobals) m (tcref: TyconRef) = let isRecdOrStructTyReadOnly (g: TcGlobals) m ty = match tryDestAppTy g ty with - | None -> false - | Some tcref -> isRecdOrStructTyconRefReadOnly g m tcref + | ValueNone -> false + | ValueSome tcref -> isRecdOrStructTyconRefReadOnly g m tcref let CanTakeAddressOf g m ty mut = @@ -5864,16 +5911,23 @@ let rec mkExprAddrOfExprAux g mustTakeAddress useReadonlyForGenericArrayAddress let ty = tyOfExpr g expr if isStructTy g ty then match mut with - | NeverMutates -> () - | AddressOfOp -> - // we get an inref - errorR(Error(FSComp.SR.tastCantTakeAddressOfExpression(), m)) + | NeverMutates + | AddressOfOp -> () | DefinitelyMutates -> // Give a nice error message for mutating something we can't take the address of errorR(Error(FSComp.SR.tastInvalidMutationOfConstant(), m)) | PossiblyMutates -> // Warn on defensive copy of something we can't take the address of warning(DefensiveCopyWarning(FSComp.SR.tastValueHasBeenCopied(), m)) + + match mut with + | NeverMutates + | DefinitelyMutates + | PossiblyMutates -> () + | AddressOfOp -> + // we get an inref + errorR(Error(FSComp.SR.tastCantTakeAddressOfExpression(), m)) + // Take a defensive copy let tmp, _ = match mut with @@ -5895,6 +5949,10 @@ let mkTupleFieldGet g (tupInfo, e, tinst, i, m) = let wrap, e', _readonly, _writeonly = mkExprAddrOfExpr g (evalTupInfoIsStruct tupInfo) false NeverMutates e None m wrap (mkTupleFieldGetViaExprAddr(tupInfo, e', tinst, i, m)) +let mkAnonRecdFieldGet g (anonInfo:AnonRecdTypeInfo, e, tinst, i, m) = + let wrap, e', _readonly, _writeonly = mkExprAddrOfExpr g (evalAnonInfoIsStruct anonInfo) false NeverMutates e None m + wrap (mkAnonRecdFieldGetViaExprAddr(anonInfo, e', tinst, i, m)) + let mkRecdFieldGet g (e, fref:RecdFieldRef, tinst, m) = assert (not (isByrefTy g (tyOfExpr g e))) let wrap, e', _readonly, _writeonly = mkExprAddrOfExpr g fref.Tycon.IsStructOrEnumTycon false NeverMutates e None m @@ -6168,7 +6226,7 @@ let mkMinusOne g m = mkInt g m (-1) let destInt32 = function Expr.Const(Const.Int32 n, _, _) -> Some n | _ -> None -let isIDelegateEventType g ty = isAppTy g ty && tyconRefEq g g.fslib_IDelegateEvent_tcr (tcrefOfAppTy g ty) +let isIDelegateEventType g ty = match tryDestAppTy g ty with ValueSome tcref -> tyconRefEq g g.fslib_IDelegateEvent_tcr tcref | _ -> false let destIDelegateEventType g ty = if isIDelegateEventType g ty then match argsOfAppTy g ty with @@ -6206,6 +6264,9 @@ let mkRefTupled g m es tys = mkAnyTupled g m tupInfoRef es tys let mkRefTupledNoTypes g m args = mkRefTupled g m args (List.map (tyOfExpr g) args) let mkRefTupledVars g m vs = mkRefTupled g m (List.map (exprForVal m) vs) (typesOfVals vs) +let mkAnonRecd (_g:TcGlobals) m anonInfo es tys = Expr.Op (TOp.AnonRecd (anonInfo),tys,es,m) + + //-------------------------------------------------------------------------- // Permute expressions //-------------------------------------------------------------------------- @@ -6261,11 +6322,6 @@ let permuteExprList (sigma:int[]) (exprs: Expr list) (ty: TType list) (names:str let reorderedExprs = permute sigma (Array.ofList newExprs) binds, Array.toList reorderedExprs -//------------------------------------------------------------------------- -// Build record expressions... -//------------------------------------------------------------------------- - - /// Evaluate the expressions in the original order, but build a record with the results in field order /// Note some fields may be static. If this were not the case we could just use /// let sigma = Array.map #Index () @@ -6317,6 +6373,18 @@ let mkIsInst ty e m = mkAsmExpr ([ isinst ], [ty], [e], [ ty ], m) let mspec_Type_GetTypeFromHandle (g: TcGlobals) = IL.mkILNonGenericStaticMethSpecInTy(g.ilg.typ_Type, "GetTypeFromHandle", [g.iltyp_RuntimeTypeHandle], g.ilg.typ_Type) let mspec_String_Length (g: TcGlobals) = mkILNonGenericInstanceMethSpecInTy (g.ilg.typ_String, "get_Length", [], g.ilg.typ_Int32) +let mspec_String_Concat2 (g: TcGlobals) = + mkILNonGenericStaticMethSpecInTy (g.ilg.typ_String, "Concat", [ g.ilg.typ_String; g.ilg.typ_String ], g.ilg.typ_String) + +let mspec_String_Concat3 (g: TcGlobals) = + mkILNonGenericStaticMethSpecInTy (g.ilg.typ_String, "Concat", [ g.ilg.typ_String; g.ilg.typ_String; g.ilg.typ_String ], g.ilg.typ_String) + +let mspec_String_Concat4 (g: TcGlobals) = + mkILNonGenericStaticMethSpecInTy (g.ilg.typ_String, "Concat", [ g.ilg.typ_String; g.ilg.typ_String; g.ilg.typ_String; g.ilg.typ_String ], g.ilg.typ_String) + +let mspec_String_Concat_Array (g: TcGlobals) = + mkILNonGenericStaticMethSpecInTy (g.ilg.typ_String, "Concat", [ mkILArr1DTy g.ilg.typ_String ], g.ilg.typ_String) + let fspec_Missing_Value (g: TcGlobals) = IL.mkILFieldSpecInTy(g.iltyp_Missing, "Value", g.iltyp_Missing) let mkInitializeArrayMethSpec (g: TcGlobals) = @@ -6538,6 +6606,21 @@ let mkGetStringLength g m e = /// ILCall(useCallvirt, isProtected, valu, newobj, valUseFlags, isProp, noTailCall, mref, actualTypeInst, actualMethInst, retTy) Expr.Op(TOp.ILCall(false, false, false, false, ValUseFlag.NormalValUse, true, false, mspec.MethodRef, [], [], [g.int32_ty]), [], [e], m) +let mkStaticCall_String_Concat2 g m arg1 arg2 = + let mspec = mspec_String_Concat2 g + Expr.Op(TOp.ILCall(false, false, false, false, ValUseFlag.NormalValUse, false, false, mspec.MethodRef, [], [], [g.string_ty]), [], [arg1; arg2], m) + +let mkStaticCall_String_Concat3 g m arg1 arg2 arg3 = + let mspec = mspec_String_Concat3 g + Expr.Op(TOp.ILCall(false, false, false, false, ValUseFlag.NormalValUse, false, false, mspec.MethodRef, [], [], [g.string_ty]), [], [arg1; arg2; arg3], m) + +let mkStaticCall_String_Concat4 g m arg1 arg2 arg3 arg4 = + let mspec = mspec_String_Concat4 g + Expr.Op(TOp.ILCall(false, false, false, false, ValUseFlag.NormalValUse, false, false, mspec.MethodRef, [], [], [g.string_ty]), [], [arg1; arg2; arg3; arg4], m) + +let mkStaticCall_String_Concat_Array g m arg = + let mspec = mspec_String_Concat_Array g + Expr.Op(TOp.ILCall(false, false, false, false, ValUseFlag.NormalValUse, false, false, mspec.MethodRef, [], [], [g.string_ty]), [], [arg], m) // Quotations can't contain any IL. // As a result, we aim to get rid of all IL generation in the typechecker and pattern match @@ -7296,6 +7379,7 @@ let rec typeEnc g (gtpsType, gtpsMethod) ty = match stripped with | TType_forall _ -> "Microsoft.FSharp.Core.FSharpTypeFunc" + | _ when isArrayTy g ty -> let tcref, tinst = destAppTy g ty let arraySuffix = @@ -7311,6 +7395,7 @@ let rec typeEnc g (gtpsType, gtpsMethod) ty = | 4 -> "[0:, 0:, 0:, 0:]" | _ -> failwith "impossible: rankOfArrayTyconRef: unsupported array rank" typeEnc g (gtpsType, gtpsMethod) (List.head tinst) + arraySuffix + | TType_ucase (UCRef(tcref, _), tinst) | TType_app (tcref, tinst) -> if tyconRefEq g g.byref_tcr tcref then @@ -7328,15 +7413,22 @@ let rec typeEnc g (gtpsType, gtpsMethod) ty = textOfPath (List.map DemangleGenericTypeName path) | _ -> assert(false); failwith "impossible" tyName + tyargsEnc g (gtpsType, gtpsMethod) tinst + + | TType_anon (anonInfo, tinst) -> + sprintf "%s%s" anonInfo.ILTypeRef.FullName (tyargsEnc g (gtpsType, gtpsMethod) tinst) + | TType_tuple (tupInfo, tys) -> if evalTupInfoIsStruct tupInfo then sprintf "System.ValueTuple%s"(tyargsEnc g (gtpsType, gtpsMethod) tys) else sprintf "System.Tuple%s"(tyargsEnc g (gtpsType, gtpsMethod) tys) + | TType_fun (f, x) -> "Microsoft.FSharp.Core.FSharpFunc" + tyargsEnc g (gtpsType, gtpsMethod) [f;x] + | TType_var typar -> typarEnc g (gtpsType, gtpsMethod) typar + | TType_measure _ -> "?" and tyargsEnc g (gtpsType, gtpsMethod) args = @@ -7461,16 +7553,16 @@ let TypeNullNever g ty = let TypeNullIsExtraValue g m ty = if isILReferenceTy g ty || isDelegateTy g ty then // Putting AllowNullLiteralAttribute(false) on an IL or provided type means 'null' can't be used with that type - not (isAppTy g ty && TryFindTyconRefBoolAttribute g m g.attrib_AllowNullLiteralAttribute (tcrefOfAppTy g ty) = Some(false)) + not (match tryDestAppTy g ty with ValueSome tcref -> TryFindTyconRefBoolAttribute g m g.attrib_AllowNullLiteralAttribute tcref = Some false | _ -> false) elif TypeNullNever g ty then false else // Putting AllowNullLiteralAttribute(true) on an F# type means 'null' can be used with that type - isAppTy g ty && TryFindTyconRefBoolAttribute g m g.attrib_AllowNullLiteralAttribute (tcrefOfAppTy g ty) = Some(true) + match tryDestAppTy g ty with ValueSome tcref -> TryFindTyconRefBoolAttribute g m g.attrib_AllowNullLiteralAttribute tcref = Some true | _ -> false let TypeNullIsTrueValue g ty = (match tryDestAppTy g ty with - | Some tcref -> IsUnionTypeWithNullAsTrueValue g tcref.Deref + | ValueSome tcref -> IsUnionTypeWithNullAsTrueValue g tcref.Deref | _ -> false) || (isUnitTy g ty) let TypeNullNotLiked g m ty = @@ -7497,6 +7589,10 @@ let rec TypeHasDefaultValue g m ty = flds |> List.forall (actualTyOfRecdField (mkTyconRefInst tcref tinst) >> TypeHasDefaultValue g m) elif isStructTupleTy g ty then destStructTupleTy g ty |> List.forall (TypeHasDefaultValue g m) + elif isStructAnonRecdTy g ty then + match tryDestAnonRecdTy g ty with + | ValueNone -> true + | ValueSome (_, ptys) -> ptys |> List.forall (TypeHasDefaultValue g m) else // All struct types defined in other .NET languages have a DefaultValue regardless of their // instantiation @@ -7509,9 +7605,13 @@ let (|SpecialComparableHeadType|_|) g ty = if isAnyTupleTy g ty then let _tupInfo, elemTys = destAnyTupleTy g ty Some elemTys + elif isAnonRecdTy g ty then + match tryDestAnonRecdTy g ty with + | ValueNone -> Some [] + | ValueSome (_anonInfo, elemTys) -> Some elemTys else - match ty with - | AppTy g (tcref, tinst) -> + match tryAppTy g ty with + | ValueSome (tcref, tinst) -> if isArrayTyconRef g tcref || tyconRefEq g tcref g.system_UIntPtr_tcref || tyconRefEq g tcref g.system_IntPtr_tcref then @@ -7620,17 +7720,16 @@ let isSealedTy g ty = | ProvidedTypeMetadata st -> st.IsSealed #endif | ILTypeMetadata (TILObjectReprData(_, _, td)) -> td.IsSealed - | FSharpOrArrayOrByrefOrTupleOrExnTypeMetadata -> - + | FSharpOrArrayOrByrefOrTupleOrExnTypeMetadata -> if (isFSharpInterfaceTy g ty || isFSharpClassTy g ty) then - let tcref, _ = destAppTy g ty - (TryFindFSharpBoolAttribute g g.attrib_SealedAttribute tcref.Attribs = Some(true)) + let tcref = tcrefOfAppTy g ty + TryFindFSharpBoolAttribute g g.attrib_SealedAttribute tcref.Attribs = Some true else // All other F# types, array, byref, tuple types are sealed true let isComInteropTy g ty = - let tcr, _ = destAppTy g ty + let tcr = tcrefOfAppTy g ty match g.attrib_ComImportAttribute with | None -> false | Some attr -> TryFindFSharpBoolAttribute g attr tcr.Attribs = Some(true) @@ -7936,9 +8035,9 @@ let MakeExportRemapping viewedCcu (mspec:ModuleOrNamespace) = let accEntityRemap (entity:Entity) acc = match tryRescopeEntity viewedCcu entity with - | Some eref -> + | ValueSome eref -> addTyconRefRemap (mkLocalTyconRef entity) eref acc - | None -> + | _ -> if entity.IsNamespace then acc else @@ -7947,9 +8046,9 @@ let MakeExportRemapping viewedCcu (mspec:ModuleOrNamespace) = let accValRemap (vspec:Val) acc = // The acc contains the entity remappings match tryRescopeVal viewedCcu acc vspec with - | Some vref -> + | ValueSome vref -> {acc with valRemap=acc.valRemap.Add vspec vref } - | None -> + | _ -> error(InternalError("Unexpected value without a pubpath when remapping assembly data", vspec.Range)) let mty = mspec.ModuleOrNamespaceType @@ -8276,12 +8375,12 @@ let rec mkCompiledTuple g isStruct (argtys, args, m) = ty8, arg8 | _ -> let ty8enc = TType_app((if isStruct then g.struct_tuple1_tcr else g.ref_tuple1_tcr), [ty8]) - let v8enc = Expr.Op (TOp.Tuple (TupInfo.Const isStruct), [ty8], [arg8], m) + let v8enc = Expr.Op (TOp.Tuple (mkTupInfo isStruct), [ty8], [arg8], m) ty8enc, v8enc | _ -> let a, b, c, d = mkCompiledTuple g isStruct (argtysB, argsB, m) let ty8plus = TType_app(a, b) - let v8plus = Expr.Op (TOp.Tuple(TupInfo.Const isStruct), b, c, d) + let v8plus = Expr.Op (TOp.Tuple(mkTupInfo isStruct), b, c, d) ty8plus, v8plus let argtysAB = argtysA @ [ty8] (mkCompiledTupleTyconRef g isStruct (List.length argtysAB), argtysAB, argsA @ [v8], m) diff --git a/src/fsharp/TastOps.fsi b/src/fsharp/TastOps.fsi index d2a532c37a9..badacfda0ea 100755 --- a/src/fsharp/TastOps.fsi +++ b/src/fsharp/TastOps.fsi @@ -3,7 +3,6 @@ /// Defines derived expression manipulation and construction functions. module internal Microsoft.FSharp.Compiler.Tastops -open System.Text open System.Collections.Generic open Internal.Utilities open Microsoft.FSharp.Compiler.AbstractIL @@ -13,15 +12,9 @@ open Microsoft.FSharp.Compiler open Microsoft.FSharp.Compiler.Range open Microsoft.FSharp.Compiler.Rational open Microsoft.FSharp.Compiler.Ast -open Microsoft.FSharp.Compiler.ErrorLogger open Microsoft.FSharp.Compiler.Tast open Microsoft.FSharp.Compiler.TcGlobals open Microsoft.FSharp.Compiler.Layout -open Microsoft.FSharp.Compiler.Lib - -#if !NO_EXTENSIONTYPING -open Microsoft.FSharp.Compiler.ExtensionTyping -#endif //------------------------------------------------------------------------- // Type equivalence @@ -41,10 +34,6 @@ val measureEquiv : TcGlobals -> Measure -> Measure -> bool /// Reduce a type to its more anonical form subject to an erasure flag, inference equations and abbreviations val stripTyEqnsWrtErasure: Erasure -> TcGlobals -> TType -> TType -//------------------------------------------------------------------------- -// Build common types -//------------------------------------------------------------------------- - /// Build a function type val mkFunTy : TType -> TType -> TType @@ -76,137 +65,232 @@ val stripExpr : Expr -> Expr /// Get the values for a set of bindings val valsOfBinds : Bindings -> Vals -val (|ExprValWithPossibleTypeInst|_|) : Expr -> (ValRef * ValUseFlag * TType list * range) option -//------------------------------------------------------------------------- -// Build decision trees imperatively -//------------------------------------------------------------------------- +/// Look for a use of an F# value, possibly including application of a generic thing to a set of type arguments +val (|ExprValWithPossibleTypeInst|_|) : Expr -> (ValRef * ValUseFlag * TType list * range) option +/// Build decision trees imperatively type MatchBuilder = + + /// Create a new builder new : SequencePointInfoForBinding * range -> MatchBuilder + + /// Add a new destination target member AddTarget : DecisionTreeTarget -> int + + /// Add a new destination target that is an expression result member AddResultTarget : Expr * SequencePointInfoForTarget -> DecisionTree + + /// Finish the targets member CloseTargets : unit -> DecisionTreeTarget list - member Close : DecisionTree * range * TType -> Expr -//------------------------------------------------------------------------- -// Make some special decision graphs -//------------------------------------------------------------------------- + /// Build the overall expression + member Close : DecisionTree * range * TType -> Expr +/// Add an if-then-else boolean conditional node into a decision tree val mkBoolSwitch : range -> Expr -> DecisionTree -> DecisionTree -> DecisionTree + +/// Build a conditional expression val primMkCond : SequencePointInfoForBinding -> SequencePointInfoForTarget -> SequencePointInfoForTarget -> range -> TType -> Expr -> Expr -> Expr -> Expr + +/// Build a conditional expression val mkCond : SequencePointInfoForBinding -> SequencePointInfoForTarget -> range -> TType -> Expr -> Expr -> Expr -> Expr + +/// Build a conditional expression that checks for non-nullness val mkNonNullCond : TcGlobals -> range -> TType -> Expr -> Expr -> Expr -> Expr -val mkIfThen : TcGlobals -> range -> Expr -> Expr -> Expr -//------------------------------------------------------------------------- -// Generate new locals -//------------------------------------------------------------------------- +/// Build an if-then statement +val mkIfThen : TcGlobals -> range -> Expr -> Expr -> Expr +/// Build an expression corresponding to the use of a value /// Note: try to use exprForValRef or the expression returned from mkLocal instead of this. val exprForVal : range -> Val -> Expr + +/// Build an expression corresponding to the use of a reference to a value val exprForValRef : range -> ValRef -> Expr -/// Return the local and an expression to reference it +/// Make a new local value and build an expression to reference it val mkLocal : range -> string -> TType -> Val * Expr + +/// Make a new compiler-generated local value and build an expression to reference it val mkCompGenLocal : range -> string -> TType -> Val * Expr + +/// Make a new mutable compiler-generated local value and build an expression to reference it val mkMutableCompGenLocal : range -> string -> TType -> Val * Expr -val mkCompGenLocalAndInvisbleBind : TcGlobals -> string -> range -> Expr -> Val * Expr * Binding -//------------------------------------------------------------------------- -// Make lambdas -//------------------------------------------------------------------------- +/// Make a new mutable compiler-generated local value, 'let' bind it to an expression +/// 'invisibly' (no sequence point etc.), and build an expression to reference it +val mkCompGenLocalAndInvisbleBind : TcGlobals -> string -> range -> Expr -> Val * Expr * Binding +/// Build a lambda expression taking multiple values val mkMultiLambda : range -> Val list -> Expr * TType -> Expr + +/// Rebuild a lambda during an expression tree traversal val rebuildLambda : range -> Val option -> Val option -> Val list -> Expr * TType -> Expr + +/// Build a lambda expression taking a single value val mkLambda : range -> Val -> Expr * TType -> Expr + +/// Build a generic lambda expression (type abstraction) val mkTypeLambda : range -> Typars -> Expr * TType -> Expr + +/// Build an object expression val mkObjExpr : TType * Val option * Expr * ObjExprMethod list * (TType * ObjExprMethod list) list * Range.range -> Expr + +/// Build an type-chose expression, indicating that a local free choice of a type variable val mkTypeChoose : range -> Typars -> Expr -> Expr + +/// Build an iterated (curried) lambda expression val mkLambdas : range -> Typars -> Val list -> Expr * TType -> Expr + +/// Build an iterated (tupled+curried) lambda expression val mkMultiLambdasCore : range -> Val list list -> Expr * TType -> Expr * TType + +/// Build an iterated generic (type abstraction + tupled+curried) lambda expression val mkMultiLambdas : range -> Typars -> Val list list -> Expr * TType -> Expr + +/// Build a lambda expression that corresponds to the implementation of a member val mkMemberLambdas : range -> Typars -> Val option -> Val option -> Val list list -> Expr * TType -> Expr +/// Build a 'while' loop expression val mkWhile : TcGlobals -> SequencePointInfoForWhileLoop * SpecialWhileLoopMarker * Expr * Expr * range -> Expr + +/// Build a 'for' loop expression val mkFor : TcGlobals -> SequencePointInfoForForLoop * Val * Expr * ForLoopStyle * Expr * Expr * range -> Expr + +/// Build a 'try/with' expression val mkTryWith : TcGlobals -> Expr * (* filter val *) Val * (* filter expr *) Expr * (* handler val *) Val * (* handler expr *) Expr * range * TType * SequencePointInfoForTry * SequencePointInfoForWith -> Expr -val mkTryFinally: TcGlobals -> Expr * Expr * range * TType * SequencePointInfoForTry * SequencePointInfoForFinally -> Expr -//------------------------------------------------------------------------- -// Make let/letrec -//------------------------------------------------------------------------- - +/// Build a 'try/finally' expression +val mkTryFinally: TcGlobals -> Expr * Expr * range * TType * SequencePointInfoForTry * SequencePointInfoForFinally -> Expr -// Generate a user-level let-bindings +/// Build a user-level value binding val mkBind : SequencePointInfoForBinding -> Val -> Expr -> Binding + +/// Build a user-level let-binding val mkLetBind : range -> Binding -> Expr -> Expr + +/// Build a user-level value sequence of let bindings val mkLetsBind : range -> Binding list -> Expr -> Expr + +/// Build a user-level value sequence of let bindings val mkLetsFromBindings : range -> Bindings -> Expr -> Expr + +/// Build a user-level let expression val mkLet : SequencePointInfoForBinding -> range -> Val -> Expr -> Expr -> Expr + +/// Make a binding that binds a function value to a lambda taking multiple arguments val mkMultiLambdaBind : Val -> SequencePointInfoForBinding -> range -> Typars -> Val list list -> Expr * TType -> Binding // Compiler generated bindings may involve a user variable. // Compiler generated bindings may give rise to a sequence point if they are part of // an SPAlways expression. Compiler generated bindings can arise from for example, inlining. val mkCompGenBind : Val -> Expr -> Binding + +/// Make a set of bindings that bind compiler generated values to corresponding expressions. +/// Compiler-generated bindings do not give rise to a sequence point in debugging. val mkCompGenBinds : Val list -> Exprs -> Bindings + +/// Make a let-expression that locally binds a compiler-generated value to an expression. +/// Compiler-generated bindings do not give rise to a sequence point in debugging. val mkCompGenLet : range -> Val -> Expr -> Expr -> Expr + +/// Make a let-expression that locally binds a compiler-generated value to an expression, where the expression +/// is returned by the given continuation. Compiler-generated bindings do not give rise to a sequence point in debugging. val mkCompGenLetIn: range -> string -> TType -> Expr -> (Val * Expr -> Expr) -> Expr -// Invisible bindings are never given a sequence point and should never have side effects +/// Make a let-expression that locally binds a value to an expression in an "invisible" way. +/// Invisible bindings are not given a sequence point and should not have side effects. val mkInvisibleLet : range -> Val -> Expr -> Expr -> Expr + +/// Make a binding that binds a value to an expression in an "invisible" way. +/// Invisible bindings are not given a sequence point and should not have side effects. val mkInvisibleBind : Val -> Expr -> Binding + +/// Make a set of bindings that bind values to expressions in an "invisible" way. +/// Invisible bindings are not given a sequence point and should not have side effects. val mkInvisibleBinds : Vals -> Exprs -> Bindings + +/// Make a let-rec expression that locally binds values to expressions where self-reference back to the values is possible. val mkLetRecBinds : range -> Bindings -> Expr -> Expr -//------------------------------------------------------------------------- -// Generalization/inference helpers -//------------------------------------------------------------------------- - /// TypeScheme (generalizedTypars, tauTy) /// /// generalizedTypars -- the truly generalized type parameters /// tauTy -- the body of the generalized type. A 'tau' type is one with its type parameters stripped off. type TypeScheme = TypeScheme of Typars * TType +/// Make the right-hand side of a generalized binding, incorporating the generalized generic parameters from the type +/// scheme into the right-hand side as type generalizations. val mkGenericBindRhs : TcGlobals -> range -> Typars -> TypeScheme -> Expr -> Expr -val isBeingGeneralized : Typar -> TypeScheme -> bool -//------------------------------------------------------------------------- -// Make lazy and/or -//------------------------------------------------------------------------- +/// Test if the type parameter is one of those being generalized by a type scheme. +val isBeingGeneralized : Typar -> TypeScheme -> bool +/// Make the expression corresponding to 'expr1 && expr2' val mkLazyAnd : TcGlobals -> range -> Expr -> Expr -> Expr + +/// Make the expression corresponding to 'expr1 || expr2' val mkLazyOr : TcGlobals -> range -> Expr -> Expr -> Expr + +/// Make a byref type val mkByrefTy : TcGlobals -> TType -> TType + +/// Make a byref type with a in/out kind inference parameter val mkByrefTyWithInference : TcGlobals -> TType -> TType -> TType + +/// Make a in-byref type with a in kind parameter val mkInByrefTy : TcGlobals -> TType -> TType -val mkOutByrefTy : TcGlobals -> TType -> TType -//------------------------------------------------------------------------- -// Make construction operations -//------------------------------------------------------------------------- +/// Make an out-byref type with an out kind parameter +val mkOutByrefTy : TcGlobals -> TType -> TType +/// Make an expression that constructs a union case, e.g. 'Some(expr)' val mkUnionCaseExpr : UnionCaseRef * TypeInst * Exprs * range -> Expr + +/// Make an expression that constructs an exception value val mkExnExpr : TyconRef * Exprs * range -> Expr + +/// Make an expression that is IL assembly code val mkAsmExpr : ILInstr list * TypeInst * Exprs * TTypes * range -> Expr + +/// Make an expression that coerces one expression to another type val mkCoerceExpr : Expr * TType * range * TType -> Expr -val mkReraise : range -> TType -> Expr -val mkReraiseLibCall : TcGlobals -> TType -> range -> Expr +/// Make an expression that re-raises an exception +val mkReraise : range -> TType -> Expr -//------------------------------------------------------------------------- -// Make projection operations -//------------------------------------------------------------------------- +/// Make an expression that re-raises an exception via a library call +val mkReraiseLibCall : TcGlobals -> TType -> range -> Expr +/// Make an expression that gets an item from a tuple val mkTupleFieldGet : TcGlobals -> TupInfo * Expr * TypeInst * int * range -> Expr + +/// Make an expression that gets an item from an anonymous record +val mkAnonRecdFieldGet : TcGlobals -> AnonRecdTypeInfo * Expr * TypeInst * int * range -> Expr + +/// Make an expression that gets an item from an anonymous record (via the address of the value if it is a struct) +val mkAnonRecdFieldGetViaExprAddr : AnonRecdTypeInfo * Expr * TypeInst * int * range -> Expr + +/// Make an expression that gets an instance field from a record or class (via the address of the value if it is a struct) val mkRecdFieldGetViaExprAddr : Expr * RecdFieldRef * TypeInst * range -> Expr + +/// Make an expression that gets the address of an instance field from a record or class (via the address of the value if it is a struct) val mkRecdFieldGetAddrViaExprAddr : readonly: bool * Expr * RecdFieldRef * TypeInst * range -> Expr + +/// Make an expression that gets a static field from a record or class val mkStaticRecdFieldGet : RecdFieldRef * TypeInst * range -> Expr + +/// Make an expression that sets a static field in a record or class val mkStaticRecdFieldSet : RecdFieldRef * TypeInst * Expr * range -> Expr + +/// Make an expression that gets the address of a static field in a record or class val mkStaticRecdFieldGetAddr : readonly: bool * RecdFieldRef * TypeInst * range -> Expr + +/// Make an expression that sets an instance the field of a record or class (via the address of the value if it is a struct) val mkRecdFieldSetViaExprAddr : Expr * RecdFieldRef * TypeInst * Expr * range -> Expr + +/// Make an expression that gets the tag of a union value (via the address of the value if it is a struct) val mkUnionCaseTagGetViaExprAddr : Expr * TyconRef * TypeInst * range -> Expr /// Make a 'TOp.UnionCaseProof' expression, which proves a union value is over a particular case (used only for ref-unions, not struct-unions) @@ -235,9 +319,13 @@ val mkUnionCaseFieldSet : Expr * UnionCaseRef * TypeInst * int * E /// Like mkUnionCaseFieldGetUnprovenViaExprAddr, but for struct-unions, the input should be a copy of the expression. val mkUnionCaseFieldGetUnproven : TcGlobals -> Expr * UnionCaseRef * TypeInst * int * range -> Expr +/// Make an expression that gets an instance field from an F# exception value val mkExnCaseFieldGet : Expr * TyconRef * int * range -> Expr + +/// Make an expression that sets an instance field in an F# exception value val mkExnCaseFieldSet : Expr * TyconRef * int * Expr * range -> Expr +/// Make an expression that gets the address of an element in an array val mkArrayElemAddress : TcGlobals -> readonly: bool * ILReadonly * bool * ILArrayShape * TType * Expr list * range -> Expr //------------------------------------------------------------------------- @@ -270,47 +358,59 @@ val mkGetTupleItemN : TcGlobals -> range -> int -> ILType -> bool -> Expr -> TTy /// but TupInfo may later be used carry variables that infer structness. val evalTupInfoIsStruct : TupInfo -> bool +/// Evaluate the AnonRecdTypeInfo to work out if it is a struct or a ref. +val evalAnonInfoIsStruct : AnonRecdTypeInfo -> bool + /// If it is a tuple type, ensure it's outermost type is a .NET tuple type, otherwise leave unchanged val convertToTypeWithMetadataIfPossible : TcGlobals -> TType -> TType - -//------------------------------------------------------------------------- -// Take the address of an expression, or force it into a mutable local. Any allocated -// mutable local may need to be kept alive over a larger expression, hence we return -// a wrapping function that wraps "let mutable loc = Expr in ..." around a larger -// expression. -//------------------------------------------------------------------------- - +/// An exception representing a warning for a defensive copy of an immutable struct exception DefensiveCopyWarning of string * range + type Mutates = AddressOfOp | DefinitelyMutates | PossiblyMutates | NeverMutates + +/// Helper to take the address of an expression val mkExprAddrOfExprAux : TcGlobals -> bool -> bool -> Mutates -> Expr -> ValRef option -> range -> (Val * Expr) option * Expr * bool * bool -val mkExprAddrOfExpr : TcGlobals -> bool -> bool -> Mutates -> Expr -> ValRef option -> range -> (Expr -> Expr) * Expr * bool * bool -//------------------------------------------------------------------------- -// Tables keyed on values and/or type parameters -//------------------------------------------------------------------------- +/// Take the address of an expression, or force it into a mutable local. Any allocated +/// mutable local may need to be kept alive over a larger expression, hence we return +/// a wrapping function that wraps "let mutable loc = Expr in ..." around a larger +/// expression. +val mkExprAddrOfExpr : TcGlobals -> bool -> bool -> Mutates -> Expr -> ValRef option -> range -> (Expr -> Expr) * Expr * bool * bool /// Maps Val to T, based on stamps [] type ValMap<'T> = + member Contents : StampMap<'T> + member Item : Val -> 'T with get + member TryFind : Val -> 'T option + member ContainsVal : Val -> bool + member Add : Val -> 'T -> ValMap<'T> + member Remove : Val -> ValMap<'T> + member IsEmpty : bool + static member Empty : ValMap<'T> + static member OfList : (Val * 'T) list -> ValMap<'T> /// Mutable data structure mapping Val's to T based on stamp keys [] type ValHash<'T> = + member Values : seq<'T> + member TryFind : Val -> 'T option + member Add : Val * 'T -> unit - static member Create : unit -> ValHash<'T> + static member Create : unit -> ValHash<'T> /// Maps Val's to list of T based on stamp keys [] @@ -328,97 +428,126 @@ type ValMultiMap<'T> = static member Empty : ValMultiMap<'T> +/// Maps type parameters to entries based on stamp keys [] -/// Maps Typar to T based on stamp keys type TyparMap<'T> = + /// Get the entry for the given type parameter member Item : Typar -> 'T with get + /// Determine is the map contains an entry for the given type parameter member ContainsKey : Typar -> bool + /// Try to find the entry for the given type parameter member TryFind : Typar -> 'T option + /// Make a new map, containing a new entry for the given type parameter member Add : Typar * 'T -> TyparMap<'T> + /// The empty map static member Empty : TyparMap<'T> -[] /// Maps TyconRef to T based on stamp keys +[] type TyconRefMap<'T> = + /// Get the entry for the given type definition member Item : TyconRef -> 'T with get + /// Try to find the entry for the given type definition member TryFind : TyconRef -> 'T option + /// Determine is the map contains an entry for the given type definition member ContainsKey : TyconRef -> bool + /// Make a new map, containing a new entry for the given type definition member Add : TyconRef -> 'T -> TyconRefMap<'T> + /// Remove the entry for the given type definition, if any member Remove : TyconRef -> TyconRefMap<'T> + /// Determine if the map is empty member IsEmpty : bool + /// The empty map static member Empty : TyconRefMap<'T> + /// Make a new map, containing entries for the given type definitions static member OfList : (TyconRef * 'T) list -> TyconRefMap<'T> /// Maps TyconRef to list of T based on stamp keys [] type TyconRefMultiMap<'T> = + /// Fetch the entries for the given type definition member Find : TyconRef -> 'T list + /// Make a new map, containing a new entry for the given type definition member Add : TyconRef * 'T -> TyconRefMultiMap<'T> + /// The empty map static member Empty : TyconRefMultiMap<'T> + /// Make a new map, containing a entries for the given type definitions static member OfList : (TyconRef * 'T) list -> TyconRefMultiMap<'T> -//------------------------------------------------------------------------- -// Orderings on Tycon, Val, RecdFieldRef, Typar -//------------------------------------------------------------------------- +/// An ordering for value definitions, based on stamp +val valOrder: IComparer -val valOrder : IComparer -val tyconOrder : IComparer -val recdFieldRefOrder : IComparer -val typarOrder : IComparer +/// An ordering for type definitions, based on stamp +val tyconOrder: IComparer -//------------------------------------------------------------------------- -// Equality on Tycon and Val -//------------------------------------------------------------------------- +/// An ordering for record fields, based on stamp +val recdFieldRefOrder: IComparer +/// An ordering for type parameters, based on stamp +val typarOrder: IComparer + +/// Equality for type definition references val tyconRefEq : TcGlobals -> TyconRef -> TyconRef -> bool + +/// Equality for value references val valRefEq : TcGlobals -> ValRef -> ValRef -> bool //------------------------------------------------------------------------- // Operations on types: substitution //------------------------------------------------------------------------- +/// Represents an instantiation where types replace type parameters type TyparInst = (Typar * TType) list +/// Represents an instantiation where type definition references replace other type definition references type TyconRefRemap = TyconRefMap + +/// Represents an instantiation where value references replace other value references type ValRemap = ValMap +/// Represents a combination of substitutions/instantiations where things replace other things during remapping [] type Remap = - { tpinst : TyparInst; - valRemap: ValRemap; - tyconRefRemap : TyconRefRemap; + { tpinst : TyparInst + valRemap: ValRemap + tyconRefRemap : TyconRefRemap removeTraitSolutions: bool } static member Empty : Remap val addTyconRefRemap : TyconRef -> TyconRef -> Remap -> Remap -val addValRemap : Val -> Val -> Remap -> Remap +val addValRemap : Val -> Val -> Remap -> Remap val mkTyparInst : Typars -> TTypes -> TyparInst + val mkTyconRefInst : TyconRef -> TypeInst -> TyparInst + val emptyTyparInst : TyparInst val instType : TyparInst -> TType -> TType + val instTypes : TyparInst -> TypeInst -> TypeInst + val instTyparConstraints : TyparInst -> TyparConstraint list -> TyparConstraint list + val instTrait : TyparInst -> TraitConstraintInfo -> TraitConstraintInfo //------------------------------------------------------------------------- @@ -426,8 +555,11 @@ val instTrait : TyparInst -> TraitConstraintInfo -> TraitConstraint //------------------------------------------------------------------------- val generalizeTypars : Typars -> TypeInst + val generalizeTyconRef : TyconRef -> TTypes * TType + val generalizedTyconRef : TyconRef -> TType + val mkTyparToTyparRenaming : Typars -> Typars -> TyparInst * TTypes //------------------------------------------------------------------------- @@ -435,12 +567,16 @@ val mkTyparToTyparRenaming : Typars -> Typars -> TyparInst * TTypes //------------------------------------------------------------------------- val reduceTyconRefAbbrev : TyconRef -> TypeInst -> TType + val reduceTyconRefMeasureableOrProvided : TcGlobals -> TyconRef -> TypeInst -> TType + val reduceTyconRefAbbrevMeasureable : TyconRef -> Measure /// set bool to 'true' to allow shortcutting of type parameter equation chains during stripping val stripTyEqnsA : TcGlobals -> bool -> TType -> TType + val stripTyEqns : TcGlobals -> TType -> TType + val stripTyEqnsAndMeasureEqns : TcGlobals -> TType -> TType val tryNormalizeMeasureInType : TcGlobals -> TType -> TType @@ -451,7 +587,9 @@ val tryNormalizeMeasureInType : TcGlobals -> TType -> TType /// See through F# exception abbreviations val stripExnEqns : TyconRef -> Tycon + val recdFieldsOfExnDefRef : TyconRef -> RecdField list + val recdFieldTysOfExnDefRef : TyconRef -> TType list //------------------------------------------------------------------------- @@ -460,57 +598,102 @@ val recdFieldTysOfExnDefRef : TyconRef -> TType list //------------------------------------------------------------------------- val destForallTy : TcGlobals -> TType -> Typars * TType + val destFunTy : TcGlobals -> TType -> TType * TType + val destAnyTupleTy : TcGlobals -> TType -> TupInfo * TTypes + val destRefTupleTy : TcGlobals -> TType -> TTypes + val destStructTupleTy : TcGlobals -> TType -> TTypes + val destTyparTy : TcGlobals -> TType -> Typar + val destAnyParTy : TcGlobals -> TType -> Typar + val destMeasureTy : TcGlobals -> TType -> Measure + val tryDestForallTy : TcGlobals -> TType -> Typars * TType val isFunTy : TcGlobals -> TType -> bool + val isForallTy : TcGlobals -> TType -> bool + val isAnyTupleTy : TcGlobals -> TType -> bool + val isRefTupleTy : TcGlobals -> TType -> bool + val isStructTupleTy : TcGlobals -> TType -> bool + +val isStructAnonRecdTy : TcGlobals -> TType -> bool + +val isAnonRecdTy : TcGlobals -> TType -> bool + val isUnionTy : TcGlobals -> TType -> bool + val isReprHiddenTy : TcGlobals -> TType -> bool + val isFSharpObjModelTy : TcGlobals -> TType -> bool + val isRecdTy : TcGlobals -> TType -> bool + val isFSharpStructOrEnumTy : TcGlobals -> TType -> bool + val isFSharpEnumTy : TcGlobals -> TType -> bool + val isTyparTy : TcGlobals -> TType -> bool + val isAnyParTy : TcGlobals -> TType -> bool -val tryAnyParTy : TcGlobals -> TType -> Typar option + +val tryAnyParTy : TcGlobals -> TType -> ValueOption + +val tryAnyParTyOption : TcGlobals -> TType -> Typar option + val isMeasureTy : TcGlobals -> TType -> bool val mkAppTy : TyconRef -> TypeInst -> TType val mkProvenUnionCaseTy : UnionCaseRef -> TypeInst -> TType + val isProvenUnionCaseTy : TType -> bool val isAppTy : TcGlobals -> TType -> bool + +val tryAppTy : TcGlobals -> TType -> ValueOption + val destAppTy : TcGlobals -> TType -> TyconRef * TypeInst + val tcrefOfAppTy : TcGlobals -> TType -> TyconRef -val tryDestAppTy : TcGlobals -> TType -> TyconRef option -val tryDestTyparTy : TcGlobals -> TType -> Typar option -val tryDestFunTy : TcGlobals -> TType -> (TType * TType) option + +val tryDestAppTy : TcGlobals -> TType -> ValueOption + +val tryDestTyparTy : TcGlobals -> TType -> ValueOption + +val tryDestFunTy : TcGlobals -> TType -> ValueOption<(TType * TType)> + +val tryDestAnonRecdTy : TcGlobals -> TType -> ValueOption + val argsOfAppTy : TcGlobals -> TType -> TypeInst + val mkInstForAppTy : TcGlobals -> TType -> TyparInst /// Try to get a TyconRef for a type without erasing type abbreviations -val tryNiceEntityRefOfTy : TType -> TyconRef option +val tryNiceEntityRefOfTy : TType -> ValueOption +val tryNiceEntityRefOfTyOption : TType -> TyconRef option val domainOfFunTy : TcGlobals -> TType -> TType + val rangeOfFunTy : TcGlobals -> TType -> TType + val stripFunTy : TcGlobals -> TType -> TType list * TType + val stripFunTyN : TcGlobals -> int -> TType -> TType list * TType val applyForallTy : TcGlobals -> TType -> TypeInst -> TType val tryDestAnyTupleTy : TcGlobals -> TType -> TupInfo * TType list + val tryDestRefTupleTy : TcGlobals -> TType -> TType list //------------------------------------------------------------------------- @@ -525,7 +708,9 @@ val actualTysOfUnionCaseFields : TyparInst -> UnionCaseRef -> TType list val actualTysOfInstanceRecdFields : TyparInst -> TyconRef -> TType list val actualTyOfRecdField : TyparInst -> RecdField -> TType + val actualTyOfRecdFieldRef : RecdFieldRef -> TypeInst -> TType + val actualTyOfRecdFieldForTycon : Tycon -> TypeInst -> RecdField -> TType //------------------------------------------------------------------------- @@ -535,14 +720,21 @@ val actualTyOfRecdFieldForTycon : Tycon -> TypeInst -> RecdField -> TType //------------------------------------------------------------------------- type UncurriedArgInfos = (TType * ArgReprInfo) list + type CurriedArgInfos = UncurriedArgInfos list val destTopForallTy : TcGlobals -> ValReprInfo -> TType -> Typars * TType + val GetTopTauTypeInFSharpForm : TcGlobals -> ArgReprInfo list list -> TType -> range -> CurriedArgInfos * TType + val GetTopValTypeInFSharpForm : TcGlobals -> ValReprInfo -> TType -> range -> Typars * CurriedArgInfos * TType * ArgReprInfo + val IsCompiledAsStaticProperty : TcGlobals -> Val -> bool + val IsCompiledAsStaticPropertyWithField : TcGlobals -> Val -> bool + val GetTopValTypeInCompiledForm : TcGlobals -> ValReprInfo -> TType -> range -> Typars * CurriedArgInfos * TType option * ArgReprInfo + val GetFSharpViewOfReturnType : TcGlobals -> TType option -> TType val NormalizeDeclaredTyparsForEquiRecursiveInference : TcGlobals -> Typars -> Typars @@ -558,40 +750,58 @@ val applyTys : TcGlobals -> TType -> TType list * 'T list -> TType //------------------------------------------------------------------------- val emptyFreeTypars : FreeTypars + val unionFreeTypars : FreeTypars -> FreeTypars -> FreeTypars val emptyFreeTycons : FreeTycons + val unionFreeTycons : FreeTycons -> FreeTycons -> FreeTycons val emptyFreeTyvars : FreeTyvars + val isEmptyFreeTyvars : FreeTyvars -> bool + val unionFreeTyvars : FreeTyvars -> FreeTyvars -> FreeTyvars val emptyFreeLocals : FreeLocals + val unionFreeLocals : FreeLocals -> FreeLocals -> FreeLocals type FreeVarOptions val CollectLocalsNoCaching : FreeVarOptions + val CollectTyparsNoCaching : FreeVarOptions + val CollectTyparsAndLocalsNoCaching : FreeVarOptions + val CollectTyparsAndLocals : FreeVarOptions + val CollectLocals : FreeVarOptions + val CollectTypars : FreeVarOptions + val CollectAllNoCaching : FreeVarOptions + val CollectAll : FreeVarOptions val accFreeInTypes : FreeVarOptions -> TType list -> FreeTyvars -> FreeTyvars + val accFreeInType : FreeVarOptions -> TType -> FreeTyvars -> FreeTyvars + val accFreeInTypars : FreeVarOptions -> Typars -> FreeTyvars -> FreeTyvars val freeInType : FreeVarOptions -> TType -> FreeTyvars + val freeInTypes : FreeVarOptions -> TType list -> FreeTyvars + val freeInVal : FreeVarOptions -> Val -> FreeTyvars // This one puts free variables in canonical left-to-right order. val freeInTypeLeftToRight : TcGlobals -> bool -> TType -> Typars + val freeInTypesLeftToRight : TcGlobals -> bool -> TType list -> Typars + val freeInTypesLeftToRightSkippingConstraints : TcGlobals -> TType list -> Typars val freeInModuleTy: ModuleOrNamespaceType -> FreeTyvars @@ -604,26 +814,41 @@ val isDimensionless : TcGlobals -> TType -> bool [] type TypeEquivEnv = - { EquivTypars: TyparMap; + { EquivTypars: TyparMap EquivTycons: TyconRefRemap } static member Empty : TypeEquivEnv + member BindEquivTypars : Typars -> Typars -> TypeEquivEnv + static member FromTyparInst : TyparInst -> TypeEquivEnv + static member FromEquivTypars : Typars -> Typars -> TypeEquivEnv val traitsAEquivAux : Erasure -> TcGlobals -> TypeEquivEnv -> TraitConstraintInfo -> TraitConstraintInfo -> bool + val traitsAEquiv : TcGlobals -> TypeEquivEnv -> TraitConstraintInfo -> TraitConstraintInfo -> bool + val typarConstraintsAEquivAux : Erasure -> TcGlobals -> TypeEquivEnv -> TyparConstraint -> TyparConstraint -> bool + val typarConstraintsAEquiv : TcGlobals -> TypeEquivEnv -> TyparConstraint -> TyparConstraint -> bool + val typarsAEquiv : TcGlobals -> TypeEquivEnv -> Typars -> Typars -> bool + val typeAEquivAux : Erasure -> TcGlobals -> TypeEquivEnv -> TType -> TType -> bool + val typeAEquiv : TcGlobals -> TypeEquivEnv -> TType -> TType -> bool + val returnTypesAEquivAux : Erasure -> TcGlobals -> TypeEquivEnv -> TType option -> TType option -> bool + val returnTypesAEquiv : TcGlobals -> TypeEquivEnv -> TType option -> TType option -> bool + val tcrefAEquiv : TcGlobals -> TypeEquivEnv -> TyconRef -> TyconRef -> bool + val valLinkageAEquiv : TcGlobals -> TypeEquivEnv -> Val -> Val -> bool +val anonInfoEquiv : AnonRecdTypeInfo -> AnonRecdTypeInfo -> bool + //------------------------------------------------------------------------- // Erasure of types wrt units-of-measure and type providers //------------------------------------------------------------------------- @@ -639,11 +864,17 @@ val getErasedTypes : TcGlobals -> TType -> TType list //------------------------------------------------------------------------- val MeasurePower : Measure -> int -> Measure + val ListMeasureVarOccsWithNonZeroExponents : Measure -> (Typar * Rational) list + val ListMeasureConOccsWithNonZeroExponents : TcGlobals -> bool -> Measure -> (TyconRef * Rational) list + val ProdMeasures : Measure list -> Measure + val MeasureVarExponent : Typar -> Measure -> Rational + val MeasureExprConExponent : TcGlobals -> bool -> TyconRef -> Measure -> Rational + val normalizeMeasure : TcGlobals -> Measure -> Measure @@ -652,19 +883,26 @@ val normalizeMeasure : TcGlobals -> Measure -> Measure //------------------------------------------------------------------------- val GetTypeOfMemberInFSharpForm : TcGlobals -> ValRef -> Typars * CurriedArgInfos * TType * ArgReprInfo + val GetTypeOfMemberInMemberForm : TcGlobals -> ValRef -> Typars * CurriedArgInfos * TType option * ArgReprInfo + val GetTypeOfIntrinsicMemberInCompiledForm : TcGlobals -> ValRef -> Typars * CurriedArgInfos * TType option * ArgReprInfo + val GetMemberTypeInMemberForm : TcGlobals -> MemberFlags -> ValReprInfo -> TType -> range -> Typars * CurriedArgInfos * TType option * ArgReprInfo /// Returns (parentTypars,memberParentTypars,memberMethodTypars,memberToParentInst,tinst) val PartitionValTyparsForApparentEnclosingType : TcGlobals -> Val -> (Typars * Typars * Typars * TyparInst * TType list) option + /// Returns (parentTypars,memberParentTypars,memberMethodTypars,memberToParentInst,tinst) val PartitionValTypars : TcGlobals -> Val -> (Typars * Typars * Typars * TyparInst * TType list) option + /// Returns (parentTypars,memberParentTypars,memberMethodTypars,memberToParentInst,tinst) val PartitionValRefTypars : TcGlobals -> ValRef -> (Typars * Typars * Typars * TyparInst * TType list) option val ReturnTypeOfPropertyVal : TcGlobals -> Val -> TType + val ArgInfosOfPropertyVal : TcGlobals -> Val -> UncurriedArgInfos + val ArgInfosOfMember: TcGlobals -> ValRef -> CurriedArgInfos val GetMemberCallInfo : TcGlobals -> ValRef * ValUseFlag -> int * bool * bool * bool * bool * bool * bool * bool @@ -675,68 +913,95 @@ val GetMemberCallInfo : TcGlobals -> ValRef * ValUseFlag -> int * bool * bool * type TyparConstraintsWithTypars = (Typar * TyparConstraint) list - module PrettyTypes = + val NeedsPrettyTyparName : Typar -> bool + val NewPrettyTypars : TyparInst -> Typars -> string list -> Typars * TyparInst + val PrettyTyparNames : (Typar -> bool) -> string list -> Typars -> string list + val PrettifyType : TcGlobals -> TType -> TType * TyparConstraintsWithTypars + val PrettifyInstAndTyparsAndType : TcGlobals -> TyparInst * Typars * TType -> (TyparInst * Typars * TType) * TyparConstraintsWithTypars + val PrettifyTypePair : TcGlobals -> TType * TType -> (TType * TType) * TyparConstraintsWithTypars + val PrettifyTypes : TcGlobals -> TTypes -> TTypes * TyparConstraintsWithTypars + val PrettifyInst : TcGlobals -> TyparInst -> TyparInst * TyparConstraintsWithTypars + val PrettifyInstAndType : TcGlobals -> TyparInst * TType -> (TyparInst * TType) * TyparConstraintsWithTypars + val PrettifyInstAndTypes : TcGlobals -> TyparInst * TTypes -> (TyparInst * TTypes) * TyparConstraintsWithTypars + val PrettifyInstAndSig : TcGlobals -> TyparInst * TTypes * TType -> (TyparInst * TTypes * TType) * TyparConstraintsWithTypars + val PrettifyCurriedTypes : TcGlobals -> TType list list -> TType list list * TyparConstraintsWithTypars + val PrettifyCurriedSigTypes : TcGlobals -> TType list list * TType -> (TType list list * TType) * TyparConstraintsWithTypars + val PrettifyInstAndUncurriedSig : TcGlobals -> TyparInst * UncurriedArgInfos * TType -> (TyparInst * UncurriedArgInfos * TType) * TyparConstraintsWithTypars + val PrettifyInstAndCurriedSig : TcGlobals -> TyparInst * TTypes * CurriedArgInfos * TType -> (TyparInst * TTypes * CurriedArgInfos * TType) * TyparConstraintsWithTypars [] type DisplayEnv = - { includeStaticParametersInTypeNames : bool; - openTopPathsSorted: Lazy; - openTopPathsRaw: string list list; - shortTypeNames: bool; - suppressNestedTypes: bool; - maxMembers : int option; - showObsoleteMembers: bool; - showHiddenMembers: bool; - showTyparBinding: bool; - showImperativeTyparAnnotations: bool; - suppressInlineKeyword:bool; - suppressMutableKeyword:bool; - showMemberContainers: bool; - shortConstraints:bool; - useColonForReturnType:bool; - showAttributes: bool; - showOverrides:bool; - showConstraintTyparAnnotations:bool; - abbreviateAdditionalConstraints: bool; + { includeStaticParametersInTypeNames : bool + openTopPathsSorted: Lazy + openTopPathsRaw: string list list + shortTypeNames: bool + suppressNestedTypes: bool + maxMembers : int option + showObsoleteMembers: bool + showHiddenMembers: bool + showTyparBinding: bool + showImperativeTyparAnnotations: bool + suppressInlineKeyword:bool + suppressMutableKeyword:bool + showMemberContainers: bool + shortConstraints:bool + useColonForReturnType:bool + showAttributes: bool + showOverrides:bool + showConstraintTyparAnnotations:bool + abbreviateAdditionalConstraints: bool showTyparDefaultConstraints: bool g: TcGlobals contextAccessibility: Accessibility generatedValueLayout:(Val -> layout option) } + member SetOpenPaths: string list list -> DisplayEnv + static member Empty: TcGlobals -> DisplayEnv member AddAccessibility : Accessibility -> DisplayEnv + member AddOpenPath : string list -> DisplayEnv + member AddOpenModuleOrNamespace : ModuleOrNamespaceRef -> DisplayEnv val tagEntityRefName: xref: EntityRef -> name: string -> StructuredFormat.TaggedText /// Return the full text for an item as we want it displayed to the user as a fully qualified entity val fullDisplayTextOfModRef : ModuleOrNamespaceRef -> string -val fullDisplayTextOfParentOfModRef : ModuleOrNamespaceRef -> string option + +val fullDisplayTextOfParentOfModRef : ModuleOrNamespaceRef -> ValueOption + val fullDisplayTextOfValRef : ValRef -> string + val fullDisplayTextOfValRefAsLayout : ValRef -> StructuredFormat.Layout + val fullDisplayTextOfTyconRef : TyconRef -> string + val fullDisplayTextOfTyconRefAsLayout : TyconRef -> StructuredFormat.Layout + val fullDisplayTextOfExnRef : TyconRef -> string + val fullDisplayTextOfExnRefAsLayout : TyconRef -> StructuredFormat.Layout + val fullDisplayTextOfUnionCaseRef : UnionCaseRef -> string + val fullDisplayTextOfRecdFieldRef : RecdFieldRef -> string val ticksAndArgCountTextOfTyconRef : TyconRef -> string @@ -747,22 +1012,23 @@ val qualifiedMangledNameOfTyconRef : TyconRef -> string -> string val trimPathByDisplayEnv : DisplayEnv -> string list -> string val prefixOfStaticReq : TyparStaticReq -> string + val prefixOfRigidTypar : Typar -> string /// Utilities used in simplifying types for visual presentation module SimplifyTypes = + type TypeSimplificationInfo = - { singletons : Typar Zset; - inplaceConstraints : Zmap; - postfixConstraints : TyparConstraintsWithTypars; } + { singletons : Typar Zset + inplaceConstraints : Zmap + postfixConstraints : TyparConstraintsWithTypars } + val typeSimplificationInfo0 : TypeSimplificationInfo - val CollectInfo : bool -> TType list -> TyparConstraintsWithTypars -> TypeSimplificationInfo -//------------------------------------------------------------------------- -// -//------------------------------------------------------------------------- + val CollectInfo : bool -> TType list -> TyparConstraintsWithTypars -> TypeSimplificationInfo val superOfTycon : TcGlobals -> Tycon -> TType + val abstractSlotValsOfTycons : Tycon list -> Val list //------------------------------------------------------------------------- @@ -770,11 +1036,15 @@ val abstractSlotValsOfTycons : Tycon list -> Val list //------------------------------------------------------------------------- val emptyFreeVars : FreeVars + val unionFreeVars : FreeVars -> FreeVars -> FreeVars val accFreeInTargets : FreeVarOptions -> DecisionTreeTarget array -> FreeVars -> FreeVars + val accFreeInExprs : FreeVarOptions -> Exprs -> FreeVars -> FreeVars + val accFreeInSwitchCases : FreeVarOptions -> DecisionTreeCase list -> DecisionTree option -> FreeVars -> FreeVars + val accFreeInDecisionTree : FreeVarOptions -> DecisionTree -> FreeVars -> FreeVars /// Get the free variables in a module definition. @@ -786,277 +1056,382 @@ val freeInExpr : FreeVarOptions -> Expr -> FreeVars /// Get the free variables in the right hand side of a binding. val freeInBindingRhs : FreeVarOptions -> Binding -> FreeVars +/// Check if a set of free type variables are all public val freeTyvarsAllPublic : FreeTyvars -> bool -val freeVarsAllPublic : FreeVars -> bool -//------------------------------------------------------------------------- -// Mark/range/position information from expressions -//------------------------------------------------------------------------- +/// Check if a set of free variables are all public +val freeVarsAllPublic : FreeVars -> bool +/// Get the mark/range/position information from an expression type Expr with member Range : range -//------------------------------------------------------------------------- -// type-of operations on the expression tree -//------------------------------------------------------------------------- - +/// Compute the type of an expression from the expression itself val tyOfExpr : TcGlobals -> Expr -> TType -//------------------------------------------------------------------------- -// Top expressions to implement top types -//------------------------------------------------------------------------- - +/// A flag to govern whether arity inference should be type-directed or syntax-directed when +/// inferring an arity from a lambda expression. [] -type AllowTypeDirectedDetupling = Yes | No +type AllowTypeDirectedDetupling = + | Yes + | No +/// Given a (curried) lambda expression, pull off its arguments val stripTopLambda : Expr * TType -> Typars * Val list list * Expr * TType + +/// Given a lambda expression, extract the ValReprInfo for its arguments and other details val InferArityOfExpr : TcGlobals -> AllowTypeDirectedDetupling -> TType -> Attribs list list -> Attribs -> Expr -> ValReprInfo + +/// Given a lambda binding, extract the ValReprInfo for its arguments and other details val InferArityOfExprBinding : TcGlobals -> AllowTypeDirectedDetupling -> Val -> Expr -> ValReprInfo -//------------------------------------------------------------------------- -// Copy expressions and types -//------------------------------------------------------------------------- - +/// Mutate a value to indicate it should be considered a local rather than a module-bound definition // REVIEW: this mutation should not be needed val setValHasNoArity : Val -> Val +/// Indicate what should happen to value definitions when copying expressions type ValCopyFlag = | CloneAll | CloneAllAndMarkExprValsAsCompilerGenerated - // OnlyCloneExprVals is a nasty setting to reuse the cloning logic in a mode where all - // Tycon and "module/member" Val objects keep their identity, but the Val objects for all Expr bindings - // are cloned. This is used to 'fixup' the TAST created by tlr.fs - // - // This is a fragile mode of use. It's not really clear why TLR needs to create a "bad" expression tree that - // reuses Val objects as multiple value bindings, and its been the cause of several subtle bugs. + + /// OnlyCloneExprVals is a nasty setting to reuse the cloning logic in a mode where all + /// Tycon and "module/member" Val objects keep their identity, but the Val objects for all Expr bindings + /// are cloned. This is used to 'fixup' the TAST created by tlr.fs + /// + /// This is a fragile mode of use. It's not really clear why TLR needs to create a "bad" expression tree that + /// reuses Val objects as multiple value bindings, and its been the cause of several subtle bugs. | OnlyCloneExprVals +/// Remap a reference to a type definition using the given remapping substitution val remapTyconRef : TyconRefRemap -> TyconRef -> TyconRef + +/// Remap a reference to a union case using the given remapping substitution val remapUnionCaseRef : TyconRefRemap -> UnionCaseRef -> UnionCaseRef + +/// Remap a reference to a record field using the given remapping substitution val remapRecdFieldRef : TyconRefRemap -> RecdFieldRef -> RecdFieldRef + +/// Remap a reference to a value using the given remapping substitution val remapValRef : Remap -> ValRef -> ValRef + +/// Remap an expression using the given remapping substitution val remapExpr : TcGlobals -> ValCopyFlag -> Remap -> Expr -> Expr + +/// Remap an attribute using the given remapping substitution val remapAttrib : TcGlobals -> Remap -> Attrib -> Attrib + +/// Remap a (possible generic) type using the given remapping substitution val remapPossibleForallTy : TcGlobals -> Remap -> TType -> TType + +/// Copy an entire module or namespace type using the given copying flags val copyModuleOrNamespaceType : TcGlobals -> ValCopyFlag -> ModuleOrNamespaceType -> ModuleOrNamespaceType + +/// Copy an entire expression using the given copying flags val copyExpr : TcGlobals -> ValCopyFlag -> Expr -> Expr + +/// Copy an entire implementation file using the given copying flags val copyImplFile : TcGlobals -> ValCopyFlag -> TypedImplFile -> TypedImplFile + +/// Copy a method slot signature, including new generic type parameters if the slot signature represents a generic method val copySlotSig : SlotSig -> SlotSig + +/// Instantiate the generic type parameters in a method slot signature, building a new one val instSlotSig : TyparInst -> SlotSig -> SlotSig -val instExpr : TcGlobals -> TyparInst -> Expr -> Expr -//------------------------------------------------------------------------- -// Build the remapping that corresponds to a module meeting its signature -// and also report the set of tycons, tycon representations and values hidden in the process. -//------------------------------------------------------------------------- +/// Instantiate the generic type parameters in an expression, building a new one +val instExpr : TcGlobals -> TyparInst -> Expr -> Expr +/// The remapping that corresponds to a module meeting its signature +/// and also report the set of tycons, tycon representations and values hidden in the process. type SignatureRepackageInfo = - { mrpiVals: (ValRef * ValRef) list; - mrpiEntities: (TyconRef * TyconRef) list } + { /// The list of corresponding values + RepackagedVals: (ValRef * ValRef) list + /// The list of corresponding modules, namespacea and type definitions + RepackagedEntities: (TyconRef * TyconRef) list } + + /// The empty table static member Empty : SignatureRepackageInfo +/// A set of tables summarizing the items hidden by a signature type SignatureHidingInfo = - { mhiTycons : Zset; - mhiTyconReprs : Zset; - mhiVals : Zset; - mhiRecdFields : Zset; - mhiUnionCases : Zset } + { HiddenTycons: Zset + HiddenTyconReprs: Zset + HiddenVals: Zset + HiddenRecdFields: Zset + HiddenUnionCases: Zset } + + /// The empty table representing no hiding static member Empty : SignatureHidingInfo -val ComputeRemappingFromInferredSignatureToExplicitSignature : TcGlobals -> ModuleOrNamespaceType -> ModuleOrNamespaceType -> SignatureRepackageInfo * SignatureHidingInfo +/// Compute the remapping information implied by a signature being inferred for a particular implementation val ComputeRemappingFromImplementationToSignature : TcGlobals -> ModuleOrNamespaceExpr -> ModuleOrNamespaceType -> SignatureRepackageInfo * SignatureHidingInfo + +/// Compute the remapping information implied by an explicit signature being given for an inferred signature +val ComputeRemappingFromInferredSignatureToExplicitSignature : TcGlobals -> ModuleOrNamespaceType -> ModuleOrNamespaceType -> SignatureRepackageInfo * SignatureHidingInfo + +/// Compute the hiding information that corresponds to the hiding applied at an assembly boundary val ComputeHidingInfoAtAssemblyBoundary : ModuleOrNamespaceType -> SignatureHidingInfo -> SignatureHidingInfo + val mkRepackageRemapping : SignatureRepackageInfo -> Remap +/// Wrap one module or namespace implementation in a 'namespace N' outer wrapper val wrapModuleOrNamespaceExprInNamespace : Ident -> CompilationPath -> ModuleOrNamespaceExpr -> ModuleOrNamespaceExpr + +/// Wrap one module or namespace definition in a 'namespace N' outer wrapper val wrapModuleOrNamespaceTypeInNamespace : Ident -> CompilationPath -> ModuleOrNamespaceType -> ModuleOrNamespaceType * ModuleOrNamespace + +/// Wrap one module or namespace definition in a 'module M = ..' outer wrapper val wrapModuleOrNamespaceType : Ident -> CompilationPath -> ModuleOrNamespaceType -> ModuleOrNamespace +/// Given an implementation, fetch its recorded signature val SigTypeOfImplFile : TypedImplFile -> ModuleOrNamespaceType -//------------------------------------------------------------------------- -// Given a list of top-most signatures that together constrain the public compilation units -// of an assembly, compute a remapping that converts local references to non-local references. -// This remapping must be applied to all pickled expressions and types -// exported from the assembly. -//------------------------------------------------------------------------- - +/// Given a namespace, module or type definition, try to produce a reference to that entity. +val tryRescopeEntity : CcuThunk -> Entity -> ValueOption -val tryRescopeEntity : CcuThunk -> Entity -> EntityRef option -val tryRescopeVal : CcuThunk -> Remap -> Val -> ValRef option +/// Given a value definition, try to produce a reference to that value. Fails for local values. +val tryRescopeVal : CcuThunk -> Remap -> Val -> ValueOption +/// Make the substitution (remapping) table for viewing a module or namespace 'from the outside' +/// +/// Given the top-most signatures constrains the public compilation units +/// of an assembly, compute a remapping that converts local references to non-local references. +/// This remapping must be applied to all pickled expressions and types +/// exported from the assembly. val MakeExportRemapping : CcuThunk -> ModuleOrNamespace -> Remap + +/// Make a remapping table for viewing a module or namespace 'from the outside' val ApplyExportRemappingToEntity : TcGlobals -> Remap -> ModuleOrNamespace -> ModuleOrNamespace -/// Query SignatureRepackageInfo +/// Determine if a type definition is hidden by a signature val IsHiddenTycon : (Remap * SignatureHidingInfo) list -> Tycon -> bool + +/// Determine if the representation of a type definition is hidden by a signature val IsHiddenTyconRepr : (Remap * SignatureHidingInfo) list -> Tycon -> bool + +/// Determine if a member, function or value is hidden by a signature val IsHiddenVal : (Remap * SignatureHidingInfo) list -> Val -> bool -val IsHiddenRecdField : (Remap * SignatureHidingInfo) list -> RecdFieldRef -> bool -//------------------------------------------------------------------------- -// Adjust marks in expressions -//------------------------------------------------------------------------- +/// Determine if a record field is hidden by a signature +val IsHiddenRecdField : (Remap * SignatureHidingInfo) list -> RecdFieldRef -> bool +/// Adjust marks in expressions, replacing all marks by thegiven mark. +/// Used when inlining. val remarkExpr : range -> Expr -> Expr - -//------------------------------------------------------------------------- -// Make applications -//------------------------------------------------------------------------- +/// Build the application of a (possibly generic, possibly curried) function value to a set of type and expression arguments val primMkApp : (Expr * TType) -> TypeInst -> Exprs -> range -> Expr + +/// Build the application of a (possibly generic, possibly curried) function value to a set of type and expression arguments. +/// Reduce the application via let-bindings if the function value is a lambda expression. val mkApps : TcGlobals -> (Expr * TType) * TType list list * Exprs * range -> Expr + +/// Build the application of a generic construct to a set of type arguments. +/// Reduce the application via substitution if the function value is a typed lambda expression. val mkTyAppExpr : range -> Expr * TType -> TType list -> Expr +/// Build an expression to mutate a local /// localv <- e val mkValSet : range -> ValRef -> Expr -> Expr + +/// Build an expression to mutate the contents of a local pointer /// *localv_ptr = e val mkAddrSet : range -> ValRef -> Expr -> Expr + +/// Build an expression to dereference a local pointer /// *localv_ptr val mkAddrGet : range -> ValRef -> Expr + +/// Build an expression to take the address of a local /// &localv val mkValAddr : range -> readonly: bool -> ValRef -> Expr -//------------------------------------------------------------------------- -// Note these take the address of the record expression if it is a struct, and -// apply a type instantiation if it is a first-class polymorphic record field. -//------------------------------------------------------------------------- - +/// Build an exression representing the read of an instance class or record field. +/// First take the address of the record expression if it is a struct. val mkRecdFieldGet : TcGlobals -> Expr * RecdFieldRef * TypeInst * range -> Expr -//------------------------------------------------------------------------- -// Get the targets used in a decision graph (for reporting warnings) -//------------------------------------------------------------------------- - +/// Accumulate the targets actually used in a decision graph (for reporting warnings) val accTargetsOfDecisionTree : DecisionTree -> int list -> int list -//------------------------------------------------------------------------- -// Optimizations on decision graphs -//------------------------------------------------------------------------- - +/// Make a 'match' expression applying some peep-hole optimizations along the way, e.g to +/// pre-decide the branch taken at compile-time. val mkAndSimplifyMatch : SequencePointInfoForBinding -> range -> range -> TType -> DecisionTree -> DecisionTreeTarget list -> Expr +/// Make a 'match' expression without applying any peep-hole optimizations. val primMkMatch : SequencePointInfoForBinding * range * DecisionTree * DecisionTreeTarget array * range * TType -> Expr -//------------------------------------------------------------------------- -// Work out what things on the r.h.s. of a let rec need to be fixed up -//------------------------------------------------------------------------- - +/// Work out what things on the right-han-side of a 'let rec' recursive binding need to be fixed up val IterateRecursiveFixups : TcGlobals -> Val option -> (Val option -> Expr -> (Expr -> Expr) -> Expr -> unit) -> Expr * (Expr -> Expr) -> Expr -> unit -//------------------------------------------------------------------------- -// From lambdas taking multiple variables to lambdas taking a single variable -// of tuple type. -//------------------------------------------------------------------------- - +/// Given a lambda expression taking multiple variables, build a corresponding lambda taking a tuple val MultiLambdaToTupledLambda : TcGlobals -> Val list -> Expr -> Val * Expr -val AdjustArityOfLambdaBody : TcGlobals -> int -> Val list -> Expr -> Val list * Expr -//------------------------------------------------------------------------- -// Make applications, doing beta reduction by introducing let-bindings -//------------------------------------------------------------------------- +/// Given a lambda expression, adjust it to have be one or two lambda expressions (fun a -> (fun b -> ...)) +/// where the first has the given arity. +val AdjustArityOfLambdaBody : TcGlobals -> int -> Val list -> Expr -> Val list * Expr +/// Make an application expression, doing beta reduction by introducing let-bindings val MakeApplicationAndBetaReduce : TcGlobals -> Expr * TType * TypeInst list * Exprs * range -> Expr +/// COmbine two static-resolution requirements on a type parameter val JoinTyparStaticReq : TyparStaticReq -> TyparStaticReq -> TyparStaticReq -//------------------------------------------------------------------------- -// More layout - this is for debugging -//------------------------------------------------------------------------- +/// Layout for internal compiler debugging purposes module DebugPrint = + /// A global flag indicating whether debug output should include ranges val layoutRanges : bool ref + + /// Convert a type to a string for debugging purposes val showType : TType -> string + + /// Convert an expression to a string for debugging purposes val showExpr : Expr -> string + /// Debug layout for a reference to a value val valRefL : ValRef -> layout + + /// Debug layout for a reference to a union case val unionCaseRefL : UnionCaseRef -> layout - val vspecAtBindL : Val -> layout + + /// Debug layout for an value definition at its binding site + val valAtBindL : Val -> layout + + /// Debug layout for an integer val intL : int -> layout + + /// Debug layout for a value definition val valL : Val -> layout + + /// Debug layout for a type parameter definition val typarDeclL : Typar -> layout + + /// Debug layout for a trait constraint val traitL : TraitConstraintInfo -> layout + + /// Debug layout for a type parameter val typarL : Typar -> layout + + /// Debug layout for a set of type parameters val typarsL : Typars -> layout + + /// Debug layout for a type val typeL : TType -> layout + + /// Debug layout for a method slot signature val slotSigL : SlotSig -> layout + + /// Debug layout for the type signature of a module or namespace definition val entityTypeL : ModuleOrNamespaceType -> layout + + /// Debug layout for a module or namespace definition val entityL : ModuleOrNamespace -> layout + + /// Debug layout for the type of a value val typeOfValL : Val -> layout + + /// Debug layout for a binding of an expression to a value val bindingL : Binding -> layout + + /// Debug layout for an expression val exprL : Expr -> layout + + /// Debug layout for a type definition val tyconL : Tycon -> layout + + /// Debug layout for a decision tree val decisionTreeL : DecisionTree -> layout + + /// Debug layout for an implementation file val implFileL : TypedImplFile -> layout + + /// Debug layout for a list of implementation files val implFilesL : TypedImplFile list -> layout - val recdFieldRefL : RecdFieldRef -> layout -//------------------------------------------------------------------------- -// Fold on expressions -//------------------------------------------------------------------------- + /// Debug layout for class and record fields + val recdFieldRefL : RecdFieldRef -> layout +/// A set of function parameters (visitor) for folding over expressions type ExprFolder<'State> = - { exprIntercept : ('State -> Expr -> 'State) -> 'State -> Expr -> 'State option; - valBindingSiteIntercept : 'State -> bool * Val -> 'State; - nonRecBindingsIntercept : 'State -> Binding -> 'State; - recBindingsIntercept : 'State -> Bindings -> 'State; - dtreeIntercept : 'State -> DecisionTree -> 'State; - targetIntercept : ('State -> Expr -> 'State) -> 'State -> DecisionTreeTarget -> 'State option; - tmethodIntercept : ('State -> Expr -> 'State) -> 'State -> ObjExprMethod -> 'State option;} + { exprIntercept : ('State -> Expr -> 'State) -> 'State -> Expr -> 'State option + valBindingSiteIntercept : 'State -> bool * Val -> 'State + nonRecBindingsIntercept : 'State -> Binding -> 'State + recBindingsIntercept : 'State -> Bindings -> 'State + dtreeIntercept : 'State -> DecisionTree -> 'State + targetIntercept : ('State -> Expr -> 'State) -> 'State -> DecisionTreeTarget -> 'State option + tmethodIntercept : ('State -> Expr -> 'State) -> 'State -> ObjExprMethod -> 'State option} + +/// The empty set of actions for folding over expressions val ExprFolder0 : ExprFolder<'State> + +/// Fold over all the expressions in an implementation file val FoldImplFile: ExprFolder<'State> -> ('State -> TypedImplFile -> 'State) + +/// Fold over all the expressions in an expression val FoldExpr : ExprFolder<'State> -> ('State -> Expr -> 'State) #if DEBUG +/// Extract some statistics from an expression val ExprStats : Expr -> string #endif -//------------------------------------------------------------------------- -// Make some common types -//------------------------------------------------------------------------- - +/// Build a nativeptr type val mkNativePtrTy : TcGlobals -> TType -> TType + +/// Build a 'voidptr' type val mkVoidPtrTy : TcGlobals -> TType + +/// Build a single-dimensional array type val mkArrayType : TcGlobals -> TType -> TType + +/// Determine is a type is an option type val isOptionTy : TcGlobals -> TType -> bool + +/// Take apart an option type val destOptionTy : TcGlobals -> TType -> TType -val tryDestOptionTy : TcGlobals -> TType -> TType option +/// Try to take apart an option type +val tryDestOptionTy : TcGlobals -> TType -> ValueOption + +/// Determine if a type is a System.Linq.Expression type val isLinqExpressionTy : TcGlobals -> TType -> bool -val destLinqExpressionTy : TcGlobals -> TType -> TType -val tryDestLinqExpressionTy : TcGlobals -> TType -> TType option -(* -val isQuoteExprTy : TcGlobals -> TType -> bool -val destQuoteExprTy : TcGlobals -> TType -> TType -val tryDestQuoteExprTy : TcGlobals -> TType -> TType option -*) +/// Take apart a System.Linq.Expression type +val destLinqExpressionTy : TcGlobals -> TType -> TType -//------------------------------------------------------------------------- -// Primitives associated with compiling the IEvent idiom to .NET events -//------------------------------------------------------------------------- +/// Try to take apart a System.Linq.Expression type +val tryDestLinqExpressionTy : TcGlobals -> TType -> TType option +/// Determine if a type is an IDelegateEvent type val isIDelegateEventType : TcGlobals -> TType -> bool + +/// Take apart an IDelegateEvent type val destIDelegateEventType : TcGlobals -> TType -> TType + +/// Build an IEvent type val mkIEventType : TcGlobals -> TType -> TType -> TType + +/// Build an IObservable type val mkIObservableType : TcGlobals -> TType -> TType -val mkIObserverType : TcGlobals -> TType -> TType -//------------------------------------------------------------------------- -// Primitives associated with printf format string parsing -//------------------------------------------------------------------------- +/// Build an IObserver type +val mkIObserverType : TcGlobals -> TType -> TType +/// Build an Lazy type val mkLazyTy : TcGlobals -> TType -> TType + +/// Build an PrintFormat type val mkPrintfFormatTy : TcGlobals -> TType -> TType -> TType -> TType -> TType -> TType //------------------------------------------------------------------------- // Classify types //------------------------------------------------------------------------- +/// Represents metadata extracted from a nominal type type TypeDefMetadata = | ILTypeMetadata of TILObjectReprData | FSharpOrArrayOrByrefOrTupleOrExnTypeMetadata @@ -1064,43 +1439,94 @@ type TypeDefMetadata = | ProvidedTypeMetadata of TProvidedTypeInfo #endif +/// Extract metadata from a type definition val metadataOfTycon : Tycon -> TypeDefMetadata + +/// Extract metadata from a type val metadataOfTy : TcGlobals -> TType -> TypeDefMetadata -val isStringTy : TcGlobals -> TType -> bool -val isListTy : TcGlobals -> TType -> bool -val isILAppTy : TcGlobals -> TType -> bool -val isArrayTy : TcGlobals -> TType -> bool -val isArray1DTy : TcGlobals -> TType -> bool -val destArrayTy : TcGlobals -> TType -> TType -val destListTy : TcGlobals -> TType -> TType +/// Determine if a type is the System.String type +val isStringTy : TcGlobals -> TType -> bool + +/// Determine if a type is an F# list type +val isListTy : TcGlobals -> TType -> bool + +/// Determine if a type is a nominal .NET type +val isILAppTy : TcGlobals -> TType -> bool + +/// Determine if a type is any kind of array type +val isArrayTy : TcGlobals -> TType -> bool + +/// Determine if a type is a single-dimensional array type +val isArray1DTy : TcGlobals -> TType -> bool + +/// Get the element type of an array type +val destArrayTy : TcGlobals -> TType -> TType + +/// Get the element type of an F# list type +val destListTy : TcGlobals -> TType -> TType + +/// Build an array type of the given rank +val mkArrayTy : TcGlobals -> int -> TType -> range -> TType -val mkArrayTy : TcGlobals -> int -> TType -> range -> TType -val isArrayTyconRef : TcGlobals -> TyconRef -> bool +/// Check if a type definition is one of the artifical type definitions used for array types of different ranks +val isArrayTyconRef : TcGlobals -> TyconRef -> bool + +/// Determine the rank of one of the artifical type definitions used for array types val rankOfArrayTyconRef : TcGlobals -> TyconRef -> int -val isUnitTy : TcGlobals -> TType -> bool -val isObjTy : TcGlobals -> TType -> bool -val isVoidTy : TcGlobals -> TType -> bool +/// Determine if a type is the F# unit type +val isUnitTy : TcGlobals -> TType -> bool + +/// Determine if a type is the System.Object type +val isObjTy : TcGlobals -> TType -> bool + +/// Determine if a type is the System.Void type +val isVoidTy : TcGlobals -> TType -> bool /// Get the element type of an array type -val destArrayTy : TcGlobals -> TType -> TType +val destArrayTy : TcGlobals -> TType -> TType + /// Get the rank of an array type val rankOfArrayTy : TcGlobals -> TType -> int -val isInterfaceTyconRef : TyconRef -> bool +/// Determine if a reference to a type definition is an interface type +val isInterfaceTyconRef : TyconRef -> bool + +/// Determine if a type is a delegate type +val isDelegateTy : TcGlobals -> TType -> bool + +/// Determine if a type is an interface type +val isInterfaceTy : TcGlobals -> TType -> bool + +/// Determine if a type is a FSharpRef type +val isRefTy : TcGlobals -> TType -> bool -val isDelegateTy : TcGlobals -> TType -> bool -val isInterfaceTy : TcGlobals -> TType -> bool -val isRefTy : TcGlobals -> TType -> bool -val isSealedTy : TcGlobals -> TType -> bool -val isComInteropTy : TcGlobals -> TType -> bool -val underlyingTypeOfEnumTy : TcGlobals -> TType -> TType -val normalizeEnumTy : TcGlobals -> TType -> TType +/// Determine if a type is a sealed type +val isSealedTy : TcGlobals -> TType -> bool + +/// Determine if a type is a ComInterop type +val isComInteropTy : TcGlobals -> TType -> bool + +/// Determine the underlying type of an enum type (normally int32) +val underlyingTypeOfEnumTy : TcGlobals -> TType -> TType + +/// If the input type is an enum type, then convert to its underlying type, otherwise return the input type +val normalizeEnumTy : TcGlobals -> TType -> TType + +/// Determine if a type is a struct type val isStructTy : TcGlobals -> TType -> bool + +/// Determine if a type is an unmanaged type val isUnmanagedTy : TcGlobals -> TType -> bool + +/// Determine if a type is a class type val isClassTy : TcGlobals -> TType -> bool + +/// Determine if a type is an enum type val isEnumTy : TcGlobals -> TType -> bool + +/// Determine if a type is a struct, record or union type val isStructRecordOrUnionTyconTy : TcGlobals -> TType -> bool /// For "type Class as self", 'self' is fixed up after initialization. To support this, @@ -1108,9 +1534,16 @@ val isStructRecordOrUnionTyconTy : TcGlobals -> TType -> bool /// returns the underlying type. val StripSelfRefCell : TcGlobals * ValBaseOrThisInfo * TType -> TType +/// An active pattern to determine if a type is a nominal type, possibly instantiated val (|AppTy|_|) : TcGlobals -> TType -> (TyconRef * TType list) option + +/// An active pattern to match System.Nullable types val (|NullableTy|_|) : TcGlobals -> TType -> TType option + +/// An active pattern to transform System.Nullable types to their input, otherwise leave the input unchanged val (|StripNullableTy|) : TcGlobals -> TType -> TType + +/// Matches any byref type, yielding the target type val (|ByrefTy|_|) : TcGlobals -> TType -> TType option //------------------------------------------------------------------------- @@ -1118,35 +1551,53 @@ val (|ByrefTy|_|) : TcGlobals -> TType -> TType option //------------------------------------------------------------------------- val IsUnionTypeWithNullAsTrueValue: TcGlobals -> Tycon -> bool + val TyconHasUseNullAsTrueValueAttribute : TcGlobals -> Tycon -> bool + val CanHaveUseNullAsTrueValueAttribute : TcGlobals -> Tycon -> bool + val MemberIsCompiledAsInstance : TcGlobals -> TyconRef -> bool -> ValMemberInfo -> Attribs -> bool + val ValSpecIsCompiledAsInstance : TcGlobals -> Val -> bool + val ValRefIsCompiledAsInstanceMember : TcGlobals -> ValRef -> bool + val ModuleNameIsMangled : TcGlobals -> Attribs -> bool val CompileAsEvent : TcGlobals -> Attribs -> bool val TypeNullIsExtraValue : TcGlobals -> range -> TType -> bool + val TypeNullIsTrueValue : TcGlobals -> TType -> bool + val TypeNullNotLiked : TcGlobals -> range -> TType -> bool + val TypeNullNever : TcGlobals -> TType -> bool val TypeSatisfiesNullConstraint : TcGlobals -> range -> TType -> bool + val TypeHasDefaultValue : TcGlobals -> range -> TType -> bool val isAbstractTycon : Tycon -> bool val isUnionCaseRefDefinitelyMutable : UnionCaseRef -> bool + val isRecdOrUnionOrStructTyconRefDefinitelyMutable : TyconRef -> bool + val isExnDefinitelyMutable : TyconRef -> bool + val isUnionCaseFieldMutable : TcGlobals -> UnionCaseRef -> int -> bool + val isExnFieldMutable : TyconRef -> int -> bool + val isRecdOrStructTyconRefReadOnly: TcGlobals -> range -> TyconRef -> bool + val isRecdOrStructTyconRefAssumedImmutable: TcGlobals -> TyconRef -> bool + val isRecdOrStructTyReadOnly: TcGlobals -> range -> TType -> bool val useGenuineField : Tycon -> RecdField -> bool + val ComputeFieldName : Tycon -> RecdField -> string //------------------------------------------------------------------------- @@ -1154,6 +1605,7 @@ val ComputeFieldName : Tycon -> RecdField -> string //------------------------------------------------------------------------- val slotSigHasVoidReturnTy : SlotSig -> bool + val actualReturnTyOfSlotSig : TypeInst -> TypeInst -> SlotSig -> TType option val returnTyOfMethod : TcGlobals -> ObjExprMethod -> TType option @@ -1163,25 +1615,37 @@ val returnTyOfMethod : TcGlobals -> ObjExprMethod -> TType option //------------------------------------------------------------------------- val mkRefCell : TcGlobals -> range -> TType -> Expr -> Expr + val mkRefCellGet : TcGlobals -> range -> TType -> Expr -> Expr + val mkRefCellSet : TcGlobals -> range -> TType -> Expr -> Expr -> Expr + val mkLazyDelayed : TcGlobals -> range -> TType -> Expr -> Expr -val mkLazyForce : TcGlobals -> range -> TType -> Expr -> Expr +val mkLazyForce : TcGlobals -> range -> TType -> Expr -> Expr val mkRefCellContentsRef : TcGlobals -> RecdFieldRef + val isRefCellTy : TcGlobals -> TType -> bool + val destRefCellTy : TcGlobals -> TType -> TType + val mkRefCellTy : TcGlobals -> TType -> TType val mkSeqTy : TcGlobals -> TType -> TType + val mkIEnumeratorTy : TcGlobals -> TType -> TType + val mkListTy : TcGlobals -> TType -> TType + val mkOptionTy : TcGlobals -> TType -> TType + val mkNoneCase : TcGlobals -> UnionCaseRef + val mkSomeCase : TcGlobals -> UnionCaseRef val mkNil : TcGlobals -> range -> TType -> Expr + val mkCons : TcGlobals -> TType -> Expr -> Expr -> Expr //------------------------------------------------------------------------- @@ -1189,17 +1653,29 @@ val mkCons : TcGlobals -> TType -> Expr -> Expr -> Expr //------------------------------------------------------------------------- val mkSequential : SequencePointInfoForSeq -> range -> Expr -> Expr -> Expr + val mkCompGenSequential : range -> Expr -> Expr -> Expr + val mkSequentials : SequencePointInfoForSeq -> TcGlobals -> range -> Exprs -> Expr + val mkRecordExpr : TcGlobals -> RecordConstructionInfo * TyconRef * TypeInst * RecdFieldRef list * Exprs * range -> Expr + val mkUnbox : TType -> Expr -> range -> Expr + val mkBox : TType -> Expr -> range -> Expr + val mkIsInst : TType -> Expr -> range -> Expr + val mkNull : range -> TType -> Expr + val mkNullTest : TcGlobals -> range -> Expr -> Expr -> Expr -> Expr + val mkNonNullTest : TcGlobals -> range -> Expr -> Expr + val mkIsInstConditional : TcGlobals -> range -> TType -> Expr -> Val -> Expr -> Expr -> Expr + val mkThrow : range -> TType -> Expr -> Expr + val mkGetArg0 : range -> TType -> Expr val mkDefault : range * TType -> Expr @@ -1207,18 +1683,31 @@ val mkDefault : range * TType -> Expr val isThrow : Expr -> bool val mkString : TcGlobals -> range -> string -> Expr + val mkBool : TcGlobals -> range -> bool -> Expr + val mkByte : TcGlobals -> range -> byte -> Expr + val mkUInt16 : TcGlobals -> range -> uint16 -> Expr + val mkTrue : TcGlobals -> range -> Expr + val mkFalse : TcGlobals -> range -> Expr + val mkUnit : TcGlobals -> range -> Expr + val mkInt32 : TcGlobals -> range -> int32 -> Expr + val mkInt : TcGlobals -> range -> int -> Expr + val mkZero : TcGlobals -> range -> Expr + val mkOne : TcGlobals -> range -> Expr + val mkTwo : TcGlobals -> range -> Expr + val mkMinusOne : TcGlobals -> range -> Expr + val destInt32 : Expr -> int32 option //------------------------------------------------------------------------- @@ -1226,8 +1715,11 @@ val destInt32 : Expr -> int32 option //------------------------------------------------------------------------- val isQuotedExprTy : TcGlobals -> TType -> bool + val destQuotedExprTy : TcGlobals -> TType -> TType + val mkQuotedExprTy : TcGlobals -> TType -> TType + val mkRawQuotedExprTy : TcGlobals -> TType //------------------------------------------------------------------------- @@ -1235,9 +1727,13 @@ val mkRawQuotedExprTy : TcGlobals -> TType //------------------------------------------------------------------------- val mspec_Type_GetTypeFromHandle : TcGlobals -> ILMethodSpec + val fspec_Missing_Value : TcGlobals -> ILFieldSpec + val mkInitializeArrayMethSpec: TcGlobals -> ILMethodSpec + val mkByteArrayTy : TcGlobals -> TType + val mkInvalidCastExnNewobj: TcGlobals -> ILInstr @@ -1248,122 +1744,207 @@ val mkInvalidCastExnNewobj: TcGlobals -> ILInstr val mkCallNewFormat : TcGlobals -> range -> TType -> TType -> TType -> TType -> TType -> Expr -> Expr val mkCallUnbox : TcGlobals -> range -> TType -> Expr -> Expr + val mkCallGetGenericComparer : TcGlobals -> range -> Expr + val mkCallGetGenericEREqualityComparer : TcGlobals -> range -> Expr + val mkCallGetGenericPEREqualityComparer : TcGlobals -> range -> Expr val mkCallUnboxFast : TcGlobals -> range -> TType -> Expr -> Expr + val canUseUnboxFast : TcGlobals -> range -> TType -> bool val mkCallDispose : TcGlobals -> range -> TType -> Expr -> Expr + val mkCallSeq : TcGlobals -> range -> TType -> Expr -> Expr val mkCallTypeTest : TcGlobals -> range -> TType -> Expr -> Expr + val canUseTypeTestFast : TcGlobals -> TType -> bool val mkCallTypeOf : TcGlobals -> range -> TType -> Expr + val mkCallTypeDefOf : TcGlobals -> range -> TType -> Expr val mkCallCreateInstance : TcGlobals -> range -> TType -> Expr + val mkCallCreateEvent : TcGlobals -> range -> TType -> TType -> Expr -> Expr -> Expr -> Expr + val mkCallArrayLength : TcGlobals -> range -> TType -> Expr -> Expr + val mkCallArrayGet : TcGlobals -> range -> TType -> Expr -> Expr -> Expr + val mkCallArray2DGet : TcGlobals -> range -> TType -> Expr -> Expr -> Expr -> Expr + val mkCallArray3DGet : TcGlobals -> range -> TType -> Expr -> Expr -> Expr -> Expr -> Expr + val mkCallArray4DGet : TcGlobals -> range -> TType -> Expr -> Expr -> Expr -> Expr -> Expr -> Expr + val mkCallArraySet : TcGlobals -> range -> TType -> Expr -> Expr -> Expr -> Expr + val mkCallArray2DSet : TcGlobals -> range -> TType -> Expr -> Expr -> Expr -> Expr -> Expr + val mkCallArray3DSet : TcGlobals -> range -> TType -> Expr -> Expr -> Expr -> Expr -> Expr -> Expr + val mkCallArray4DSet : TcGlobals -> range -> TType -> Expr -> Expr -> Expr -> Expr -> Expr -> Expr -> Expr val mkCallHash : TcGlobals -> range -> TType -> Expr -> Expr + val mkCallBox : TcGlobals -> range -> TType -> Expr -> Expr + val mkCallIsNull : TcGlobals -> range -> TType -> Expr -> Expr + val mkCallIsNotNull : TcGlobals -> range -> TType -> Expr -> Expr + val mkCallRaise : TcGlobals -> range -> TType -> Expr -> Expr val mkCallGenericComparisonWithComparerOuter : TcGlobals -> range -> TType -> Expr -> Expr -> Expr -> Expr + val mkCallGenericEqualityEROuter : TcGlobals -> range -> TType -> Expr -> Expr -> Expr + val mkCallGenericEqualityWithComparerOuter : TcGlobals -> range -> TType -> Expr -> Expr -> Expr -> Expr + val mkCallGenericHashWithComparerOuter : TcGlobals -> range -> TType -> Expr -> Expr -> Expr val mkCallEqualsOperator : TcGlobals -> range -> TType -> Expr -> Expr -> Expr + val mkCallNotEqualsOperator : TcGlobals -> range -> TType -> Expr -> Expr -> Expr + val mkCallLessThanOperator : TcGlobals -> range -> TType -> Expr -> Expr -> Expr + val mkCallLessThanOrEqualsOperator : TcGlobals -> range -> TType -> Expr -> Expr -> Expr + val mkCallGreaterThanOperator : TcGlobals -> range -> TType -> Expr -> Expr -> Expr + val mkCallGreaterThanOrEqualsOperator : TcGlobals -> range -> TType -> Expr -> Expr -> Expr val mkCallAdditionOperator : TcGlobals -> range -> TType -> Expr -> Expr -> Expr + val mkCallSubtractionOperator : TcGlobals -> range -> TType -> Expr -> Expr -> Expr + val mkCallMultiplyOperator : TcGlobals -> range -> TType -> Expr -> Expr -> Expr + val mkCallDivisionOperator : TcGlobals -> range -> TType -> Expr -> Expr -> Expr + val mkCallModulusOperator : TcGlobals -> range -> TType -> Expr -> Expr -> Expr + val mkCallBitwiseAndOperator : TcGlobals -> range -> TType -> Expr -> Expr -> Expr + val mkCallBitwiseOrOperator : TcGlobals -> range -> TType -> Expr -> Expr -> Expr + val mkCallBitwiseXorOperator : TcGlobals -> range -> TType -> Expr -> Expr -> Expr + val mkCallShiftLeftOperator : TcGlobals -> range -> TType -> Expr -> Expr -> Expr + val mkCallShiftRightOperator : TcGlobals -> range -> TType -> Expr -> Expr -> Expr val mkCallUnaryNegOperator : TcGlobals -> range -> TType -> Expr -> Expr + val mkCallUnaryNotOperator : TcGlobals -> range -> TType -> Expr -> Expr val mkCallAdditionChecked : TcGlobals -> range -> TType -> Expr -> Expr -> Expr + val mkCallSubtractionChecked : TcGlobals -> range -> TType -> Expr -> Expr -> Expr + val mkCallMultiplyChecked : TcGlobals -> range -> TType -> Expr -> Expr -> Expr + val mkCallUnaryNegChecked : TcGlobals -> range -> TType -> Expr -> Expr val mkCallToByteChecked : TcGlobals -> range -> TType -> Expr -> Expr + val mkCallToSByteChecked : TcGlobals -> range -> TType -> Expr -> Expr + val mkCallToInt16Checked : TcGlobals -> range -> TType -> Expr -> Expr + val mkCallToUInt16Checked : TcGlobals -> range -> TType -> Expr -> Expr + val mkCallToIntChecked : TcGlobals -> range -> TType -> Expr -> Expr + val mkCallToInt32Checked : TcGlobals -> range -> TType -> Expr -> Expr + val mkCallToUInt32Checked : TcGlobals -> range -> TType -> Expr -> Expr + val mkCallToInt64Checked : TcGlobals -> range -> TType -> Expr -> Expr + val mkCallToUInt64Checked : TcGlobals -> range -> TType -> Expr -> Expr + val mkCallToIntPtrChecked : TcGlobals -> range -> TType -> Expr -> Expr + val mkCallToUIntPtrChecked : TcGlobals -> range -> TType -> Expr -> Expr val mkCallToByteOperator : TcGlobals -> range -> TType -> Expr -> Expr + val mkCallToSByteOperator : TcGlobals -> range -> TType -> Expr -> Expr + val mkCallToInt16Operator : TcGlobals -> range -> TType -> Expr -> Expr + val mkCallToUInt16Operator : TcGlobals -> range -> TType -> Expr -> Expr + val mkCallToIntOperator : TcGlobals -> range -> TType -> Expr -> Expr + val mkCallToInt32Operator : TcGlobals -> range -> TType -> Expr -> Expr + val mkCallToUInt32Operator : TcGlobals -> range -> TType -> Expr -> Expr + val mkCallToInt64Operator : TcGlobals -> range -> TType -> Expr -> Expr + val mkCallToUInt64Operator : TcGlobals -> range -> TType -> Expr -> Expr + val mkCallToSingleOperator : TcGlobals -> range -> TType -> Expr -> Expr + val mkCallToDoubleOperator : TcGlobals -> range -> TType -> Expr -> Expr + val mkCallToIntPtrOperator : TcGlobals -> range -> TType -> Expr -> Expr + val mkCallToUIntPtrOperator : TcGlobals -> range -> TType -> Expr -> Expr val mkCallToCharOperator : TcGlobals -> range -> TType -> Expr -> Expr + val mkCallToEnumOperator : TcGlobals -> range -> TType -> Expr -> Expr val mkCallDeserializeQuotationFSharp20Plus : TcGlobals -> range -> Expr -> Expr -> Expr -> Expr -> Expr + val mkCallDeserializeQuotationFSharp40Plus : TcGlobals -> range -> Expr -> Expr -> Expr -> Expr -> Expr -> Expr + val mkCallCastQuotation : TcGlobals -> range -> TType -> Expr -> Expr + val mkCallLiftValueWithName : TcGlobals -> range -> TType -> string -> Expr -> Expr + val mkCallLiftValueWithDefn : TcGlobals -> range -> TType -> Expr -> Expr + val mkCallSeqCollect : TcGlobals -> range -> TType -> TType -> Expr -> Expr -> Expr + val mkCallSeqUsing : TcGlobals -> range -> TType -> TType -> Expr -> Expr -> Expr + val mkCallSeqDelay : TcGlobals -> range -> TType -> Expr -> Expr + val mkCallSeqAppend : TcGlobals -> range -> TType -> Expr -> Expr -> Expr + val mkCallSeqFinally : TcGlobals -> range -> TType -> Expr -> Expr -> Expr + val mkCallSeqGenerated : TcGlobals -> range -> TType -> Expr -> Expr -> Expr + val mkCallSeqOfFunctions : TcGlobals -> range -> TType -> TType -> Expr -> Expr -> Expr -> Expr + val mkCallSeqToArray : TcGlobals -> range -> TType -> Expr -> Expr + val mkCallSeqToList : TcGlobals -> range -> TType -> Expr -> Expr + val mkCallSeqMap : TcGlobals -> range -> TType -> TType -> Expr -> Expr -> Expr + val mkCallSeqSingleton : TcGlobals -> range -> TType -> Expr -> Expr + val mkCallSeqEmpty : TcGlobals -> range -> TType -> Expr + val mkILAsmCeq : TcGlobals -> range -> Expr -> Expr -> Expr + val mkILAsmClt : TcGlobals -> range -> Expr -> Expr -> Expr val mkCallFailInit : TcGlobals -> range -> Expr + val mkCallFailStaticInit : TcGlobals -> range -> Expr + val mkCallCheckThis : TcGlobals -> range -> TType -> Expr -> Expr val mkCase : DecisionTreeTest * DecisionTree -> DecisionTreeCase @@ -1371,18 +1952,30 @@ val mkCase : DecisionTreeTest * DecisionTree -> DecisionTreeCase val mkCallQuoteToLinqLambdaExpression : TcGlobals -> range -> TType -> Expr -> Expr val mkCallGetQuerySourceAsEnumerable : TcGlobals -> range -> TType -> TType -> Expr -> Expr + val mkCallNewQuerySource : TcGlobals -> range -> TType -> TType -> Expr -> Expr val mkArray : TType * Exprs * range -> Expr +val mkStaticCall_String_Concat2 : TcGlobals -> range -> Expr -> Expr -> Expr + +val mkStaticCall_String_Concat3 : TcGlobals -> range -> Expr -> Expr -> Expr -> Expr + +val mkStaticCall_String_Concat4 : TcGlobals -> range -> Expr -> Expr -> Expr -> Expr -> Expr + +val mkStaticCall_String_Concat_Array : TcGlobals -> range -> Expr -> Expr + //------------------------------------------------------------------------- // operations primarily associated with the optimization to fix // up loops to generate .NET code that does not include array bound checks //------------------------------------------------------------------------- val mkDecr : TcGlobals -> range -> Expr -> Expr + val mkIncr : TcGlobals -> range -> Expr -> Expr + val mkLdlen : TcGlobals -> range -> Expr -> Expr + val mkLdelem : TcGlobals -> range -> TType -> Expr -> Expr -> Expr //------------------------------------------------------------------------- @@ -1390,18 +1983,29 @@ val mkLdelem : TcGlobals -> range -> TType -> Expr -> Expr -> Expr //------------------------------------------------------------------------- val TryDecodeILAttribute : TcGlobals -> ILTypeRef -> ILAttributes -> (ILAttribElem list * ILAttributeNamedArg list) option + val TryFindILAttribute : BuiltinAttribInfo -> ILAttributes -> bool + val TryFindILAttributeOpt : BuiltinAttribInfo option -> ILAttributes -> bool val IsMatchingFSharpAttribute : TcGlobals -> BuiltinAttribInfo -> Attrib -> bool + val IsMatchingFSharpAttributeOpt : TcGlobals -> BuiltinAttribInfo option -> Attrib -> bool + val HasFSharpAttribute : TcGlobals -> BuiltinAttribInfo -> Attribs -> bool + val HasFSharpAttributeOpt : TcGlobals -> BuiltinAttribInfo option -> Attribs -> bool + val TryFindFSharpAttribute : TcGlobals -> BuiltinAttribInfo -> Attribs -> Attrib option + val TryFindFSharpAttributeOpt : TcGlobals -> BuiltinAttribInfo option -> Attribs -> Attrib option + val TryFindFSharpBoolAttribute : TcGlobals -> BuiltinAttribInfo -> Attribs -> bool option + val TryFindFSharpBoolAttributeAssumeFalse : TcGlobals -> BuiltinAttribInfo -> Attribs -> bool option + val TryFindFSharpStringAttribute : TcGlobals -> BuiltinAttribInfo -> Attribs -> string option + val TryFindFSharpInt32Attribute : TcGlobals -> BuiltinAttribInfo -> Attribs -> int32 option /// Try to find a specific attribute on a type definition, where the attribute accepts a string argument. @@ -1422,19 +2026,29 @@ val TryFindAttributeUsageAttribute : TcGlobals -> range -> TyconRef -> bool opti /// returns Some(assemblyName) for success val TryDecodeTypeProviderAssemblyAttr : ILGlobals -> ILAttribute -> string option #endif + val IsSignatureDataVersionAttr : ILAttribute -> bool + val TryFindAutoOpenAttr : IL.ILGlobals -> ILAttribute -> string option + val TryFindInternalsVisibleToAttr : IL.ILGlobals -> ILAttribute -> string option -val IsMatchingSignatureDataVersionAttr : IL.ILGlobals -> ILVersionInfo -> ILAttribute -> bool +val IsMatchingSignatureDataVersionAttr : IL.ILGlobals -> ILVersionInfo -> ILAttribute -> bool val mkCompilationMappingAttr : TcGlobals -> int -> ILAttribute val mkCompilationMappingAttrWithSeqNum : TcGlobals -> int -> int -> ILAttribute + + val mkCompilationMappingAttrWithVariantNumAndSeqNum : TcGlobals -> int -> int -> int -> ILAttribute + val mkCompilationMappingAttrForQuotationResource : TcGlobals -> string * ILTypeRef list -> ILAttribute + val mkCompilationArgumentCountsAttr : TcGlobals -> int list -> ILAttribute + val mkCompilationSourceNameAttr : TcGlobals -> string -> ILAttribute + val mkSignatureDataVersionAttr : TcGlobals -> ILVersionInfo -> ILAttribute + val mkCompilerGeneratedAttr : TcGlobals -> int -> ILAttribute //------------------------------------------------------------------------- @@ -1442,16 +2056,23 @@ val mkCompilerGeneratedAttr : TcGlobals -> int -> ILAtt //------------------------------------------------------------------------- val isInByrefTy : TcGlobals -> TType -> bool + val isOutByrefTy : TcGlobals -> TType -> bool + val isByrefTy : TcGlobals -> TType -> bool val isNativePtrTy : TcGlobals -> TType -> bool + val destByrefTy : TcGlobals -> TType -> TType + val destNativePtrTy : TcGlobals -> TType -> TType val isByrefTyconRef : TcGlobals -> TyconRef -> bool + val isByrefLikeTyconRef : TcGlobals -> range -> TyconRef -> bool + val isSpanLikeTyconRef : TcGlobals -> range -> TyconRef -> bool + val isByrefLikeTy : TcGlobals -> range -> TType -> bool /// Check if the type is a byref-like but not a byref. @@ -1462,26 +2083,37 @@ val isSpanLikeTy : TcGlobals -> range -> TType -> bool //------------------------------------------------------------------------- val isRefTupleExpr : Expr -> bool + val tryDestRefTupleExpr : Expr -> Exprs val mkAnyTupledTy : TcGlobals -> TupInfo -> TType list -> TType val mkAnyTupled : TcGlobals -> range -> TupInfo -> Exprs -> TType list -> Expr + val mkRefTupled : TcGlobals -> range -> Exprs -> TType list -> Expr + val mkRefTupledNoTypes : TcGlobals -> range -> Exprs -> Expr + val mkRefTupledTy : TcGlobals -> TType list -> TType + val mkRefTupledVarsTy : TcGlobals -> Val list -> TType + val mkRefTupledVars : TcGlobals -> range -> Val list -> Expr + val mkMethodTy : TcGlobals -> TType list list -> TType -> TType -//------------------------------------------------------------------------- -// -//------------------------------------------------------------------------- +val mkAnyAnonRecdTy : TcGlobals -> AnonRecdTypeInfo -> TType list -> TType + +val mkAnonRecd : TcGlobals -> range -> AnonRecdTypeInfo -> Exprs -> TType list -> Expr val AdjustValForExpectedArity : TcGlobals -> range -> ValRef -> ValUseFlag -> ValReprInfo -> Expr * TType + val AdjustValToTopVal : Val -> ParentRef -> ValReprInfo -> unit + val LinearizeTopMatch : TcGlobals -> ParentRef -> Expr -> Expr + val AdjustPossibleSubsumptionExpr : TcGlobals -> Expr -> Exprs -> (Expr * Exprs) option + val NormalizeAndAdjustPossibleSubsumptionExprs : TcGlobals -> Expr -> Expr //------------------------------------------------------------------------- @@ -1491,28 +2123,35 @@ val NormalizeAndAdjustPossibleSubsumptionExprs : TcGlobals -> Expr -> Expr val buildAccessPath : CompilationPath option -> string val XmlDocArgsEnc : TcGlobals -> Typars * Typars -> TType list -> string + val XmlDocSigOfVal : TcGlobals -> string -> Val -> string + val XmlDocSigOfUnionCase : (string list -> string) + val XmlDocSigOfField : (string list -> string) + val XmlDocSigOfProperty : (string list -> string) + val XmlDocSigOfTycon : (string list -> string) + val XmlDocSigOfSubModul : (string list -> string) + val XmlDocSigOfEntity : EntityRef -> string //--------------------------------------------------------------------------- // Resolve static optimizations //------------------------------------------------------------------------- + type StaticOptimizationAnswer = | Yes = 1y | No = -1y | Unknown = 0y + val DecideStaticOptimizations : TcGlobals -> StaticOptimization list -> StaticOptimizationAnswer -val mkStaticOptimizationExpr : TcGlobals -> StaticOptimization list * Expr * Expr * range -> Expr -//--------------------------------------------------------------------------- -// Build for loops -//------------------------------------------------------------------------- +val mkStaticOptimizationExpr : TcGlobals -> StaticOptimization list * Expr * Expr * range -> Expr +/// Build for loops val mkFastForLoop : TcGlobals -> SequencePointInfoForForLoop * range * Val * Expr * bool * Expr * Expr -> Expr //--------------------------------------------------------------------------- @@ -1523,12 +2162,15 @@ type ActivePatternElemRef with member Name : string val TryGetActivePatternInfo : ValRef -> PrettyNaming.ActivePatternInfo option + val mkChoiceCaseRef : TcGlobals -> range -> int -> int -> UnionCaseRef type PrettyNaming.ActivePatternInfo with + member Names : string list member ResultType : TcGlobals -> range -> TType list -> TType + member OverallType : TcGlobals -> range -> TType -> TType list -> TType val doesActivePatternHaveFreeTypars : TcGlobals -> ValRef -> bool @@ -1539,61 +2181,84 @@ val doesActivePatternHaveFreeTypars : TcGlobals -> ValRef -> bool [] type ExprRewritingEnv = - {PreIntercept: ((Expr -> Expr) -> Expr -> Expr option) option; - PostTransform: Expr -> Expr option; - PreInterceptBinding: ((Expr -> Expr) -> Binding -> Binding option) option; - IsUnderQuotations: bool } + { PreIntercept: ((Expr -> Expr) -> Expr -> Expr option) option + PostTransform: Expr -> Expr option + PreInterceptBinding: ((Expr -> Expr) -> Binding -> Binding option) option + IsUnderQuotations: bool } val RewriteExpr : ExprRewritingEnv -> Expr -> Expr + val RewriteImplFile : ExprRewritingEnv -> TypedImplFile -> TypedImplFile val IsGenericValWithGenericContraints: TcGlobals -> Val -> bool type Entity with + member HasInterface : TcGlobals -> TType -> bool + member HasOverride : TcGlobals -> string -> TType list -> bool + member HasMember : TcGlobals -> string -> TType list -> bool type EntityRef with + member HasInterface : TcGlobals -> TType -> bool + member HasOverride : TcGlobals -> string -> TType list -> bool + member HasMember : TcGlobals -> string -> TType list -> bool val (|AttribBitwiseOrExpr|_|) : TcGlobals -> Expr -> (Expr * Expr) option + val (|EnumExpr|_|) : TcGlobals -> Expr -> Expr option + val (|TypeOfExpr|_|) : TcGlobals -> Expr -> TType option + val (|TypeDefOfExpr|_|) : TcGlobals -> Expr -> TType option val EvalLiteralExprOrAttribArg: TcGlobals -> Expr -> Expr + val EvaledAttribExprEquality : TcGlobals -> Expr -> Expr -> bool + val IsSimpleSyntacticConstantExpr: TcGlobals -> Expr -> bool val (|ConstToILFieldInit|_|): Const -> ILFieldInit option val (|ExtractAttribNamedArg|_|) : string -> AttribNamedArg list -> AttribExpr option + val (|AttribInt32Arg|_|) : AttribExpr -> int32 option + val (|AttribInt16Arg|_|) : AttribExpr -> int16 option + val (|AttribBoolArg|_|) : AttribExpr -> bool option + val (|AttribStringArg|_|) : AttribExpr -> string option + val (|Int32Expr|_|) : Expr -> int32 option /// Determines types that are potentially known to satisfy the 'comparable' constraint and returns /// a set of residual types that must also satisfy the constraint val (|SpecialComparableHeadType|_|) : TcGlobals -> TType -> TType list option + val (|SpecialEquatableHeadType|_|) : TcGlobals -> TType -> TType list option + val (|SpecialNotEquatableHeadType|_|) : TcGlobals -> TType -> unit option type OptimizeForExpressionOptions = OptimizeIntRangesOnly | OptimizeAllForExpressions + val DetectAndOptimizeForExpression : TcGlobals -> OptimizeForExpressionOptions -> Expr -> Expr val TryEliminateDesugaredConstants : TcGlobals -> range -> Const -> Expr option val MemberIsExplicitImpl : TcGlobals -> ValMemberInfo -> bool + val ValIsExplicitImpl : TcGlobals -> Val -> bool + val ValRefIsExplicitImpl : TcGlobals -> ValRef -> bool val (|LinearMatchExpr|_|) : Expr -> (SequencePointInfoForBinding * range * DecisionTree * DecisionTreeTarget * Expr * SequencePointInfoForTarget * range * TType) option + val rebuildLinearMatchExpr : (SequencePointInfoForBinding * range * DecisionTree * DecisionTreeTarget * Expr * SequencePointInfoForTarget * range * TType) -> Expr val mkCoerceIfNeeded : TcGlobals -> tgtTy: TType -> srcTy: TType -> Expr -> Expr diff --git a/src/fsharp/TastPickle.fs b/src/fsharp/TastPickle.fs index 3f184165ad2..14998cc882d 100755 --- a/src/fsharp/TastPickle.fs +++ b/src/fsharp/TastPickle.fs @@ -36,16 +36,16 @@ type PickledDataWithReferences<'rawData> = { /// The data that uses a collection of CcuThunks internally RawData: 'rawData /// The assumptions that need to be fixed up - FixupThunks: list } + FixupThunks: CcuThunk [] } member x.Fixup loader = - x.FixupThunks |> List.iter (fun reqd -> reqd.Fixup(loader reqd.AssemblyName)) + x.FixupThunks |> Array.iter (fun reqd -> reqd.Fixup(loader reqd.AssemblyName)) x.RawData /// Like Fixup but loader may return None, in which case there is no fixup. member x.OptionalFixup loader = x.FixupThunks - |> List.iter(fun reqd-> + |> Array.iter(fun reqd-> match loader reqd.AssemblyName with | Some(loaded) -> reqd.Fixup(loaded) | None -> reqd.FixupOrphaned() ) @@ -113,9 +113,10 @@ type WriterState = { os: ByteBuffer oscope: CcuThunk occus: Table - otycons: NodeOutTable + oentities: NodeOutTable otypars: NodeOutTable ovals: NodeOutTable + oanoninfos: NodeOutTable ostrings: Table opubpaths: Table onlerefs: Table @@ -144,9 +145,10 @@ type ReaderState = { is: ByteStream iilscope: ILScopeRef iccus: InputTable - itycons: NodeInTable + ientities: NodeInTable itypars: NodeInTable ivals: NodeInTable + ianoninfos: NodeInTable istrings: InputTable ipubpaths: InputTable inlerefs: InputTable @@ -317,10 +319,13 @@ let u_used_space1 f st = let inline u_tup2 p1 p2 (st:ReaderState) = let a = p1 st in let b = p2 st in (a,b) + let inline u_tup3 p1 p2 p3 (st:ReaderState) = let a = p1 st in let b = p2 st in let c = p3 st in (a,b,c) + let inline u_tup4 p1 p2 p3 p4 (st:ReaderState) = let a = p1 st in let b = p2 st in let c = p3 st in let d = p4 st in (a,b,c,d) + let inline u_tup5 p1 p2 p3 p4 p5 (st:ReaderState) = let a = p1 st let b = p2 st @@ -328,32 +333,41 @@ let inline u_tup5 p1 p2 p3 p4 p5 (st:ReaderState) = let d = p4 st let e = p5 st (a,b,c,d,e) + let inline u_tup6 p1 p2 p3 p4 p5 p6 (st:ReaderState) = let a = p1 st in let b = p2 st in let c = p3 st in let d = p4 st in let e = p5 st in let f = p6 st in (a,b,c,d,e,f) + let inline u_tup7 p1 p2 p3 p4 p5 p6 p7 (st:ReaderState) = let a = p1 st in let b = p2 st in let c = p3 st in let d = p4 st in let e = p5 st in let f = p6 st in let x7 = p7 st in (a,b,c,d,e,f,x7) + let inline u_tup8 p1 p2 p3 p4 p5 p6 p7 p8 (st:ReaderState) = let a = p1 st in let b = p2 st in let c = p3 st in let d = p4 st in let e = p5 st in let f = p6 st in let x7 = p7 st in let x8 = p8 st in (a,b,c,d,e,f,x7,x8) + let inline u_tup9 p1 p2 p3 p4 p5 p6 p7 p8 p9 (st:ReaderState) = let a = p1 st in let b = p2 st in let c = p3 st in let d = p4 st in let e = p5 st in let f = p6 st in let x7 = p7 st in let x8 = p8 st in let x9 = p9 st in (a,b,c,d,e,f,x7,x8,x9) + let inline u_tup10 p1 p2 p3 p4 p5 p6 p7 p8 p9 p10 (st:ReaderState) = let a = p1 st in let b = p2 st in let c = p3 st in let d = p4 st in let e = p5 st in let f = p6 st in let x7 = p7 st in let x8 = p8 st in let x9 = p9 st in let x10 = p10 st in (a,b,c,d,e,f,x7,x8,x9,x10) + let inline u_tup11 p1 p2 p3 p4 p5 p6 p7 p8 p9 p10 p11 (st:ReaderState) = let a = p1 st in let b = p2 st in let c = p3 st in let d = p4 st in let e = p5 st in let f = p6 st in let x7 = p7 st in let x8 = p8 st in let x9 = p9 st in let x10 = p10 st in let x11 = p11 st in (a,b,c,d,e,f,x7,x8,x9,x10,x11) + let inline u_tup12 p1 p2 p3 p4 p5 p6 p7 p8 p9 p10 p11 p12 (st:ReaderState) = let a = p1 st in let b = p2 st in let c = p3 st in let d = p4 st in let e = p5 st in let f = p6 st in let x7 = p7 st in let x8 = p8 st in let x9 = p9 st in let x10 = p10 st in let x11 = p11 st in let x12 = p12 st in (a,b,c,d,e,f,x7,x8,x9,x10,x11,x12) + let inline u_tup13 p1 p2 p3 p4 p5 p6 p7 p8 p9 p10 p11 p12 p13 (st:ReaderState) = let a = p1 st in let b = p2 st in let c = p3 st in let d = p4 st in let e = p5 st in let f = p6 st in let x7 = p7 st in let x8 = p8 st in let x9 = p9 st in let x10 = p10 st in let x11 = p11 st in let x12 = p12 st in let x13 = p13 st in (a,b,c,d,e,f,x7,x8,x9,x10,x11,x12,x13) + let inline u_tup14 p1 p2 p3 p4 p5 p6 p7 p8 p9 p10 p11 p12 p13 p14 (st:ReaderState) = let a = p1 st in let b = p2 st in let c = p3 st in let d = p4 st in let e = p5 st in let f = p6 st in let x7 = p7 st in let x8 = p8 st in @@ -391,7 +405,7 @@ let inline u_tup17 p1 p2 p3 p4 p5 p6 p7 p8 p9 p10 p11 p12 p13 p14 p15 p16 p17 (s // ctxt is for debugging let p_osgn_ref (_ctxt:string) (outMap : NodeOutTable<_,_>) x st = let idx = outMap.Table.FindOrAdd (outMap.NodeStamp x) - //if ((idx = 0) && outMap.Name = "otycons") then + //if ((idx = 0) && outMap.Name = "oentities") then // System.Diagnostics.Debug.Assert(false, sprintf "idx %d#%d in table %s has name '%s', was defined at '%s' and is referenced from context %s\n" idx (outMap.NodeStamp x) outMap.Name (outMap.NodeName x) (stringOfRange (outMap.GetRange x)) _ctxt) p_int idx st @@ -447,9 +461,21 @@ let p_array_ext extraf f (x: 'T[]) st = | Some f -> f st p_array_core f x st - -let p_list f x st = p_array f (Array.ofList x) st -let p_list_ext extraf f x st = p_array_ext extraf f (Array.ofList x) st +let p_list_core f (xs: 'T list) st = + for x in xs do + f x st + +let p_list f x st = + p_int (List.length x) st + p_list_core f x st +let p_list_ext extraf f x st = + let n = List.length x + let n = if Option.isSome extraf then n ||| 0x80000000 else n + p_int n st + match extraf with + | None -> () + | Some f -> f st + p_list_core f x st let p_List f (x: 'T list) st = p_list f x st @@ -479,7 +505,7 @@ let private p_lazy_impl p v st = let fixupPos7 = st.os.Position prim_p_int32 0 st let idx1 = st.os.Position - let otyconsIdx1 = st.otycons.Size + let otyconsIdx1 = st.oentities.Size let otyparsIdx1 = st.otypars.Size let ovalsIdx1 = st.ovals.Size // Run the pickler @@ -488,7 +514,7 @@ let private p_lazy_impl p v st = let idx2 = st.os.Position st.os.FixupInt32 fixupPos1 (idx2-idx1) // Determine and fixup the ranges of OSGN nodes defined within the lazy portion - let otyconsIdx2 = st.otycons.Size + let otyconsIdx2 = st.oentities.Size let otyparsIdx2 = st.otypars.Size let ovalsIdx2 = st.ovals.Size st.os.FixupInt32 fixupPos2 otyconsIdx1 @@ -534,8 +560,22 @@ let u_array_ext extraf f st = let arr = u_array_core f (n &&& 0x7FFFFFFF) st extraItem, arr -let u_list f st = Array.toList (u_array f st) -let u_list_ext extra f st = let v, res = u_array_ext extra f st in v, Array.toList res +let u_list_core f n st = + [ for _ in 1..n do + yield f st ] + +let u_list f st = + let n = u_int st + u_list_core f n st +let u_list_ext extra f st = + let n = u_int st + let extraItem = + if n &&& 0x80000000 = 0x80000000 then + Some (extra st) + else + None + let list = u_list_core f (n &&& 0x7FFFFFFF) st + extraItem, list #if FLAT_LIST_AS_LIST #else @@ -558,7 +598,10 @@ let u_array_revi f st = res // Mark up default constraints with a priority in reverse order: last gets 0 etc. See comment on TyparConstraint.DefaultsTo -let u_list_revi f st = Array.toList (u_array_revi f st) +let u_list_revi f st = + let n = u_int st + [ for i = 0 to n-1 do + yield f st (n-1-i) ] let u_wrap (f: 'U -> 'T) (u : 'U unpickler) : 'T unpickler = (fun st -> f (u st)) @@ -599,7 +642,7 @@ let u_lazy u st = lazy (let st = { st with is = st.is.CloneAndSeek idx1 } u st) /// Force the reading of the data as a "tripwire" for each of the OSGN thunks - for i = otyconsIdx1 to otyconsIdx2-1 do wire (st.itycons.Get(i)) res done + for i = otyconsIdx1 to otyconsIdx2-1 do wire (st.ientities.Get(i)) res done for i = ovalsIdx1 to ovalsIdx2-1 do wire (st.ivals.Get(i)) res done for i = otyparsIdx1 to otyparsIdx2-1 do wire (st.itypars.Get(i)) res done res @@ -692,21 +735,23 @@ let p_nleref x st = p_int (encode_nleref st.occus st.ostrings st.onlerefs st.osc let decode_simpletyp st _ccuTab _stringTab nlerefTab a = TType_app(ERefNonLocal (lookup_nleref st nlerefTab a),[]) let lookup_simpletyp st simpleTyTab x = lookup_uniq st simpleTyTab x let u_encoded_simpletyp st = u_int st +let u_encoded_anoninfo st = u_int st let u_simpletyp st = lookup_uniq st st.isimpletys (u_int st) let encode_simpletyp ccuTab stringTab nlerefTab simpleTyTab thisCcu a = encode_uniq simpleTyTab (encode_nleref ccuTab stringTab nlerefTab thisCcu a) let p_encoded_simpletyp x st = p_int x st +let p_encoded_anoninfo x st = p_int x st let p_simpletyp x st = p_int (encode_simpletyp st.occus st.ostrings st.onlerefs st.osimpletys st.oscope x) st -type sizes = int * int * int let pickleObjWithDanglingCcus inMem file g scope p x = - let ccuNameTab,(sizes: sizes),stringTab,pubpathTab,nlerefTab,simpleTyTab,phase1bytes = + let ccuNameTab,(ntycons, ntypars, nvals, nanoninfos),stringTab,pubpathTab,nlerefTab,simpleTyTab,phase1bytes = let st1 = { os = ByteBuffer.Create 100000 oscope=scope occus= Table<_>.Create "occus" - otycons=NodeOutTable<_,_>.Create((fun (tc:Tycon) -> tc.Stamp),(fun tc -> tc.LogicalName),(fun tc -> tc.Range),(fun osgn -> osgn),"otycons") + oentities=NodeOutTable<_,_>.Create((fun (tc:Tycon) -> tc.Stamp),(fun tc -> tc.LogicalName),(fun tc -> tc.Range),(fun osgn -> osgn),"otycons") otypars=NodeOutTable<_,_>.Create((fun (tp:Typar) -> tp.Stamp),(fun tp -> tp.DisplayName),(fun tp -> tp.Range),(fun osgn -> osgn),"otypars") ovals=NodeOutTable<_,_>.Create((fun (v:Val) -> v.Stamp),(fun v -> v.LogicalName),(fun v -> v.Range),(fun osgn -> osgn),"ovals") + oanoninfos=NodeOutTable<_,_>.Create((fun (v:AnonRecdTypeInfo) -> v.Stamp),(fun v -> string v.Stamp),(fun _ -> range0),id,"oanoninfos") ostrings=Table<_>.Create "ostrings" onlerefs=Table<_>.Create "onlerefs" opubpaths=Table<_>.Create "opubpaths" @@ -716,19 +761,21 @@ let pickleObjWithDanglingCcus inMem file g scope p x = oInMem=inMem } p x st1 let sizes = - st1.otycons.Size, + st1.oentities.Size, st1.otypars.Size, - st1.ovals.Size + st1.ovals.Size, + st1.oanoninfos.Size st1.occus, sizes, st1.ostrings, st1.opubpaths,st1.onlerefs, st1.osimpletys, st1.os.Close() - let phase2data = (ccuNameTab.AsArray,sizes,stringTab.AsArray,pubpathTab.AsArray,nlerefTab.AsArray,simpleTyTab.AsArray,phase1bytes) + let phase2bytes = let st2 = { os = ByteBuffer.Create 100000 oscope=scope occus= Table<_>.Create "occus (fake)" - otycons=NodeOutTable<_,_>.Create((fun (tc:Tycon) -> tc.Stamp),(fun tc -> tc.LogicalName),(fun tc -> tc.Range),(fun osgn -> osgn),"otycons") + oentities=NodeOutTable<_,_>.Create((fun (tc:Tycon) -> tc.Stamp),(fun tc -> tc.LogicalName),(fun tc -> tc.Range),(fun osgn -> osgn),"otycons") otypars=NodeOutTable<_,_>.Create((fun (tp:Typar) -> tp.Stamp),(fun tp -> tp.DisplayName),(fun tp -> tp.Range),(fun osgn -> osgn),"otypars") ovals=NodeOutTable<_,_>.Create((fun (v:Val) -> v.Stamp),(fun v -> v.LogicalName),(fun v -> v.Range),(fun osgn -> osgn),"ovals") + oanoninfos=NodeOutTable<_,_>.Create((fun (v:AnonRecdTypeInfo) -> v.Stamp),(fun v -> string v.Stamp),(fun _ -> range0),id,"oanoninfos") ostrings=Table<_>.Create "ostrings (fake)" opubpaths=Table<_>.Create "opubpaths (fake)" onlerefs=Table<_>.Create "onlerefs (fake)" @@ -736,15 +783,21 @@ let pickleObjWithDanglingCcus inMem file g scope p x = oglobals=g ofile=file oInMem=inMem } - p_tup7 - (p_array p_encoded_ccuref) - (p_tup3 p_int p_int p_int) - (p_array p_encoded_string) - (p_array p_encoded_pubpath) - (p_array p_encoded_nleref) - (p_array p_encoded_simpletyp) - p_bytes - phase2data st2 + p_array p_encoded_ccuref ccuNameTab.AsArray st2 + // Add a 4th integer indicated by a negative 1st integer + let z1 = if nanoninfos > 0 then -ntycons-1 else ntycons + p_int z1 st2 + p_tup2 p_int p_int (ntypars, nvals) st2 + if nanoninfos > 0 then + p_int nanoninfos st2 + p_tup5 + (p_array p_encoded_string) + (p_array p_encoded_pubpath) + (p_array p_encoded_nleref) + (p_array p_encoded_simpletyp) + p_bytes + (stringTab.AsArray,pubpathTab.AsArray,nlerefTab.AsArray,simpleTyTab.AsArray,phase1bytes) + st2 st2.os.Close() phase2bytes @@ -760,59 +813,62 @@ let unpickleObjWithDanglingCcus file ilscope (iILModule:ILModuleDef option) u (p { is = ByteStream.FromBytes (phase2bytes,0,phase2bytes.Length) iilscope= ilscope iccus= new_itbl "iccus (fake)" [| |] - itycons= NodeInTable<_,_>.Create (Tycon.NewUnlinked, (fun osgn tg -> osgn.Link tg),(fun osgn -> osgn.IsLinked),"itycons",0) + ientities= NodeInTable<_,_>.Create (Tycon.NewUnlinked, (fun osgn tg -> osgn.Link tg),(fun osgn -> osgn.IsLinked),"itycons",0) itypars= NodeInTable<_,_>.Create (Typar.NewUnlinked, (fun osgn tg -> osgn.Link tg),(fun osgn -> osgn.IsLinked),"itypars",0) ivals = NodeInTable<_,_>.Create (Val.NewUnlinked , (fun osgn tg -> osgn.Link tg),(fun osgn -> osgn.IsLinked),"ivals",0) + ianoninfos=NodeInTable<_,_>.Create(AnonRecdTypeInfo.NewUnlinked, (fun osgn tg -> osgn.Link tg),(fun osgn -> osgn.IsLinked),"ianoninfos",0); istrings = new_itbl "istrings (fake)" [| |] inlerefs = new_itbl "inlerefs (fake)" [| |] ipubpaths = new_itbl "ipubpaths (fake)" [| |] isimpletys = new_itbl "isimpletys (fake)" [| |] ifile=file iILModule = iILModule } - let phase2data = - u_tup7 - (u_array u_encoded_ccuref) - (u_tup3 u_int u_int u_int) - (u_array u_encoded_string) - (u_array u_encoded_pubpath) - (u_array u_encoded_nleref) - (u_array u_encoded_simpletyp) - u_bytes st2 - let ccuNameTab,sizes,stringTab,pubpathTab,nlerefTab,simpleTyTab,phase1bytes = phase2data + let ccuNameTab = u_array u_encoded_ccuref st2 + let z1 = u_int st2 + let ntycons = if z1 < 0 then -z1-1 else z1 + let ntypars, nvals = u_tup2 u_int u_int st2 + let nanoninfos = if z1 < 0 then u_int st2 else 0 + let stringTab,pubpathTab,nlerefTab,simpleTyTab,phase1bytes = + u_tup5 + (u_array u_encoded_string) + (u_array u_encoded_pubpath) + (u_array u_encoded_nleref) + (u_array u_encoded_simpletyp) + u_bytes + st2 let ccuTab = new_itbl "iccus" (Array.map (CcuThunk.CreateDelayed) ccuNameTab) let stringTab = new_itbl "istrings" (Array.map decode_string stringTab) let pubpathTab = new_itbl "ipubpaths" (Array.map (decode_pubpath st2 stringTab) pubpathTab) let nlerefTab = new_itbl "inlerefs" (Array.map (decode_nleref st2 ccuTab stringTab) nlerefTab) - let simpleTyTab = new_itbl "isimpletys" (Array.map (decode_simpletyp st2 ccuTab stringTab nlerefTab) simpleTyTab) - let ((ntycons,ntypars,nvals) : sizes) = sizes + let simpletypTab = new_itbl "simpleTyTab" (Array.map (decode_simpletyp st2 ccuTab stringTab nlerefTab) simpleTyTab) let data = let st1 = { is = ByteStream.FromBytes (phase1bytes,0,phase1bytes.Length) iccus= ccuTab iilscope= ilscope - itycons= NodeInTable<_,_>.Create(Tycon.NewUnlinked,(fun osgn tg -> osgn.Link tg),(fun osgn -> osgn.IsLinked),"itycons",ntycons) + ientities= NodeInTable<_,_>.Create(Tycon.NewUnlinked,(fun osgn tg -> osgn.Link tg),(fun osgn -> osgn.IsLinked),"itycons",ntycons) itypars= NodeInTable<_,_>.Create(Typar.NewUnlinked,(fun osgn tg -> osgn.Link tg),(fun osgn -> osgn.IsLinked),"itypars",ntypars) ivals= NodeInTable<_,_>.Create(Val.NewUnlinked ,(fun osgn tg -> osgn.Link tg),(fun osgn -> osgn.IsLinked),"ivals",nvals) + ianoninfos=NodeInTable<_,_>.Create(AnonRecdTypeInfo.NewUnlinked, (fun osgn tg -> osgn.Link tg),(fun osgn -> osgn.IsLinked),"ianoninfos",nanoninfos); istrings = stringTab ipubpaths = pubpathTab inlerefs = nlerefTab - isimpletys = simpleTyTab + isimpletys = simpletypTab ifile=file iILModule = iILModule } let res = u st1 -#if LAZY_UNPICKLE -#else - check ilscope st1.itycons +#if !LAZY_UNPICKLE + check ilscope st1.ientities check ilscope st1.ivals check ilscope st1.itypars #endif res - {RawData=data; FixupThunks=Array.toList ccuTab.itbl_rows } + {RawData=data; FixupThunks=ccuTab.itbl_rows } //========================================================================= -// PART II *) +// PART II //========================================================================= //--------------------------------------------------------------------------- @@ -823,7 +879,9 @@ let p_ILPublicKey x st = match x with | PublicKey b -> p_byte 0 st; p_bytes b st | PublicKeyToken b -> p_byte 1 st; p_bytes b st + let p_ILVersion x st = p_tup4 p_uint16 p_uint16 p_uint16 p_uint16 x st + let p_ILModuleRef (x:ILModuleRef) st = p_tup3 p_string p_bool (p_option p_bytes) (x.Name,x.HasMetadata,x.Hash) st @@ -947,8 +1005,11 @@ let rec u_ILType st = | 7 -> u_uint16 st |> mkILTyvarTy | 8 -> u_tup3 u_bool u_ILTypeRef u_ILType st |> ILType.Modified | _ -> ufailwith st "u_ILType" + and u_ILTypes st = u_list u_ILType st + and u_ILCallSig = u_wrap (fun (a,b,c) -> {CallingConv=a; ArgTypes=b; ReturnType=c}) (u_tup3 u_ILCallConv u_ILTypes u_ILType) + and u_ILTypeSpec st = let a,b = u_tup2 u_ILTypeRef u_ILTypes st in ILTypeSpec.Create(a,b) @@ -1244,7 +1305,7 @@ let p_local_item_ref ctxt tab st = p_osgn_ref ctxt tab st let p_tcref ctxt (x:EntityRef) st = match x with - | ERefLocal x -> p_byte 0 st; p_local_item_ref ctxt st.otycons x st + | ERefLocal x -> p_byte 0 st; p_local_item_ref ctxt st.oentities x st | ERefNonLocal x -> p_byte 1 st; p_nleref x st let p_ucref (UCRef(a,b)) st = p_tup2 (p_tcref "ucref") p_string (a,b) st @@ -1256,7 +1317,7 @@ let u_local_item_ref tab st = u_osgn_ref tab st let u_tcref st = let tag = u_byte st match tag with - | 0 -> u_local_item_ref st.itycons st |> ERefLocal + | 0 -> u_local_item_ref st.ientities st |> ERefLocal | 1 -> u_nleref st |> ERefNonLocal | _ -> ufailwith st "u_item_ref" @@ -1374,6 +1435,12 @@ let u_MemberFlags st = let fill_u_Expr_hole,u_expr_fwd = u_hole() let fill_p_Expr_hole,p_expr_fwd = p_hole() +let p_anonInfo_data (anonInfo: AnonRecdTypeInfo) st = + p_tup3 p_ccuref p_bool (p_array p_ident) (anonInfo.Assembly, evalTupInfoIsStruct anonInfo.TupInfo, anonInfo.SortedIds) st + +let p_anonInfo x st = + p_osgn_decl st.oanoninfos p_anonInfo_data x st + let p_trait_sln sln st = match sln with | ILMethSln(a,b,c,d) -> @@ -1386,10 +1453,20 @@ let p_trait_sln sln st = p_byte 3 st; p_expr_fwd expr st | FSRecdFieldSln(a,b,c) -> p_byte 4 st; p_tup3 p_tys p_rfref p_bool (a,b,c) st + | FSAnonRecdFieldSln(a, b, c) -> + p_byte 5 st; p_tup3 p_anonInfo p_tys p_int (a,b,c) st + let p_trait (TTrait(a,b,c,d,e,f)) st = p_tup6 p_tys p_string p_MemberFlags p_tys (p_option p_ty) (p_option p_trait_sln) (a,b,c,d,e,!f) st +let u_anonInfo_data st = + let (ccu, info, nms) = u_tup3 u_ccuref u_bool (u_array u_ident) st + AnonRecdTypeInfo.Create (ccu, mkTupInfo info, nms) + +let u_anonInfo st = + u_osgn_decl st.ianoninfos u_anonInfo_data st + // We have to store trait solutions since they can occur in optimization data let u_trait_sln st = let tag = u_byte st @@ -1407,6 +1484,9 @@ let u_trait_sln st = | 4 -> let (a,b,c) = u_tup3 u_tys u_rfref u_bool st FSRecdFieldSln(a,b,c) + | 5 -> + let (a,b,c) = u_tup3 u_anonInfo u_tys u_int st + FSAnonRecdFieldSln(a, b, c) | _ -> ufailwith st "u_trait_sln" let u_trait st = @@ -1417,7 +1497,9 @@ let u_trait st = let p_rational q st = p_int32 (GetNumerator q) st; p_int32 (GetDenominator q) st let p_measure_con tcref st = p_byte 0 st; p_tcref "measure" tcref st + let p_measure_var v st = p_byte 3 st; p_tpref v st + let p_measure_one = p_byte 4 // Pickle a unit-of-measure variable or constructor @@ -1527,7 +1609,6 @@ let p_tyar_spec_data (x:Typar) st = p_int64 p_tyar_constraints p_xmldoc - (x.typar_id,x.Attribs,int64 x.typar_flags.PickledBits,x.Constraints,x.XmlDoc) st let p_tyar_spec (x:Typar) st = @@ -1585,7 +1666,12 @@ let _ = fill_p_ty2 (fun isStructThisArgPos ty st -> // Note, the "this" argument may be found in the body of a generic forall type, so propagate the isStructThisArgPos value p_ty2 isStructThisArgPos r st | TType_measure unt -> p_byte 6 st; p_measure_expr unt st - | TType_ucase (uc,tinst) -> p_byte 7 st; p_tup2 p_ucref p_tys (uc,tinst) st) + | TType_ucase (uc,tinst) -> p_byte 7 st; p_tup2 p_ucref p_tys (uc,tinst) st + // p_byte 8 taken by TType_tuple above + | TType_anon (anonInfo, l) -> + p_byte 9 st + p_anonInfo anonInfo st + p_tys l st) let _ = fill_u_ty (fun st -> let tag = u_byte st @@ -1599,7 +1685,8 @@ let _ = fill_u_ty (fun st -> | 6 -> let unt = u_measure_expr st in TType_measure unt | 7 -> let uc = u_ucref st in let tinst = u_tys st in TType_ucase (uc,tinst) | 8 -> let l = u_tys st in TType_tuple (tupInfoStruct, l) - | _ -> ufailwith st "u_ty") + | 9 -> let anonInfo = u_anonInfo st in let l = u_tys st in TType_anon (anonInfo, l) + | _ -> ufailwith st "u_typ") let fill_p_binds,p_binds = p_hole() @@ -1675,7 +1762,7 @@ and p_tycon_repr x st = // The leading "p_byte 1" and "p_byte 0" come from the F# 2.0 format, which used an option value at this point. match x with | TRecdRepr fs -> p_byte 1 st; p_byte 0 st; p_rfield_table fs st; false - | TUnionRepr x -> p_byte 1 st; p_byte 1 st; p_list p_unioncase_spec (Array.toList x.CasesTable.CasesByIndex) st; false + | TUnionRepr x -> p_byte 1 st; p_byte 1 st; p_array p_unioncase_spec (x.CasesTable.CasesByIndex) st; false | TAsmRepr ilty -> p_byte 1 st; p_byte 2 st; p_ILType ilty st; false | TFSharpObjectRepr r -> p_byte 1 st; p_byte 3 st; p_tycon_objmodel_data r st; false | TMeasureableRepr ty -> p_byte 1 st; p_byte 4 st; p_ty ty st; false @@ -1717,7 +1804,7 @@ and p_exnc_repr x st = | TExnFresh x -> p_byte 2 st; p_rfield_table x st | TExnNone -> p_byte 3 st -and p_exnc_spec x st = p_tycon_spec x st +and p_exnc_spec x st = p_entity_spec x st and p_access (TAccess n) st = p_list p_cpath n st @@ -1735,7 +1822,7 @@ and p_recdfield_spec x st = p_access x.rfield_access st and p_rfield_table x st = - p_list p_recdfield_spec (Array.toList x.FieldsByIndex) st + p_array p_recdfield_spec (x.FieldsByIndex) st and p_entity_spec_data (x:Entity) st = p_tyar_specs (x.entity_typars.Force(x.entity_range)) st @@ -1789,7 +1876,7 @@ and p_tcaug p st = p.tcaug_abstract, space) st -and p_tycon_spec x st = p_osgn_decl st.otycons p_entity_spec_data x st +and p_entity_spec x st = p_osgn_decl st.oentities p_entity_spec_data x st and p_parentref x st = match x with @@ -1873,7 +1960,7 @@ and p_modul_typ (x: ModuleOrNamespaceType) st = p_tup3 p_istype (p_qlist p_Val) - (p_qlist p_tycon_spec) + (p_qlist p_entity_spec) (x.ModuleOrNamespaceKind,x.AllValsAndMembers,x.AllEntities) st @@ -1958,7 +2045,7 @@ and u_exnc_repr st = | 3 -> TExnNone | _ -> ufailwith st "u_exnc_repr" -and u_exnc_spec st = u_tycon_spec st +and u_exnc_spec st = u_entity_spec st and u_access st = match u_list u_cpath st with @@ -2065,8 +2152,8 @@ and u_tcaug st = tcaug_closed=true tcaug_abstract=g} -and u_tycon_spec st = - u_osgn_decl st.itycons u_entity_spec_data st +and u_entity_spec st = + u_osgn_decl st.ientities u_entity_spec_data st and u_parentref st = let tag = u_byte st @@ -2184,7 +2271,7 @@ and u_modul_typ st = u_tup3 u_istype (u_qlist u_Val) - (u_qlist u_tycon_spec) st + (u_qlist u_entity_spec) st ModuleOrNamespaceType(x1,x3,x5) @@ -2340,6 +2427,10 @@ and p_op x st = | TOp.UnionCaseFieldGetAddr (a,b, _) -> p_byte 28 st; p_tup2 p_ucref p_int (a,b) st // Note tag byte 29 is taken for struct tuples, see above // Note tag byte 30 is taken for struct tuples, see above + (* 29: TOp.Tuple when evalTupInfoIsStruct tupInfo = true *) + (* 30: TOp.TupleFieldGet when evalTupInfoIsStruct tupInfo = true *) + | TOp.AnonRecd info -> p_byte 31 st; p_anonInfo info st + | TOp.AnonRecdGet (info, n) -> p_byte 32 st; p_anonInfo info st; p_int n st | TOp.Goto _ | TOp.Label _ | TOp.Return -> failwith "unexpected backend construct in pickled TAST" and u_op st = @@ -2406,6 +2497,11 @@ and u_op st = | 29 -> TOp.Tuple tupInfoStruct | 30 -> let a = u_int st TOp.TupleFieldGet (tupInfoStruct, a) + | 31 -> let info = u_anonInfo st + TOp.AnonRecd (info) + | 32 -> let info = u_anonInfo st + let n = u_int st + TOp.AnonRecdGet (info, n) | _ -> ufailwith st "u_op" and p_expr expr st = @@ -2559,11 +2655,12 @@ let _ = fill_u_Vals (u_list u_Val) // Pickle/unpickle F# interface data //--------------------------------------------------------------------------- -let pickleModuleOrNamespace mspec st = p_tycon_spec mspec st +let pickleModuleOrNamespace mspec st = p_entity_spec mspec st + let pickleCcuInfo (minfo: PickledCcuInfo) st = p_tup4 pickleModuleOrNamespace p_string p_bool (p_space 3) (minfo.mspec, minfo.compileTimeWorkingDir, minfo.usesQuotations,()) st -let unpickleModuleOrNamespace st = u_tycon_spec st +let unpickleModuleOrNamespace st = u_entity_spec st let unpickleCcuInfo st = let a,b,c,_space = u_tup4 unpickleModuleOrNamespace u_string u_bool (u_space 3) st diff --git a/src/fsharp/TastPickle.fsi b/src/fsharp/TastPickle.fsi index 4bf6aca3ef1..97eab4b30b9 100644 --- a/src/fsharp/TastPickle.fsi +++ b/src/fsharp/TastPickle.fsi @@ -18,7 +18,7 @@ type PickledDataWithReferences<'RawData> = { /// The data that uses a collection of CcuThunks internally RawData: 'RawData /// The assumptions that need to be fixed up - FixupThunks: list } + FixupThunks: CcuThunk [] } member Fixup : (CcuReference -> CcuThunk) -> 'RawData /// Like Fixup but loader may return None, in which case there is no fixup. diff --git a/src/fsharp/TcGlobals.fs b/src/fsharp/TcGlobals.fs index d6fb7cd3c73..85f12f8b3fd 100755 --- a/src/fsharp/TcGlobals.fs +++ b/src/fsharp/TcGlobals.fs @@ -255,7 +255,7 @@ type public TcGlobals(compilingFslib: bool, ilg:ILGlobals, fslibCcu: CcuThunk, d let path, typeName = splitILTypeName nm let scoref = match tryFindSysTypeCcu path typeName with - | None -> ILScopeRef.Assembly (mkSimpleAssRef (dummyAssemblyNameCarryingUsefulErrorInformation path typeName)) + | None -> ILScopeRef.Assembly (mkSimpleAssemblyRef (dummyAssemblyNameCarryingUsefulErrorInformation path typeName)) | Some ccu -> ccu.ILScopeRef mkILTyRef (scoref, nm) diff --git a/src/fsharp/TypeChecker.fs b/src/fsharp/TypeChecker.fs index 1c5a4c9451e..fad9e40f721 100755 --- a/src/fsharp/TypeChecker.fs +++ b/src/fsharp/TypeChecker.fs @@ -504,8 +504,8 @@ type cenv = /// Used to resolve names nameResolver: NameResolver - /// The set of active conditional defines - conditionalDefines: string list + /// The set of active conditional defines. The value is None when conditional erasure is disabled in tooling. + conditionalDefines: string list option isInternalTestSpanStackReferring: bool } @@ -707,38 +707,72 @@ let UnifyRefTupleType contextInfo cenv denv m ty ps = AddCxTypeEqualsType contextInfo denv cenv.css m ty (TType_tuple (tupInfoRef, ptys)) ptys -/// Optimized unification routine that avoids creating new inference -/// variables unnecessarily -let UnifyStructTupleType contextInfo cenv denv m ty ps = - let ptys = - if isStructTupleTy cenv.g ty then - let ptys = destStructTupleTy cenv.g ty - if List.length ps = List.length ptys then ptys - else NewInferenceTypes ps - else NewInferenceTypes ps - AddCxTypeEqualsType contextInfo denv cenv.css m ty (TType_tuple (tupInfoStruct, ptys)) +/// Allow the inference of structness from the known type, e.g. +/// let (x : struct (int * int)) = (3,4) +let UnifyTupleTypeAndInferCharacteristics contextInfo cenv denv m knownTy isExplicitStruct ps = + let tupInfo, ptys = + if isAnyTupleTy cenv.g knownTy then + let tupInfo, ptys = destAnyTupleTy cenv.g knownTy + let tupInfo = (if isExplicitStruct then tupInfoStruct else tupInfo) + let ptys = + if List.length ps = List.length ptys then ptys + else NewInferenceTypes ps + tupInfo, ptys + else + mkTupInfo isExplicitStruct, NewInferenceTypes ps + + let contextInfo = + match contextInfo with + | ContextInfo.RecordFields -> ContextInfo.TupleInRecordFields + | _ -> contextInfo + + let ty2 = TType_tuple (tupInfo, ptys) + AddCxTypeEqualsType contextInfo denv cenv.css m knownTy ty2 + tupInfo, ptys + +// Allow inference of assembly-affinity and structness from the known type - even from another assembly. This is a rule of +// the language design and allows effective cross-assembly use of anonymous types in some limited circumstances. +let UnifyAnonRecdTypeAndInferCharacteristics contextInfo cenv denv m ty isExplicitStruct unsortedNames = + let anonInfo, ptys = + match tryDestAnonRecdTy cenv.g ty with + | ValueSome (anonInfo, ptys) -> + // Note: use the assembly of the known type, not the current assembly + // Note: use the structness of the known type, unless explicit + // Note: use the names of our type, since they are always explicit + let tupInfo = (if isExplicitStruct then tupInfoStruct else anonInfo.TupInfo) + let anonInfo = AnonRecdTypeInfo.Create(anonInfo.Assembly, tupInfo, unsortedNames) + let ptys = + if List.length ptys = Array.length unsortedNames then ptys + else NewInferenceTypes (Array.toList anonInfo.SortedNames) + anonInfo, ptys + | ValueNone -> + // Note: no known anonymous record type - use our assembly + let anonInfo = AnonRecdTypeInfo.Create(cenv.topCcu, mkTupInfo isExplicitStruct, unsortedNames) + anonInfo, NewInferenceTypes (Array.toList anonInfo.SortedNames) + let ty2 = TType_anon (anonInfo, ptys) + AddCxTypeEqualsType contextInfo denv cenv.css m ty ty2 + anonInfo, ptys - ptys /// Optimized unification routine that avoids creating new inference /// variables unnecessarily let UnifyFunctionTypeUndoIfFailed cenv denv m ty = match tryDestFunTy cenv.g ty with - | None -> + | ValueNone -> let domainTy = NewInferenceType () let resultTy = NewInferenceType () if AddCxTypeEqualsTypeUndoIfFailed denv cenv.css m ty (domainTy --> resultTy) then - Some(domainTy, resultTy) + ValueSome(domainTy, resultTy) else - None + ValueNone | r -> r /// Optimized unification routine that avoids creating new inference /// variables unnecessarily let UnifyFunctionType extraInfo cenv denv mFunExpr ty = match UnifyFunctionTypeUndoIfFailed cenv denv mFunExpr ty with - | Some res -> res - | None -> + | ValueSome res -> res + | ValueNone -> match extraInfo with | Some argm -> error (NotAFunction(denv, ty, mFunExpr, argm)) | None -> error (FunctionExpected(denv, ty, mFunExpr)) @@ -1507,7 +1541,7 @@ let MakeAndPublishBaseVal cenv env baseIdOpt ty = let InstanceMembersNeedSafeInitCheck cenv m thisTy = ExistsInEntireHierarchyOfType - (fun ty -> not (isStructTy cenv.g ty) && (match tryDestAppTy cenv.g ty with Some tcref when tcref.HasSelfReferentialConstructor -> true | _ -> false)) + (fun ty -> not (isStructTy cenv.g ty) && (match tryDestAppTy cenv.g ty with ValueSome tcref when tcref.HasSelfReferentialConstructor -> true | _ -> false)) cenv.g cenv.amap m @@ -1923,6 +1957,7 @@ let FreshenAbstractSlot g amap m synTyparDecls absMethInfo = let BuildFieldMap cenv env isPartial ty flds m = let ad = env.eAccessRights if isNil flds then invalidArg "flds" "BuildFieldMap" + let fldCount = flds.Length let frefSets = let allFields = flds |> List.map (fun ((_, ident), _) -> ident) @@ -1942,7 +1977,7 @@ let BuildFieldMap cenv env isPartial ty flds m = warning (Error(FSComp.SR.tcFieldsDoNotDetermineUniqueRecordType(), m)) // try finding a record type with the same number of fields as the ones that are given. - match tcrefs |> List.tryFind (fun tc -> tc.TrueFieldsAsList.Length = flds.Length) with + match tcrefs |> List.tryFind (fun tc -> tc.TrueFieldsAsList.Length = fldCount) with | Some tcref -> tcref | _ -> // OK, there isn't a unique, good type dictated by the intersection for the field refs. @@ -2204,11 +2239,11 @@ module GeneralizationHelpers = let lhsConstraintTypars = allUntupledArgTys |> List.collect (fun ty -> match tryDestTyparTy cenv.g ty with - | Some tp -> + | ValueSome tp -> match relevantUniqueSubtypeConstraint tp with | Some cxty -> freeInTypeLeftToRight cenv.g false cxty | None -> [] - | None -> []) + | _ -> []) let IsCondensationTypar (tp:Typar) = // A condensation typar may not a user-generated type variable nor has it been unified with any user type variable @@ -2220,7 +2255,7 @@ module GeneralizationHelpers = // A condensation typar can't be used in the constraints of any candidate condensation typars not (ListSet.contains typarEq tp lhsConstraintTypars) && // A condensation typar must occur precisely once in tyIJ, and must not occur free in any other tyIJ - (match allUntupledArgTysWithFreeVars |> List.partition (fun (ty, _) -> match tryDestTyparTy cenv.g ty with Some destTypar -> typarEq destTypar tp | _ -> false) with + (match allUntupledArgTysWithFreeVars |> List.partition (fun (ty, _) -> match tryDestTyparTy cenv.g ty with ValueSome destTypar -> typarEq destTypar tp | _ -> false) with | [_], rest -> not (rest |> List.exists (fun (_, fvs) -> ListSet.contains typarEq tp fvs)) | _ -> false) @@ -2969,8 +3004,8 @@ let BuildPossiblyConditionalMethodCall cenv env isMutable m isProp minfo valUseF let conditionalCallDefineOpt = TryFindMethInfoStringAttribute cenv.g m cenv.g.attrib_ConditionalAttribute minfo - match conditionalCallDefineOpt with - | Some d when not (List.contains d cenv.conditionalDefines) -> + match conditionalCallDefineOpt, cenv.conditionalDefines with + | Some d, Some defines when not (List.contains d defines) -> // Methods marked with 'Conditional' must return 'unit' UnifyTypes cenv env m cenv.g.unit_ty (minfo.GetFSharpReturnTy(cenv.amap, m, minst)) @@ -3155,7 +3190,7 @@ let GetMethodArgs arg = let args = match arg with | SynExpr.Const (SynConst.Unit, _) -> [] - | SynExprParen(SynExpr.Tuple (args, _, _), _, _, _) | SynExpr.Tuple (args, _, _) -> args + | SynExprParen(SynExpr.Tuple (false, args, _, _), _, _, _) | SynExpr.Tuple (false, args, _, _) -> args | SynExprParen(arg, _, _, _) | arg -> [arg] let unnamedCallerArgs, namedCallerArgs = args |> List.takeUntil IsNamedArg @@ -3438,10 +3473,10 @@ let elimFastIntegerForLoop (spBind, id, start, dir, finish, innerExpr, m) = let (|ExprAsPat|_|) (f:SynExpr) = match f with | SingleIdent v1 | SynExprParen(SingleIdent v1, _, _, _) -> Some (mkSynPatVar None v1) - | SynExprParen(SynExpr.Tuple (elems, _, _), _, _, _) -> + | SynExprParen(SynExpr.Tuple (false, elems, _, _), _, _, _) -> let elems = elems |> List.map (|SingleIdent|_|) if elems |> List.forall (fun x -> x.IsSome) then - Some (SynPat.Tuple((elems |> List.map (fun x -> mkSynPatVar None x.Value)), f.Range)) + Some (SynPat.Tuple(false, (elems |> List.map (fun x -> mkSynPatVar None x.Value)), f.Range)) else None | _ -> None @@ -4470,9 +4505,9 @@ and TcTyparOrMeasurePar optKind cenv (env:TcEnv) newOk tpenv (Typar(id, _, _) as // CallNameResolutionSink cenv.tcSink (tp.Range.StartRange, env.NameEnv, item, item, ItemOccurence.UseInType, env.DisplayEnv, env.eAccessRights) res, tpenv let key = id.idText - match env.eNameResEnv.eTypars.TryFind key with - | Some res -> checkRes res - | None -> + match env.eNameResEnv.eTypars.TryGetValue key with + | true, res -> checkRes res + | _ -> match TryFindUnscopedTypar key tpenv with | Some res -> checkRes res | None -> @@ -4580,21 +4615,34 @@ and TcTypeOrMeasure optKind cenv newOk checkCxs occ env (tpenv:SyntacticUnscoped match ltyp with | AppTy cenv.g (tcref, tinst) -> let tcref = ResolveTypeLongIdentInTyconRef cenv.tcSink cenv.nameResolver env.eNameResEnv (TypeNameResolutionInfo.ResolveToTypeRefs (TypeNameResolutionStaticArgsInfo.FromTyArgs args.Length)) ad m tcref longId - TcTypeApp cenv newOk checkCxs occ env tpenv m tcref tinst args + TcTypeApp cenv newOk checkCxs occ env tpenv m tcref tinst args | _ -> error(Error(FSComp.SR.tcTypeHasNoNestedTypes(), m)) - | SynType.Tuple(args, m) -> - let isMeasure = match optKind with Some TyparKind.Measure -> true | None -> List.exists (fun (isquot, _) -> isquot) args | _ -> false - if isMeasure then - let ms, tpenv = TcMeasuresAsTuple cenv newOk checkCxs occ env tpenv args m - TType_measure ms, tpenv + | SynType.Tuple(isStruct, args, m) -> + let tupInfo = mkTupInfo isStruct + if isStruct then + let args',tpenv = TcTypesAsTuple cenv newOk checkCxs occ env tpenv args m + TType_tuple(tupInfo,args'),tpenv else - let args', tpenv = TcTypesAsTuple cenv newOk checkCxs occ env tpenv args m - TType_tuple(tupInfoRef, args'), tpenv - - | SynType.StructTuple(args, m) -> - let args', tpenv = TcTypesAsTuple cenv newOk checkCxs occ env tpenv args m - TType_tuple(tupInfoStruct, args'), tpenv + let isMeasure = match optKind with Some TyparKind.Measure -> true | None -> List.exists (fun (isquot,_) -> isquot) args | _ -> false + if isMeasure then + let ms,tpenv = TcMeasuresAsTuple cenv newOk checkCxs occ env tpenv args m + TType_measure ms,tpenv + else + let args',tpenv = TcTypesAsTuple cenv newOk checkCxs occ env tpenv args m + TType_tuple(tupInfo,args'),tpenv + + | SynType.AnonRecd(isStruct, args,m) -> + let tupInfo = mkTupInfo isStruct + let args',tpenv = TcTypesAsTuple cenv newOk checkCxs occ env tpenv (args |> List.map snd |> List.map (fun x -> (false,x))) m + let unsortedIds = args |> List.map fst |> List.toArray + let anonInfo = AnonRecdTypeInfo.Create(cenv.topCcu, tupInfo, unsortedIds) + // Sort into canonical order + let sortedArgTys, sortedCheckedArgTys = List.zip args args' |> List.indexed |> List.sortBy (fun (i,_) -> unsortedIds.[i].idText) |> List.map snd |> List.unzip + sortedArgTys |> List.iteri (fun i (x,_) -> + let item = Item.AnonRecdField(anonInfo, sortedCheckedArgTys, i, x.idRange) + CallNameResolutionSink cenv.tcSink (x.idRange,env.NameEnv,item,item,emptyTyparInst,ItemOccurence.UseInType,env.DisplayEnv,env.eAccessRights)) + TType_anon(anonInfo, sortedCheckedArgTys),tpenv | SynType.Fun(domainTy, resultTy, _) -> let domainTy', tpenv = TcTypeAndRecover cenv newOk checkCxs occ env tpenv domainTy @@ -5101,17 +5149,17 @@ and TcPatBindingName cenv env id ty isMemberThis vis1 topValData (inlineFlag, de let names = Map.add id.idText (PrelimValScheme1(id, declaredTypars, ty, topValData, None, isMutable, inlineFlag, baseOrThis, argAttribs, vis, compgen)) names let takenNames = Set.add id.idText takenNames (fun (TcPatPhase2Input (values, isLeftMost)) -> - let (vspec, typeScheme) = - match values.TryFind id.idText with - | Some value -> - let name = id.idText + let (vspec, typeScheme) = + let name = id.idText + match values.TryGetValue name with + | true, value -> if not (String.IsNullOrEmpty name) && Char.IsLower(name.[0]) then - match TryFindPatternByName name env.eNameResEnv with - | Some (Item.Value vref) when vref.LiteralValue.IsSome -> - warning(Error(FSComp.SR.checkLowercaseLiteralBindingInPattern(id.idText), id.idRange)) - | Some _ | None -> () + match env.eNameResEnv.ePatItems.TryGetValue name with + | true, Item.Value vref when vref.LiteralValue.IsSome -> + warning(Error(FSComp.SR.checkLowercaseLiteralBindingInPattern name, id.idRange)) + | _ -> () value - | None -> error(Error(FSComp.SR.tcNameNotBoundInPattern(id.idText), id.idRange)) + | _ -> error(Error(FSComp.SR.tcNameNotBoundInPattern name, id.idRange)) // isLeftMost indicates we are processing the left-most path through a disjunctive or pattern. // For those binding locations, CallNameResolutionSink is called in MakeAndPublishValue, like all other bindings @@ -5198,10 +5246,10 @@ and TcPat warnOnUpper cenv env topValInfo vFlags (tpenv, names, takenNames) ty p // matching error (UnionPatternsBindDifferentNames m) names1 |> Map.iter (fun _ (PrelimValScheme1(id1, _, ty1, _, _, _, _, _, _, _, _)) -> - match Map.tryFind id1.idText names2 with - | None -> () - | Some (PrelimValScheme1(_, _, ty2, _, _, _, _, _, _, _, _)) -> - UnifyTypes cenv env m ty1 ty2) + match names2.TryGetValue id1.idText with + | true, PrelimValScheme1(_, _, ty2, _, _, _, _, _, _, _, _) -> + UnifyTypes cenv env m ty1 ty2 + | _ -> ()) (fun values -> TPat_disjs ([pat1' values;pat2' values.RightPath], m)), (tpenv, names1, takenNames1) | SynPat.Ands (pats, m) -> @@ -5269,10 +5317,10 @@ and TcPat warnOnUpper cenv env topValInfo vFlags (tpenv, names, takenNames) ty p SynExpr.DiscardAfterMissingQualificationAfterDot(e, unionRanges e.Range (List.last dotms)) else SynExpr.LongIdent(false, lidwd, None, m) List.fold (fun f x -> mkSynApp1 f (convSynPatToSynExpr x) m) e args - | SynPat.Tuple (args, m) -> SynExpr.Tuple(List.map convSynPatToSynExpr args, [], m) + | SynPat.Tuple (isStruct, args, m) -> SynExpr.Tuple(isStruct, List.map convSynPatToSynExpr args, [], m) | SynPat.Paren (p, _) -> convSynPatToSynExpr p - | SynPat.ArrayOrList (isArray, args, m) -> SynExpr.ArrayOrList(isArray, List.map convSynPatToSynExpr args, m) - | SynPat.QuoteExpr (e, _) -> e + | SynPat.ArrayOrList (isArray, args, m) -> SynExpr.ArrayOrList(isArray,List.map convSynPatToSynExpr args, m) + | SynPat.QuoteExpr (e,_) -> e | SynPat.Null m -> SynExpr.Null(m) | _ -> error(Error(FSComp.SR.tcInvalidArgForParameterizedPattern(), x.Range)) let activePatArgsAsSynExprs = List.map convSynPatToSynExpr activePatArgsAsSynPats @@ -5315,12 +5363,14 @@ and TcPat warnOnUpper cenv env topValInfo vFlags (tpenv, names, takenNames) ty p for (id, pat) in pairs do match argNames |> List.tryFindIndex (fun id2 -> id.idText = id2.idText) with | None -> - let caseName = - match item with - | Item.UnionCase(uci, _) -> uci.Name - | Item.ExnCase tcref -> tcref.DisplayName - | _ -> failwith "impossible" - error(Error(FSComp.SR.tcUnionCaseConstructorDoesNotHaveFieldWithGivenName(caseName, id.idText), id.idRange)) + match item with + | Item.UnionCase(uci, _) -> + error(Error(FSComp.SR.tcUnionCaseConstructorDoesNotHaveFieldWithGivenName(uci.Name, id.idText), id.idRange)) + | Item.ExnCase tcref -> + error(Error(FSComp.SR.tcExceptionConstructorDoesNotHaveFieldWithGivenName(tcref.DisplayName, id.idText), id.idRange)) + | _ -> + error(Error(FSComp.SR.tcConstructorDoesNotHaveFieldWithGivenName(id.idText), id.idRange)) + | Some idx -> match box result.[idx] with | null -> @@ -5339,13 +5389,13 @@ and TcPat warnOnUpper cenv env topValInfo vFlags (tpenv, names, takenNames) ty p let args = List.ofArray result if result.Length = 1 then args - else [ SynPat.Tuple(args, m) ] + else [ SynPat.Tuple(false, args, m) ] let args = match args with | []-> [] // note: the next will always be parenthesized - | [SynPatErrorSkip(SynPat.Tuple (args, _)) | SynPatErrorSkip(SynPat.Paren(SynPatErrorSkip(SynPat.Tuple (args, _)), _))] when numArgTys > 1 -> args + | [SynPatErrorSkip(SynPat.Tuple (false, args, _)) | SynPatErrorSkip(SynPat.Paren(SynPatErrorSkip(SynPat.Tuple (false, args, _)), _))] when numArgTys > 1 -> args // note: we allow both 'C _' and 'C (_)' regardless of number of argument of the pattern | [SynPatErrorSkip(SynPat.Wild _ as e) | SynPatErrorSkip(SynPat.Paren(SynPatErrorSkip(SynPat.Wild _ as e), _))] -> Array.toList (Array.create numArgTys e) @@ -5409,17 +5459,10 @@ and TcPat warnOnUpper cenv env topValInfo vFlags (tpenv, names, takenNames) ty p | SynPat.QuoteExpr(_, m) -> error (Error(FSComp.SR.tcInvalidPattern(), m)) - | SynPat.Tuple (args, m) -> - let argTys = NewInferenceTypes args - UnifyTypes cenv env m ty (TType_tuple (tupInfoRef, argTys)) - let args', acc = TcPatterns warnOnUpper cenv env vFlags (tpenv, names, takenNames) argTys args - (fun values -> TPat_tuple(tupInfoRef, List.map (fun f -> f values) args', argTys, m)), acc - - | SynPat.StructTuple (args, m) -> - let argTys = NewInferenceTypes args - UnifyTypes cenv env m ty (TType_tuple (tupInfoStruct, argTys)) + | SynPat.Tuple (isExplicitStruct, args, m) -> + let tupInfo, argTys = UnifyTupleTypeAndInferCharacteristics env.eContextInfo cenv env.DisplayEnv m ty isExplicitStruct args let args', acc = TcPatterns warnOnUpper cenv env vFlags (tpenv, names, takenNames) argTys args - (fun values -> TPat_tuple(tupInfoStruct, List.map (fun f -> f values) args', argTys, m)), acc + (fun values -> TPat_tuple(tupInfo, List.map (fun f -> f values) args', argTys, m)), acc | SynPat.Paren (p, _) -> TcPat warnOnUpper cenv env None vFlags (tpenv, names, takenNames) ty p @@ -5442,9 +5485,9 @@ and TcPat warnOnUpper cenv env topValInfo vFlags (tpenv, names, takenNames) ty p let ftys = fields |> List.map (fun fsp -> actualTyOfRecdField inst fsp, fsp) let fldsmap', acc = ((tpenv, names, takenNames), ftys) ||> List.mapFold (fun s (ty, fsp) -> - match Map.tryFind fsp.rfield_id.idText fldsmap with - | Some v -> TcPat warnOnUpper cenv env None vFlags s ty v - | None -> (fun _ -> TPat_wild m), s) + match fldsmap.TryGetValue fsp.rfield_id.idText with + | true, v -> TcPat warnOnUpper cenv env None vFlags s ty v + | _ -> (fun _ -> TPat_wild m), s) (fun values -> TPat_recd (tcref, tinst, List.map (fun f -> f values) fldsmap', m)), acc @@ -5647,15 +5690,15 @@ and TcExprThen cenv overallTy env tpenv synExpr delayed = let expr, exprty, tpenv = TcExprUndelayedNoType cenv env tpenv synExpr PropagateThenTcDelayed cenv overallTy env tpenv synExpr.Range (MakeApplicableExprNoFlex cenv expr) exprty ExprAtomicFlag.NonAtomic delayed -and TcExprs cenv env m tpenv flexes argtys args = - if List.length args <> List.length argtys then error(Error(FSComp.SR.tcExpressionCountMisMatch((List.length argtys), (List.length args)), m)) - (tpenv, List.zip3 flexes argtys args) ||> List.mapFold (fun tpenv (flex, ty, e) -> +and TcExprs cenv env m tpenv flexes argTys args = + if List.length args <> List.length argTys then error(Error(FSComp.SR.tcExpressionCountMisMatch((List.length argTys), (List.length args)), m)) + (tpenv, List.zip3 flexes argTys args) ||> List.mapFold (fun tpenv (flex, ty, e) -> TcExprFlex cenv flex false ty env tpenv e) and CheckSuperInit cenv objTy m = // Check the type is not abstract match tryDestAppTy cenv.g objTy with - | Some tcref when isAbstractTycon tcref.Deref -> + | ValueSome tcref when isAbstractTycon tcref.Deref -> errorR(Error(FSComp.SR.tcAbstractTypeCannotBeInstantiated(), m)) | _ -> () @@ -5789,20 +5832,16 @@ and TcExprUndelayed cenv overallTy env tpenv (synExpr: SynExpr) = let expr = mkLazyDelayed cenv.g m innerTy (mkUnitDelayLambda cenv.g m innerExpr) expr, tpenv - | SynExpr.Tuple (args, _, m) -> - let argTys = UnifyRefTupleType env.eContextInfo cenv env.DisplayEnv m overallTy args + | SynExpr.Tuple (isExplicitStruct, args, _, m) -> + let tupInfo, argTys = UnifyTupleTypeAndInferCharacteristics env.eContextInfo cenv env.DisplayEnv m overallTy isExplicitStruct args // No subsumption at tuple construction let flexes = argTys |> List.map (fun _ -> false) let args', tpenv = TcExprs cenv env m tpenv flexes argTys args - let expr = mkRefTupled cenv.g m args' argTys + let expr = mkAnyTupled cenv.g m tupInfo args' argTys expr, tpenv - | SynExpr.StructTuple (args, _, m) -> - let argTys = UnifyStructTupleType env.eContextInfo cenv env.DisplayEnv m overallTy args - // No subsumption at tuple construction - let flexes = argTys |> List.map (fun _ -> false) - let args', tpenv = TcExprs cenv env m tpenv flexes argTys args - mkAnyTupled cenv.g m tupInfoStruct args' argTys, tpenv + | SynExpr.AnonRecd (isStruct, optOrigExpr, unsortedArgs, mWholeExpr) -> + TcAnonRecdExpr cenv overallTy env tpenv (isStruct, optOrigExpr, unsortedArgs, mWholeExpr) | SynExpr.ArrayOrList (isArray, args, m) -> CallExprHasTypeSink cenv.tcSink (m, env.NameEnv, overallTy, env.DisplayEnv, env.eAccessRights) @@ -6182,9 +6221,9 @@ and TcIndexerThen cenv env overallTy mWholeExpr mDot tpenv wholeExpr e1 indexArg match acc with | None -> match tryDestAppTy cenv.g ty with - | Some tcref -> + | ValueSome tcref -> TryFindTyconRefStringAttribute cenv.g mWholeExpr cenv.g.attrib_DefaultMemberAttribute tcref - | None -> + | _ -> match AllPropInfosOfTypeInScope cenv.infoReader env.NameEnv (Some "Item", ad) IgnoreOverrides mWholeExpr ty with | [] -> None | _ -> Some "Item" @@ -6208,7 +6247,7 @@ and TcIndexerThen cenv env overallTy mWholeExpr mDot tpenv wholeExpr e1 indexArg match indexArgs with | [] -> failwith "unexpected empty index list" | [SynIndexerArg.One h] -> SynExpr.Paren(h, range0, None, idxRange) - | _ -> SynExpr.Paren(SynExpr.Tuple(GetIndexArgs indexArgs @ Option.toList vopt, [], idxRange), range0, None, idxRange) + | _ -> SynExpr.Paren(SynExpr.Tuple(false, GetIndexArgs indexArgs @ Option.toList vopt, [], idxRange), range0, None, idxRange) let attemptArrayString = if isArray || isString then @@ -6217,13 +6256,13 @@ and TcIndexerThen cenv env overallTy mWholeExpr mDot tpenv wholeExpr e1 indexArg let sliceOpPath = ["Microsoft";"FSharp";"Core";"Operators";"OperatorIntrinsics"] let info = match isString, isArray, wholeExpr with - | false, true, SynExpr.DotIndexedGet(_, [SynIndexerArg.One(SynExpr.Tuple ([_;_] as idxs, _, _))], _, _) -> Some (indexOpPath, "GetArray2D", idxs) - | false, true, SynExpr.DotIndexedGet(_, [SynIndexerArg.One(SynExpr.Tuple ([_;_;_] as idxs, _, _))], _, _) -> Some (indexOpPath, "GetArray3D", idxs) - | false, true, SynExpr.DotIndexedGet(_, [SynIndexerArg.One(SynExpr.Tuple ([_;_;_;_] as idxs, _, _))], _, _) -> Some (indexOpPath, "GetArray4D", idxs) + | false, true, SynExpr.DotIndexedGet(_, [SynIndexerArg.One(SynExpr.Tuple (false, ([_;_] as idxs), _, _))], _, _) -> Some (indexOpPath, "GetArray2D", idxs) + | false, true, SynExpr.DotIndexedGet(_, [SynIndexerArg.One(SynExpr.Tuple (false, ([_;_;_] as idxs), _, _))], _, _) -> Some (indexOpPath, "GetArray3D", idxs) + | false, true, SynExpr.DotIndexedGet(_, [SynIndexerArg.One(SynExpr.Tuple (false, ([_;_;_;_] as idxs), _, _))], _, _) -> Some (indexOpPath, "GetArray4D", idxs) | false, true, SynExpr.DotIndexedGet(_, [SynIndexerArg.One idx], _, _) -> Some (indexOpPath, "GetArray", [idx]) - | false, true, SynExpr.DotIndexedSet(_, [SynIndexerArg.One(SynExpr.Tuple ([_;_] as idxs, _, _))] , e3, _, _, _) -> Some (indexOpPath, "SetArray2D", (idxs @ [e3])) - | false, true, SynExpr.DotIndexedSet(_, [SynIndexerArg.One(SynExpr.Tuple ([_;_;_] as idxs, _, _))] , e3, _, _, _) -> Some (indexOpPath, "SetArray3D", (idxs @ [e3])) - | false, true, SynExpr.DotIndexedSet(_, [SynIndexerArg.One(SynExpr.Tuple ([_;_;_;_] as idxs, _, _))] , e3, _, _, _) -> Some (indexOpPath, "SetArray4D", (idxs @ [e3])) + | false, true, SynExpr.DotIndexedSet(_, [SynIndexerArg.One(SynExpr.Tuple (false, ([_;_] as idxs), _, _))] , e3, _, _, _) -> Some (indexOpPath, "SetArray2D", (idxs @ [e3])) + | false, true, SynExpr.DotIndexedSet(_, [SynIndexerArg.One(SynExpr.Tuple (false, ([_;_;_] as idxs), _, _))] , e3, _, _, _) -> Some (indexOpPath, "SetArray3D", (idxs @ [e3])) + | false, true, SynExpr.DotIndexedSet(_, [SynIndexerArg.One(SynExpr.Tuple (false, ([_;_;_;_] as idxs), _, _))] , e3, _, _, _) -> Some (indexOpPath, "SetArray4D", (idxs @ [e3])) | false, true, SynExpr.DotIndexedSet(_, [SynIndexerArg.One _], e3, _, _, _) -> Some (indexOpPath, "SetArray", (GetIndexArgs indexArgs @ [e3])) | true, false, SynExpr.DotIndexedGet(_, [SynIndexerArg.Two _], _, _) -> Some (sliceOpPath, "GetStringSlice", GetIndexArgs indexArgs) | true, false, SynExpr.DotIndexedGet(_, [SynIndexerArg.One _], _, _) -> Some (indexOpPath, "GetString", GetIndexArgs indexArgs) @@ -6340,10 +6379,6 @@ and TcCtorCall isNaked cenv env tpenv overallTy objTy mObjTyOpt item superInit a error(Error(FSComp.SR.tcSyntaxCanOnlyBeUsedToCreateObjectTypes(if superInit then "inherit" else "new"), mWholeCall)) -//------------------------------------------------------------------------- -// TcRecordConstruction -//------------------------------------------------------------------------- - // Check a record construction expression and TcRecordConstruction cenv overallTy env tpenv optOrigExprInfo objTy fldsList m = let tcref, tinst = destAppTy cenv.g objTy @@ -6666,8 +6701,8 @@ and TcObjectExpr cenv overallTy env tpenv (synObjTy, argopt, binds, extraImpls, let objTy, tpenv = TcType cenv NewTyparsOK CheckCxs ItemOccurence.UseInType env tpenv synObjTy match tryDestAppTy cenv.g objTy with - | None -> error(Error(FSComp.SR.tcNewMustBeUsedWithNamedType(), mNewExpr)) - | Some tcref -> + | ValueNone -> error(Error(FSComp.SR.tcNewMustBeUsedWithNamedType(), mNewExpr)) + | ValueSome tcref -> let isRecordTy = isRecdTy cenv.g objTy if not isRecordTy && not (isInterfaceTy cenv.g objTy) && isSealedTy cenv.g objTy then errorR(Error(FSComp.SR.tcCannotCreateExtensionOfSealedType(), mNewExpr)) @@ -6683,9 +6718,9 @@ and TcObjectExpr cenv overallTy env tpenv (synObjTy, argopt, binds, extraImpls, if // record construction ? isRecordTy || // object construction? - (isFSharpObjModelTy cenv.g objTy && not (isInterfaceTy cenv.g objTy) && Option.isNone argopt) then + (isFSharpObjModelTy cenv.g objTy && not (isInterfaceTy cenv.g objTy) && argopt.IsNone) then - if Option.isSome argopt then error(Error(FSComp.SR.tcNoArgumentsForRecordValue(), mWholeExpr)) + if argopt.IsSome then error(Error(FSComp.SR.tcNoArgumentsForRecordValue(), mWholeExpr)) if not (isNil extraImpls) then error(Error(FSComp.SR.tcNoInterfaceImplementationForConstructionExpression(), mNewExpr)) if isFSharpObjModelTy cenv.g objTy && GetCtorShapeCounter env <> 1 then error(Error(FSComp.SR.tcObjectConstructionCanOnlyBeUsedInClassTypes(), mNewExpr)) @@ -6892,11 +6927,6 @@ and TcAssertExpr cenv overallTy env (m:range) tpenv x = TcExpr cenv overallTy env tpenv callDiagnosticsExpr - -//------------------------------------------------------------------------- -// TcRecdExpr -//------------------------------------------------------------------------- - and TcRecdExpr cenv overallTy env tpenv (inherits, optOrigExpr, flds, mWholeExpr) = let transformAstForNestedUpdates (lidwd : LongIdentWithDots) v = let recdExprCopyInfo ids (optOrigExpr : (SynExpr * BlockSeparator) option) (id : Ident) = @@ -7074,9 +7104,104 @@ and TcRecdExpr cenv overallTy env tpenv (inherits, optOrigExpr, flds, mWholeExpr expr, tpenv -//------------------------------------------------------------------------- -// TcForEachExpr -//------------------------------------------------------------------------- +// Check '{| .... |}' +and TcAnonRecdExpr cenv overallTy env tpenv (isStruct, optOrigExpr, unsortedArgs, mWholeExpr) = + + match optOrigExpr with + | None -> + let unsortedIds = unsortedArgs |> List.map fst |> List.toArray + let anonInfo, sortedArgTys = UnifyAnonRecdTypeAndInferCharacteristics env.eContextInfo cenv env.DisplayEnv mWholeExpr overallTy isStruct unsortedIds + + // Sort into canonical order + let sortedIndexedArgs = unsortedArgs |> List.indexed |> List.sortBy (fun (i,_) -> unsortedIds.[i].idText) + let sigma = List.map fst sortedIndexedArgs |> List.toArray + let sortedArgs = List.map snd sortedIndexedArgs + sortedArgs |> List.iteri (fun j (x, _) -> + let item = Item.AnonRecdField(anonInfo, sortedArgTys, j, x.idRange) + CallNameResolutionSink cenv.tcSink (x.idRange, env.NameEnv, item, item, emptyTyparInst, ItemOccurence.Use, env.DisplayEnv, env.eAccessRights)) + let unsortedArgTys = sortedArgTys |> List.indexed |> List.sortBy (fun (j, _) -> sigma.[j]) |> List.map snd + let flexes = unsortedArgTys |> List.map (fun _ -> true) + let unsortedCheckedArgs, tpenv = TcExprs cenv env mWholeExpr tpenv flexes unsortedArgTys (List.map snd unsortedArgs) + let sortedCheckedArgs = unsortedCheckedArgs |> List.indexed |> List.sortBy (fun (i,_) -> unsortedIds.[i].idText) |> List.map snd + + mkAnonRecd cenv.g mWholeExpr anonInfo sortedCheckedArgs sortedArgTys, tpenv + + | Some (origExpr, _) -> + // The fairly complex case '{| origExpr with X = 1; Y = 2 |}' + // The origExpr may be either a record or anonymous record. + // The origExpr may be either a struct or not. + // All the properties of origExpr are copied across except where they are overridden. + // The result is a field-sorted anonymous record. + // + // Unlike in the case of record type copy-and-update we do _not_ assume that the origExpr has the same type as the overall expression. + // Unlike in the case of record type copy-and-update {| a with X = 1 |} does not force a.X to exist or have had type 'int' + + let origExprTy = NewInferenceType() + let origExprChecked, tpenv = TcExpr cenv origExprTy env tpenv origExpr + let oldv, oldve = mkCompGenLocal mWholeExpr "inputRecord" origExprTy + let mOrigExpr = origExpr.Range + + if not (isAppTy cenv.g origExprTy || isAnonRecdTy cenv.g origExprTy) then + error (Error (FSComp.SR.tcCopyAndUpdateNeedsRecordType(), mOrigExpr)) + + let origExprIsStruct = + match tryDestAnonRecdTy cenv.g origExprTy with + | ValueSome (anonInfo, _) -> evalTupInfoIsStruct anonInfo.TupInfo + | ValueNone -> + let tcref, _ = destAppTy cenv.g origExprTy + tcref.IsStructOrEnumTycon + + let wrap, oldveaddr, _readonly, _writeonly = mkExprAddrOfExpr cenv.g origExprIsStruct false NeverMutates oldve None mOrigExpr + + // Put all the expressions in unsorted order. The new bindings come first. The origin of each is tracked using + /// - Choice1Of2 for a new binding + /// - Choice2Of2 for a binding coming from the original expression + let unsortedIdAndExprsAll = + [| for (id, e) in unsortedArgs do + yield (id, Choice1Of2 e) + match tryDestAnonRecdTy cenv.g origExprTy with + | ValueSome (anonInfo, tinst) -> + for (i, id) in Array.indexed anonInfo.SortedIds do + yield id, Choice2Of2 (mkAnonRecdFieldGetViaExprAddr (anonInfo, oldveaddr, tinst, i, mOrigExpr)) + | ValueNone -> + if isRecdTy cenv.g origExprTy then + let tcref, tinst = destAppTy cenv.g origExprTy + let fspecs = tcref.Deref.TrueInstanceFieldsAsList + for fspec in fspecs do + yield fspec.Id, Choice2Of2 (mkRecdFieldGetViaExprAddr (oldveaddr , tcref.MakeNestedRecdFieldRef fspec, tinst, mOrigExpr)) + else + error (Error (FSComp.SR.tcCopyAndUpdateNeedsRecordType(), mOrigExpr)) |] + |> Array.distinctBy (fst >> textOfId) + + let unsortedIdsAll = Array.map fst unsortedIdAndExprsAll + let anonInfo, sortedArgTysAll = UnifyAnonRecdTypeAndInferCharacteristics env.eContextInfo cenv env.DisplayEnv mWholeExpr overallTy isStruct unsortedIdsAll + let sortedIndexedArgsAll = unsortedIdAndExprsAll |> Array.indexed |> Array.sortBy (snd >> fst >> textOfId) + let sigma = Array.map fst sortedIndexedArgsAll // map from sorted indexes to unsorted indexes + let sortedArgsAll = Array.map snd sortedIndexedArgsAll + sortedArgsAll |> Array.iteri (fun j (x, expr) -> + match expr with + | Choice1Of2 _ -> + let item = Item.AnonRecdField(anonInfo, sortedArgTysAll, j, x.idRange) + CallNameResolutionSink cenv.tcSink (x.idRange, env.NameEnv, item, item, emptyTyparInst, ItemOccurence.Use, env.DisplayEnv, env.eAccessRights) + | Choice2Of2 _ -> ()) + + let unsortedArgTysNew = sortedArgTysAll |> List.indexed |> List.sortBy (fun (j, _) -> sigma.[j]) |> List.take unsortedArgs.Length |> List.map snd + let flexes = unsortedArgTysNew |> List.map (fun _ -> true) + + let unsortedCheckedArgsNew, tpenv = TcExprs cenv env mWholeExpr tpenv flexes unsortedArgTysNew (List.map snd unsortedArgs) + let sortedArgTysAllArray = Array.ofList sortedArgTysAll + let unsortedCheckedArgsNewArray = unsortedCheckedArgsNew |> List.toArray + let sortedCheckedArgsAll = + sortedArgsAll |> Array.mapi (fun j (_, expr) -> + match expr with + | Choice1Of2 _ -> unsortedCheckedArgsNewArray.[sigma.[j]] + | Choice2Of2 subExpr -> UnifyTypes cenv env mOrigExpr (tyOfExpr cenv.g subExpr) sortedArgTysAllArray.[j]; subExpr) + + let expr = mkAnonRecd cenv.g mWholeExpr anonInfo (List.ofArray sortedCheckedArgsAll) sortedArgTysAll + let expr = wrap expr + let expr = mkCompGenLet mOrigExpr oldv origExprChecked expr + expr, tpenv + and TcForEachExpr cenv overallTy env tpenv (pat, enumSynExpr, bodySynExpr, mWholeExpr, spForLoop) = UnifyTypes cenv env mWholeExpr overallTy cenv.g.unit_ty @@ -7240,7 +7365,7 @@ and TcComputationExpression cenv env overallTy mWhole interpExpr builderTy tpenv match args with | [] -> SynExpr.Const(SynConst.Unit, m) | [arg] -> SynExpr.Paren(SynExpr.Paren(arg, range0, None, m), range0, None, m) - | args -> SynExpr.Paren(SynExpr.Tuple(args, [], m), range0, None, m) + | args -> SynExpr.Paren(SynExpr.Tuple(false, args, [], m), range0, None, m) let builderVal = mkSynIdGet m builderValName mkSynApp1 (SynExpr.DotGet(builderVal, range0, LongIdentWithDots([mkSynId m nm], []), m)) args m @@ -7606,7 +7731,7 @@ and TcComputationExpression cenv env overallTy mWhole interpExpr builderTy tpenv match patvs with | [] -> SynExpr.Const(SynConst.Unit, m) | [v] -> SynExpr.Ident v.Id - | vs -> SynExpr.Tuple((vs |> List.map (fun v -> SynExpr.Ident v.Id)), [], m) + | vs -> SynExpr.Tuple(false, (vs |> List.map (fun v -> SynExpr.Ident v.Id)), [], m) let mkSimplePatForVarSpace m (patvs: Val list) = let spats = @@ -7620,7 +7745,7 @@ and TcComputationExpression cenv env overallTy mWhole interpExpr builderTy tpenv match patvs with | [] -> SynPat.Const (SynConst.Unit, m) | [v] -> mkSynPatVar None v.Id - | vs -> SynPat.Tuple((vs |> List.map (fun x -> mkSynPatVar None x.Id)), m) + | vs -> SynPat.Tuple(false, (vs |> List.map (fun x -> mkSynPatVar None x.Id)), m) let (|OptionalSequential|) e = match e with @@ -7637,7 +7762,7 @@ and TcComputationExpression cenv env overallTy mWhole interpExpr builderTy tpenv let estimatedRangeOfIntendedLeftAndRightArguments = unionRanges (List.last args).Range arg2.Range errorR(Error(FSComp.SR.tcUnrecognizedQueryBinaryOperator(), estimatedRangeOfIntendedLeftAndRightArguments)) true - | SynExpr.Tuple( (StripApps(SingleIdent nm2, args) :: _), _, m) when + | SynExpr.Tuple(false, (StripApps(SingleIdent nm2, args) :: _), _, m) when expectedArgCountForCustomOperator nm2 > 0 && not (List.isEmpty args) -> let estimatedRangeOfIntendedLeftAndRightArguments = unionRanges (List.last args).Range m.EndRange @@ -8477,7 +8602,7 @@ and Propagate cenv overallTy env tpenv (expr: ApplicableExpr) exprty delayed = | DelayedApp (_, arg, mExprAndArg) :: delayedList' -> let denv = env.DisplayEnv match UnifyFunctionTypeUndoIfFailed cenv denv mExpr exprty with - | Some (_, resultTy) -> + | ValueSome (_, resultTy) -> // We add tag parameter to the return type for "&x" and 'NativePtr.toByRef' // See RFC FS-1053.md @@ -8490,7 +8615,7 @@ and Propagate cenv overallTy env tpenv (expr: ApplicableExpr) exprty delayed = propagate isAddrOf delayedList' mExprAndArg resultTy - | None -> + | _ -> let mArg = arg.Range match arg with | SynExpr.CompExpr _ -> () @@ -8529,7 +8654,7 @@ and TcDelayed cenv overallTy env tpenv mExpr expr exprty (atomicFlag:ExprAtomicF match delayed with | [] | DelayedDot :: _ -> - UnifyTypesAndRecover cenv env mExpr overallTy exprty + UnifyTypes cenv env mExpr overallTy exprty expr.Expr, tpenv // expr.M(args) where x.M is a .NET method or index property // expr.M(args) where x.M is a .NET method or index property @@ -8578,7 +8703,7 @@ and TcFunctionApplicationThen cenv overallTy env tpenv mExprAndArg expr exprty ( // If the type of 'synArg' unifies as a function type, then this is a function application, otherwise // it is an error or a computation expression match UnifyFunctionTypeUndoIfFailed cenv denv mFunExpr exprty with - | Some (domainTy, resultTy) -> + | ValueSome (domainTy, resultTy) -> // Notice the special case 'seq { ... }'. In this case 'seq' is actually a function in the F# library. // Set a flag in the syntax tree to say we noticed a leading 'seq' @@ -8595,7 +8720,7 @@ and TcFunctionApplicationThen cenv overallTy env tpenv mExprAndArg expr exprty ( let arg, tpenv = TcExpr cenv domainTy env tpenv synArg let exprAndArg, resultTy = buildApp cenv expr resultTy arg mExprAndArg TcDelayed cenv overallTy env tpenv mExprAndArg exprAndArg resultTy atomicFlag delayed - | None -> + | _ -> // OK, 'expr' doesn't have function type, but perhaps 'expr' is a computation expression builder, and 'arg' is '{ ... }' match synArg with | SynExpr.CompExpr (false, _isNotNakedRefCell, comp, _m) -> @@ -8663,8 +8788,8 @@ and TcItemThen cenv overallTy env tpenv (item, mItem, rest, afterResolution) del let (|FittedArgs|_|) arg = match arg with - | SynExprParen(SynExpr.Tuple(args, _, _), _, _, _) - | SynExpr.Tuple(args, _, _) when numArgTys > 1 -> Some args + | SynExprParen(SynExpr.Tuple(false, args, _, _), _, _, _) + | SynExpr.Tuple(false, args, _, _) when numArgTys > 1 -> Some args | SynExprParen(arg, _, _, _) | arg when numArgTys = 1 -> Some [arg] | _ -> None @@ -8734,13 +8859,16 @@ and TcItemThen cenv overallTy env tpenv (item, mItem, rest, afterResolution) del assert (isNull(box fittedArgs.[currentIndex])) fittedArgs.[currentIndex] <- List.item currentIndex args // grab original argument, not item from the list of named parameters currentIndex <- currentIndex + 1 - else - let caseName = - match item with - | Item.UnionCase(uci, _) -> uci.Name - | Item.ExnCase tcref -> tcref.DisplayName - | _ -> failwith "impossible" - error(Error(FSComp.SR.tcUnionCaseConstructorDoesNotHaveFieldWithGivenName(caseName, id.idText), id.idRange)) + else + match item with + | Item.UnionCase(uci, _) -> + error(Error(FSComp.SR.tcUnionCaseConstructorDoesNotHaveFieldWithGivenName(uci.Name, id.idText), id.idRange)) + | Item.ExnCase tcref -> + error(Error(FSComp.SR.tcExceptionConstructorDoesNotHaveFieldWithGivenName(tcref.DisplayName, id.idText), id.idRange)) + | Item.ActivePatternResult(_,_,_,_) -> + error(Error(FSComp.SR.tcActivePatternsDoNotHaveFields(), id.idRange)) + | _ -> + error(Error(FSComp.SR.tcConstructorDoesNotHaveFieldWithGivenName(id.idText), id.idRange)) assert (Seq.forall (box >> ((<>) null) ) fittedArgs) List.ofArray fittedArgs @@ -8955,14 +9083,14 @@ and TcItemThen cenv overallTy env tpenv (item, mItem, rest, afterResolution) del | SynExpr.Const _ | SynExpr.LongIdent _ -> true - | SynExpr.Tuple(synExprs, _, _) - | SynExpr.StructTuple(synExprs, _, _) + | SynExpr.Tuple(_, synExprs, _, _) | SynExpr.ArrayOrList(_, synExprs, _) -> synExprs |> List.forall isSimpleArgument | SynExpr.Record(_, copyOpt, fields, _) -> copyOpt |> Option.forall (fst >> isSimpleArgument) && fields |> List.forall (p23 >> Option.forall isSimpleArgument) | SynExpr.App (_, _, synExpr, synExpr2, _) -> isSimpleArgument synExpr && isSimpleArgument synExpr2 | SynExpr.IfThenElse(synExpr, synExpr2, synExprOpt, _, _, _, _) -> isSimpleArgument synExpr && isSimpleArgument synExpr2 && Option.forall isSimpleArgument synExprOpt | SynExpr.DotIndexedGet(synExpr, _, _, _) -> isSimpleArgument synExpr | SynExpr.ObjExpr _ + | SynExpr.AnonRecd _ | SynExpr.While _ | SynExpr.For _ | SynExpr.ForEach _ @@ -9329,6 +9457,18 @@ and TcLookupThen cenv overallTy env tpenv mObjExpr objExpr objExprTy longId dela let objExpr' = mkRecdFieldGet cenv.g (objExpr, rfinfo.RecdFieldRef, rfinfo.TypeInst, mExprAndItem) PropagateThenTcDelayed cenv overallTy env tpenv mExprAndItem (MakeApplicableExprWithFlex cenv env objExpr') fieldTy ExprAtomicFlag.Atomic delayed + | Item.AnonRecdField (anonInfo, tinst, n, _) -> + let tgty = TType_anon (anonInfo, tinst) + AddCxTypeMustSubsumeType ContextInfo.NoContext env.DisplayEnv cenv.css mItem NoTrace tgty objExprTy + let fieldTy = List.item n tinst + match delayed with + | DelayedSet _ :: _otherDelayed -> + error(Error(FSComp.SR.tcInvalidAssignment(),mItem)) + | _ -> + // Instance F# Anonymous Record + let objExpr' = mkAnonRecdFieldGet cenv.g (anonInfo,objExpr,tinst,n,mExprAndItem) + PropagateThenTcDelayed cenv overallTy env tpenv mExprAndItem (MakeApplicableExprWithFlex cenv env objExpr') fieldTy ExprAtomicFlag.Atomic delayed + | Item.ILField finfo -> // Get or set instance IL field ILFieldInstanceChecks cenv.g cenv.amap ad mItem finfo @@ -9889,10 +10029,11 @@ and TcMethodApplication let objArgPreBinder, objArgs = match objArgs, lambdaVars with | [objArg], Some _ -> + if finalCalledMethInfo.IsExtensionMember && finalCalledMethInfo.ObjArgNeedsAddress(cenv.amap, mMethExpr) then + error(Error(FSComp.SR.tcCannotPartiallyApplyExtensionMethodForByref(finalCalledMethInfo.DisplayName), mMethExpr)) let objArgTy = tyOfExpr cenv.g objArg let v, ve = mkCompGenLocal mMethExpr "objectArg" objArgTy (fun body -> mkCompGenLet mMethExpr v objArg body), [ve] - | _ -> emptyPreBinder, objArgs @@ -10010,7 +10151,7 @@ and TcMethodApplication | CallerLineNumber, _ when typeEquiv cenv.g currCalledArgTy cenv.g.int_ty -> emptyPreBinder, Expr.Const(Const.Int32(mMethExpr.StartLine), mMethExpr, currCalledArgTy) | CallerFilePath, _ when typeEquiv cenv.g currCalledArgTy cenv.g.string_ty -> - emptyPreBinder, Expr.Const(Const.String(System.IO.Path.GetFullPath(mMethExpr.FileName)), mMethExpr, currCalledArgTy) + emptyPreBinder, Expr.Const(Const.String(FileSystem.GetFullPathShim(mMethExpr.FileName)), mMethExpr, currCalledArgTy) | CallerMemberName, Some(callerName) when (typeEquiv cenv.g currCalledArgTy cenv.g.string_ty) -> emptyPreBinder, Expr.Const(Const.String(callerName), mMethExpr, currCalledArgTy) | _ -> @@ -10049,7 +10190,7 @@ and TcMethodApplication let lineExpr = Expr.Const(Const.Int32(mMethExpr.StartLine), mMethExpr, calledNonOptTy) emptyPreBinder, mkUnionCaseExpr(mkSomeCase cenv.g, [calledNonOptTy], [lineExpr], mMethExpr) | CallerFilePath, _ when typeEquiv cenv.g calledNonOptTy cenv.g.string_ty -> - let filePathExpr = Expr.Const(Const.String(System.IO.Path.GetFullPath(mMethExpr.FileName)), mMethExpr, calledNonOptTy) + let filePathExpr = Expr.Const(Const.String(FileSystem.GetFullPathShim(mMethExpr.FileName)), mMethExpr, calledNonOptTy) emptyPreBinder, mkUnionCaseExpr(mkSomeCase cenv.g, [calledNonOptTy], [filePathExpr], mMethExpr) | CallerMemberName, Some(callerName) when typeEquiv cenv.g calledNonOptTy cenv.g.string_ty -> let memberNameExpr = Expr.Const(Const.String(callerName), mMethExpr, calledNonOptTy) @@ -10302,10 +10443,10 @@ and TcMethodArg cenv env (lambdaPropagationInfo, tpenv) (lambdaPropagationInfo if allRowsGiveSameArgumentType then // Force the caller to be a function type. match UnifyFunctionTypeUndoIfFailed cenv env.DisplayEnv mArg callerLambdaTy with - | Some (callerLambdaDomainTy, callerLambdaRangeTy) -> + | ValueSome (callerLambdaDomainTy, callerLambdaRangeTy) -> if AddCxTypeEqualsTypeUndoIfFailed env.DisplayEnv cenv.css mArg calledLambdaArgTy callerLambdaDomainTy then loop callerLambdaRangeTy (lambdaVarNum + 1) - | None -> () + | _ -> () loop argTy 0 let e', tpenv = TcExpr cenv argTy env tpenv argExpr @@ -10778,11 +10919,10 @@ and TcAttribute canFail cenv (env: TcEnv) attrTgt (synAttr: SynAttribute) = let conditionalCallDefineOpt = TryFindTyconRefStringAttribute cenv.g mAttr cenv.g.attrib_ConditionalAttribute tcref - match conditionalCallDefineOpt with - | Some d when not (List.contains d cenv.conditionalDefines) -> + match conditionalCallDefineOpt, cenv.conditionalDefines with + | Some d, Some defines when not (List.contains d defines) -> [], false | _ -> - // REVIEW: take notice of inherited? let validOn, _inherited = let validOnDefault = 0x7fff @@ -11689,10 +11829,10 @@ and TcIncrementalLetRecGeneralization cenv scopem // pathological situations let freeInUncheckedRecBinds = lazy ((emptyFreeTyvars, cenv.recUses.Contents) ||> Map.fold (fun acc vStamp _ -> - match Map.tryFind vStamp uncheckedRecBindsTable with - | Some fwdBind -> - accFreeInType CollectAllNoCaching fwdBind.RecBindingInfo.Val.Type acc - | None -> + match uncheckedRecBindsTable.TryGetValue vStamp with + | true, fwdBind -> + accFreeInType CollectAllNoCaching fwdBind.RecBindingInfo.Val.Type acc + | _ -> acc)) let rec loop (preGeneralizationRecBinds: PreGeneralizationRecursiveBinding list, @@ -14154,7 +14294,7 @@ module AddAugmentationDeclarations = let tcaugHasNominalInterface g (tcaug: TyconAugmentation) tcref = tcaug.tcaug_interfaces |> List.exists (fun (x, _, _) -> match tryDestAppTy g x with - | Some tcref2 when tyconRefEq g tcref2 tcref -> true + | ValueSome tcref2 when tyconRefEq g tcref2 tcref -> true | _ -> false) let AddGenericCompareDeclarations cenv (env: TcEnv) (scSet:Set) (tycon:Tycon) = @@ -14302,7 +14442,7 @@ module TyconConstraintInference = // Is the field type a type parameter? match tryDestTyparTy cenv.g ty with - | Some tp -> + | ValueSome tp -> // Look for an explicit 'comparison' constraint if tp.Constraints |> List.exists (function TyparConstraint.SupportsComparison _ -> true | _ -> false) then true @@ -14315,7 +14455,7 @@ module TyconConstraintInference = else false - | None -> + | _ -> match ty with // Look for array, UIntPtr and IntPtr types | SpecialComparableHeadType g tinst -> @@ -14427,7 +14567,7 @@ module TyconConstraintInference = // and type parameters. let rec checkIfFieldTypeSupportsEquality (tycon:Tycon) (ty: TType) = match tryDestTyparTy cenv.g ty with - | Some tp -> + | ValueSome tp -> // Look for an explicit 'equality' constraint if tp.Constraints |> List.exists (function TyparConstraint.SupportsEquality _ -> true | _ -> false) then true @@ -14439,7 +14579,7 @@ module TyconConstraintInference = true else false - | None -> + | _ -> match ty with | SpecialEquatableHeadType g tinst -> tinst |> List.forall (checkIfFieldTypeSupportsEquality tycon) @@ -14784,11 +14924,11 @@ module EstablishTypeDefinitionCores = let AdjustModuleName modKind nm = (match modKind with FSharpModuleWithSuffix -> nm+FSharpModuleSuffix | _ -> nm) - let TypeNamesInMutRecDecls (compDecls: MutRecShapes) = + let TypeNamesInMutRecDecls cenv env (compDecls: MutRecShapes) = [ for d in compDecls do match d with - | MutRecShape.Tycon (MutRecDefnsPhase1DataForTycon(ComponentInfo(_, _, _, ids, _, _, _, _), _, _, _, _, isAtOriginalTyconDefn), _) -> - if isAtOriginalTyconDefn then + | MutRecShape.Tycon (MutRecDefnsPhase1DataForTycon(ComponentInfo(_, typars, _, ids, _, _, _, _), _, _, _, _, isAtOriginalTyconDefn), _) -> + if isAtOriginalTyconDefn && (TcTyparDecls cenv env typars |> List.forall (fun p -> p.Kind = TyparKind.Measure)) then yield (List.last ids).idText | _ -> () ] |> set @@ -14835,7 +14975,7 @@ module EstablishTypeDefinitionCores = let envForDecls, mtypeAcc = MakeInnerEnv envInitial id modKind let mspec = NewModuleOrNamespace (Some envInitial.eCompPath) vis id (xml.ToXmlDoc()) modAttrs (MaybeLazy.Strict (NewEmptyModuleOrNamespaceType modKind)) let innerParent = Parent (mkLocalModRef mspec) - let innerTypeNames = TypeNamesInMutRecDecls decls + let innerTypeNames = TypeNamesInMutRecDecls cenv envForDecls decls MutRecDefnsPhase2DataForModule (mtypeAcc, mspec), (innerParent, innerTypeNames, envForDecls) /// Establish 'type C < T1... TN > = ...' including @@ -15716,6 +15856,7 @@ module EstablishTypeDefinitionCores = let rec accInAbbrevType ty acc = match stripTyparEqns ty with + | TType_anon (_,l) | TType_tuple (_, l) -> accInAbbrevTypes l acc | TType_ucase (UCRef(tc, _), tinst) | TType_app (tc, tinst) -> @@ -15814,9 +15955,9 @@ module EstablishTypeDefinitionCores = else acc // note: all edges added are (tycon, _) let insertEdgeToType ty acc = match tryDestAppTy cenv.g ty with - | Some tcref -> + | ValueSome tcref -> insertEdgeToTycon tcref.Deref acc - | None -> + | _ -> acc // collect edges from an a struct field (which is struct-contained in tycon) @@ -15838,9 +15979,9 @@ module EstablishTypeDefinitionCores = (structTycon === tycon2) && (structTyInst, tinst2) ||> List.lengthsEqAndForall2 (fun ty1 ty2 -> match tryDestTyparTy cenv.g ty1 with - | Some destTypar1 -> + | ValueSome destTypar1 -> match tryDestTyparTy cenv.g ty2 with - | Some destTypar2 -> typarEq destTypar1 destTypar2 + | ValueSome destTypar2 -> typarEq destTypar1 destTypar2 | _ -> false | _ -> false) if specialCaseStaticField then @@ -15865,7 +16006,7 @@ module EstablishTypeDefinitionCores = let fspecs = if structTycon.IsUnionTycon then [ for uc in structTycon.UnionCasesArray do - for c in uc.FieldTable.AllFieldsAsList do + for c in uc.FieldTable.FieldsByIndex do yield c] else structTycon.AllFieldsAsList @@ -16115,12 +16256,12 @@ module TcDeclarations = else let isInSameModuleOrNamespace = - match envForDecls.eModuleOrNamespaceTypeAccumulator.Value.TypesByMangledName.TryFind(tcref.LogicalName) with - | Some tycon -> (tyconOrder.Compare(tcref.Deref, tycon) = 0) - | None -> + match envForDecls.eModuleOrNamespaceTypeAccumulator.Value.TypesByMangledName.TryGetValue tcref.LogicalName with + | true, tycon -> tyconOrder.Compare(tcref.Deref, tycon) = 0 + | _ -> //false // There is a special case we allow when compiling FSharp.Core.dll which permits interface implementations across namespace fragments - (cenv.g.compilingFslib && tcref.LogicalName.StartsWithOrdinal("Tuple`")) + cenv.g.compilingFslib && tcref.LogicalName.StartsWithOrdinal("Tuple`") let nReqTypars = reqTypars.Length @@ -16409,9 +16550,14 @@ module TcDeclarations = let tyDeclRange = synTyconInfo.Range let (ComponentInfo(_, typars, cs, longPath, _, _, _, _)) = synTyconInfo let declKind, tcref, declaredTyconTypars = ComputeTyconDeclKind tyconOpt isAtOriginalTyconDefn cenv envForDecls false tyDeclRange typars cs longPath - let newslotsOK = (if isAtOriginalTyconDefn && tcref.IsFSharpObjectModelTycon then NewSlotsOK else NoNewSlots) + let newslotsOK = (if isAtOriginalTyconDefn && tcref.IsFSharpObjectModelTycon then NewSlotsOK else NoNewSlots) + + if (declKind = ExtrinsicExtensionBinding) && isByrefTyconRef cenv.g tcref then + error(Error(FSComp.SR.tcByrefsMayNotHaveTypeExtensions(), tyDeclRange)) + if not (isNil members) && tcref.IsTypeAbbrev then errorR(Error(FSComp.SR.tcTypeAbbreviationsCannotHaveAugmentations(), tyDeclRange)) + MutRecDefnsPhase2DataForTycon(tyconOpt, innerParent, declKind, tcref, baseValOpt, safeInitInfo, declaredTyconTypars, members, tyDeclRange, newslotsOK, fixupFinalAttrs)) // By now we've established the full contents of type definitions apart from their @@ -16657,7 +16803,7 @@ let rec TcSignatureElementNonMutRec cenv parent typeNames endm (env: TcEnv) synS return env - | SynModuleSigDecl.NamespaceFragment (SynModuleOrNamespaceSig(longId, isRec, isModule, defs, xml, attribs, vis, m)) -> + | SynModuleSigDecl.NamespaceFragment (SynModuleOrNamespaceSig(longId, isRec, kind, defs, xml, attribs, vis, m)) -> do for id in longId do CheckNamespaceModuleOrTypeName cenv.g id @@ -16669,7 +16815,7 @@ let rec TcSignatureElementNonMutRec cenv parent typeNames endm (env: TcEnv) synS // namespace [rec] A.B // module M = ... let enclosingNamespacePath, defs = - if isModule then + if kind.IsModule then let nsp, modName = List.frontAndBack longId let modDecl = [SynModuleSigDecl.NestedModule(ComponentInfo(attribs, [], [], [modName], xml, false, vis, m), false, defs, m)] nsp, modDecl @@ -16966,7 +17112,7 @@ let rec TcModuleOrNamespaceElementNonMutRec (cenv:cenv) parent typeNames scopem return ((fun modDefs -> modDefn :: modDefs), topAttrsNew), env, envAtEnd - | SynModuleDecl.NamespaceFragment(SynModuleOrNamespace(longId, isRec, isModule, defs, xml, attribs, vis, m)) -> + | SynModuleDecl.NamespaceFragment(SynModuleOrNamespace(longId, isRec, kind, defs, xml, attribs, vis, m)) -> if !progress then dprintn ("Typecheck implementation " + textOfLid longId) let endm = m.EndRange @@ -16981,7 +17127,7 @@ let rec TcModuleOrNamespaceElementNonMutRec (cenv:cenv) parent typeNames scopem // namespace [rec] A.B // module M = ... let enclosingNamespacePath, defs = - if isModule then + if kind.IsModule then let nsp, modName = List.frontAndBack longId let modDecl = [SynModuleDecl.NestedModule(ComponentInfo(attribs, [], [], [modName], xml, false, vis, m), false, defs, true, m)] nsp, modDecl @@ -17332,7 +17478,7 @@ let CheckModuleSignature g cenv m denvAtEnd rootSigOpt implFileTypePriorToSig im // Compute the remapping from implementation to signature let remapInfo , _ = ComputeRemappingFromInferredSignatureToExplicitSignature cenv.g implFileTypePriorToSig sigFileType - let aenv = { TypeEquivEnv.Empty with EquivTycons = TyconRefMap.OfList remapInfo.mrpiEntities } + let aenv = { TypeEquivEnv.Empty with EquivTycons = TyconRefMap.OfList remapInfo.RepackagedEntities } if not (SignatureConformance.Checker(cenv.g, cenv.amap, denv, remapInfo, true).CheckSignature aenv (mkLocalModRef implFileSpecPriorToSig) sigFileType) then ( // We can just raise 'ReportedError' since CheckModuleOrNamespace raises its own error @@ -17414,14 +17560,14 @@ let TypeCheckOneImplFile // We ALWAYS run the PostTypeCheckSemanticChecks phase, though we if we have already encountered some // errors we turn off error reporting. This is because it performs various fixups over the TAST, e.g. // assigning nice names for inference variables. - let hasExplicitEntryPoint = + let hasExplicitEntryPoint, anonRecdTypes = conditionallySuppressErrorReporting (checkForErrors()) (fun () -> try let reportErrors = not (checkForErrors()) PostTypeCheckSemanticChecks.CheckTopImpl (g, cenv.amap, reportErrors, cenv.infoReader, env.eInternalsVisibleCompPaths, cenv.topCcu, envAtEnd.DisplayEnv, implFileExprAfterSig, extraAttribs, isLastCompiland, isInternalTestSpanStackReferring) with e -> errorRecovery e m - false) + false, StampMap.Empty) // Warn on version attributes. topAttrs.assemblyAttrs |> List.iter (function @@ -17437,7 +17583,7 @@ let TypeCheckOneImplFile | _ -> () | _ -> ()) - let implFile = TImplFile(qualNameOfFile, scopedPragmas, implFileExprAfterSig, hasExplicitEntryPoint, isScript) + let implFile = TImplFile(qualNameOfFile, scopedPragmas, implFileExprAfterSig, hasExplicitEntryPoint, isScript, anonRecdTypes) return (topAttrs, implFile, implFileTypePriorToSig, envAtEnd, cenv.createsGeneratedProvidedTypes) } diff --git a/src/fsharp/TypeChecker.fsi b/src/fsharp/TypeChecker.fsi index 3f84e1992fc..aae09544998 100644 --- a/src/fsharp/TypeChecker.fsi +++ b/src/fsharp/TypeChecker.fsi @@ -39,14 +39,14 @@ val EmptyTopAttrs : TopAttribs val CombineTopAttrs : TopAttribs -> TopAttribs -> TopAttribs val TypeCheckOneImplFile : - TcGlobals * NiceNameGenerator * ImportMap * CcuThunk * (unit -> bool) * ConditionalDefines * NameResolution.TcResultsSink * bool + TcGlobals * NiceNameGenerator * ImportMap * CcuThunk * (unit -> bool) * ConditionalDefines option * NameResolution.TcResultsSink * bool -> TcEnv -> Tast.ModuleOrNamespaceType option -> ParsedImplFileInput -> Eventually val TypeCheckOneSigFile : - TcGlobals * NiceNameGenerator * ImportMap * CcuThunk * (unit -> bool) * ConditionalDefines * NameResolution.TcResultsSink * bool + TcGlobals * NiceNameGenerator * ImportMap * CcuThunk * (unit -> bool) * ConditionalDefines option * NameResolution.TcResultsSink * bool -> TcEnv -> ParsedSigFileInput -> Eventually diff --git a/src/fsharp/ast.fs b/src/fsharp/ast.fs index 59dddd88122..22b960d18c6 100644 --- a/src/fsharp/ast.fs +++ b/src/fsharp/ast.fs @@ -162,22 +162,26 @@ type LongIdentWithDots = /// more freedom about typechecking these expressions. /// LongIdent can be empty list - it is used to denote that name of some AST element is absent (i.e. empty type name in inherit) | LongIdentWithDots of id:LongIdent * dotms:range list - with member this.Range = - match this with - | LongIdentWithDots([],_) -> failwith "rangeOfLidwd" - | LongIdentWithDots([id],[]) -> id.idRange - | LongIdentWithDots([id],[m]) -> unionRanges id.idRange m - | LongIdentWithDots(h::t,[]) -> unionRanges h.idRange (List.last t).idRange - | LongIdentWithDots(h::t,dotms) -> unionRanges h.idRange (List.last t).idRange |> unionRanges (List.last dotms) - member this.Lid = match this with LongIdentWithDots(lid,_) -> lid - member this.ThereIsAnExtraDotAtTheEnd = match this with LongIdentWithDots(lid,dots) -> lid.Length = dots.Length - member this.RangeSansAnyExtraDot = - match this with - | LongIdentWithDots([],_) -> failwith "rangeOfLidwd" - | LongIdentWithDots([id],_) -> id.idRange - | LongIdentWithDots(h::t,dotms) -> - let nonExtraDots = if dotms.Length = t.Length then dotms else List.truncate t.Length dotms - unionRanges h.idRange (List.last t).idRange |> unionRanges (List.last nonExtraDots) + + member this.Range = + match this with + | LongIdentWithDots([],_) -> failwith "rangeOfLidwd" + | LongIdentWithDots([id],[]) -> id.idRange + | LongIdentWithDots([id],[m]) -> unionRanges id.idRange m + | LongIdentWithDots(h::t,[]) -> unionRanges h.idRange (List.last t).idRange + | LongIdentWithDots(h::t,dotms) -> unionRanges h.idRange (List.last t).idRange |> unionRanges (List.last dotms) + + member this.Lid = match this with LongIdentWithDots(lid,_) -> lid + + member this.ThereIsAnExtraDotAtTheEnd = match this with LongIdentWithDots(lid,dots) -> lid.Length = dots.Length + + member this.RangeSansAnyExtraDot = + match this with + | LongIdentWithDots([],_) -> failwith "rangeOfLidwd" + | LongIdentWithDots([id],_) -> id.idRange + | LongIdentWithDots(h::t,dotms) -> + let nonExtraDots = if dotms.Length = t.Length then dotms else List.truncate t.Length dotms + unionRanges h.idRange (List.last t).idRange |> unionRanges (List.last nonExtraDots) //------------------------------------------------------------------------ // AST: the grammar of implicitly scoped type parameters @@ -428,44 +432,56 @@ and | LongIdentApp of typeName:SynType * longDotId:LongIdentWithDots * LESSRange:range option * typeArgs:SynType list * commaRanges:range list * GREATERrange:range option * range:range /// F# syntax : type * ... * type - // the bool is true if / rather than * follows the type - | Tuple of typeNames:(bool*SynType) list * range:range - /// F# syntax : struct (type * ... * type) // the bool is true if / rather than * follows the type - | StructTuple of typeNames:(bool*SynType) list * range:range + | Tuple of isStruct:bool * typeNames:(bool*SynType) list * range:range + + /// F# syntax : {| id: type; ...; id: type |} + /// F# syntax : struct {| id: type; ...; id: type |} + | AnonRecd of isStruct:bool * typeNames:(Ident * SynType) list * range:range /// F# syntax : type[] | Array of int * elementType:SynType * range:range + /// F# syntax : type -> type | Fun of argType:SynType * returnType:SynType * range:range + /// F# syntax : 'Var | Var of genericName:SynTypar * range:range + /// F# syntax : _ | Anon of range:range + /// F# syntax : typ with constraints | WithGlobalConstraints of typeName:SynType * constraints:SynTypeConstraint list * range:range + /// F# syntax : #type | HashConstraint of SynType * range:range + /// F# syntax : for units of measure e.g. m / s | MeasureDivide of dividendType:SynType * divisorType:SynType * range:range + /// F# syntax : for units of measure e.g. m^3, kg^1/2 | MeasurePower of measureType:SynType * SynRationalConst * range:range + /// F# syntax : 1, "abc" etc, used in parameters to type providers /// For the dimensionless units i.e. 1 , and static parameters to provided types | StaticConstant of constant:SynConst * range:range + /// F# syntax : const expr, used in static parameters to type providers | StaticConstantExpr of expr:SynExpr * range:range + /// F# syntax : ident=1 etc., used in static parameters to type providers | StaticConstantNamed of expr:SynType * SynType * range:range + /// Get the syntactic range of source code covered by this construct. member x.Range = match x with | SynType.App (range=m) | SynType.LongIdentApp (range=m) | SynType.Tuple (range=m) - | SynType.StructTuple (range=m) | SynType.Array (range=m) + | SynType.AnonRecd (range=m) | SynType.Fun (range=m) | SynType.Var (range=m) | SynType.Anon (range=m) @@ -504,10 +520,11 @@ and | Typed of expr:SynExpr * typeName:SynType * range:range /// F# syntax: e1, ..., eN - | Tuple of exprs:SynExpr list * commaRanges:range list * range:range // "range list" is for interstitial commas, these only matter for parsing/design-time tooling, the typechecker may munge/discard them + | Tuple of isStruct: bool * exprs:SynExpr list * commaRanges:range list * range:range // "range list" is for interstitial commas, these only matter for parsing/design-time tooling, the typechecker may munge/discard them - /// F# syntax: struct (e1, ..., eN) - | StructTuple of exprs:SynExpr list * commaRanges:range list * range:range // "range list" is for interstitial commas, these only matter for parsing/design-time tooling, the typechecker may munge/discard them + /// F# syntax: {| id1=e1; ...; idN=eN |} + /// F# syntax: struct {| id1=e1; ...; idN=eN |} + | AnonRecd of isStruct: bool * copyInfo:(SynExpr * BlockSeparator) option * recordFields:(Ident * SynExpr) list * range:range /// F# syntax: [ e1; ...; en ], [| e1; ...; en |] | ArrayOrList of isList:bool * exprs:SynExpr list * range:range @@ -734,7 +751,7 @@ and | SynExpr.Const (range=m) | SynExpr.Typed (range=m) | SynExpr.Tuple (range=m) - | SynExpr.StructTuple (range=m) + | SynExpr.AnonRecd (range=m) | SynExpr.ArrayOrList (range=m) | SynExpr.Record (range=m) | SynExpr.New (range=m) @@ -799,8 +816,8 @@ and | SynExpr.Const (range=m) | SynExpr.Typed (range=m) | SynExpr.Tuple (range=m) - | SynExpr.StructTuple (range=m) | SynExpr.ArrayOrList (range=m) + | SynExpr.AnonRecd (range=m) | SynExpr.Record (range=m) | SynExpr.New (range=m) | SynExpr.ObjExpr (range=m) @@ -855,6 +872,7 @@ and | SynExpr.DiscardAfterMissingQualificationAfterDot (expr,_) -> expr.Range | SynExpr.Fixed (_,m) -> m | SynExpr.Ident id -> id.idRange + /// Attempt to get the range of the first token or initial portion only - this is extremely ad-hoc, just a cheap way to improve a certain 'query custom operation' error range member e.RangeOfFirstPortion = match e with @@ -863,8 +881,8 @@ and | SynExpr.Const (range=m) | SynExpr.Typed (range=m) | SynExpr.Tuple (range=m) - | SynExpr.StructTuple (range=m) | SynExpr.ArrayOrList (range=m) + | SynExpr.AnonRecd (range=m) | SynExpr.Record (range=m) | SynExpr.New (range=m) | SynExpr.ObjExpr (range=m) @@ -993,8 +1011,7 @@ and | Or of SynPat * SynPat * range:range | Ands of SynPat list * range:range | LongIdent of longDotId:LongIdentWithDots * (* holds additional ident for tooling *) Ident option * SynValTyparDecls option (* usually None: temporary used to parse "f<'a> x = x"*) * SynConstructorArgs * accessibility:SynAccess option * range:range - | Tuple of SynPat list * range:range - | StructTuple of SynPat list * range:range + | Tuple of isStruct: bool * SynPat list * range:range | Paren of SynPat * range:range | ArrayOrList of bool * SynPat list * range:range | Record of ((LongIdent * Ident) * SynPat) list * range:range @@ -1025,7 +1042,6 @@ and | SynPat.LongIdent (range=m) | SynPat.ArrayOrList (range=m) | SynPat.Tuple (range=m) - | SynPat.StructTuple (range=m) | SynPat.Typed (range=m) | SynPat.Attrib (range=m) | SynPat.Record (range=m) @@ -1393,7 +1409,7 @@ and SynModuleDecl = | ModuleAbbrev of ident:Ident * longId:LongIdent * range:range | NestedModule of SynComponentInfo * isRecursive:bool * SynModuleDecls * bool * range:range - | Let of bool * SynBinding list * range:range + | Let of isRecursive:bool * SynBinding list * range:range | DoExpr of SequencePointInfoForBinding * SynExpr * range:range | Types of SynTypeDefn list * range:range | Exception of SynExceptionDefn * range:range @@ -1446,11 +1462,23 @@ and and SynModuleSigDecls = SynModuleSigDecl list -/// SynModuleOrNamespace(lid,isRec,isModule,decls,xmlDoc,attribs,SynAccess,m) +and + [] + SynModuleOrNamespaceKind = + | NamedModule + | AnonModule + | DeclaredNamespace + | GlobalNamespace + + member x.IsModule = + match x with + | NamedModule | AnonModule -> true + | _ -> false + and [] SynModuleOrNamespace = - | SynModuleOrNamespace of longId:LongIdent * isRecursive:bool * isModule:bool * decls:SynModuleDecls * xmlDoc:PreXmlDoc * attribs:SynAttributes * accessibility:SynAccess option * range:range + | SynModuleOrNamespace of longId:LongIdent * isRecursive:bool * kind:SynModuleOrNamespaceKind * decls:SynModuleDecls * xmlDoc:PreXmlDoc * attribs:SynAttributes * accessibility:SynAccess option * range:range member this.Range = match this with | SynModuleOrNamespace (range=m) -> m @@ -1458,7 +1486,7 @@ and and [] SynModuleOrNamespaceSig = - | SynModuleOrNamespaceSig of longId:LongIdent * isRecursive:bool * isModule:bool * SynModuleSigDecls * xmlDoc:PreXmlDoc * attribs:SynAttributes * accessibility:SynAccess option * range:range + | SynModuleOrNamespaceSig of longId:LongIdent * isRecursive:bool * kind:SynModuleOrNamespaceKind * SynModuleSigDecls * xmlDoc:PreXmlDoc * attribs:SynAttributes * accessibility:SynAccess option * range:range and [] ParsedHashDirective = @@ -1468,13 +1496,13 @@ and [] type ParsedImplFileFragment = | AnonModule of SynModuleDecls * range:range | NamedModule of SynModuleOrNamespace - | NamespaceFragment of longId:LongIdent * bool * bool * SynModuleDecls * xmlDoc:PreXmlDoc * SynAttributes * range:range + | NamespaceFragment of longId:LongIdent * bool * SynModuleOrNamespaceKind * SynModuleDecls * xmlDoc:PreXmlDoc * SynAttributes * range:range [] type ParsedSigFileFragment = | AnonModule of SynModuleSigDecls * range:range | NamedModule of SynModuleOrNamespaceSig - | NamespaceFragment of longId:LongIdent * bool * bool * SynModuleSigDecls * xmlDoc:PreXmlDoc * SynAttributes * range:range + | NamespaceFragment of longId:LongIdent * bool * SynModuleOrNamespaceKind * SynModuleSigDecls * xmlDoc:PreXmlDoc * SynAttributes * range:range [] type ParsedFsiInteraction = @@ -1714,8 +1742,8 @@ let rec SimplePatsOfPat synArgNameGenerator p = SynSimplePats.Typed(p2,ty,m), laterf // | SynPat.Paren (p,m) -> SimplePatsOfPat synArgNameGenerator p - | SynPat.Tuple (ps,m) - | SynPat.Paren(SynPat.Tuple (ps,m),_) -> + | SynPat.Tuple (false,ps,m) + | SynPat.Paren(SynPat.Tuple (false,ps,m),_) -> let ps2,laterf = List.foldBack (fun (p',rhsf) (ps',rhsf') -> @@ -1847,14 +1875,14 @@ let mkSynDotBrackSeqSliceGet m mDot arr (argslist:list) = | SynIndexerArg.One x -> yield x | _ -> () ] if notsliced.Length = argslist.Length then - SynExpr.DotIndexedGet(arr,[SynIndexerArg.One (SynExpr.Tuple(notsliced,[],unionRanges (List.head notsliced).Range (List.last notsliced).Range))],mDot,m) + SynExpr.DotIndexedGet(arr,[SynIndexerArg.One (SynExpr.Tuple(false,notsliced,[],unionRanges (List.head notsliced).Range (List.last notsliced).Range))],mDot,m) else SynExpr.DotIndexedGet(arr,argslist,mDot,m) let mkSynDotParenGet lhsm dotm a b = match b with - | SynExpr.Tuple ([_;_],_,_) -> errorR(Deprecated(FSComp.SR.astDeprecatedIndexerNotation(),lhsm)) ; SynExpr.Const(SynConst.Unit,lhsm) - | SynExpr.Tuple ([_;_;_],_,_) -> errorR(Deprecated(FSComp.SR.astDeprecatedIndexerNotation(),lhsm)) ; SynExpr.Const(SynConst.Unit,lhsm) + | SynExpr.Tuple (false,[_;_],_,_) -> errorR(Deprecated(FSComp.SR.astDeprecatedIndexerNotation(),lhsm)) ; SynExpr.Const(SynConst.Unit,lhsm) + | SynExpr.Tuple (false,[_;_;_],_,_) -> errorR(Deprecated(FSComp.SR.astDeprecatedIndexerNotation(),lhsm)) ; SynExpr.Const(SynConst.Unit,lhsm) | _ -> mkSynInfix dotm a parenGet b let mkSynUnit m = SynExpr.Const(SynConst.Unit,m) @@ -2382,11 +2410,15 @@ let rec synExprContainsError inpExpr = walkExpr e1 || walkExpr e2 | SynExpr.ArrayOrList (_,es,_) - | SynExpr.Tuple (es,_,_) - | SynExpr.StructTuple (es,_,_) -> + | SynExpr.Tuple (_,es,_,_) -> walkExprs es - | SynExpr.Record (_,_,fs,_) -> + | SynExpr.AnonRecd (_,origExpr,flds,_) -> + (match origExpr with Some (e,_) -> walkExpr e | None -> false) || + walkExprs (List.map snd flds) + + | SynExpr.Record (_,origExpr,fs,_) -> + (match origExpr with Some (e,_) -> walkExpr e | None -> false) || let flds = fs |> List.choose (fun (_, v, _) -> v) walkExprs (flds) diff --git a/src/fsharp/fsc.fs b/src/fsharp/fsc.fs index e418b1bb9b1..f3117e16e86 100644 --- a/src/fsharp/fsc.fs +++ b/src/fsharp/fsc.fs @@ -296,7 +296,7 @@ module InterfaceFileWriter = fprintfn os "#light" fprintfn os "" - for (TImplFile(_, _, mexpr, _, _)) in declaredImpls do + for (TImplFile(_, _, mexpr, _, _, _)) in declaredImpls do let denv = BuildInitialDisplayEnvForSigFileGeneration tcGlobals writeViaBufferWithEnvironmentNewLines os (fun os s -> Printf.bprintf os "%s\n\n" s) (NicePrint.layoutInferredSigOfModuleExpr true denv infoReader AccessibleFromSomewhere range0 mexpr |> Layout.squashTo 80 |> Layout.showL) @@ -329,9 +329,9 @@ module XmlDocWriter = if (hasDoc tc.XmlDoc) then tc.XmlDocSig <- XmlDocSigOfTycon [ptext; tc.CompiledName] for vref in tc.MembersOfFSharpTyconSorted do doValSig ptext vref.Deref - for uc in tc.UnionCasesAsList do + for uc in tc.UnionCasesArray do if (hasDoc uc.XmlDoc) then uc.XmlDocSig <- XmlDocSigOfUnionCase [ptext; tc.CompiledName; uc.Id.idText] - for rf in tc.AllFieldsAsList do + for rf in tc.AllFieldsArray do if (hasDoc rf.XmlDoc) then rf.XmlDocSig <- if tc.IsRecordTycon && (not rf.IsStatic) then @@ -380,9 +380,9 @@ module XmlDocWriter = addMember tc.XmlDocSig tc.XmlDoc for vref in tc.MembersOfFSharpTyconSorted do doVal vref.Deref - for uc in tc.UnionCasesAsList do + for uc in tc.UnionCasesArray do doUnionCase uc - for rf in tc.AllFieldsAsList do + for rf in tc.AllFieldsArray do doField rf let modulMember (m:ModuleOrNamespace) = addMember m.XmlDocSig m.XmlDoc @@ -1773,11 +1773,9 @@ let main0(ctok, argv, legacyReferenceResolver, bannerAlreadyPrinted, reduceMemor errorRecoveryNoRange e exiter.Exit 1 - let inputs = - // Deduplicate module names - let moduleNamesDict = ConcurrentDictionary>() - inputs - |> List.map (fun (input,x) -> DeduplicateParsedInputModuleName moduleNamesDict input,x) + let inputs, _ = + (Map.empty, inputs) + ||> List.mapFold (fun state (input,x) -> let inputT, stateT = DeduplicateParsedInputModuleName state input in (inputT,x), stateT) if tcConfig.parseOnly then exiter.Exit 0 if not tcConfig.continueAfterParseFailure then @@ -1831,7 +1829,7 @@ let main1(Args (ctok, tcGlobals, tcImports: TcImports, frameworkTcImports, gener // it as the updated global error logger and never remove it let oldLogger = errorLogger let errorLogger = - let scopedPragmas = [ for (TImplFile(_, pragmas, _, _, _)) in typedImplFiles do yield! pragmas ] + let scopedPragmas = [ for (TImplFile(_, pragmas, _, _, _, _)) in typedImplFiles do yield! pragmas ] GetErrorLoggerFilteringByScopedPragmas(true, scopedPragmas, oldLogger) let _unwindEL_3 = PushErrorLoggerPhaseUntilUnwind(fun _ -> errorLogger) @@ -1999,13 +1997,10 @@ let main2b (tcImportsCapture,dynamicAssemblyCreator) (Args (ctok, tcConfig: TcCo let ilxGenerator = CreateIlxAssemblyGenerator (tcConfig, tcImports, tcGlobals, (LightweightTcValForUsingInBuildMethodCall tcGlobals), generatedCcu) let codegenResults = GenerateIlxCode ((if Option.isSome dynamicAssemblyCreator then IlReflectBackend else IlWriteBackend), Option.isSome dynamicAssemblyCreator, false, tcConfig, topAttrs, optimizedImpls, generatedCcu.AssemblyName, ilxGenerator) - let casApplied = new Dictionary() - let securityAttrs, topAssemblyAttrs = topAttrs.assemblyAttrs |> List.partition (fun a -> IsSecurityAttribute tcGlobals (tcImports.GetImportMap()) casApplied a rangeStartup) - - // remove any security attributes from the top-level assembly attribute list + let topAssemblyAttrs = codegenResults.topAssemblyAttrs let topAttrs = {topAttrs with assemblyAttrs=topAssemblyAttrs} - let permissionSets = ilxGenerator.CreatePermissionSets securityAttrs - let secDecls = if List.isEmpty securityAttrs then emptyILSecurityDecls else mkILSecurityDecls permissionSets + let permissionSets = codegenResults.permissionSets + let secDecls = mkILSecurityDecls permissionSets let ilxMainModule = MainModuleBuilder.CreateMainModule (ctok, tcConfig, tcGlobals, tcImports, pdbfile, assemblyName, outfile, topAttrs, idata, optDataResources, codegenResults, assemVerFromAttrib, metadataVersion, secDecls) @@ -2039,7 +2034,7 @@ let main4 dynamicAssemblyCreator (Args (ctok, tcConfig, tcImports: TcImports, t DoesNotRequireCompilerThreadTokenAndCouldPossiblyBeMadeConcurrent ctok - let pdbfile = pdbfile |> Option.map (tcConfig.MakePathAbsolute >> Path.GetFullPath) + let pdbfile = pdbfile |> Option.map (tcConfig.MakePathAbsolute >> FileSystem.GetFullPathShim) let normalizeAssemblyRefs (aref:ILAssemblyRef) = match tcImports.TryFindDllInfo (ctok, Range.rangeStartup, aref.Name, lookupOnly=false) with @@ -2114,3 +2109,4 @@ let mainCompile (ctok, argv, legacyReferenceResolver, bannerAlreadyPrinted, redu //System.Runtime.GCSettings.LatencyMode <- System.Runtime.GCLatencyMode.Batch typecheckAndCompile(ctok, argv, legacyReferenceResolver, bannerAlreadyPrinted, reduceMemoryUsage, defaultCopyFSharpCore, exiter, errorLoggerProvider, tcImportsCapture, dynamicAssemblyCreator) + diff --git a/src/fsharp/Fsc/InternalsVisibleTo.fs b/src/fsharp/fsc/InternalsVisibleTo.fs similarity index 100% rename from src/fsharp/Fsc/InternalsVisibleTo.fs rename to src/fsharp/fsc/InternalsVisibleTo.fs diff --git a/src/fsharp/Fsc/app.config b/src/fsharp/fsc/app.config similarity index 100% rename from src/fsharp/Fsc/app.config rename to src/fsharp/fsc/app.config diff --git a/src/fsharp/fsc/fsc.fsproj b/src/fsharp/fsc/fsc.fsproj new file mode 100644 index 00000000000..40f56a0627e --- /dev/null +++ b/src/fsharp/fsc/fsc.fsproj @@ -0,0 +1,43 @@ + + + + + + Exe + net46;netcoreapp2.1 + .exe + fsc + $(NoWarn);45;55;62;75;1204 + true + $(OtherFlags) --maxerrors:20 --extraoptimizationloops:1 + true + true + true + + + + + fscmain.fs + + + + default.win32manifest + PreserveNewest + + + + + + + + + + + + + + + + + + diff --git a/src/fsharp/fsi/Fsi.fsproj b/src/fsharp/fsi/Fsi.fsproj deleted file mode 100644 index ad16d0c0017..00000000000 --- a/src/fsharp/fsi/Fsi.fsproj +++ /dev/null @@ -1,73 +0,0 @@ - - - - - $(MSBuildProjectDirectory)\..\.. - FSharp - true - true - - - - Debug - - x86 - AnyCPU - {d0e98c0d-490b-4c61-9329-0862f6e87645} - Exe - $(NoWarn);62 - fsi - 0x0A000000 - FSI_SHADOW_COPY_REFERENCES;$(DefineConstants) - FSI_SERVER;$(DefineConstants) - true - $(OtherFlags) --warnon:1182 - fsi.res - v4.6 - - - - console.fs - - - fsimain.fs - - - - - - - - - - - - - - - - - - - - - - {2E4D67B4-522D-4CF7-97E4-BA940F0B18F3} - FSharp.Compiler.Private - - - {DED3BBD7-53F4-428A-8C9F-27968E768605} - FSharp.Core - - - - - FSharp.Compiler.Server.Shared - {d5870cf0-ed51-4cbc-b3d7-6f56da84ac06} - True - - - \ No newline at end of file diff --git a/src/fsharp/fsi/fsi.fs b/src/fsharp/fsi/fsi.fs index eb926991dc1..8190be40784 100644 --- a/src/fsharp/fsi/fsi.fs +++ b/src/fsharp/fsi/fsi.fs @@ -1060,7 +1060,7 @@ type internal FsiDynamicCompiler #if DEBUG if fsiOptions.ShowILCode then fsiConsoleOutput.uprintnfn "--------------------"; - ILAsciiWriter.output_module outWriter mainmod3; + ILAsciiWriter.output_module outWriter ilGlobals mainmod3; fsiConsoleOutput.uprintnfn "--------------------" #else ignore(fsiOptions) @@ -1116,7 +1116,7 @@ type internal FsiDynamicCompiler // 'Open' the path for the fragment we just compiled for any future printing. let denv = denv.AddOpenPath (pathOfLid prefixPath) - for (TImplFile(_qname,_,mexpr,_,_)) in declaredImpls do + for (TImplFile(_qname,_,mexpr,_,_,_)) in declaredImpls do let responseL = NicePrint.layoutInferredSigOfModuleExpr false denv infoReader AccessibleFromSomewhere rangeStdin mexpr if not (Layout.isEmptyL responseL) then let opts = valuePrinter.GetFsiPrintOptions() @@ -1154,7 +1154,7 @@ type internal FsiDynamicCompiler let i = nextFragmentId() let prefix = mkFragmentPath i let prefixPath = pathOfLid prefix - let impl = SynModuleOrNamespace(prefix,(*isRec*)false, (* isModule: *) true,defs,PreXmlDoc.Empty,[],None,rangeStdin) + let impl = SynModuleOrNamespace(prefix,(*isRec*)false, NamedModule,defs,PreXmlDoc.Empty,[],None,rangeStdin) let input = ParsedInput.ImplFile(ParsedImplFileInput(filename,true, ComputeQualifiedNameOfFileFromUniquePath (rangeStdin,prefixPath),[],[],[impl],(true (* isLastCompiland *), false (* isExe *)) )) let istate,tcEnvAtEndOfLastInput,declaredImpls = ProcessInputs (ctok, errorLogger, istate, [input], showTypes, true, isInteractiveItExpr, prefix) let tcState = istate.tcState diff --git a/src/fsharp/fsi/fsi.fsproj b/src/fsharp/fsi/fsi.fsproj new file mode 100644 index 00000000000..5dbcac7557e --- /dev/null +++ b/src/fsharp/fsi/fsi.fsproj @@ -0,0 +1,60 @@ + + + + + + Exe + net46;netcoreapp2.1 + .exe + fsi + $(NoWarn);45;55;62;75;1204 + true + $(OtherFlags) --warnon:1182 --maxerrors:20 --extraoptimizationloops:1 + fsi.res + true + true + true + + + + $(DefineConstants);FSI_SHADOW_COPY_REFERENCES;FSI_SERVER + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/fsharp/fsi/project.json b/src/fsharp/fsi/project.json deleted file mode 100644 index 8fdb41c7a8e..00000000000 --- a/src/fsharp/fsi/project.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "NETStandard.Library": "1.6.1", - "System.Diagnostics.Process": "4.3.0", - "System.Linq.Expressions": "4.3.0", - "System.Reflection.Emit": "4.3.0", - "System.Reflection.TypeExtensions": "4.3.0", - "System.Runtime.Loader": "4.3.0", - "System.Threading.Thread": "4.3.0", - "System.Reflection.Metadata": "1.6.0" - }, - "runtimes": { - "win7-x86": { }, - "win7-x64": { }, - "osx.10.11-x64": { }, - "ubuntu.14.04-x64": { } - }, - "frameworks": { - "netcoreapp1.0": { - "dependencies": { - "Microsoft.NETCore.App": { - "type": "platform", - "version": "1.1.0" - } - }, - "imports": [ "netstandard1.6", "portable-net45+win8+wp8+wpa81" ] - } - } -} diff --git a/src/fsharp/fsi/xlf/FSIstrings.txt.cs.xlf b/src/fsharp/fsi/xlf/FSIstrings.txt.cs.xlf index d4667e04c08..98419003261 100644 --- a/src/fsharp/fsi/xlf/FSIstrings.txt.cs.xlf +++ b/src/fsharp/fsi/xlf/FSIstrings.txt.cs.xlf @@ -1,4 +1,4 @@ - + diff --git a/src/fsharp/fsi/xlf/FSIstrings.txt.de.xlf b/src/fsharp/fsi/xlf/FSIstrings.txt.de.xlf index f87d3361f21..93303b279f6 100644 --- a/src/fsharp/fsi/xlf/FSIstrings.txt.de.xlf +++ b/src/fsharp/fsi/xlf/FSIstrings.txt.de.xlf @@ -1,4 +1,4 @@ - + diff --git a/src/fsharp/fsi/xlf/FSIstrings.txt.es.xlf b/src/fsharp/fsi/xlf/FSIstrings.txt.es.xlf index 6af67db2550..6b25550fed5 100644 --- a/src/fsharp/fsi/xlf/FSIstrings.txt.es.xlf +++ b/src/fsharp/fsi/xlf/FSIstrings.txt.es.xlf @@ -1,4 +1,4 @@ - + diff --git a/src/fsharp/fsi/xlf/FSIstrings.txt.fr.xlf b/src/fsharp/fsi/xlf/FSIstrings.txt.fr.xlf index 917a17f4352..b69c71103d4 100644 --- a/src/fsharp/fsi/xlf/FSIstrings.txt.fr.xlf +++ b/src/fsharp/fsi/xlf/FSIstrings.txt.fr.xlf @@ -1,4 +1,4 @@ - + @@ -134,7 +134,7 @@ \n\nException raised during pretty printing.\nPlease report this so it can be fixed.\nTrace: {0}\n - \n\nException déclenchée durant l'impression en mode Pretty.\nSignalez ce problème afin qu'il soit corrigé.\nTrace : {0}\n + \n\nException déclenchée durant l'impression automatique.\nSignalez ce problème afin qu'il soit corrigé.\nTrace : {0}\n @@ -184,7 +184,7 @@ Loading - Chargement en cours + Chargement diff --git a/src/fsharp/fsi/xlf/FSIstrings.txt.it.xlf b/src/fsharp/fsi/xlf/FSIstrings.txt.it.xlf index d7f05d6aa96..51a94aabb2a 100644 --- a/src/fsharp/fsi/xlf/FSIstrings.txt.it.xlf +++ b/src/fsharp/fsi/xlf/FSIstrings.txt.it.xlf @@ -1,4 +1,4 @@ - + diff --git a/src/fsharp/fsi/xlf/FSIstrings.txt.ko.xlf b/src/fsharp/fsi/xlf/FSIstrings.txt.ko.xlf index 69a5d3b5352..5d0b2017d62 100644 --- a/src/fsharp/fsi/xlf/FSIstrings.txt.ko.xlf +++ b/src/fsharp/fsi/xlf/FSIstrings.txt.ko.xlf @@ -1,4 +1,4 @@ - + diff --git a/src/fsharp/fsi/xlf/FSIstrings.txt.pl.xlf b/src/fsharp/fsi/xlf/FSIstrings.txt.pl.xlf index 82960cad8fd..f6b3de9b345 100644 --- a/src/fsharp/fsi/xlf/FSIstrings.txt.pl.xlf +++ b/src/fsharp/fsi/xlf/FSIstrings.txt.pl.xlf @@ -1,4 +1,4 @@ - + diff --git a/src/fsharp/fsi/xlf/FSIstrings.txt.pt-BR.xlf b/src/fsharp/fsi/xlf/FSIstrings.txt.pt-BR.xlf index d35388b4cb9..70a3636f04a 100644 --- a/src/fsharp/fsi/xlf/FSIstrings.txt.pt-BR.xlf +++ b/src/fsharp/fsi/xlf/FSIstrings.txt.pt-BR.xlf @@ -1,4 +1,4 @@ - + diff --git a/src/fsharp/fsi/xlf/FSIstrings.txt.ru.xlf b/src/fsharp/fsi/xlf/FSIstrings.txt.ru.xlf index 6e40ee07dd5..de3a08eed18 100644 --- a/src/fsharp/fsi/xlf/FSIstrings.txt.ru.xlf +++ b/src/fsharp/fsi/xlf/FSIstrings.txt.ru.xlf @@ -1,4 +1,4 @@ - + diff --git a/src/fsharp/fsi/xlf/FSIstrings.txt.tr.xlf b/src/fsharp/fsi/xlf/FSIstrings.txt.tr.xlf index 6497500a1f1..35bd3478f9b 100644 --- a/src/fsharp/fsi/xlf/FSIstrings.txt.tr.xlf +++ b/src/fsharp/fsi/xlf/FSIstrings.txt.tr.xlf @@ -1,4 +1,4 @@ - + diff --git a/src/fsharp/fsiAnyCpu/FsiAnyCPU.fsproj b/src/fsharp/fsiAnyCpu/FsiAnyCPU.fsproj deleted file mode 100644 index 894178d18bd..00000000000 --- a/src/fsharp/fsiAnyCpu/FsiAnyCPU.fsproj +++ /dev/null @@ -1,58 +0,0 @@ - - - - - $(MSBuildProjectDirectory)\..\.. - FSharp - true - true - - - - Debug - AnyCPU - {8b3e283d-b5fe-4055-9d80-7e3a32f3967b} - Exe - $(NoWarn);62 - fsiAnyCpu - 0x0A000000 - FSI_SHADOW_COPY_REFERENCES;$(DefineConstants) - FSI_SERVER;$(DefineConstants) - true - $(OtherFlags) --warnon:1182 - ..\fsi\fsi.res - v4.6 - - - - console.fs - - - fsimain.fs - - - - - - - - - - - - - - FSharp.Compiler.Server.Shared - {d5870cf0-ed51-4cbc-b3d7-6f56da84ac06} - True - - - {2E4D67B4-522D-4CF7-97E4-BA940F0B18F3} - FSharp.Compiler.Private - - - {DED3BBD7-53F4-428A-8C9F-27968E768605} - FSharp.Core - - - \ No newline at end of file diff --git a/src/fsharp/fsiAnyCpu/fsiAnyCpu.fsproj b/src/fsharp/fsiAnyCpu/fsiAnyCpu.fsproj new file mode 100644 index 00000000000..200bd6d40a3 --- /dev/null +++ b/src/fsharp/fsiAnyCpu/fsiAnyCpu.fsproj @@ -0,0 +1,44 @@ + + + + + + Exe + net46 + AnyCPU + .exe + fsiAnyCpu + $(NoWarn);45;55;62;75;1204 + true + $(OtherFlags) --warnon:1182 --maxerrors:20 --extraoptimizationloops:1 + ..\fsi\fsi.res + true + true + + + + $(DefineConstants);FSI_SHADOW_COPY_REFERENCES;FSI_SERVER + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/fsharp/import.fs b/src/fsharp/import.fs index 098720fb0ad..e06ee756da3 100644 --- a/src/fsharp/import.fs +++ b/src/fsharp/import.fs @@ -62,13 +62,13 @@ let CanImportILScopeRef (env:ImportMap) m scoref = match scoref with | ILScopeRef.Local -> true | ILScopeRef.Module _ -> true - | ILScopeRef.Assembly assref -> + | ILScopeRef.Assembly assemblyRef -> // Explanation: This represents an unchecked invariant in the hosted compiler: that any operations // which import types (and resolve assemblies from the tcImports tables) happen on the compilation thread. let ctok = AssumeCompilationThreadWithoutEvidence() - match env.assemblyLoader.FindCcuFromAssemblyRef (ctok, m, assref) with + match env.assemblyLoader.FindCcuFromAssemblyRef (ctok, m, assemblyRef) with | UnresolvedCcu _ -> false | ResolvedCcu _ -> true @@ -84,7 +84,7 @@ let ImportTypeRefData (env:ImportMap) m (scoref,path,typeName) = match scoref with | ILScopeRef.Local -> error(InternalError("ImportILTypeRef: unexpected local scope",m)) | ILScopeRef.Module _ -> error(InternalError("ImportILTypeRef: reference found to a type in an auxiliary module",m)) - | ILScopeRef.Assembly assref -> env.assemblyLoader.FindCcuFromAssemblyRef (ctok, m, assref) // NOTE: only assemblyLoader callsite + | ILScopeRef.Assembly assemblyRef -> env.assemblyLoader.FindCcuFromAssemblyRef (ctok, m, assemblyRef) // NOTE: only assemblyLoader callsite // Do a dereference of a fake tcref for the type just to check it exists in the target assembly and to find // the corresponding Tycon. @@ -109,8 +109,8 @@ let ImportTypeRefData (env:ImportMap) m (scoref,path,typeName) = () #endif match tryRescopeEntity ccu tycon with - | None -> error (Error(FSComp.SR.impImportedAssemblyUsesNotPublicType(String.concat "." (Array.toList path@[typeName])),m)) - | Some tcref -> tcref + | ValueNone -> error (Error(FSComp.SR.impImportedAssemblyUsesNotPublicType(String.concat "." (Array.toList path@[typeName])),m)) + | ValueSome tcref -> tcref /// Import a reference to a type definition, given an AbstractIL ILTypeRef, without caching @@ -168,7 +168,6 @@ let rec ImportILType (env:ImportMap) m tinst ty = let inst = tspec.GenericArgs |> List.map (ImportILType env m tinst) ImportTyconRefApp env tcref inst - | ILType.Modified(_,tref,ILType.Byref ty) when tref.Name = "System.Runtime.InteropServices.InAttribute" -> mkInByrefTy env.g (ImportILType env m tinst ty) | ILType.Byref ty -> mkByrefTy env.g (ImportILType env m tinst ty) | ILType.Ptr ILType.Void when env.g.voidptr_tcr.CanDeref -> mkVoidPtrTy env.g | ILType.Ptr ty -> mkNativePtrTy env.g (ImportILType env m tinst ty) diff --git a/src/fsharp/infos.fs b/src/fsharp/infos.fs index 7e23785723d..6ee5a6b53cd 100755 --- a/src/fsharp/infos.fs +++ b/src/fsharp/infos.fs @@ -67,15 +67,14 @@ let GetSuperTypeOfType g amap m ty = | Some super -> Some(Import.ImportProvidedType amap m super) #endif | ILTypeMetadata (TILObjectReprData(scoref,_,tdef)) -> - let _,tinst = destAppTy g ty + let tinst = argsOfAppTy g ty match tdef.Extends with | None -> None | Some ilty -> Some (ImportILType scoref amap m tinst ilty) | FSharpOrArrayOrByrefOrTupleOrExnTypeMetadata -> - - if isFSharpObjModelTy g ty || isExnDeclTy g ty then - let tcref,_tinst = destAppTy g ty + if isFSharpObjModelTy g ty || isExnDeclTy g ty then + let tcref = tcrefOfAppTy g ty Some (instType (mkInstForAppTy g ty) (superOfTycon g tcref.Deref)) elif isArrayTy g ty then Some g.system_Array_ty @@ -88,6 +87,8 @@ let GetSuperTypeOfType g amap m ty = Some(g.system_Enum_ty) else Some (g.system_Value_ty) + elif isAnonRecdTy g ty then + Some g.obj_ty elif isRecdTy g ty || isUnionTy g ty then Some g.obj_ty else @@ -105,8 +106,8 @@ type SkipUnrefInterfaces = Yes | No /// traverse the type hierarchy to collect further interfaces. let rec GetImmediateInterfacesOfType skipUnref g amap m ty = let itys = - if isAppTy g ty then - let tcref,tinst = destAppTy g ty + match tryAppTy g ty with + | ValueSome(tcref,tinst) -> if tcref.IsMeasureableReprTycon then [ match tcref.TypeReprInfo with | TMeasureableRepr reprTy -> @@ -142,8 +143,7 @@ let rec GetImmediateInterfacesOfType skipUnref g amap m ty = | FSharpOrArrayOrByrefOrTupleOrExnTypeMetadata -> tcref.ImmediateInterfaceTypesOfFSharpTycon |> List.map (instType (mkInstForAppTy g ty)) - else - [] + | _ -> [] // .NET array types are considered to implement IList let itys = @@ -187,7 +187,7 @@ let private FoldHierarchyOfTypeAux followInterfaces allowMultiIntfInst skipUnref (loop ndeep g.obj_ty state) else match tryDestTyparTy g ty with - | Some tp -> + | ValueSome tp -> let state = loop (ndeep+1) g.obj_ty state List.foldBack (fun x vacc -> @@ -208,7 +208,7 @@ let private FoldHierarchyOfTypeAux followInterfaces allowMultiIntfInst skipUnref loop (ndeep + 1) cty vacc) tp.Constraints state - | None -> + | _ -> let state = if followInterfaces then List.foldBack @@ -284,13 +284,26 @@ let ExistsHeadTypeInEntireHierarchy g amap m typeToSearchFrom tcrefToLookFor = let ImportILTypeFromMetadata amap m scoref tinst minst ilty = ImportILType scoref amap m (tinst@minst) ilty - -/// Get the return type of an IL method, taking into account instantiations for type and method generic parameters, and +/// Read an Abstract IL type from metadata, including any attributes that may affect the type itself, and convert to an F# type. +let ImportILTypeFromMetadataWithAttributes amap m scoref tinst minst ilty cattrs = + let ty = ImportILType scoref amap m (tinst@minst) ilty + // If the type is a byref and one of attributes from a return or parameter has IsReadOnly, then it's a inref. + if isByrefTy amap.g ty && TryFindILAttribute amap.g.attrib_IsReadOnlyAttribute cattrs then + mkInByrefTy amap.g (destByrefTy amap.g ty) + else + ty + +/// Get the parameter type of an IL method. +let ImportParameterTypeFromMetadata amap m ilty cattrs scoref tinst mist = + ImportILTypeFromMetadataWithAttributes amap m scoref tinst mist ilty cattrs + +/// Get the return type of an IL method, taking into account instantiations for type, return attributes and method generic parameters, and /// translating 'void' to 'None'. -let ImportReturnTypeFromMetaData amap m ty scoref tinst minst = - match ty with +let ImportReturnTypeFromMetadata amap m ilty cattrs scoref tinst minst = + match ilty with | ILType.Void -> None - | retTy -> Some (ImportILTypeFromMetadata amap m scoref tinst minst retTy) + | retTy -> Some(ImportILTypeFromMetadataWithAttributes amap m scoref tinst minst retTy cattrs) + /// Copy constraints. If the constraint comes from a type parameter associated /// with a type constructor then we are simply renaming type variables. If it comes @@ -806,19 +819,19 @@ type ILMethInfo = /// Get the argument types of the the IL method. If this is an C#-style extension method /// then drop the object argument. member x.GetParamTypes(amap,m,minst) = - x.ParamMetadata |> List.map (fun p -> ImportILTypeFromMetadata amap m x.MetadataScope x.DeclaringTypeInst minst p.Type) + x.ParamMetadata |> List.map (fun p -> ImportParameterTypeFromMetadata amap m p.Type p.CustomAttrs x.MetadataScope x.DeclaringTypeInst minst) /// Get all the argument types of the IL method. Include the object argument even if this is /// an C#-style extension method. member x.GetRawArgTypes(amap,m,minst) = - x.RawMetadata.Parameters |> List.map (fun p -> ImportILTypeFromMetadata amap m x.MetadataScope x.DeclaringTypeInst minst p.Type) + x.RawMetadata.Parameters |> List.map (fun p -> ImportParameterTypeFromMetadata amap m p.Type p.CustomAttrs x.MetadataScope x.DeclaringTypeInst minst) /// Get info about the arguments of the IL method. If this is an C#-style extension method then /// drop the object argument. /// /// Any type parameters of the enclosing type are instantiated in the type returned. member x.GetParamNamesAndTypes(amap,m,minst) = - x.ParamMetadata |> List.map (fun p -> ParamNameAndType(Option.map (mkSynId m) p.Name, ImportILTypeFromMetadata amap m x.MetadataScope x.DeclaringTypeInst minst p.Type) ) + x.ParamMetadata |> List.map (fun p -> ParamNameAndType(Option.map (mkSynId m) p.Name, ImportParameterTypeFromMetadata amap m p.Type p.CustomAttrs x.MetadataScope x.DeclaringTypeInst minst) ) /// Get a reference to the method (dropping all generic instantiations), as an Abstract IL ILMethodRef. member x.ILMethodRef = @@ -838,7 +851,8 @@ type ILMethInfo = // All C#-style extension methods are instance. We have to re-read the 'obj' type w.r.t. the // method instantiation. if x.IsILExtensionMethod then - [ImportILTypeFromMetadata amap m x.MetadataScope x.DeclaringTypeInst minst x.RawMetadata.Parameters.Head.Type] + let p = x.RawMetadata.Parameters.Head + [ ImportParameterTypeFromMetadata amap m p.Type p.CustomAttrs x.MetadataScope x.DeclaringTypeInst minst ] else if x.IsInstance then [ x.ApparentEnclosingType ] else @@ -846,7 +860,7 @@ type ILMethInfo = /// Get the compiled return type of the method, where 'void' is None. member x.GetCompiledReturnTy (amap, m, minst) = - ImportReturnTypeFromMetaData amap m x.RawMetadata.Return.Type x.MetadataScope x.DeclaringTypeInst minst + ImportReturnTypeFromMetadata amap m x.RawMetadata.Return.Type x.RawMetadata.Return.CustomAttrs x.MetadataScope x.DeclaringTypeInst minst /// Get the F# view of the return type of the method, where 'void' is 'unit'. member x.GetFSharpReturnTy (amap, m, minst) = @@ -1436,7 +1450,7 @@ type MethInfo = // if multiple caller info attributes are specified, pick the "wrong" one here // so that we get an error later match tryDestOptionTy g ty with - | Some optTy when typeEquiv g g.int32_ty optTy -> CallerFilePath + | ValueSome optTy when typeEquiv g g.int32_ty optTy -> CallerFilePath | _ -> CallerLineNumber (isParamArrayArg, isInArg, isOutArg, optArgInfo, callerInfo, reflArgInfo)) @@ -1503,7 +1517,7 @@ type MethInfo = match x with | ILMeth(_,ilminfo,_) -> let ftinfo = ILTypeInfo.FromType g (TType_app(tcref,formalEnclosingTyparTys)) - let formalRetTy = ImportReturnTypeFromMetaData amap m ilminfo.RawMetadata.Return.Type ftinfo.ILScopeRef ftinfo.TypeInstOfRawMetadata formalMethTyparTys + let formalRetTy = ImportReturnTypeFromMetadata amap m ilminfo.RawMetadata.Return.Type ilminfo.RawMetadata.Return.CustomAttrs ftinfo.ILScopeRef ftinfo.TypeInstOfRawMetadata formalMethTyparTys let formalParams = [ [ for p in ilminfo.RawMetadata.Parameters do let paramType = ImportILTypeFromMetadata amap m ftinfo.ILScopeRef ftinfo.TypeInstOfRawMetadata formalMethTyparTys p.Type @@ -1581,6 +1595,14 @@ type MethInfo = | _ -> x.DeclaringTyconRef.Typars(m) + /// Tries to get the object arg type if it's a byref type. + member x.TryObjArgByrefType(amap, m, minst) = + x.GetObjArgTypes(amap, m, minst) + |> List.tryHead + |> Option.bind (fun ty -> + if isByrefTy x.TcGlobals ty then Some(ty) + else None) + //------------------------------------------------------------------------- // ILFieldInfo @@ -2456,6 +2478,10 @@ type EventInfo = //------------------------------------------------------------------------- // Helpers associated with getting and comparing method signatures +/// Strips inref and outref to be a byref. +let stripByrefTy g ty = + if isByrefTy g ty then mkByrefTy g (destByrefTy g ty) + else ty /// Represents the information about the compiled form of a method signature. Used when analyzing implementation /// relations between members and abstract slots. @@ -2479,7 +2505,8 @@ let CompiledSigOfMeth g amap m (minfo:MethInfo) = CompiledSig(vargtys,vrty,formalMethTypars,fmtpinst) -/// Used to hide/filter members from super classes based on signature +/// Used to hide/filter members from super classes based on signature +/// Inref and outref parameter types will be treated as a byref type for equivalency. let MethInfosEquivByNameAndPartialSig erasureFlag ignoreFinal g amap m (minfo:MethInfo) (minfo2:MethInfo) = (minfo.LogicalName = minfo2.LogicalName) && (minfo.GenericArity = minfo2.GenericArity) && @@ -2490,7 +2517,8 @@ let MethInfosEquivByNameAndPartialSig erasureFlag ignoreFinal g amap m (minfo:Me let fminst2 = generalizeTypars formalMethTypars2 let argtys = minfo.GetParamTypes(amap, m, fminst) let argtys2 = minfo2.GetParamTypes(amap, m, fminst2) - (argtys,argtys2) ||> List.lengthsEqAndForall2 (List.lengthsEqAndForall2 (typeAEquivAux erasureFlag g (TypeEquivEnv.FromEquivTypars formalMethTypars formalMethTypars2))) + (argtys,argtys2) ||> List.lengthsEqAndForall2 (List.lengthsEqAndForall2 (fun ty1 ty2 -> + typeAEquivAux erasureFlag g (TypeEquivEnv.FromEquivTypars formalMethTypars formalMethTypars2) (stripByrefTy g ty1) (stripByrefTy g ty2))) /// Used to hide/filter members from super classes based on signature let PropInfosEquivByNameAndPartialSig erasureFlag g amap m (pinfo:PropInfo) (pinfo2:PropInfo) = diff --git a/src/fsharp/layout.fs b/src/fsharp/layout.fs index 0a59e85582a..2ee543d9b1f 100644 --- a/src/fsharp/layout.fs +++ b/src/fsharp/layout.fs @@ -109,6 +109,8 @@ module TaggedTextOps = let rightBracket = Internal.Utilities.StructuredFormat.TaggedTextOps.Literals.rightBracket let leftBrace = Internal.Utilities.StructuredFormat.TaggedTextOps.Literals.leftBrace let rightBrace = Internal.Utilities.StructuredFormat.TaggedTextOps.Literals.rightBrace + let leftBraceBar = Internal.Utilities.StructuredFormat.TaggedTextOps.Literals.leftBraceBar + let rightBraceBar = Internal.Utilities.StructuredFormat.TaggedTextOps.Literals.rightBraceBar let equals = Internal.Utilities.StructuredFormat.TaggedTextOps.Literals.equals let arrow = Internal.Utilities.StructuredFormat.TaggedTextOps.Literals.arrow let questionMark = Internal.Utilities.StructuredFormat.TaggedTextOps.Literals.questionMark diff --git a/src/fsharp/layout.fsi b/src/fsharp/layout.fsi index e2d1bcc7a3b..a9ced6d9f2a 100644 --- a/src/fsharp/layout.fsi +++ b/src/fsharp/layout.fsi @@ -104,6 +104,8 @@ module TaggedTextOps = val rightBracket : TaggedText val leftBrace: TaggedText val rightBrace : TaggedText + val leftBraceBar: TaggedText + val rightBraceBar : TaggedText val leftAngle: TaggedText val rightAngle: TaggedText val equals : TaggedText diff --git a/src/fsharp/lex.fsl b/src/fsharp/lex.fsl index f3842f908e2..62fea65c296 100644 --- a/src/fsharp/lex.fsl +++ b/src/fsharp/lex.fsl @@ -562,11 +562,13 @@ rule token args skip = parse | "=" { EQUALS } | "[" { LBRACK } | "[|" { LBRACK_BAR } + | "{|" { LBRACE_BAR } | "<" { LESS false } | ">" { GREATER false } | "[<" { LBRACK_LESS } | "]" { RBRACK } | "|]" { BAR_RBRACK } + | "|}" { BAR_RBRACE } | ">]" { GREATER_RBRACK } | "{" { LBRACE } | "|" { BAR } diff --git a/src/fsharp/lib.fs b/src/fsharp/lib.fs index 3d5e854aff8..18404ba377d 100755 --- a/src/fsharp/lib.fs +++ b/src/fsharp/lib.fs @@ -226,9 +226,8 @@ module ListSet = | (h::t) -> if contains f h l1 then h::intersect f l1 t else intersect f l1 t | [] -> [] - (* NOTE: quadratic! *) // Note: if duplicates appear, keep the ones toward the _front_ of the list - let setify f l = List.foldBack (insert f) (List.rev l) [] |> List.rev + let setify f l = List.fold (fun acc x -> insert f x acc) [] l |> List.rev let hasDuplicates f l = match l with diff --git a/src/fsharp/pars.fsy b/src/fsharp/pars.fsy index 9ca12c58e5f..25c8ce10a8c 100644 --- a/src/fsharp/pars.fsy +++ b/src/fsharp/pars.fsy @@ -197,8 +197,8 @@ let rangeOfLongIdent(lid:LongIdent) = %token OPEN OR REC THEN TO TRUE TRY TYPE VAL INLINE INTERFACE INSTANCE CONST %token WHEN WHILE WITH HASH AMP AMP_AMP QUOTE LPAREN RPAREN RPAREN_COMING_SOON RPAREN_IS_HERE STAR COMMA RARROW GREATER_BAR_RBRACK LPAREN_STAR_RPAREN %token QMARK QMARK_QMARK DOT COLON COLON_COLON COLON_GREATER COLON_QMARK_GREATER COLON_QMARK COLON_EQUALS SEMICOLON -%token SEMICOLON_SEMICOLON LARROW EQUALS LBRACK LBRACK_BAR LBRACK_LESS LBRACE -%token LBRACE_LESS BAR_RBRACK GREATER_RBRACE UNDERSCORE +%token SEMICOLON_SEMICOLON LARROW EQUALS LBRACK LBRACK_BAR LBRACE_BAR LBRACK_LESS LBRACE +%token BAR_RBRACK BAR_RBRACE UNDERSCORE %token BAR RBRACK RBRACE RBRACE_COMING_SOON RBRACE_IS_HERE MINUS DOLLAR %token GREATER_RBRACK STRUCT SIG %token STATIC MEMBER CLASS ABSTRACT OVERRIDE DEFAULT CONSTRUCTOR INHERIT @@ -675,14 +675,14 @@ fileModuleSpec: (fun (isRec2,path,_) -> if not (isNil path) then errorR(Error(FSComp.SR.parsNamespaceOrModuleNotBoth(),m2)) let lid = path@path2 - ParsedSigFileFragment.NamedModule(SynModuleOrNamespaceSig(lid, (isRec || isRec2), true, $4, xml,$1,vis,m))) } + ParsedSigFileFragment.NamedModule(SynModuleOrNamespaceSig(lid, (isRec || isRec2), NamedModule, $4, xml,$1,vis,m))) } | moduleSpfnsPossiblyEmptyBlock { let m = (rhs parseState 1) (fun (isRec, path, xml) -> match path with | [] -> ParsedSigFileFragment.AnonModule($1, m) - | _ -> ParsedSigFileFragment.NamespaceFragment(path, isRec, false, $1, xml,[],m)) } + | _ -> ParsedSigFileFragment.NamespaceFragment(path, isRec, DeclaredNamespace, $1, xml,[],m)) } moduleSpfnsPossiblyEmptyBlock: @@ -1097,14 +1097,14 @@ fileModuleImpl: (fun (isRec, path, _) -> if not (isNil path) then errorR(Error(FSComp.SR.parsNamespaceOrModuleNotBoth(),m2)) let lid = path@path2 - ParsedImplFileFragment.NamedModule(SynModuleOrNamespace(lid, (isRec || isRec2), true, $4, xml,$1,vis,m))) } + ParsedImplFileFragment.NamedModule(SynModuleOrNamespace(lid, (isRec || isRec2), NamedModule, $4, xml,$1,vis,m))) } | moduleDefnsOrExprPossiblyEmptyOrBlock { let m = (rhs parseState 1) (fun (isRec, path, xml) -> match path with | [] -> ParsedImplFileFragment.AnonModule($1,m) - | _ -> ParsedImplFileFragment.NamespaceFragment(path, isRec, false, $1, xml,[],m)) } + | _ -> ParsedImplFileFragment.NamespaceFragment(path, isRec, DeclaredNamespace, $1, xml,[],m)) } /* A collection/block of definitions or expressions making up a module or namespace, possibly empty */ @@ -1782,10 +1782,10 @@ memberCore: let args = if id.idText = "set" then match args with - | [SynPat.Paren(SynPat.Tuple (indexPats,_),indexPatRange);valuePat] when id.idText = "set" -> - [SynPat.Tuple(indexPats@[valuePat],unionRanges indexPatRange valuePat.Range)] + | [SynPat.Paren(SynPat.Tuple (false,indexPats,_),indexPatRange);valuePat] when id.idText = "set" -> + [SynPat.Tuple(false,indexPats@[valuePat],unionRanges indexPatRange valuePat.Range)] | [indexPat;valuePat] -> - [SynPat.Tuple(args,unionRanges indexPat.Range valuePat.Range)] + [SynPat.Tuple(false,args,unionRanges indexPat.Range valuePat.Range)] | [valuePat] -> [valuePat] | _ -> @@ -1945,11 +1945,11 @@ opt_classDefn: /* An 'inherits' definition in an object type definition */ inheritsDefn: - | INHERIT appTypeNonAtomicDeprecated optBaseSpec + | INHERIT atomTypeNonAtomicDeprecated optBaseSpec { let mDecl = unionRanges (rhs parseState 1) (($2): SynType).Range SynMemberDefn.Inherit($2,$3,mDecl) } - | INHERIT appTypeNonAtomicDeprecated opt_HIGH_PRECEDENCE_APP atomicExprAfterType optBaseSpec + | INHERIT atomTypeNonAtomicDeprecated opt_HIGH_PRECEDENCE_APP atomicExprAfterType optBaseSpec { let mDecl = unionRanges (rhs parseState 1) $4.Range SynMemberDefn.ImplicitInherit($2,$4,$5,mDecl) } @@ -2081,6 +2081,24 @@ braceFieldDeclList: | LBRACE error rbrace { [] } +anonRecdType: + | STRUCT braceBarFieldDeclListCore + { $2,true } + | braceBarFieldDeclListCore + { $1,false } + +/* The core of a record type definition */ +braceBarFieldDeclListCore: + | LBRACE_BAR recdFieldDeclList bar_rbrace + { $2 } + + | LBRACE_BAR recdFieldDeclList recover + { reportParseErrorAt (rhs parseState 1) (FSComp.SR.parsUnmatchedBraceBar()) + $2 } + + | LBRACE_BAR error bar_rbrace + { [] } + inlineAssemblyTyconRepr: | HASH stringOrKeywordString HASH { libraryOnlyError (lhs parseState) @@ -2210,8 +2228,8 @@ typeConstraint: | nm -> raiseParseErrorAt (rhs parseState 3) (FSComp.SR.parsUnexpectedIdentifier(nm)) } typarAlts: - | typarAlts OR appType { $3::$1 } - | appType { [$1] } + | typarAlts OR appType { $3::$1 } + | appType { [$1] } /* The core of a union type definition */ unionTypeRepr: @@ -2359,7 +2377,7 @@ openDecl: /*-------------------------------------------------------------------------*/ -/* F# Definitions and Expressions */ +/* F# Definitions, Types, Patterns and Expressions */ /* A 'let ...' or 'do ...' statement in the non-#light syntax */ defnBindings: @@ -2472,7 +2490,7 @@ cPrototype: SynExpr.Const(SynConst.String("extern was not given a DllImport attribute",rhs parseState 8),rhs parseState 8), mRhs) (fun attrs vis -> - let bindingId = SynPat.LongIdent (LongIdentWithDots([nm],[]), None, Some noInferredTypars, SynConstructorArgs.Pats [SynPat.Tuple(args,argsm)], vis, nmm) + let bindingId = SynPat.LongIdent (LongIdentWithDots([nm],[]), None, Some noInferredTypars, SynConstructorArgs.Pats [SynPat.Tuple(false,args,argsm)], vis, nmm) let binding = mkSynBinding (xmlDoc, bindingId) (vis, false, false, mBindLhs, NoSequencePointAtInvisibleBinding, Some rty ,rhsExpr, mRhs, [], attrs, None) @@ -2754,9 +2772,9 @@ headBindingPattern: | headBindingPattern BAR headBindingPattern { SynPat.Or($1,$3,rhs2 parseState 1 3) } | headBindingPattern COLON_COLON headBindingPattern - { SynPat.LongIdent (LongIdentWithDots(mkSynCaseName (rhs parseState 2) opNameCons,[]), None, None, SynConstructorArgs.Pats [SynPat.Tuple ([$1;$3],rhs2 parseState 1 3)],None,lhs parseState) } + { SynPat.LongIdent (LongIdentWithDots(mkSynCaseName (rhs parseState 2) opNameCons,[]), None, None, SynConstructorArgs.Pats [SynPat.Tuple (false,[$1;$3],rhs2 parseState 1 3)],None,lhs parseState) } | tuplePatternElements %prec pat_tuple - { SynPat.Tuple(List.rev $1, lhs parseState) } + { SynPat.Tuple(false,List.rev $1, lhs parseState) } | conjPatternElements %prec pat_conj { SynPat.Ands(List.rev $1, lhs parseState) } | constrPattern @@ -2790,7 +2808,7 @@ constrPattern: { let vis,lid = $1 in SynPat.LongIdent (lid,None,$2, $4,vis,lhs parseState) } | atomicPatternLongIdent opt_explicitValTyparDecls2 HIGH_PRECEDENCE_BRACK_APP atomicPatsOrNamePatPairs { let vis,lid = $1 in SynPat.LongIdent (lid,None,$2, $4,vis,lhs parseState) } - | COLON_QMARK atomType %prec pat_isinst + | COLON_QMARK atomTypeOrAnonRecdType %prec pat_isinst { SynPat.IsInst($2,lhs parseState) } | atomicPattern { $1 } @@ -2815,8 +2833,8 @@ atomicPattern: | quoteExpr { SynPat.QuoteExpr($1,lhs parseState) } | CHAR DOT_DOT CHAR { SynPat.DeprecatedCharRange ($1,$3,rhs2 parseState 1 3) } - | LBRACE recordPatternElements rbrace - { $2 } + | LBRACE recordPatternElementsAux rbrace + { let rs,m = $2 in SynPat.Record (rs,m) } | LBRACK listPatternElements RBRACK { SynPat.ArrayOrList(false,$2,lhs parseState) } | LBRACK_BAR listPatternElements BAR_RBRACK @@ -2850,10 +2868,10 @@ atomicPattern: { reportParseErrorAt (rhs parseState 1) (FSComp.SR.parsUnmatchedParen()) SynPat.Wild (lhs parseState)} | STRUCT LPAREN tupleParenPatternElements rparen - { SynPat.StructTuple(List.rev $3,lhs parseState) } + { SynPat.Tuple(true, List.rev $3,lhs parseState) } | STRUCT LPAREN tupleParenPatternElements recover { reportParseErrorAt (rhs parseState 2) (FSComp.SR.parsUnmatchedParen()); - SynPat.StructTuple(List.rev $3,lhs parseState) } + SynPat.Tuple(true, List.rev $3,lhs parseState) } | STRUCT LPAREN error rparen { (* silent recovery *) SynPat.Wild (lhs parseState) } | STRUCT LPAREN recover @@ -2899,7 +2917,7 @@ parenPattern: | parenPattern BAR parenPattern { SynPat.Or($1,$3,rhs2 parseState 1 3) } | tupleParenPatternElements - { SynPat.Tuple(List.rev $1,lhs parseState) } + { SynPat.Tuple(false,List.rev $1,lhs parseState) } | conjParenPatternElements { SynPat.Ands(List.rev $1,rhs2 parseState 1 3) } | parenPattern COLON typeWithTypeConstraints %prec paren_pat_colon @@ -2909,7 +2927,7 @@ parenPattern: { let lhsm = lhs parseState SynPat.Attrib($2,$1,lhsm) } | parenPattern COLON_COLON parenPattern - { SynPat.LongIdent (LongIdentWithDots(mkSynCaseName (rhs parseState 2) opNameCons,[]), None, None, SynConstructorArgs.Pats [ SynPat.Tuple ([$1;$3],rhs2 parseState 1 3) ],None,lhs parseState) } + { SynPat.LongIdent (LongIdentWithDots(mkSynCaseName (rhs parseState 2) opNameCons,[]), None, None, SynConstructorArgs.Pats [ SynPat.Tuple (false,[$1;$3],rhs2 parseState 1 3) ],None,lhs parseState) } | constrPattern { $1 } tupleParenPatternElements: @@ -2924,9 +2942,6 @@ conjParenPatternElements: | parenPattern AMP parenPattern { $3 :: $1 :: [] } -recordPatternElements: - | recordPatternElementsAux { let rs,m = $1 in SynPat.Record (rs,m) } - recordPatternElementsAux: /* Fix 1190 */ | recordPatternElement opt_seps { [$1],lhs parseState } @@ -3340,7 +3355,7 @@ declExpr: | declExpr COLON_EQUALS declExpr { mkSynInfix (rhs parseState 2) $1 ":=" $3 } | minusExpr LARROW declExprBlock { mkSynAssign $1 $3 } /* | minusExpr LARROW recover { mkSynAssign $1 (arbExpr("assignRhs",rhs parseState 2)) } */ - | tupleExpr %prec expr_tuple { let exprs,commas = $1 in SynExpr.Tuple(List.rev exprs, List.rev commas, (commas.Head, exprs) ||> unionRangeWithListBy (fun e -> e.Range) ) } + | tupleExpr %prec expr_tuple { let exprs,commas = $1 in SynExpr.Tuple(false, List.rev exprs, List.rev commas, (commas.Head, exprs) ||> unionRangeWithListBy (fun e -> e.Range) ) } | declExpr JOIN_IN declExpr { SynExpr.JoinIn($1,rhs parseState 2,$3,unionRanges $1.Range $3.Range) } | declExpr BAR_BAR declExpr { mkSynInfix (rhs parseState 2) $1 "||" $3 } | declExpr INFIX_BAR_OP declExpr { mkSynInfix (rhs parseState 2) $1 $2 $3 } @@ -3357,7 +3372,7 @@ declExpr: | declExpr GREATER declExpr { mkSynInfix (rhs parseState 2) $1 ">" $3 } | declExpr INFIX_AT_HAT_OP declExpr { mkSynInfix (rhs parseState 2) $1 $2 $3 } | declExpr PERCENT_OP declExpr { mkSynInfix (rhs parseState 2) $1 $2 $3 } - | declExpr COLON_COLON declExpr { SynExpr.App (ExprAtomicFlag.NonAtomic, true, mkSynIdGet (rhs parseState 2) opNameCons,SynExpr.Tuple ([$1;$3],[rhs parseState 2],unionRanges $1.Range $3.Range),unionRanges $1.Range $3.Range) } + | declExpr COLON_COLON declExpr { SynExpr.App (ExprAtomicFlag.NonAtomic, true, mkSynIdGet (rhs parseState 2) opNameCons,SynExpr.Tuple (false,[$1;$3],[rhs parseState 2],unionRanges $1.Range $3.Range),unionRanges $1.Range $3.Range) } | declExpr PLUS_MINUS_OP declExpr { mkSynInfix (rhs parseState 2) $1 $2 $3 } | declExpr MINUS declExpr { mkSynInfix (rhs parseState 2) $1 "-" $3 } | declExpr STAR declExpr { mkSynInfix (rhs parseState 2) $1 "*" $3 } @@ -3393,7 +3408,7 @@ declExpr: | declExpr PERCENT_OP OBLOCKEND_COMING_SOON { reportParseErrorAt (rhs parseState 2) (FSComp.SR.parsUnfinishedExpression($2)) exprFromParseError(mkSynInfix (rhs parseState 2) $1 $2 (arbExpr("declExprInfix",(rhs parseState 3).StartRange))) } | declExpr COLON_COLON OBLOCKEND_COMING_SOON { reportParseErrorAt (rhs parseState 2) (FSComp.SR.parsUnfinishedExpression("::")) - SynExpr.App (ExprAtomicFlag.NonAtomic, true, mkSynIdGet (rhs parseState 2) opNameCons,SynExpr.Tuple ([$1;(arbExpr("declExprInfix",(rhs parseState 3).StartRange))],[rhs parseState 2],unionRanges $1.Range (rhs parseState 3).StartRange),unionRanges $1.Range (rhs parseState 3).StartRange) } + SynExpr.App (ExprAtomicFlag.NonAtomic, true, mkSynIdGet (rhs parseState 2) opNameCons,SynExpr.Tuple (false,[$1;(arbExpr("declExprInfix",(rhs parseState 3).StartRange))],[rhs parseState 2],unionRanges $1.Range (rhs parseState 3).StartRange),unionRanges $1.Range (rhs parseState 3).StartRange) } | declExpr PLUS_MINUS_OP OBLOCKEND_COMING_SOON { reportParseErrorAt (rhs parseState 2) (FSComp.SR.parsUnfinishedExpression($2)) exprFromParseError(mkSynInfix (rhs parseState 2) $1 $2 (arbExpr("declExprInfix",(rhs parseState 3).StartRange))) } | declExpr MINUS OBLOCKEND_COMING_SOON { reportParseErrorAt (rhs parseState 2) (FSComp.SR.parsUnfinishedExpression("-")) @@ -3558,10 +3573,10 @@ minusExpr: | AMP_AMP minusExpr { SynExpr.AddressOf(false,$2,rhs parseState 1, unionRanges (rhs parseState 1) $2.Range) } - | NEW appTypeNonAtomicDeprecated opt_HIGH_PRECEDENCE_APP atomicExprAfterType + | NEW atomTypeNonAtomicDeprecated opt_HIGH_PRECEDENCE_APP atomicExprAfterType { SynExpr.New(false,$2,$4,unionRanges (rhs parseState 1) $4.Range) } - | NEW appTypeNonAtomicDeprecated opt_HIGH_PRECEDENCE_APP error + | NEW atomTypeNonAtomicDeprecated opt_HIGH_PRECEDENCE_APP error { SynExpr.New(false,$2,arbExpr("minusExpr",(rhs parseState 4)),unionRanges (rhs parseState 1) ($2).Range) } | NEW error @@ -3656,11 +3671,11 @@ atomicExpr: exprFromParseError (SynExpr.ArrayOrList(false,[ ], rhs parseState 1)),false } | STRUCT LPAREN tupleExpr rparen - { let exprs,commas = $3 in SynExpr.StructTuple(List.rev exprs, List.rev commas, (commas.Head, exprs) ||> unionRangeWithListBy (fun e -> e.Range) ), false } + { let exprs,commas = $3 in SynExpr.Tuple(true, List.rev exprs, List.rev commas, (commas.Head, exprs) ||> unionRangeWithListBy (fun e -> e.Range) ), false } | STRUCT LPAREN tupleExpr recover { reportParseErrorAt (rhs parseState 2) (FSComp.SR.parsUnmatchedBracket()); - let exprs,commas = $3 in SynExpr.StructTuple(List.rev exprs, List.rev commas, (commas.Head, exprs) ||> unionRangeWithListBy (fun e -> e.Range) ), false } + let exprs,commas = $3 in SynExpr.Tuple(true, List.rev exprs, List.rev commas, (commas.Head, exprs) ||> unionRangeWithListBy (fun e -> e.Range) ), false } | atomicExprAfterType { $1,false } @@ -3748,6 +3763,8 @@ atomicExprAfterType: { $1 } | braceExpr { $1 } + | braceBarExpr + { $1 } | NULL { SynExpr.Null(lhs parseState) } | FALSE @@ -3974,6 +3991,10 @@ forLoopRange: | parenPattern EQUALS rangeSequenceExpr { raiseParseErrorAt (rhs parseState 2) (FSComp.SR.parsUnexpectedSymbolEqualsInsteadOfIn()) } +forLoopDirection: + | TO { true } + | DOWNTO { false } + inlineAssemblyExpr: | HASH stringOrKeywordString opt_inlineAssemblyTypeArg opt_curriedArgExprs opt_inlineAssemblyReturnTypes HASH { libraryOnlyWarning (lhs parseState) @@ -4009,7 +4030,7 @@ opt_inlineAssemblyReturnTypes: { [] } recdExpr: - | INHERIT appTypeNonAtomicDeprecated opt_HIGH_PRECEDENCE_APP opt_atomicExprAfterType recdExprBindings opt_seps_recd + | INHERIT atomTypeNonAtomicDeprecated opt_HIGH_PRECEDENCE_APP opt_atomicExprAfterType recdExprBindings opt_seps_recd { let arg = match $4 with None -> mkSynUnit (lhs parseState) | Some e -> e let l = List.rev $5 let dummyField = mkRecdField (LongIdentWithDots([], [])) // dummy identifier, it will be discarded @@ -4017,14 +4038,17 @@ recdExpr: let (_, _, inheritsSep) = List.head l let bindings = List.tail l (Some ($2,arg,rhs2 parseState 2 4, inheritsSep, rhs parseState 1), None, bindings) } + | recdExprCore + { let a,b = $1 in (None, a, b) } +recdExprCore: | appExpr EQUALS declExprBlock recdExprBindings opt_seps_recd { match $1 with | LongOrSingleIdent(false, (LongIdentWithDots(_,_) as f),None,m) -> let f = mkRecdField f let l = List.rev $4 let l = rebindRanges (f, Some $3) l $5 - (None, None, l) + (None, l) | _ -> raiseParseErrorAt (rhs parseState 2) (FSComp.SR.parsFieldBinding()) } /* @@ -4036,7 +4060,7 @@ recdExpr: reportParseErrorAt m (FSComp.SR.parsUnderscoreInvalidFieldName()) reportParseErrorAt m (FSComp.SR.parsFieldBinding()) let f = mkUnderscoreRecdField m - (None, None, [ f, None, None ]) } + (None, [ (f, None, None) ]) } | UNDERSCORE EQUALS { let m = rhs parseState 1 @@ -4045,29 +4069,28 @@ recdExpr: reportParseErrorAt (rhs2 parseState 1 2) (FSComp.SR.parsFieldBinding()) - (None, None, [f, None, None]) } + (None, [ (f, None, None) ]) } | UNDERSCORE EQUALS declExprBlock recdExprBindings opt_seps_recd { reportParseErrorAt (rhs parseState 1) (FSComp.SR.parsUnderscoreInvalidFieldName()) let f = mkUnderscoreRecdField (rhs parseState 1) - let l = List.rev $4 let l = rebindRanges (f, Some $3) l $5 - (None, None, l) } + (None, l) } /* handles case like {x with} */ | appExpr WITH recdBinding recdExprBindings opt_seps_recd { let l = List.rev $4 let l = rebindRanges $3 l $5 - (None,Some ($1, (rhs parseState 2, None)), l) } + (Some ($1, (rhs parseState 2, None)), l) } | appExpr OWITH opt_seps_recd OEND - { (None,Some ($1, (rhs parseState 2, None)), []) } + { (Some ($1, (rhs parseState 2, None)), []) } | appExpr OWITH recdBinding recdExprBindings opt_seps_recd OEND { let l = List.rev $4 let l = rebindRanges $3 l $5 - (None,Some ($1, (rhs parseState 2, None)), l) } + (Some ($1, (rhs parseState 2, None)), l) } opt_seps_recd: | seps_recd { Some $1 } @@ -4079,6 +4102,7 @@ seps_recd: | SEMICOLON OBLOCKSEP { (rhs2 parseState 1 2), Some (rhs parseState 1).End } | OBLOCKSEP SEMICOLON { (rhs2 parseState 1 2), Some (rhs parseState 2).End } + /* identifier can start from the underscore */ @@ -4131,19 +4155,19 @@ objExpr: let fullRange = match $3 with [] -> (rhs parseState 1) | _ -> (rhs2 parseState 1 3) fullRange, (fun m -> let (a,b) = $1 in SynExpr.ObjExpr(a,b,[],$3, mNewExpr, m)) } - | NEW appTypeNonAtomicDeprecated + | NEW atomTypeNonAtomicDeprecated { let mNewExpr = rhs parseState 1 (rhs2 parseState 1 2), (fun m -> let (a,b) = $2,None in SynExpr.ObjExpr(a,b,[],[], mNewExpr, m)) } objExprBaseCall: - | NEW appTypeNonAtomicDeprecated opt_HIGH_PRECEDENCE_APP atomicExprAfterType baseSpec + | NEW atomTypeNonAtomicDeprecated opt_HIGH_PRECEDENCE_APP atomicExprAfterType baseSpec { ($2, Some($4,Some($5))) } - | NEW appTypeNonAtomicDeprecated opt_HIGH_PRECEDENCE_APP atomicExprAfterType + | NEW atomTypeNonAtomicDeprecated opt_HIGH_PRECEDENCE_APP atomicExprAfterType { ($2, Some($4,None)) } - | NEW appTypeNonAtomicDeprecated + | NEW atomTypeNonAtomicDeprecated { $2,None } @@ -4187,9 +4211,47 @@ objExprInterface: | interfaceMember appType opt_objExprBindings opt_declEnd opt_OBLOCKSEP { InterfaceImpl($2, $3, lhs parseState) } -forLoopDirection: - | TO { true } - | DOWNTO { false } +braceBarExpr: + | STRUCT braceBarExprCore + { $2 true } + | braceBarExprCore + { $1 false } + +braceBarExprCore: + | LBRACE_BAR recdExprCore bar_rbrace + { let orig, flds = $2 + let flds = + flds |> List.choose (function + | ((LongIdentWithDots([id],_),_),Some e,_) -> Some (id,e) + | ((LongIdentWithDots([id],_),_),None,_) -> Some (id, arbExpr("anonField",id.idRange)) + | _ -> reportParseErrorAt (rhs parseState 1) (FSComp.SR.parsInvalidAnonRecdType()); None) + let m = rhs2 parseState 1 3 + (fun isStruct -> SynExpr.AnonRecd(isStruct,orig,flds,m)) } + + | LBRACE_BAR recdExprCore recover + { reportParseErrorAt (rhs parseState 1) (FSComp.SR.parsUnmatchedBraceBar()) + let orig, flds = $2 + let flds = + flds |> List.choose (function + | ((LongIdentWithDots([id],_),_),Some e,_) -> Some (id,e) + | ((LongIdentWithDots([id],_),_),None,_) -> Some (id, arbExpr("anonField",id.idRange)) + | _ -> reportParseErrorAt (rhs parseState 1) (FSComp.SR.parsInvalidAnonRecdType()); None) + let m = rhs2 parseState 1 2 + (fun isStruct -> SynExpr.AnonRecd(isStruct,orig,flds,m)) } + + | LBRACE_BAR error bar_rbrace + { // silent recovery + let m = rhs2 parseState 1 3 + (fun _ -> arbExpr("braceBarExpr",m)) } + + | LBRACE_BAR recover + { reportParseErrorAt (rhs parseState 1) (FSComp.SR.parsUnmatchedBraceBar()) + let m = rhs2 parseState 1 1 + (fun isStruct -> SynExpr.AnonRecd(isStruct,None,[],m)) } + + | LBRACE_BAR bar_rbrace + { let m = rhs2 parseState 1 2 + (fun isStruct -> SynExpr.AnonRecd(isStruct,None,[],m)) } anonLambdaExpr: | FUN atomicPatterns RARROW typedSeqExprBlock @@ -4273,7 +4335,7 @@ topType: topTupleType: | topAppType STAR topTupleTypeElements - { let ty,mdata = $1 in let tys,mdatas = List.unzip $3 in (SynType.Tuple(List.map (fun ty -> (false,ty)) (ty ::tys), lhs parseState)),(mdata :: mdatas) } + { let ty,mdata = $1 in let tys,mdatas = List.unzip $3 in (SynType.Tuple(false,List.map (fun ty -> (false,ty)) (ty ::tys), lhs parseState)),(mdata :: mdatas) } | topAppType { let ty,mdata = $1 in ty,[mdata] } @@ -4323,15 +4385,15 @@ typEOF: tupleType: | appType STAR tupleOrQuotTypeElements - { SynType.Tuple((false,$1) :: $3,lhs parseState) } + { SynType.Tuple(false,(false,$1) :: $3,lhs parseState) } | INFIX_STAR_DIV_MOD_OP tupleOrQuotTypeElements { if $1 <> "/" then reportParseErrorAt (rhs parseState 1) (FSComp.SR.parsUnexpectedInfixOperator()); - SynType.Tuple((true, SynType.StaticConstant (SynConst.Int32 1, lhs parseState)):: $2, lhs parseState) } + SynType.Tuple(false,(true, SynType.StaticConstant (SynConst.Int32 1, lhs parseState)):: $2, lhs parseState) } | appType INFIX_STAR_DIV_MOD_OP tupleOrQuotTypeElements { if $2 <> "/" then reportParseErrorAt (rhs parseState 1) (FSComp.SR.parsUnexpectedInfixOperator()); - SynType.Tuple((true,$1) :: $3, lhs parseState) } + SynType.Tuple(false,(true,$1) :: $3, lhs parseState) } | appType %prec prec_tuptyp_prefix { $1 } @@ -4347,13 +4409,6 @@ tupleOrQuotTypeElements: | appType %prec prec_tuptyptail_prefix { [(false,$1)] } -tupleTypeElements: - | appType STAR tupleTypeElements - { $1 :: $3 } - - | appType %prec prec_tuptyptail_prefix - { [$1] } - appTypeCon: | path %prec prec_atomtyp_path { SynType.LongIdent($1) } @@ -4427,57 +4482,37 @@ typeArgListElements: { [], [] } powerType: - | atomType + | atomTypeOrAnonRecdType { $1 } - | atomType INFIX_AT_HAT_OP atomicRationalConstant + | atomTypeOrAnonRecdType INFIX_AT_HAT_OP atomicRationalConstant { if $2 <> "^" && $2 <> "^-" then reportParseErrorAt (rhs parseState 2) (FSComp.SR.parsUnexpectedInfixOperator()); if $2 = "^-" then SynType.MeasurePower($1, SynRationalConst.Negate($3), lhs parseState) else SynType.MeasurePower($1, $3, lhs parseState) } -/* Like appType but gives a deprecation error when a non-atomic type is used */ -appTypeNonAtomicDeprecated: - | appType arrayTypeSuffix - { deprecatedWithError (FSComp.SR.parsNonAtomicType()) (lhs parseState); - SynType.Array($2,$1,lhs parseState) } - - | appType HIGH_PRECEDENCE_BRACK_APP arrayTypeSuffix /* only HPA for "name[]" allowed here */ - { deprecatedWithError (FSComp.SR.parsNonAtomicType()) (lhs parseState); - SynType.Array($3,$1,lhs parseState) } - - | appType appTypeConPower - { let mWhole = unionRanges (rhs parseState 1) $2.Range // note: use "rhs parseState 1" to deal with parens in "(int) list" - deprecatedWithError (FSComp.SR.parsNonAtomicType()) mWhole; - SynType.App($2, None, [$1], [], None, true, mWhole) } +/* Like appType but gives a deprecation error when a non-atomic type is used */ +/* Also, doesn't start with '{|' */ +atomTypeNonAtomicDeprecated: | LPAREN appTypePrefixArguments rparen appTypeConPower { let args, commas = $2 mlCompatWarning (FSComp.SR.parsMultiArgumentGenericTypeFormDeprecated()) (unionRanges (rhs parseState 1) $4.Range); SynType.App($4, None, args, commas, None, true, unionRanges (rhs parseState 1) $4.Range) } - | powerTypeNonAtomicDeprecated + | atomType { $1 } - | typar COLON_GREATER typ - { deprecatedWithError (FSComp.SR.parsNonAtomicType()) (lhs parseState); - let tp,typ = $1,$3 - let m = lhs parseState - SynType.WithGlobalConstraints(SynType.Var (tp, rhs parseState 1), [WhereTyparSubtypeOfType(tp,typ,m)],m) } - - | UNDERSCORE COLON_GREATER typ %prec COLON_GREATER - { deprecatedWithError (FSComp.SR.parsNonAtomicType()) (lhs parseState); - SynType.HashConstraint($3, lhs parseState) } - -/* Like powerType but gives a deprecation warning if a non-atomic type is used */ -powerTypeNonAtomicDeprecated: +atomTypeOrAnonRecdType: | atomType - { $1 } + { $1 } + | anonRecdType + { let flds,isStruct = $1 + let flds2 = + flds |> List.choose (function + | (Field([],false,Some id,ty,false,_xmldoc,None,_m)) -> Some (id,ty) + | _ -> reportParseErrorAt (rhs parseState 1) (FSComp.SR.parsInvalidAnonRecdType()); None) + SynType.AnonRecd (isStruct,flds2, rhs parseState 1) } - | atomType INFIX_AT_HAT_OP atomicRationalConstant - { if $2 <> "^" && $2 <> "^-" then reportParseErrorAt (rhs parseState 2) (FSComp.SR.parsUnexpectedInfixOperator()); - deprecatedWithError (FSComp.SR.parsNonAtomicType()) (lhs parseState); - if $2 = "^-" then SynType.MeasurePower($1, SynRationalConst.Negate($3), lhs parseState) - else SynType.MeasurePower($1, $3, lhs parseState) } /* Any tokens in this grammar must be added to the lex filter rule 'peekAdjacentTypars' */ @@ -4500,11 +4535,11 @@ atomType: $2 } | STRUCT LPAREN appType STAR tupleOrQuotTypeElements rparen - { SynType.StructTuple((false,$3) :: $5,lhs parseState) } + { SynType.Tuple(true, (false,$3) :: $5,lhs parseState) } | STRUCT LPAREN appType STAR tupleOrQuotTypeElements recover { reportParseErrorAt (rhs parseState 2) (FSComp.SR.parsUnmatchedParen()) - SynType.StructTuple((false,$3) :: $5,lhs parseState) } + SynType.Tuple(true, (false,$3) :: $5,lhs parseState) } | STRUCT LPAREN appType STAR recover { reportParseErrorAt (rhs parseState 2) (FSComp.SR.parsUnmatchedParen()) @@ -4976,6 +5011,9 @@ rbrace: | RBRACE_IS_HERE { } | RBRACE { } +bar_rbrace: + | BAR_RBRACE { } + rparen: | RPAREN_COMING_SOON rparen { } | RPAREN_IS_HERE { } diff --git a/src/fsharp/range.fs b/src/fsharp/range.fs index 8649b700867..4e97edc2b37 100755 --- a/src/fsharp/range.fs +++ b/src/fsharp/range.fs @@ -5,99 +5,119 @@ module Microsoft.FSharp.Compiler.Range open System open System.IO -open System.Collections.Generic +open System.Collections.Concurrent open Microsoft.FSharp.Core.Printf -open Internal.Utilities -open Microsoft.FSharp.Compiler.AbstractIL -open Microsoft.FSharp.Compiler.AbstractIL.Internal open Microsoft.FSharp.Compiler.AbstractIL.Internal.Library -open Microsoft.FSharp.Compiler open Microsoft.FSharp.Compiler.Lib open Microsoft.FSharp.Compiler.Lib.Bits type FileIndex = int32 [] -let columnBitCount = 9 +let columnBitCount = 20 + [] -let lineBitCount = 16 +let lineBitCount = 31 let posBitCount = lineBitCount + columnBitCount -let _ = assert (posBitCount <= 32) -let posColumnMask = mask32 0 columnBitCount -let lineColumnMask = mask32 columnBitCount lineBitCount -let inline (lsr) (x:int) (y:int) = int32 (uint32 x >>> y) + +let posColumnMask = mask64 0 columnBitCount + +let lineColumnMask = mask64 columnBitCount lineBitCount [] [] -type pos(code:int32) = +type pos(code:int64) = + new (l, c) = let l = max 0 l let c = max 0 c - let p = ( c &&& posColumnMask) - ||| ((l <<< columnBitCount) &&& lineColumnMask) + let p = (int64 c &&& posColumnMask) + ||| ((int64 l <<< columnBitCount) &&& lineColumnMask) pos p - member p.Line = (code lsr columnBitCount) - member p.Column = (code &&& posColumnMask) + member p.Line = int32 (uint64 code >>> columnBitCount) + + member p.Column = int32 (code &&& posColumnMask) member r.Encoding = code + static member EncodingSize = posBitCount - static member Decode (code:int32) : pos = pos code + + static member Decode (code:int64) : pos = pos code + override p.Equals(obj) = match obj with :? pos as p2 -> code = p2.Encoding | _ -> false + override p.GetHashCode() = hash code + override p.ToString() = sprintf "(%d,%d)" p.Line p.Column [] -let fileIndexBitCount = 14 +let fileIndexBitCount = 24 + [] -let startLineBitCount = lineBitCount +let startColumnBitCount = columnBitCount // 20 + [] -let startColumnBitCount = columnBitCount +let endColumnBitCount = columnBitCount // 20 + [] -let heightBitCount = 15 // If necessary, could probably deduct one or two bits here without ill effect. +let startLineBitCount = lineBitCount // 31 + [] -let endColumnBitCount = columnBitCount +let heightBitCount = 27 + [] let isSyntheticBitCount = 1 -#if DEBUG -let _ = assert (fileIndexBitCount + startLineBitCount + startColumnBitCount + heightBitCount + endColumnBitCount + isSyntheticBitCount = 64) -#endif - + [] let fileIndexShift = 0 + [] -let startLineShift = 14 -[] -let startColumnShift = 30 +let startColumnShift = 24 + [] -let heightShift = 39 +let endColumnShift = 44 + [] -let endColumnShift = 54 +let startLineShift = 0 + [] -let isSyntheticShift = 63 +let heightShift = 31 +[] +let isSyntheticShift = 58 [] -let fileIndexMask = 0b0000000000000000000000000000000000000000000000000011111111111111L +let fileIndexMask = 0b0000000000000000000000000000000000000000111111111111111111111111L + [] -let startLineMask = 0b0000000000000000000000000000000000111111111111111100000000000000L +let startColumnMask = 0b0000000000000000000011111111111111111111000000000000000000000000L + [] -let startColumnMask = 0b0000000000000000000000000111111111000000000000000000000000000000L +let endColumnMask = 0b1111111111111111111100000000000000000000000000000000000000000000L + [] -let heightMask = 0b0000000000111111111111111000000000000000000000000000000000000000L +let startLineMask = 0b0000000000000000000000000000000001111111111111111111111111111111L + [] -let endColumnMask = 0b0111111111000000000000000000000000000000000000000000000000000000L +let heightMask = 0b0000001111111111111111111111111110000000000000000000000000000000L + [] -let isSyntheticMask = 0b1000000000000000000000000000000000000000000000000000000000000000L +let isSyntheticMask = 0b0000010000000000000000000000000000000000000000000000000000000000L #if DEBUG -let _ = assert (startLineShift = fileIndexShift + fileIndexBitCount) -let _ = assert (startColumnShift = startLineShift + startLineBitCount) -let _ = assert (heightShift = startColumnShift + startColumnBitCount) -let _ = assert (endColumnShift = heightShift + heightBitCount) -let _ = assert (isSyntheticShift = endColumnShift + endColumnBitCount) -let _ = assert (fileIndexMask = mask64 0 fileIndexBitCount) +let _ = assert (posBitCount <= 64) +let _ = assert (fileIndexBitCount + startColumnBitCount + endColumnBitCount <= 64) +let _ = assert (startLineBitCount + heightBitCount + isSyntheticBitCount <= 64) + +let _ = assert (startColumnShift = fileIndexShift + fileIndexBitCount) +let _ = assert (endColumnShift = startColumnShift + startColumnBitCount) + +let _ = assert (heightShift = startLineShift + startLineBitCount) +let _ = assert (isSyntheticShift = heightShift + heightBitCount) + +let _ = assert (fileIndexMask = mask64 fileIndexShift fileIndexBitCount) let _ = assert (startLineMask = mask64 startLineShift startLineBitCount) let _ = assert (startColumnMask = mask64 startColumnShift startColumnBitCount) let _ = assert (heightMask = mask64 heightShift heightBitCount) @@ -105,28 +125,64 @@ let _ = assert (endColumnMask = mask64 endColumnShift endColumnBitCount) let _ = assert (isSyntheticMask = mask64 isSyntheticShift isSyntheticBitCount) #endif -// This is just a standard unique-index table +/// Removes relative parts from any full paths +let normalizeFilePath (filePath: string) = + try + if FileSystem.IsPathRootedShim filePath then + FileSystem.GetFullPathShim filePath + else + filePath + with _ -> filePath + +/// A unique-index table for file names. type FileIndexTable() = let indexToFileTable = new ResizeArray<_>(11) - let fileToIndexTable = new Dictionary(11) - member t.FileToIndex f = - let mutable res = 0 - let ok = fileToIndexTable.TryGetValue(f, &res) - if ok then res - else + let fileToIndexTable = new ConcurrentDictionary() + + // Note: we should likely adjust this code to always normalize. However some testing (and possibly some + // product behaviour) appears to be sensitive to error messages reporting un-normalized file names. + // Currently all names going through 'mkRange' get normalized, while this going through just 'fileIndexOfFile' + // do not. Also any file names which are not put into ranges at all are non-normalized. + // + // TO move forward we should eventually introduce a new type NormalizedFileName that tracks this invariant. + member t.FileToIndex normalize filePath = + match fileToIndexTable.TryGetValue(filePath) with + | true, idx -> idx + | _ -> + + // Try again looking for a normalized entry. + let normalizedFilePath = if normalize then normalizeFilePath filePath else filePath + match fileToIndexTable.TryGetValue(normalizedFilePath) with + | true, idx -> + // Record the non-normalized entry if necessary + if filePath <> normalizedFilePath then + lock fileToIndexTable (fun () -> + fileToIndexTable.[filePath] <- idx) + + // Return the index + idx + + | _ -> lock fileToIndexTable (fun () -> - let mutable res = 0 in - let ok = fileToIndexTable.TryGetValue(f, &res) in - if ok then res - else - let n = indexToFileTable.Count in - indexToFileTable.Add(f) - fileToIndexTable.[f] <- n - n) + // Get the new index + let idx = indexToFileTable.Count + + // Record the normalized entry + indexToFileTable.Add normalizedFilePath + fileToIndexTable.[normalizedFilePath] <- idx + + // Record the non-normalized entry if necessary + if filePath <> normalizedFilePath then + fileToIndexTable.[filePath] <- idx + + // Return the index + idx) member t.IndexToFile n = - (if n < 0 then failwithf "fileOfFileIndex: negative argument: n = %d\n" n) - (if n >= indexToFileTable.Count then failwithf "fileOfFileIndex: invalid argument: n = %d\n" n) + if n < 0 then + failwithf "fileOfFileIndex: negative argument: n = %d\n" n + if n >= indexToFileTable.Count then + failwithf "fileOfFileIndex: invalid argument: n = %d\n" n indexToFileTable.[n] let maxFileIndex = pown32 fileIndexBitCount @@ -136,8 +192,11 @@ let maxFileIndex = pown32 fileIndexBitCount let fileIndexTable = new FileIndexTable() // If we exceed the maximum number of files we'll start to report incorrect file names -let fileIndexOfFile f = fileIndexTable.FileToIndex(f) % maxFileIndex -let fileOfFileIndex n = fileIndexTable.IndexToFile(n) +let fileIndexOfFileAux normalize f = fileIndexTable.FileToIndex normalize f % maxFileIndex + +let fileIndexOfFile filePath = fileIndexOfFileAux false filePath + +let fileOfFileIndex idx = fileIndexTable.IndexToFile idx let mkPos l c = pos (l, c) @@ -147,28 +206,47 @@ let mkPos l c = pos (l, c) #else [] #endif -type range(code:int64) = - static member Zero = range(0L) +type range(code1:int64, code2: int64) = + static member Zero = range(0L, 0L) new (fidx, bl, bc, el, ec) = - range( int64 fidx - ||| (int64 bl <<< startLineShift) - ||| (int64 bc <<< startColumnShift) - ||| (int64 (el-bl) <<< heightShift) - ||| (int64 ec <<< endColumnShift) ) + let code1 = ((int64 fidx) &&& fileIndexMask) + ||| ((int64 bc <<< startColumnShift) &&& startColumnMask) + ||| ((int64 ec <<< endColumnShift) &&& endColumnMask) + let code2 = + ((int64 bl <<< startLineShift) &&& startLineMask) + ||| ((int64 (el-bl) <<< heightShift) &&& heightMask) + range(code1, code2) new (fidx, b:pos, e:pos) = range(fidx, b.Line, b.Column, e.Line, e.Column) - member r.StartLine = int32((code &&& startLineMask) >>> startLineShift) - member r.StartColumn = int32((code &&& startColumnMask) >>> startColumnShift) - member r.EndLine = int32((code &&& heightMask) >>> heightShift) + r.StartLine - member r.EndColumn = int32((code &&& endColumnMask) >>> endColumnShift) - member r.IsSynthetic = int32((code &&& isSyntheticMask) >>> isSyntheticShift) <> 0 + member r.StartLine = int32((code2 &&& startLineMask) >>> startLineShift) + + member r.StartColumn = int32((code1 &&& startColumnMask) >>> startColumnShift) + + member r.EndLine = int32((code2 &&& heightMask) >>> heightShift) + r.StartLine + + member r.EndColumn = int32((code1 &&& endColumnMask) >>> endColumnShift) + + member r.IsSynthetic = int32((code2 &&& isSyntheticMask) >>> isSyntheticShift) <> 0 + member r.Start = pos (r.StartLine, r.StartColumn) + member r.End = pos (r.EndLine, r.EndColumn) - member r.FileIndex = int32(code &&& fileIndexMask) + + member r.FileIndex = int32(code1 &&& fileIndexMask) + member m.StartRange = range (m.FileIndex, m.Start, m.Start) + member m.EndRange = range (m.FileIndex, m.End, m.End) + member r.FileName = fileOfFileIndex r.FileIndex + + member r.MakeSynthetic() = range(code1, code2 ||| isSyntheticMask) + + member r.Code1 = code1 + + member r.Code2 = code2 + #if DEBUG member r.DebugCode = try @@ -182,37 +260,37 @@ type range(code:int64) = with e -> e.ToString() #endif - member r.MakeSynthetic() = range(code ||| isSyntheticMask) - override r.ToString() = sprintf "%s (%d,%d--%d,%d) IsSynthetic=%b" r.FileName r.StartLine r.StartColumn r.EndLine r.EndColumn r.IsSynthetic + member r.ToShortString() = sprintf "(%d,%d--%d,%d)" r.StartLine r.StartColumn r.EndLine r.EndColumn - member r.Code = code - override r.Equals(obj) = match obj with :? range as r2 -> code = r2.Code | _ -> false - override r.GetHashCode() = hash code -let mkRange f b e = - // remove relative parts from full path - let normalizedFilePath = if Path.IsPathRooted f then try Path.GetFullPath f with _ -> f else f - range (fileIndexOfFile normalizedFilePath, b, e) + override r.Equals(obj) = match obj with :? range as r2 -> code1 = r2.Code1 && code2 = r2.Code2 | _ -> false + + override r.GetHashCode() = hash code1 + hash code2 + + override r.ToString() = sprintf "%s (%d,%d--%d,%d) IsSynthetic=%b" r.FileName r.StartLine r.StartColumn r.EndLine r.EndColumn r.IsSynthetic -let mkFileIndexRange fi b e = range (fi, b, e) +let mkRange filePath startPos endPos = range (fileIndexOfFileAux true filePath, startPos, endPos) + +let mkFileIndexRange fileIndex startPos endPos = range (fileIndex, startPos, endPos) -(* end representation, start derived ops *) - let posOrder = Order.orderOn (fun (p:pos) -> p.Line, p.Column) (Pair.order (Int32.order, Int32.order)) -(* rangeOrder: not a total order, but enough to sort on ranges *) + +/// rangeOrder: not a total order, but enough to sort on ranges let rangeOrder = Order.orderOn (fun (r:range) -> r.FileName, r.Start) (Pair.order (String.order, posOrder)) let outputPos (os:TextWriter) (m:pos) = fprintf os "(%d,%d)" m.Line m.Column + let outputRange (os:TextWriter) (m:range) = fprintf os "%s%a-%a" m.FileName outputPos m.Start outputPos m.End -let boutputPos os (m:pos) = bprintf os "(%d,%d)" m.Line m.Column -let boutputRange os (m:range) = bprintf os "%s%a-%a" m.FileName boutputPos m.Start boutputPos m.End let posGt (p1:pos) (p2:pos) = (p1.Line > p2.Line || (p1.Line = p2.Line && p1.Column > p2.Column)) + let posEq (p1:pos) (p2:pos) = (p1.Line = p2.Line && p1.Column = p2.Column) + let posGeq p1 p2 = posEq p1 p2 || posGt p1 p2 + let posLt p1 p2 = posGt p2 p1 -// This is deliberately written in an allocation-free way, i.e. m1.Start, m1.End etc. are not called +/// This is deliberately written in an allocation-free way, i.e. m1.Start, m1.End etc. are not called let unionRanges (m1:range) (m2:range) = if m1.FileIndex <> m2.FileIndex then m2 else let b = @@ -236,9 +314,13 @@ let rangeBeforePos (m1:range) p = posGeq p m1.End let rangeN filename line = mkRange filename (mkPos line 0) (mkPos line 0) + let pos0 = mkPos 1 0 + let range0 = rangeN "unknown" 1 + let rangeStartup = rangeN "startup" 1 + let rangeCmdArgs = rangeN "commandLineArgs" 0 let trimRangeToLine (r:range) = @@ -252,6 +334,7 @@ let trimRangeToLine (r:range) = (* For Diagnostics *) let stringOfPos (pos:pos) = sprintf "(%d,%d)" pos.Line pos.Column + let stringOfRange (r:range) = sprintf "%s%s-%s" r.FileName (stringOfPos r.Start) (stringOfPos r.End) #if CHECK_LINE0_TYPES // turn on to check that we correctly transform zero-based line counts to one-based line counts @@ -266,17 +349,22 @@ type Pos01 = Line0 * int type Range01 = Pos01 * Pos01 module Line = + // Visual Studio uses line counts starting at 0, F# uses them starting at 1 let fromZ (line:Line0) = int line+1 + let toZ (line:int) : Line0 = LanguagePrimitives.Int32WithMeasure(line - 1) module Pos = + let fromZ (line:Line0) idx = mkPos (Line.fromZ line) idx - let toZ (p:pos) = (Line.toZ p.Line, p.Column) + let toZ (p:pos) = (Line.toZ p.Line, p.Column) module Range = + let toZ (m:range) = Pos.toZ m.Start, Pos.toZ m.End + let toFileZ (m:range) = m.FileName, toZ m diff --git a/src/fsharp/range.fsi b/src/fsharp/range.fsi index c3805f4659a..d4ef8be800f 100755 --- a/src/fsharp/range.fsi +++ b/src/fsharp/range.fsi @@ -10,44 +10,86 @@ open Microsoft.FSharp.Compiler.AbstractIL.Internal open Microsoft.FSharp.Compiler -(* we keep a global tables of filenames that we can reference by integers *) +/// An index into a global tables of filenames type FileIndex = int32 -val fileIndexOfFile : string -> FileIndex + +/// Convert a file path to an index +val fileIndexOfFile : filePath: string -> FileIndex + +/// Convert an index into a file path val fileOfFileIndex : FileIndex -> string +/// Represents a position in a file [] type pos = + + /// The line number for the position member Line : int + + /// The column number for the position member Column : int - member Encoding : int32 - static member Decode : int32 -> pos + /// The encoding of the position as a 64-bit integer + member Encoding : int64 + + /// Decode a position fro a 64-bit integer + static member Decode : int64 -> pos + /// The maximum number of bits needed to store an encoded position - static member EncodingSize : int32 + static member EncodingSize : int /// Create a position for the given line and column val mkPos : line:int -> column:int -> pos +/// Ordering on positions val posOrder : IComparer +/// Represents a range within a known file [] type range = + + /// The start line of the range member StartLine : int + + /// The start column of the range member StartColumn : int + + /// The line number for the end position of the range member EndLine : int + + /// The column number for the end position of the range member EndColumn : int + + /// The start position of the range member Start : pos + + /// The end position of the range member End : pos + + /// The empty range that is located at the start position of the range member StartRange: range + + /// The empty range that is located at the end position of the range member EndRange: range + + /// The file index for the range member FileIndex : int + + /// The file name for the file of the range member FileName : string + /// Synthetic marks ranges which are produced by intermediate compilation phases. This /// bit signifies that the range covers something that should not be visible to language /// service operations like dot-completion. member IsSynthetic : bool + + /// Convert a range to be synthetic member MakeSynthetic : unit -> range + + /// Convert a range to string member ToShortString : unit -> string + + /// The range where all values are zero static member Zero : range /// This view of range marks uses file indexes explicitly @@ -56,34 +98,61 @@ val mkFileIndexRange : FileIndex -> pos -> pos -> range /// This view hides the use of file indexes and just uses filenames val mkRange : string -> pos -> pos -> range +/// Reduce a range so it only covers a line val trimRangeToLine : range -> range /// not a total order, but enough to sort on ranges val rangeOrder : IComparer +/// Output a position val outputPos : System.IO.TextWriter -> pos -> unit + +/// Output a range val outputRange : System.IO.TextWriter -> range -> unit -val boutputPos : StringBuilder -> pos -> unit -val boutputRange : StringBuilder -> range -> unit +/// Compare positions for less-than val posLt : pos -> pos -> bool + +/// Compare positions for greater-than val posGt : pos -> pos -> bool + +/// Compare positions for equality val posEq : pos -> pos -> bool + +/// Compare positions for greater-than-or-equal-to val posGeq : pos -> pos -> bool +/// Union two ranges, taking their first occurring start position and last occurring end position val unionRanges : range -> range -> range + +/// Test to see if one range contains another range val rangeContainsRange : range -> range -> bool + +/// Test to see if a range contains a position val rangeContainsPos : range -> pos -> bool + +/// Test to see if a range occurs fully before a position val rangeBeforePos : range -> pos -> bool +/// Make a dummy range for a file val rangeN : string -> int -> range + +/// The zero position val pos0 : pos + +/// The zero range val range0 : range + +/// A range associated with a dummy file called "startup" val rangeStartup : range + +/// A range associated with a dummy file for the command line arguments val rangeCmdArgs : range -(* For diagnostics *) +/// Convert a position to a string val stringOfPos : pos -> string + +/// Convert a range to a string val stringOfRange : range -> string /// Represents a line number when using zero-based line counting (used by Visual Studio) @@ -98,22 +167,30 @@ type Line0 = int /// Represents a position using zero-based line counting (used by Visual Studio) type Pos01 = Line0 * int + /// Represents a range using zero-based line counting (used by Visual Studio) type Range01 = Pos01 * Pos01 module Line = + /// Convert a line number from zero-based line counting (used by Visual Studio) to one-based line counting (used internally in the F# compiler and in F# error messages) val fromZ : Line0 -> int + /// Convert a line number from one-based line counting (used internally in the F# compiler and in F# error messages) to zero-based line counting (used by Visual Studio) val toZ : int -> Line0 module Pos = + /// Convert a position from zero-based line counting (used by Visual Studio) to one-based line counting (used internally in the F# compiler and in F# error messages) val fromZ : line:Line0 -> column:int -> pos + /// Convert a position from one-based line counting (used internally in the F# compiler and in F# error messages) to zero-based line counting (used by Visual Studio) val toZ : pos -> Pos01 module Range = + /// Convert a range from one-based line counting (used internally in the F# compiler and in F# error messages) to zero-based line counting (used by Visual Studio) val toZ : range -> Range01 + + /// Convert a range from one-based line counting (used internally in the F# compiler and in F# error messages) to zero-based line counting (used by Visual Studio) val toFileZ : range -> string * Range01 diff --git a/src/fsharp/service/IncrementalBuild.fs b/src/fsharp/service/IncrementalBuild.fs index 7065d72a6f0..f5d0141b32e 100755 --- a/src/fsharp/service/IncrementalBuild.fs +++ b/src/fsharp/service/IncrementalBuild.fs @@ -55,15 +55,16 @@ module internal IncrementalBuild = /// Get the Id for the given ScalarBuildRule. member x.Id = match x with - | ScalarInput(id, _) ->id - | ScalarDemultiplex(id, _, _, _) ->id - | ScalarMap(id, _, _, _) ->id + | ScalarInput(id, _) -> id + | ScalarDemultiplex(id, _, _, _) -> id + | ScalarMap(id, _, _, _) -> id + /// Get the Name for the givenScalarExpr. member x.Name = match x with - | ScalarInput(_, n) ->n - | ScalarDemultiplex(_, n, _, _) ->n - | ScalarMap(_, n, _, _) ->n + | ScalarInput(_, n) -> n + | ScalarDemultiplex(_, n, _, _) -> n + | ScalarMap(_, n, _, _) -> n /// A build rule with a vector of outputs and VectorBuildRule = @@ -1034,6 +1035,7 @@ type TypeCheckAccumulator = /// Accumulated 'open' declarations, last file first tcOpenDeclarationsRev: OpenDeclaration[] list + topAttribs:TopAttribs option /// Result of checking most recent file, if any @@ -1043,6 +1045,9 @@ type TypeCheckAccumulator = tcDependencyFiles: string list + /// Disambiguation table for module names + tcModuleNamesDict: ModuleNamesDict + /// Accumulated errors, last file first tcErrorsRev:(PhasedDiagnostic * FSharpErrorSeverity)[] list } @@ -1125,10 +1130,17 @@ type PartialCheckResults = /// Kept in a stack so that each incremental update shares storage with previous files TcOpenDeclarationsRev: OpenDeclaration[] list + /// Disambiguation table for module names + ModuleNamesDict: ModuleNamesDict + TcDependencyFiles: string list + TopAttribs: TopAttribs option + TimeStamp: DateTime + LatestImplementationFile: TypedImplFile option + LastestCcuSigForFile: ModuleOrNamespaceType option } member x.TcErrors = Array.concat (List.rev x.TcErrorsRev) @@ -1146,6 +1158,7 @@ type PartialCheckResults = TcOpenDeclarationsRev = tcAcc.tcOpenDeclarationsRev TcDependencyFiles = tcAcc.tcDependencyFiles TopAttribs = tcAcc.topAttribs + ModuleNamesDict = tcAcc.tcModuleNamesDict TimeStamp = timestamp LatestImplementationFile = tcAcc.latestImplFile LastestCcuSigForFile = tcAcc.latestCcuSigForFile } @@ -1175,7 +1188,9 @@ type RawFSharpAssemblyDataBackedByLanguageService (tcConfig, tcGlobals, tcState: yield (ccuName, (fun () -> r.GetBytes())) ] let autoOpenAttrs = topAttrs.assemblyAttrs |> List.choose (List.singleton >> TryFindFSharpStringAttribute tcGlobals tcGlobals.attrib_AutoOpenAttribute) + let ivtAttrs = topAttrs.assemblyAttrs |> List.choose (List.singleton >> TryFindFSharpStringAttribute tcGlobals tcGlobals.attrib_InternalsVisibleToAttribute) + interface IRawFSharpAssemblyData with member __.GetAutoOpenAttributes(_ilg) = autoOpenAttrs member __.GetInternalsVisibleToAttributes(_ilg) = ivtAttrs @@ -1246,6 +1261,7 @@ type IncrementalBuilder(tcGlobals, frameworkTcImports, nonFrameworkAssemblyInput let assertNotDisposed() = if disposed then System.Diagnostics.Debug.Assert(false, "IncrementalBuild object has already been disposed!") + let mutable referenceCount = 0 //---------------------------------------------------- @@ -1258,14 +1274,9 @@ type IncrementalBuilder(tcGlobals, frameworkTcImports, nonFrameworkAssemblyInput assertNotDisposed() cache.GetFileTimeStamp filename - // Deduplicate module names - let moduleNamesDict = ConcurrentDictionary>() - /// This is a build task function that gets placed into the build rules as the computation for a VectorMap /// - /// Parse the given files and return the given inputs. This function is expected to be - /// able to be called with a subset of sourceFiles and return the corresponding subset of - /// parsed inputs. + /// Parse the given file and return the given input. let ParseTask ctok (sourceRange:range, filename:string, isLastCompiland) = assertNotDisposed() DoesNotRequireCompilerThreadTokenAndCouldPossiblyBeMadeConcurrent ctok @@ -1278,12 +1289,12 @@ type IncrementalBuilder(tcGlobals, frameworkTcImports, nonFrameworkAssemblyInput IncrementalBuilderEventTesting.MRU.Add(IncrementalBuilderEventTesting.IBEParsed filename) let input = ParseOneInputFile(tcConfig, lexResourceManager, [], filename , isLastCompiland, errorLogger, (*retryLocked*)true) fileParsed.Trigger (filename) - let result = Option.map (DeduplicateParsedInputModuleName moduleNamesDict) input - result, sourceRange, filename, errorLogger.GetErrors () + input, sourceRange, filename, errorLogger.GetErrors () with exn -> - System.Diagnostics.Debug.Assert(false, sprintf "unexpected failure in IncrementalFSharpBuild.Parse\nerror = %s" (exn.ToString())) - failwith "last chance failure" + let msg = sprintf "unexpected failure in IncrementalFSharpBuild.Parse\nerror = %s" (exn.ToString()) + System.Diagnostics.Debug.Assert(false, msg) + failwith msg /// This is a build task function that gets placed into the build rules as the computation for a Vector.Stamp @@ -1356,7 +1367,8 @@ type IncrementalBuilder(tcGlobals, frameworkTcImports, nonFrameworkAssemblyInput latestImplFile=None latestCcuSigForFile=None tcDependencyFiles=basicDependencies - tcErrorsRev = [ initialErrors ] } + tcErrorsRev = [ initialErrors ] + tcModuleNamesDict = Map.empty } return tcAcc } /// This is a build task function that gets placed into the build rules as the computation for a Vector.ScanLeft @@ -1377,6 +1389,8 @@ type IncrementalBuilder(tcGlobals, frameworkTcImports, nonFrameworkAssemblyInput let sink = TcResultsSinkImpl(tcAcc.tcGlobals) let hadParseErrors = not (Array.isEmpty parseErrors) + let input, moduleNamesDict = DeduplicateParsedInputModuleName tcAcc.tcModuleNamesDict input + let! (tcEnvAtEndOfFile, topAttribs, implFile, ccuSigForFile), tcState = TypeCheckOneInputEventually ((fun () -> hadParseErrors || errorLogger.ErrorCount > 0), @@ -1405,6 +1419,7 @@ type IncrementalBuilder(tcGlobals, frameworkTcImports, nonFrameworkAssemblyInput tcSymbolUsesRev=tcSymbolUses :: tcAcc.tcSymbolUsesRev tcOpenDeclarationsRev = sink.GetOpenDeclarations() :: tcAcc.tcOpenDeclarationsRev tcErrorsRev = newErrors :: tcAcc.tcErrorsRev + tcModuleNamesDict = moduleNamesDict tcDependencyFiles = filename :: tcAcc.tcDependencyFiles } } @@ -1447,55 +1462,55 @@ type IncrementalBuilder(tcGlobals, frameworkTcImports, nonFrameworkAssemblyInput TypeCheckMultipleInputsFinish (results, finalAcc.tcState) let ilAssemRef, tcAssemblyDataOpt, tcAssemblyExprOpt = - try - // TypeCheckClosedInputSetFinish fills in tcState.Ccu but in incremental scenarios we don't want this, - // so we make this temporary here - let oldContents = tcState.Ccu.Deref.Contents - try - let tcState, tcAssemblyExpr = TypeCheckClosedInputSetFinish (mimpls, tcState) - - // Compute the identity of the generated assembly based on attributes, options etc. - // Some of this is duplicated from fsc.fs - let ilAssemRef = - let publicKey = - try - let signingInfo = Driver.ValidateKeySigningAttributes (tcConfig, tcGlobals, topAttrs) - match Driver.GetStrongNameSigner signingInfo with - | None -> None - | Some s -> Some (PublicKey.KeyAsToken(s.PublicKey)) - with e -> - errorRecoveryNoRange e - None - let locale = TryFindFSharpStringAttribute tcGlobals (tcGlobals.FindSysAttrib "System.Reflection.AssemblyCultureAttribute") topAttrs.assemblyAttrs - let assemVerFromAttrib = - TryFindFSharpStringAttribute tcGlobals (tcGlobals.FindSysAttrib "System.Reflection.AssemblyVersionAttribute") topAttrs.assemblyAttrs - |> Option.bind (fun v -> try Some (parseILVersion v) with _ -> None) - let ver = - match assemVerFromAttrib with - | None -> tcConfig.version.GetVersionInfo(tcConfig.implicitIncludeDir) - | Some v -> v - ILAssemblyRef.Create(assemblyName, None, publicKey, false, Some ver, locale) - - let tcAssemblyDataOpt = + try + // TypeCheckClosedInputSetFinish fills in tcState.Ccu but in incremental scenarios we don't want this, + // so we make this temporary here + let oldContents = tcState.Ccu.Deref.Contents try - // Assemblies containing type provider components can not successfully be used via cross-assembly references. - // We return 'None' for the assembly portion of the cross-assembly reference - let hasTypeProviderAssemblyAttrib = - topAttrs.assemblyAttrs |> List.exists (fun (Attrib(tcref, _, _, _, _, _, _)) -> tcref.CompiledRepresentationForNamedType.BasicQualifiedName = typeof.FullName) - if tcState.CreatesGeneratedProvidedTypes || hasTypeProviderAssemblyAttrib then - None - else - Some (RawFSharpAssemblyDataBackedByLanguageService (tcConfig, tcGlobals, tcState, outfile, topAttrs, assemblyName, ilAssemRef) :> IRawFSharpAssemblyData) - - with e -> - errorRecoveryNoRange e - None - ilAssemRef, tcAssemblyDataOpt, Some tcAssemblyExpr - finally - tcState.Ccu.Deref.Contents <- oldContents - with e -> - errorRecoveryNoRange e - mkSimpleAssRef assemblyName, None, None + let tcState, tcAssemblyExpr = TypeCheckClosedInputSetFinish (mimpls, tcState) + + // Compute the identity of the generated assembly based on attributes, options etc. + // Some of this is duplicated from fsc.fs + let ilAssemRef = + let publicKey = + try + let signingInfo = Driver.ValidateKeySigningAttributes (tcConfig, tcGlobals, topAttrs) + match Driver.GetStrongNameSigner signingInfo with + | None -> None + | Some s -> Some (PublicKey.KeyAsToken(s.PublicKey)) + with e -> + errorRecoveryNoRange e + None + let locale = TryFindFSharpStringAttribute tcGlobals (tcGlobals.FindSysAttrib "System.Reflection.AssemblyCultureAttribute") topAttrs.assemblyAttrs + let assemVerFromAttrib = + TryFindFSharpStringAttribute tcGlobals (tcGlobals.FindSysAttrib "System.Reflection.AssemblyVersionAttribute") topAttrs.assemblyAttrs + |> Option.bind (fun v -> try Some (parseILVersion v) with _ -> None) + let ver = + match assemVerFromAttrib with + | None -> tcConfig.version.GetVersionInfo(tcConfig.implicitIncludeDir) + | Some v -> v + ILAssemblyRef.Create(assemblyName, None, publicKey, false, Some ver, locale) + + let tcAssemblyDataOpt = + try + // Assemblies containing type provider components can not successfully be used via cross-assembly references. + // We return 'None' for the assembly portion of the cross-assembly reference + let hasTypeProviderAssemblyAttrib = + topAttrs.assemblyAttrs |> List.exists (fun (Attrib(tcref, _, _, _, _, _, _)) -> tcref.CompiledRepresentationForNamedType.BasicQualifiedName = typeof.FullName) + if tcState.CreatesGeneratedProvidedTypes || hasTypeProviderAssemblyAttrib then + None + else + Some (RawFSharpAssemblyDataBackedByLanguageService (tcConfig, tcGlobals, tcState, outfile, topAttrs, assemblyName, ilAssemRef) :> IRawFSharpAssemblyData) + + with e -> + errorRecoveryNoRange e + None + ilAssemRef, tcAssemblyDataOpt, Some tcAssemblyExpr + finally + tcState.Ccu.Deref.Contents <- oldContents + with e -> + errorRecoveryNoRange e + mkSimpleAssemblyRef assemblyName, None, None let finalAccWithErrors = { finalAcc with @@ -1560,9 +1575,9 @@ type IncrementalBuilder(tcGlobals, frameworkTcImports, nonFrameworkAssemblyInput member this.IncrementUsageCount() = assertNotDisposed() System.Threading.Interlocked.Increment(&referenceCount) |> ignore - { new System.IDisposable with member x.Dispose() = this.DecrementUsageCount() } + { new System.IDisposable with member __.Dispose() = this.DecrementUsageCount() } - member this.DecrementUsageCount() = + member __.DecrementUsageCount() = assertNotDisposed() let currentValue = System.Threading.Interlocked.Decrement(&referenceCount) if currentValue = 0 then @@ -1572,11 +1587,17 @@ type IncrementalBuilder(tcGlobals, frameworkTcImports, nonFrameworkAssemblyInput member __.IsAlive = referenceCount > 0 member __.TcConfig = tcConfig + member __.FileParsed = fileParsed.Publish + member __.BeforeFileChecked = beforeFileChecked.Publish + member __.FileChecked = fileChecked.Publish + member __.ProjectChecked = projectChecked.Publish + member __.ImportedCcusInvalidated = importsInvalidated.Publish + member __.AllDependenciesDeprecated = allDependencies #if !NO_EXTENSIONTYPING @@ -1621,7 +1642,7 @@ type IncrementalBuilder(tcGlobals, frameworkTcImports, nonFrameworkAssemblyInput | (*first file*) 0 -> IncrementalBuild.IsReady cache (Target(initialTcAccNode, None)) partialBuild | _ -> IncrementalBuild.IsReady cache (Target(tcStatesNode, Some (slotOfFile-1))) partialBuild - member builder.GetCheckResultsBeforeSlotInProject (ctok: CompilationThreadToken, slotOfFile) = + member __.GetCheckResultsBeforeSlotInProject (ctok: CompilationThreadToken, slotOfFile) = cancellable { let cache = TimeStampCache(defaultTimeStamp) let! result = @@ -1651,9 +1672,6 @@ type IncrementalBuilder(tcGlobals, frameworkTcImports, nonFrameworkAssemblyInput member builder.GetCheckResultsAfterLastFileInProject (ctok: CompilationThreadToken) = builder.GetCheckResultsBeforeSlotInProject(ctok, builder.GetSlotsCount()) - member builder.DeduplicateParsedInputModuleNameInProject (input) = - DeduplicateParsedInputModuleName moduleNamesDict input - member __.GetCheckResultsAndImplementationsForProject(ctok: CompilationThreadToken) = cancellable { let cache = TimeStampCache(defaultTimeStamp) @@ -1860,10 +1878,11 @@ type IncrementalBuilder(tcGlobals, frameworkTcImports, nonFrameworkAssemblyInput return builderOpt, diagnostics } + static member KeepBuilderAlive (builderOpt: IncrementalBuilder option) = match builderOpt with | Some builder -> builder.IncrementUsageCount() | None -> { new System.IDisposable with member __.Dispose() = () } - member builder.IsBeingKeptAliveApartFromCacheEntry = (referenceCount >= 2) + member __.IsBeingKeptAliveApartFromCacheEntry = (referenceCount >= 2) diff --git a/src/fsharp/service/IncrementalBuild.fsi b/src/fsharp/service/IncrementalBuild.fsi index b6b64a7ffd0..29c7a03a454 100755 --- a/src/fsharp/service/IncrementalBuild.fsi +++ b/src/fsharp/service/IncrementalBuild.fsi @@ -55,6 +55,9 @@ type internal PartialCheckResults = /// Represents open declarations TcOpenDeclarationsRev: OpenDeclaration[] list + /// Disambiguation table for module names + ModuleNamesDict: ModuleNamesDict + TcDependencyFiles: string list /// Represents the collected attributes to apply to the module of assuembly generates @@ -151,8 +154,6 @@ type internal IncrementalBuilder = // TODO: make this an Eventually (which can be scheduled) or an Async (which can be cancelled) member GetCheckResultsAndImplementationsForProject : CompilationThreadToken -> Cancellable - member DeduplicateParsedInputModuleNameInProject: Ast.ParsedInput -> Ast.ParsedInput - /// Get the logical time stamp that is associated with the output of the project if it were gully built immediately member GetLogicalTimeStampForProject: TimeStampCache * CompilationThreadToken -> DateTime diff --git a/src/fsharp/service/ServiceAssemblyContent.fs b/src/fsharp/service/ServiceAssemblyContent.fs index 673fe03e060..663ed82a941 100644 --- a/src/fsharp/service/ServiceAssemblyContent.fs +++ b/src/fsharp/service/ServiceAssemblyContent.fs @@ -555,7 +555,7 @@ module ParsedInput = | SynTypeConstraint.WhereTyparSupportsMember (ts, sign, _) -> List.iter walkType ts; walkMemberSig sign and walkPat = function - | SynPat.Tuple (pats, _) + | SynPat.Tuple (_,pats, _) | SynPat.ArrayOrList (_, pats, _) | SynPat.Ands (pats, _) -> List.iter walkPat pats | SynPat.Named (pat, ident, _, _, _) -> @@ -603,7 +603,7 @@ module ParsedInput = | SynType.LongIdent ident -> addLongIdentWithDots ident | SynType.App (ty, _, types, _, _, _, _) -> walkType ty; List.iter walkType types | SynType.LongIdentApp (_, _, _, types, _, _, _) -> List.iter walkType types - | SynType.Tuple (ts, _) -> ts |> List.iter (fun (_, t) -> walkType t) + | SynType.Tuple (_, ts, _) -> ts |> List.iter (fun (_, t) -> walkType t) | SynType.WithGlobalConstraints (t, typeConstraints, _) -> walkType t; List.iter walkTypeConstraint typeConstraints | _ -> () @@ -641,7 +641,7 @@ module ParsedInput = | SynExpr.TypeTest (e, t, _) | SynExpr.Upcast (e, t, _) | SynExpr.Downcast (e, t, _) -> walkExpr e; walkType t - | SynExpr.Tuple (es, _, _) + | SynExpr.Tuple (_, es, _, _) | Sequentials es | SynExpr.ArrayOrList (_, es, _) -> List.iter walkExpr es | SynExpr.App (_, _, e1, e2, _) @@ -914,8 +914,9 @@ module ParsedInput = let rec walkImplFileInput (ParsedImplFileInput(modules = moduleOrNamespaceList)) = List.iter (walkSynModuleOrNamespace []) moduleOrNamespaceList - and walkSynModuleOrNamespace (parent: LongIdent) (SynModuleOrNamespace(ident, _, isModule, decls, _, _, _, range)) = + and walkSynModuleOrNamespace (parent: LongIdent) (SynModuleOrNamespace(ident, _, kind, decls, _, _, _, range)) = if range.EndLine >= currentLine then + let isModule = kind.IsModule match isModule, parent, ident with | false, _, _ -> ns := Some (longIdentToIdents ident) // top level module with "inlined" namespace like Ns1.Ns2.TopModule @@ -1035,4 +1036,4 @@ module ParsedInput = | _ -> // we failed to find insertion point because ast is empty for some reason, return top left point in this case { ScopeKind = ScopeKind.TopModule - Pos = mkPos 1 0 } \ No newline at end of file + Pos = mkPos 1 0 } diff --git a/src/fsharp/service/ServiceDeclarationLists.fs b/src/fsharp/service/ServiceDeclarationLists.fs index 85d7249f61c..22b851a5b88 100644 --- a/src/fsharp/service/ServiceDeclarationLists.fs +++ b/src/fsharp/service/ServiceDeclarationLists.fs @@ -28,7 +28,7 @@ open Microsoft.FSharp.Compiler.InfoReader module EnvMisc3 = /// dataTipSpinWaitTime limits how long we block the UI thread while a tooltip pops up next to a selected item in an IntelliSense completion list. /// This time appears to be somewhat amortized by the time it takes the VS completion UI to actually bring up the tooltip after selecting an item in the first place. - let dataTipSpinWaitTime = GetEnvInteger "FCS_ToolTipSpinWaitTime" 300 + let dataTipSpinWaitTime = GetEnvInteger "FCS_ToolTipSpinWaitTime" 5000 [] @@ -109,7 +109,7 @@ module internal DescriptionListsImpl = | Some id, true, ptyOpt -> let nm = id.idText // detect parameter type, if ptyOpt is None - this is .NET style optional argument - let pty = defaultArg ptyOpt pty + let pty = match ptyOpt with ValueSome x -> x | _ -> pty (nm, isOptArg, SepL.questionMark ^^ (wordL (TaggedTextOps.tagParameter nm))), pty // Layout an unnamed argument | None, _,_ -> @@ -204,13 +204,13 @@ module internal DescriptionListsImpl = let getPrettyParamsOfTypes() = let tau = vref.TauType match tryDestFunTy denv.g tau with - | Some(arg,rtau) -> + | ValueSome(arg,rtau) -> let args = tryDestRefTupleTy denv.g arg let _prettyTyparInst, prettyParams, prettyRetTyL, _prettyConstraintsL = PrettyParamsOfTypes g denv item.TyparInst args rtau // FUTURE: prettyTyparInst is the pretty version of the known instantiations of type parameters in the output. It could be returned // for display as part of the method group prettyParams, prettyRetTyL - | None -> + | _ -> let _prettyTyparInst, prettyTyL = NicePrint.prettyLayoutOfUncurriedSig denv item.TyparInst [] tau [], prettyTyL @@ -241,8 +241,8 @@ module internal DescriptionListsImpl = // Adjust the return type so it only strips the first argument let curriedRetTy = match tryDestFunTy denv.g vref.TauType with - | Some(_,rtau) -> rtau - | None -> lastRetTy + | ValueSome(_,rtau) -> rtau + | _ -> lastRetTy let _prettyTyparInst, prettyFirstCurriedParams, prettyCurriedRetTyL, prettyConstraintsL = PrettyParamsOfParamDatas g denv item.TyparInst firstCurriedParamDatas curriedRetTy @@ -283,6 +283,10 @@ module internal DescriptionListsImpl = let _prettyTyparInst, prettyRetTyL = NicePrint.prettyLayoutOfUncurriedSig denv item.TyparInst [] rfinfo.FieldType [], prettyRetTyL + | Item.AnonRecdField(_anonInfo,tys,i, _) -> + let _prettyTyparInst, prettyRetTyL = NicePrint.prettyLayoutOfUncurriedSig denv item.TyparInst [] tys.[i] + [], prettyRetTyL + | Item.ILField finfo -> let _prettyTyparInst, prettyRetTyL = NicePrint.prettyLayoutOfUncurriedSig denv item.TyparInst [] (finfo.FieldType(amap,m)) [], prettyRetTyL @@ -381,14 +385,14 @@ module internal DescriptionListsImpl = /// Find the glyph for the given type representation. let typeToGlyph ty = - if isAppTy denv.g ty then - let tcref = tcrefOfAppTy denv.g ty - tcref.TypeReprInfo |> reprToGlyph - elif isStructTupleTy denv.g ty then FSharpGlyph.Struct - elif isRefTupleTy denv.g ty then FSharpGlyph.Class - elif isFunction denv.g ty then FSharpGlyph.Delegate - elif isTyparTy denv.g ty then FSharpGlyph.Struct - else FSharpGlyph.Typedef + match tryDestAppTy denv.g ty with + | ValueSome tcref -> tcref.TypeReprInfo |> reprToGlyph + | _ -> + if isStructTupleTy denv.g ty then FSharpGlyph.Struct + elif isRefTupleTy denv.g ty then FSharpGlyph.Class + elif isFunction denv.g ty then FSharpGlyph.Delegate + elif isTyparTy denv.g ty then FSharpGlyph.Struct + else FSharpGlyph.Typedef // This may explore assemblies that are not in the reference set, // e.g. for type abbreviations to types not in the reference set. @@ -403,6 +407,7 @@ module internal DescriptionListsImpl = | Item.UnionCase _ | Item.ActivePatternCase _ -> FSharpGlyph.EnumMember | Item.ExnCase _ -> FSharpGlyph.Exception + | Item.AnonRecdField _ -> FSharpGlyph.Field | Item.RecdField _ -> FSharpGlyph.Field | Item.ILField _ -> FSharpGlyph.Field | Item.Event _ -> FSharpGlyph.Event diff --git a/src/fsharp/service/ServiceInterfaceStubGenerator.fs b/src/fsharp/service/ServiceInterfaceStubGenerator.fs index dccb9a91db9..90a8ae4d7b3 100644 --- a/src/fsharp/service/ServiceInterfaceStubGenerator.fs +++ b/src/fsharp/service/ServiceInterfaceStubGenerator.fs @@ -151,8 +151,8 @@ type internal InterfaceData = None | SynType.Anon _ -> Some "_" - | SynType.Tuple(ts, _) -> - Some (ts |> Seq.choose (snd >> (|TypeIdent|_|)) |> String.concat " * ") + | SynType.AnonRecd (_, ts, _) -> + Some (ts |> Seq.choose (snd >> (|TypeIdent|_|)) |> String.concat "; ") | SynType.Array(dimension, TypeIdent typeName, _) -> Some (sprintf "%s [%s]" typeName (new String(',', dimension-1))) | SynType.MeasurePower(TypeIdent typeName, RationalConst power, _) -> @@ -761,7 +761,7 @@ module internal InterfaceStubGenerator = | SynExpr.Typed(synExpr, _synType, _range) -> walkExpr synExpr - | SynExpr.Tuple(synExprList, _, _range) + | SynExpr.Tuple(_, synExprList, _, _range) | SynExpr.ArrayOrList(_, synExprList, _range) -> List.tryPick walkExpr synExprList diff --git a/src/fsharp/service/ServiceLexing.fs b/src/fsharp/service/ServiceLexing.fs index abf3cde1c70..5eda7cb31dc 100755 --- a/src/fsharp/service/ServiceLexing.fs +++ b/src/fsharp/service/ServiceLexing.fs @@ -242,16 +242,16 @@ module internal TokenClassifications = | RPAREN | RPAREN_COMING_SOON | RPAREN_IS_HERE -> (FSharpTokenColorKind.Punctuation,FSharpTokenCharKind.Delimiter, FSharpTokenTriggerClass.ParamEnd ||| FSharpTokenTriggerClass.MatchBraces) - | LBRACK_LESS | LBRACE_LESS + | LBRACK_LESS -> (FSharpTokenColorKind.Punctuation,FSharpTokenCharKind.Delimiter,FSharpTokenTriggerClass.None ) - | LQUOTE _ | LBRACK | LBRACE | LBRACK_BAR + | LQUOTE _ | LBRACK | LBRACE | LBRACK_BAR | LBRACE_BAR -> (FSharpTokenColorKind.Punctuation,FSharpTokenCharKind.Delimiter,FSharpTokenTriggerClass.MatchBraces ) - | GREATER_RBRACE | GREATER_RBRACK | GREATER_BAR_RBRACK + | GREATER_RBRACK | GREATER_BAR_RBRACK -> (FSharpTokenColorKind.Punctuation,FSharpTokenCharKind.Delimiter,FSharpTokenTriggerClass.None ) - | RQUOTE _ | RBRACK | RBRACE | RBRACE_COMING_SOON | RBRACE_IS_HERE | BAR_RBRACK + | RQUOTE _ | RBRACK | RBRACE | RBRACE_COMING_SOON | RBRACE_IS_HERE | BAR_RBRACK | BAR_RBRACE -> (FSharpTokenColorKind.Punctuation,FSharpTokenCharKind.Delimiter,FSharpTokenTriggerClass.MatchBraces ) | PUBLIC | PRIVATE | INTERNAL | BASE | GLOBAL @@ -307,7 +307,14 @@ module internal TestExpose = //---------------------------------------------------------------------------- // Lexer states encoded to/from integers //-------------------------------------------------------------------------- -type FSharpTokenizerLexState = int64 +[] +type FSharpTokenizerLexState = + { PosBits: int64 + OtherBits: int64 } + static member Initial = { PosBits = 0L; OtherBits = 0L } + member this.Equals (other: FSharpTokenizerLexState) = (this.PosBits = other.PosBits) && (this.OtherBits = other.OtherBits) + override this.Equals (obj: obj) = match obj with :? FSharpTokenizerLexState as other -> this.Equals(other) | _ -> false + override this.GetHashCode () = hash this.PosBits + hash this.OtherBits type FSharpTokenizerColorState = | Token = 1 @@ -323,7 +330,6 @@ type FSharpTokenizerColorState = | EndLineThenToken = 12 | TripleQuoteString = 13 | TripleQuoteStringInComment = 14 - | InitialState = 0 @@ -348,31 +354,25 @@ module internal LexerStateEncoding = // Note that this will discard all lexcont state, including the ifdefStack. let revertToDefaultLexCont = LexCont.Token [] - let resize32 (i:int32) : FSharpTokenizerLexState = int64 i - let lexstateNumBits = 4 - let ncommentsNumBits = 2 - let startPosNumBits = pos.EncodingSize + let ncommentsNumBits = 4 let hardwhiteNumBits = 1 - let ifdefstackCountNumBits = 4 - let ifdefstackNumBits = 16 // 0 means if, 1 means else + let ifdefstackCountNumBits = 8 + let ifdefstackNumBits = 24 // 0 means if, 1 means else let _ = assert (lexstateNumBits + ncommentsNumBits - + startPosNumBits + hardwhiteNumBits + ifdefstackCountNumBits + ifdefstackNumBits <= 64) let lexstateStart = 0 let ncommentsStart = lexstateNumBits - let startPosStart = lexstateNumBits+ncommentsNumBits - let hardwhitePosStart = lexstateNumBits+ncommentsNumBits+startPosNumBits - let ifdefstackCountStart = lexstateNumBits+ncommentsNumBits+startPosNumBits+hardwhiteNumBits - let ifdefstackStart = lexstateNumBits+ncommentsNumBits+startPosNumBits+hardwhiteNumBits+ifdefstackCountNumBits + let hardwhitePosStart = lexstateNumBits+ncommentsNumBits + let ifdefstackCountStart = lexstateNumBits+ncommentsNumBits+hardwhiteNumBits + let ifdefstackStart = lexstateNumBits+ncommentsNumBits+hardwhiteNumBits+ifdefstackCountNumBits let lexstateMask = Bits.mask64 lexstateStart lexstateNumBits let ncommentsMask = Bits.mask64 ncommentsStart ncommentsNumBits - let startPosMask = Bits.mask64 startPosStart startPosNumBits let hardwhitePosMask = Bits.mask64 hardwhitePosStart hardwhiteNumBits let ifdefstackCountMask = Bits.mask64 ifdefstackCountStart ifdefstackCountNumBits let ifdefstackMask = Bits.mask64 ifdefstackStart ifdefstackNumBits @@ -381,7 +381,7 @@ module internal LexerStateEncoding = let boolOfBit n = (n = 1L) let inline colorStateOfLexState (state: FSharpTokenizerLexState) = - enum (int32 ((state &&& lexstateMask) >>> lexstateStart)) + enum (int32 ((state.OtherBits &&& lexstateMask) >>> lexstateStart)) let inline lexStateOfColorState (state: FSharpTokenizerColorState) = (int64 state <<< lexstateStart) &&& lexstateMask @@ -396,42 +396,46 @@ module internal LexerStateEncoding = ifdefStackBits <- (ifdefStackBits ||| (1 <<< ifdefStackCount)) ifdefStackCount <- ifdefStackCount + 1 - lexStateOfColorState colorState - ||| ((ncomments <<< ncommentsStart) &&& ncommentsMask) - ||| ((resize32 b.Encoding <<< startPosStart) &&& startPosMask) - ||| ((resize32 (bitOfBool light) <<< hardwhitePosStart) &&& hardwhitePosMask) - ||| ((resize32 ifdefStackCount <<< ifdefstackCountStart) &&& ifdefstackCountMask) - ||| ((resize32 ifdefStackBits <<< ifdefstackStart) &&& ifdefstackMask) + let bits = + lexStateOfColorState colorState + ||| ((ncomments <<< ncommentsStart) &&& ncommentsMask) + ||| ((int64 (bitOfBool light) <<< hardwhitePosStart) &&& hardwhitePosMask) + ||| ((int64 ifdefStackCount <<< ifdefstackCountStart) &&& ifdefstackCountMask) + ||| ((int64 ifdefStackBits <<< ifdefstackStart) &&& ifdefstackMask) + { PosBits = b.Encoding + OtherBits = bits } + let decodeLexCont (state:FSharpTokenizerLexState) = let mutable ifDefs = [] - let ifdefStackCount = (int32) ((state &&& ifdefstackCountMask) >>> ifdefstackCountStart) + let bits = state.OtherBits + let ifdefStackCount = (int32) ((bits &&& ifdefstackCountMask) >>> ifdefstackCountStart) if ifdefStackCount>0 then - let ifdefStack = (int32) ((state &&& ifdefstackMask) >>> ifdefstackStart) + let ifdefStack = (int32) ((bits &&& ifdefstackMask) >>> ifdefstackStart) for i in 1..ifdefStackCount do let bit = ifdefStackCount-i let mask = 1 <<< bit let ifDef = (if ifdefStack &&& mask = 0 then IfDefIf else IfDefElse) ifDefs<-(ifDef,range0)::ifDefs colorStateOfLexState state, - (int32) ((state &&& ncommentsMask) >>> ncommentsStart), - pos.Decode (int32 ((state &&& startPosMask) >>> startPosStart)), + int32 ((bits &&& ncommentsMask) >>> ncommentsStart), + pos.Decode state.PosBits, ifDefs, - boolOfBit ((state &&& hardwhitePosMask) >>> hardwhitePosStart) + boolOfBit ((bits &&& hardwhitePosMask) >>> hardwhitePosStart) let encodeLexInt lightSyntaxStatus (lexcont:LexerWhitespaceContinuation) = let tag,n1,p1,ifd = match lexcont with | LexCont.Token ifd -> FSharpTokenizerColorState.Token, 0L, pos0, ifd - | LexCont.IfDefSkip (ifd,n,m) -> FSharpTokenizerColorState.IfDefSkip, resize32 n, m.Start, ifd - | LexCont.EndLine(LexerEndlineContinuation.Skip(ifd,n,m)) -> FSharpTokenizerColorState.EndLineThenSkip, resize32 n, m.Start, ifd + | LexCont.IfDefSkip (ifd,n,m) -> FSharpTokenizerColorState.IfDefSkip, int64 n, m.Start, ifd + | LexCont.EndLine(LexerEndlineContinuation.Skip(ifd,n,m)) -> FSharpTokenizerColorState.EndLineThenSkip, int64 n, m.Start, ifd | LexCont.EndLine(LexerEndlineContinuation.Token(ifd)) -> FSharpTokenizerColorState.EndLineThenToken, 0L, pos0, ifd | LexCont.String (ifd,m) -> FSharpTokenizerColorState.String, 0L, m.Start, ifd - | LexCont.Comment (ifd,n,m) -> FSharpTokenizerColorState.Comment, resize32 n, m.Start, ifd - | LexCont.SingleLineComment (ifd,n,m) -> FSharpTokenizerColorState.SingleLineComment, resize32 n, m.Start, ifd - | LexCont.StringInComment (ifd,n,m) -> FSharpTokenizerColorState.StringInComment, resize32 n, m.Start, ifd - | LexCont.VerbatimStringInComment (ifd,n,m) -> FSharpTokenizerColorState.VerbatimStringInComment, resize32 n, m.Start, ifd - | LexCont.TripleQuoteStringInComment (ifd,n,m) -> FSharpTokenizerColorState.TripleQuoteStringInComment,resize32 n, m.Start, ifd + | LexCont.Comment (ifd,n,m) -> FSharpTokenizerColorState.Comment, int64 n, m.Start, ifd + | LexCont.SingleLineComment (ifd,n,m) -> FSharpTokenizerColorState.SingleLineComment, int64 n, m.Start, ifd + | LexCont.StringInComment (ifd,n,m) -> FSharpTokenizerColorState.StringInComment, int64 n, m.Start, ifd + | LexCont.VerbatimStringInComment (ifd,n,m) -> FSharpTokenizerColorState.VerbatimStringInComment, int64 n, m.Start, ifd + | LexCont.TripleQuoteStringInComment (ifd,n,m) -> FSharpTokenizerColorState.TripleQuoteStringInComment,int64 n, m.Start, ifd | LexCont.MLOnly (ifd,m) -> FSharpTokenizerColorState.CamlOnly, 0L, m.Start, ifd | LexCont.VerbatimString (ifd,m) -> FSharpTokenizerColorState.VerbatimString, 0L, m.Start, ifd | LexCont.TripleQuoteString (ifd,m) -> FSharpTokenizerColorState.TripleQuoteString, 0L, m.Start, ifd @@ -576,7 +580,7 @@ type FSharpLineTokenizer(lexbuf: UnicodeLexing.Lexbuf, | None -> lexbuf.EndPos <- Internal.Utilities.Text.Lexing.Position.Empty | Some(value) -> resetLexbufPos value lexbuf - member x.ScanToken(lexintInitial) : Option * FSharpTokenizerLexState = + member x.ScanToken(lexintInitial) : FSharpTokenInfo option * FSharpTokenizerLexState = use unwindBP = PushThreadBuildPhaseUntilUnwind BuildPhase.Parse use unwindEL = PushErrorLoggerPhaseUntilUnwind (fun _ -> DiscardErrorsLogger) @@ -749,10 +753,10 @@ type FSharpLineTokenizer(lexbuf: UnicodeLexing.Lexbuf, LexerStateEncoding.colorStateOfLexState lexState static member LexStateOfColorState(colorState: FSharpTokenizerColorState) = - LexerStateEncoding.lexStateOfColorState colorState + { PosBits = 0L; OtherBits = LexerStateEncoding.lexStateOfColorState colorState } [] -type FSharpSourceTokenizer(defineConstants : string list, filename : Option) = +type FSharpSourceTokenizer(defineConstants : string list, filename : string option) = let lexResourceManager = new Lexhelp.LexResourceManager() let lexArgsLightOn = mkLexargs(filename,defineConstants,LightSyntaxStatus(true,false),lexResourceManager, ref [],DiscardErrorsLogger) diff --git a/src/fsharp/service/ServiceLexing.fsi b/src/fsharp/service/ServiceLexing.fsi index 1501f45415b..d354e452e1c 100755 --- a/src/fsharp/service/ServiceLexing.fsi +++ b/src/fsharp/service/ServiceLexing.fsi @@ -8,7 +8,12 @@ type Position = int * int type Range = Position * Position /// Represents encoded information for the end-of-line continuation of lexing -type FSharpTokenizerLexState = int64 +[] +type FSharpTokenizerLexState = + { PosBits: int64 + OtherBits: int64 } + static member Initial : FSharpTokenizerLexState + member Equals : FSharpTokenizerLexState -> bool /// Represents stable information for the state of the laxing engine at the end of a line type FSharpTokenizerColorState = @@ -27,7 +32,6 @@ type FSharpTokenizerColorState = | TripleQuoteStringInComment = 14 | InitialState = 0 - /// Gives an indicattion of the color class to assign to the token an IDE type FSharpTokenColorKind = | Default = 0 @@ -193,21 +197,28 @@ module FSharpTokenTag = type FSharpTokenInfo = { /// Left column of the token. LeftColumn:int + /// Right column of the token. RightColumn:int + ColorClass:FSharpTokenColorKind + /// Gives an indication of the class to assign to the token an IDE CharClass:FSharpTokenCharKind + /// Actions taken when the token is typed FSharpTokenTriggerClass:FSharpTokenTriggerClass + /// The tag is an integer identifier for the token Tag:int + /// Provides additional information about the token TokenName:string; + /// The full length consumed by this match, including delayed tokens (which can be ignored in naive lexers) FullMatchedLength: int } -/// Object to tokenize a line of F# source code, starting with the given lexState. The lexState should be 0 for +/// Object to tokenize a line of F# source code, starting with the given lexState. The lexState should be FSharpTokenizerLexState.Initial for /// the first line of text. Returns an array of ranges of the text and two enumerations categorizing the /// tokens and characters covered by that range, i.e. FSharpTokenColorKind and FSharpTokenCharKind. The enumerations /// are somewhat adhoc but useful enough to give good colorization options to the user in an IDE. @@ -221,7 +232,6 @@ type FSharpLineTokenizer = static member ColorStateOfLexState : FSharpTokenizerLexState -> FSharpTokenizerColorState static member LexStateOfColorState : FSharpTokenizerColorState -> FSharpTokenizerLexState - /// Tokenizer for a source file. Holds some expensive-to-compute resources at the scope of the file. [] type FSharpSourceTokenizer = @@ -229,7 +239,6 @@ type FSharpSourceTokenizer = member CreateLineTokenizer : lineText:string -> FSharpLineTokenizer member CreateBufferTokenizer : bufferFiller:(char[] * int * int -> int) -> FSharpLineTokenizer - module internal TestExpose = val TokenInfo : Parser.token -> (FSharpTokenColorKind * FSharpTokenCharKind * FSharpTokenTriggerClass) diff --git a/src/fsharp/service/ServiceNavigation.fs b/src/fsharp/service/ServiceNavigation.fs index 24d83f532bd..e0e1feb1b32 100755 --- a/src/fsharp/service/ServiceNavigation.fs +++ b/src/fsharp/service/ServiceNavigation.fs @@ -270,7 +270,7 @@ module NavigationImpl = let items = // Show base name for this module only if it's not the root one let singleTopLevel = (modules.Length = 1) - modules |> List.collect (fun (SynModuleOrNamespace(id, _isRec, isModule, decls, _, _, access, m)) -> + modules |> List.collect (fun (SynModuleOrNamespace(id, _isRec, kind, decls, _, _, access, m)) -> let baseName = if (not singleTopLevel) then textOfLid id else "" // Find let bindings (for the right dropdown) let nested = processNestedDeclarations(decls) @@ -283,7 +283,7 @@ module NavigationImpl = | _ -> let decl = FSharpNavigationDeclarationItem.Create - (textOfLid id, (if isModule then ModuleFileDecl else NamespaceDecl), + (textOfLid id, (if kind.IsModule then ModuleFileDecl else NamespaceDecl), FSharpGlyph.Module, m, unionRangesChecked (rangeOfDecls nested) (moduleRange (rangeOfLid id) other), singleTopLevel, FSharpEnclosingEntityKind.Module, false, access), (addItemName(textOfLid id)), nested @@ -410,7 +410,7 @@ module NavigationImpl = let items = // Show base name for this module only if it's not the root one let singleTopLevel = (modules.Length = 1) - modules |> List.collect (fun (SynModuleOrNamespaceSig(id, _isRec, isModule, decls, _, _, access, m)) -> + modules |> List.collect (fun (SynModuleOrNamespaceSig(id, _isRec, kind, decls, _, _, access, m)) -> let baseName = if (not singleTopLevel) then textOfLid id else "" // Find let bindings (for the right dropdown) let nested = processNestedSigDeclarations(decls) @@ -420,7 +420,7 @@ module NavigationImpl = // Create explicitly - it can be 'single top level' thing that is hidden let decl = FSharpNavigationDeclarationItem.Create - (textOfLid id, (if isModule then ModuleFileDecl else NamespaceDecl), + (textOfLid id, (if kind.IsModule then ModuleFileDecl else NamespaceDecl), FSharpGlyph.Module, m, unionRangesChecked (rangeOfDecls nested) (moduleRange (rangeOfLid id) other), singleTopLevel, FSharpEnclosingEntityKind.Module, false, access), (addItemName(textOfLid id)), nested @@ -574,7 +574,8 @@ module NavigateTo = for item in moduleOrNamespaceList do walkSynModuleOrNamespaceSig item { Type = ContainerType.File; Name = fileName } - and walkSynModuleOrNamespaceSig (SynModuleOrNamespaceSig(lid, _, isModule, decls, _, _, _, _)) container = + and walkSynModuleOrNamespaceSig (SynModuleOrNamespaceSig(lid, _, kind, decls, _, _, _, _)) container = + let isModule = kind.IsModule if isModule then addModule lid true container let container = @@ -631,7 +632,8 @@ module NavigateTo = for item in moduleOrNamespaceList do walkSynModuleOrNamespace item container - and walkSynModuleOrNamespace(SynModuleOrNamespace(lid, _, isModule, decls, _, _, _, _)) container = + and walkSynModuleOrNamespace(SynModuleOrNamespace(lid, _, kind, decls, _, _, _, _)) container = + let isModule = kind.IsModule if isModule then addModule lid false container let container = diff --git a/src/fsharp/service/ServiceParamInfoLocations.fs b/src/fsharp/service/ServiceParamInfoLocations.fs index 23681498fb7..e0e9affd2d5 100755 --- a/src/fsharp/service/ServiceParamInfoLocations.fs +++ b/src/fsharp/service/ServiceParamInfoLocations.fs @@ -96,7 +96,7 @@ module internal NoteworthyParamInfoLocationsImpl = // see bug 345385. let rec searchSynArgExpr traverseSynExpr pos expr = match expr with - | SynExprParen((SynExpr.Tuple(synExprList, commaRanges, _tupleRange) as synExpr), _lpRange, rpRangeOpt, parenRange) -> // tuple argument + | SynExprParen((SynExpr.Tuple(false, synExprList, commaRanges, _tupleRange) as synExpr), _lpRange, rpRangeOpt, parenRange) -> // tuple argument let inner = traverseSynExpr synExpr match inner with | None -> @@ -108,7 +108,7 @@ module internal NoteworthyParamInfoLocationsImpl = NotFound, None | _ -> NotFound, None - | SynExprParen(SynExprParen(SynExpr.Tuple(_, _, _), _, _, _) as synExpr, _, rpRangeOpt, parenRange) -> // f((x, y)) is special, single tuple arg + | SynExprParen(SynExprParen(SynExpr.Tuple(false, _, _, _), _, _, _) as synExpr, _, rpRangeOpt, parenRange) -> // f((x, y)) is special, single tuple arg handleSingleArg traverseSynExpr (pos, synExpr, parenRange, rpRangeOpt) // dig into multiple parens diff --git a/src/fsharp/service/ServiceParseTreeWalk.fs b/src/fsharp/service/ServiceParseTreeWalk.fs index fbd173b1bd2..14e08c9b2de 100755 --- a/src/fsharp/service/ServiceParseTreeWalk.fs +++ b/src/fsharp/service/ServiceParseTreeWalk.fs @@ -49,48 +49,63 @@ module public AstTraversal = /// traverseSynExpr(subExpr) to recurse deeper on some particular sub-expression based on your own logic /// path helps to track AST nodes that were passed during traversal abstract VisitExpr : TraversePath * (SynExpr -> 'T option) * (SynExpr -> 'T option) * SynExpr -> 'T option + /// VisitTypeAbbrev(ty,m), defaults to ignoring this leaf of the AST abstract VisitTypeAbbrev : SynType * range -> 'T option default this.VisitTypeAbbrev(_ty,_m) = None + /// VisitImplicitInherit(defaultTraverse,ty,expr,m), defaults to just visiting expr abstract VisitImplicitInherit : (SynExpr -> 'T option) * SynType * SynExpr * range -> 'T option default this.VisitImplicitInherit(defaultTraverse, _ty, expr, _m) = defaultTraverse expr + /// VisitModuleDecl allows overriding module declaration behavior abstract VisitModuleDecl : (SynModuleDecl -> 'T option) * SynModuleDecl -> 'T option default this.VisitModuleDecl(defaultTraverse, decl) = defaultTraverse decl + /// VisitBinding allows overriding binding behavior (note: by default it would defaultTraverse expression) abstract VisitBinding : (SynBinding -> 'T option) * SynBinding -> 'T option default this.VisitBinding(defaultTraverse, binding) = defaultTraverse binding + /// VisitMatchClause allows overriding clause behavior (note: by default it would defaultTraverse expression) abstract VisitMatchClause : (SynMatchClause -> 'T option) * SynMatchClause -> 'T option default this.VisitMatchClause(defaultTraverse, mc) = defaultTraverse mc + /// VisitInheritSynMemberDefn allows overriding inherit behavior (by default do nothing) abstract VisitInheritSynMemberDefn : SynComponentInfo * SynTypeDefnKind * SynType * SynMemberDefns * range -> 'T option default this.VisitInheritSynMemberDefn(_componentInfo, _typeDefnKind, _synType, _members, _range) = None + /// VisitInterfaceSynMemberDefnType allows overriding behavior for visiting interface member in types (by default - do nothing) abstract VisitInterfaceSynMemberDefnType : SynType -> 'T option default this.VisitInterfaceSynMemberDefnType(_synType) = None + /// VisitRecordField allows overriding behavior when visiting l.h.s. of constructed record instances abstract VisitRecordField : TraversePath * SynExpr option * LongIdentWithDots option -> 'T option default this.VisitRecordField (_path, _copyOpt, _recordField) = None + /// VisitHashDirective allows overriding behavior when visiting hash directives in FSX scripts, like #r, #load and #I. abstract VisitHashDirective : range -> 'T option default this.VisitHashDirective (_) = None + /// VisitModuleOrNamespace allows overriding behavior when visiting module or namespaces abstract VisitModuleOrNamespace : SynModuleOrNamespace -> 'T option default this.VisitModuleOrNamespace (_) = None + /// VisitComponentInfo allows overriding behavior when visiting type component infos abstract VisitComponentInfo : SynComponentInfo -> 'T option default this.VisitComponentInfo (_) = None + /// VisitLetOrUse allows overriding behavior when visiting module or local let or use bindings abstract VisitLetOrUse : TraversePath * (SynBinding -> 'T option) * SynBinding list * range -> 'T option default this.VisitLetOrUse (_, _, _, _) = None + /// VisitType allows overriding behavior when visiting simple pats abstract VisitSimplePats : SynSimplePat list -> 'T option default this.VisitSimplePats (_) = None + /// VisitPat allows overriding behavior when visiting patterns abstract VisitPat : (SynPat -> 'T option) * SynPat -> 'T option default this.VisitPat (defaultTraverse, pat) = defaultTraverse pat + /// VisitType allows overriding behavior when visiting type hints (x: ..., etc.) abstract VisitType : (SynType -> 'T option) * SynType -> 'T option default this.VisitType (defaultTraverse, ty) = defaultTraverse ty @@ -191,9 +206,25 @@ module public AstTraversal = |> pick expr | SynExpr.Const(_synConst, _range) -> None | SynExpr.Typed(synExpr, synType, _range) -> [ traverseSynExpr synExpr; traverseSynType synType ] |> List.tryPick id - | SynExpr.Tuple(synExprList, _, _range) - | SynExpr.StructTuple(synExprList, _, _range) -> synExprList |> List.map (fun x -> dive x x.Range traverseSynExpr) |> pick expr + | SynExpr.Tuple(_, synExprList, _, _range) | SynExpr.ArrayOrList(_, synExprList, _range) -> synExprList |> List.map (fun x -> dive x x.Range traverseSynExpr) |> pick expr + + | SynExpr.AnonRecd(_isStruct, copyOpt, synExprList, _range) -> + [ match copyOpt with + | Some(expr, (withRange, _)) -> + yield dive expr expr.Range traverseSynExpr + yield dive () withRange (fun () -> + if posGeq pos withRange.End then + // special case: caret is after WITH + // { x with $ } + visitor.VisitRecordField (path, Some expr, None) + else + None + ) + | _ -> () + for (_,x) in synExprList do + yield dive x x.Range traverseSynExpr + ] |> pick expr | SynExpr.Record(inheritOpt,copyOpt,fields, _range) -> [ let diveIntoSeparator offsideColumn scPosOpt copyOpt = @@ -425,9 +456,12 @@ module public AstTraversal = dive synExpr2 synExpr2.Range traverseSynExpr dive synExpr3 synExpr3.Range traverseSynExpr] |> pick expr - | SynExpr.TypeTest(synExpr, _synType, _range) -> traverseSynExpr synExpr - | SynExpr.Upcast(synExpr, _synType, _range) -> traverseSynExpr synExpr - | SynExpr.Downcast(synExpr, _synType, _range) -> traverseSynExpr synExpr + | SynExpr.TypeTest(synExpr, synType, _range) + | SynExpr.Upcast(synExpr, synType, _range) + | SynExpr.Downcast(synExpr, synType, _range) -> + [dive synExpr synExpr.Range traverseSynExpr + dive synType synType.Range traverseSynType] + |> pick expr | SynExpr.InferredUpcast(synExpr, _range) -> traverseSynExpr synExpr | SynExpr.InferredDowncast(synExpr, _range) -> traverseSynExpr synExpr | SynExpr.Null(_range) -> None @@ -462,8 +496,7 @@ module public AstTraversal = | SynPat.Paren (p, _) -> traversePat p | SynPat.Or (p1, p2, _) -> [ p1; p2] |> List.tryPick traversePat | SynPat.Ands (ps, _) - | SynPat.Tuple (ps, _) - | SynPat.StructTuple (ps, _) + | SynPat.Tuple (_, ps, _) | SynPat.ArrayOrList (_, ps, _) -> ps |> List.tryPick traversePat | SynPat.Attrib (p, _, _) -> traversePat p | SynPat.LongIdent(_, _, _, args, _, _) -> @@ -492,8 +525,7 @@ module public AstTraversal = | SynType.Array (_, ty, _) -> traverseSynType ty | SynType.StaticConstantNamed (ty1, ty2, _) | SynType.MeasureDivide (ty1, ty2, _) -> [ty1; ty2] |> List.tryPick traverseSynType - | SynType.Tuple (tys, _) - | SynType.StructTuple (tys, _) -> tys |> List.map snd |> List.tryPick traverseSynType + | SynType.Tuple (_, tys, _) -> tys |> List.map snd |> List.tryPick traverseSynType | SynType.StaticConstantExpr (expr, _) -> traverseSynExpr [] expr | SynType.Anon _ -> None | _ -> None diff --git a/src/fsharp/service/ServiceStructure.fs b/src/fsharp/service/ServiceStructure.fs index 242c3e74dae..a89afd44c54 100644 --- a/src/fsharp/service/ServiceStructure.fs +++ b/src/fsharp/service/ServiceStructure.fs @@ -378,8 +378,7 @@ module Structure = // subtract columns so the @@> or @> is not collapsed rcheck Scope.Quote Collapse.Same r (Range.modBoth (if isRaw then 3 else 2) (if isRaw then 3 else 2) r) parseExpr e - | SynExpr.Tuple (es,_,r) - | SynExpr.StructTuple(es,_,r) -> + | SynExpr.Tuple (_, es, _, r) -> rcheck Scope.Tuple Collapse.Same r r List.iter parseExpr es | SynExpr.Paren (e,_,_,_) -> @@ -611,14 +610,14 @@ module Structure = parseAttributes attrs | _ -> () - let parseModuleOrNamespace isScript (SynModuleOrNamespace (longId,_,isModule,decls,_,attribs,_,r)) = + let parseModuleOrNamespace (SynModuleOrNamespace (longId,_,kind,decls,_,attribs,_,r)) = parseAttributes attribs let idRange = longIdentRange longId let fullrange = Range.startToEnd idRange r let collapse = Range.endToEnd idRange r // do not return range for top level implicit module in scripts - if isModule && not isScript then + if kind = NamedModule then rcheck Scope.Module Collapse.Below fullrange collapse collectHashDirectives decls @@ -834,14 +833,14 @@ module Structure = List.iter parseModuleSigDeclaration decls | _ -> () - let parseModuleOrNamespaceSigs (SynModuleOrNamespaceSig(longId,_,isModule,decls,_,attribs,_,r)) = + let parseModuleOrNamespaceSigs (SynModuleOrNamespaceSig(longId,_,kind,decls,_,attribs,_,r)) = parseAttributes attribs let rangeEnd = lastModuleSigDeclRangeElse r decls let idrange = longIdentRange longId let fullrange = Range.startToEnd idrange rangeEnd let collapse = Range.endToEnd idrange rangeEnd - if isModule then + if kind.IsModule then rcheck Scope.Module Collapse.Below fullrange collapse collectSigHashDirectives decls @@ -849,11 +848,11 @@ module Structure = List.iter parseModuleSigDeclaration decls match parsedInput with - | ParsedInput.ImplFile (ParsedImplFileInput (modules = modules; isScript = isScript)) -> - modules |> List.iter (parseModuleOrNamespace isScript) + | ParsedInput.ImplFile (ParsedImplFileInput (modules = modules)) -> + modules |> List.iter parseModuleOrNamespace getCommentRanges sourceLines | ParsedInput.SigFile (ParsedSigFileInput (modules = moduleSigs)) -> List.iter parseModuleOrNamespaceSigs moduleSigs getCommentRanges sourceLines - acc :> seq<_> \ No newline at end of file + acc :> seq<_> diff --git a/src/fsharp/service/ServiceUntypedParse.fs b/src/fsharp/service/ServiceUntypedParse.fs index e60364e4ddf..62c8892331f 100755 --- a/src/fsharp/service/ServiceUntypedParse.fs +++ b/src/fsharp/service/ServiceUntypedParse.fs @@ -219,15 +219,20 @@ type FSharpParseFileResults(errors: FSharpErrorInfo[], input: Ast.ParsedInput op yield! walkExpr false e2 | SynExpr.ArrayOrList (_,es,_) - | SynExpr.Tuple (es,_,_) - | SynExpr.StructTuple (es,_,_) -> + | SynExpr.Tuple (_,es,_,_) -> yield! walkExprs es | SynExpr.Record (_,copyExprOpt,fs,_) -> match copyExprOpt with | Some (e,_) -> yield! walkExpr true e | None -> () - yield! walkExprs (List.map (fun (_, v, _) -> v) fs |> List.choose id) + yield! walkExprs (fs |> List.choose p23) + + | SynExpr.AnonRecd (_isStruct, copyExprOpt, fs, _) -> + match copyExprOpt with + | Some (e,_) -> yield! walkExpr true e + | None -> () + yield! walkExprs (fs |> List.map snd) | SynExpr.ObjExpr (_,args,bs,is,_,_) -> match args with @@ -758,7 +763,7 @@ module UntypedParseImpl = List.tryPick walkTyparDecl typars |> Option.orElse (List.tryPick walkTypeConstraint constraints))) |> Option.orElse (List.tryPick walkPat pats) - | SynPat.Tuple(pats, _) -> List.tryPick walkPat pats + | SynPat.Tuple(_,pats, _) -> List.tryPick walkPat pats | SynPat.Paren(pat, _) -> walkPat pat | SynPat.ArrayOrList(_, pats, _) -> List.tryPick walkPat pats | SynPat.IsInst(t, _) -> walkType t @@ -791,7 +796,7 @@ module UntypedParseImpl = | SynType.App(ty, _, types, _, _, _, _) -> walkType ty |> Option.orElse (List.tryPick walkType types) | SynType.LongIdentApp(_, _, _, types, _, _, _) -> List.tryPick walkType types - | SynType.Tuple(ts, _) -> ts |> List.tryPick (fun (_, t) -> walkType t) + | SynType.Tuple(_,ts, _) -> ts |> List.tryPick (fun (_, t) -> walkType t) | SynType.Array(_, t, _) -> walkType t | SynType.Fun(t1, t2, _) -> walkType t1 |> Option.orElse (walkType t2) | SynType.WithGlobalConstraints(t, _, _) -> walkType t @@ -819,7 +824,7 @@ module UntypedParseImpl = | SynExpr.Paren (e, _, _, _) -> walkExprWithKind parentKind e | SynExpr.Quote(_, _, e, _, _) -> walkExprWithKind parentKind e | SynExpr.Typed(e, _, _) -> walkExprWithKind parentKind e - | SynExpr.Tuple(es, _, _) -> List.tryPick (walkExprWithKind parentKind) es + | SynExpr.Tuple(_, es, _, _) -> List.tryPick (walkExprWithKind parentKind) es | SynExpr.ArrayOrList(_, es, _) -> List.tryPick (walkExprWithKind parentKind) es | SynExpr.Record(_, _, fields, r) -> ifPosInRange r (fun _ -> @@ -1093,7 +1098,7 @@ module UntypedParseImpl = let findSetters argList = match argList with - | SynExpr.Paren(SynExpr.Tuple(parameters, _, _), _, _, _) -> + | SynExpr.Paren(SynExpr.Tuple(false, parameters, _, _), _, _, _) -> let setters = HashSet() for p in parameters do match p with @@ -1154,7 +1159,7 @@ module UntypedParseImpl = match path with | TS.Expr(SynExpr.Paren _)::TS.Expr(NewObjectOrMethodCall(args))::_ -> if Option.isSome precedingArgument then None else Some args - | TS.Expr(SynExpr.Tuple (elements, commas, _))::TS.Expr(SynExpr.Paren _)::TS.Expr(NewObjectOrMethodCall(args))::_ -> + | TS.Expr(SynExpr.Tuple (false, elements, commas, _))::TS.Expr(SynExpr.Paren _)::TS.Expr(NewObjectOrMethodCall(args))::_ -> match precedingArgument with | None -> Some args | Some e -> @@ -1259,7 +1264,7 @@ module UntypedParseImpl = match pat with | SynPat.Paren(pat, _) -> match pat with - | SynPat.Tuple(pats, _) -> + | SynPat.Tuple(_, pats, _) -> pats |> List.tryPick visitParam | _ -> visitParam pat | SynPat.Wild(range) when rangeContainsPos range pos -> diff --git a/src/fsharp/service/ServiceXmlDocParser.fs b/src/fsharp/service/ServiceXmlDocParser.fs index 92535f0cecf..0cfd5ec6b7b 100644 --- a/src/fsharp/service/ServiceXmlDocParser.fs +++ b/src/fsharp/service/ServiceXmlDocParser.fs @@ -22,8 +22,7 @@ module XmlDocParsing = | SynPat.Attrib(pat,_attrs,_range) -> digNamesFrom pat | SynPat.LongIdent(_lid,_idOpt,_typDeclsOpt,ConstructorPats pats,_access,_range) -> pats |> List.collect digNamesFrom - | SynPat.Tuple(pats,_range) - | SynPat.StructTuple(pats,_range) -> pats |> List.collect digNamesFrom + | SynPat.Tuple(_,pats,_range) -> pats |> List.collect digNamesFrom | SynPat.Paren(pat,_range) -> digNamesFrom pat | SynPat.OptionalVal (id, _) -> [id.idText] | SynPat.Or _ // no one uses ors in fun decls diff --git a/src/fsharp/service/service.fs b/src/fsharp/service/service.fs index cee4936084b..7fbc49c1f39 100644 --- a/src/fsharp/service/service.fs +++ b/src/fsharp/service/service.fs @@ -568,7 +568,7 @@ type TypeCheckInfo p <- p - 1 if p >= 0 then Some p else None - let CompletionItem (ty: TyconRef option) (assemblySymbol: AssemblySymbol option) (item: ItemWithInst) = + let CompletionItem (ty: ValueOption) (assemblySymbol: ValueOption) (item: ItemWithInst) = let kind = match item.Item with | Item.MethodGroup (_, minfo :: _, _) -> CompletionItemKind.Method minfo.IsExtensionMember @@ -584,10 +584,10 @@ type TypeCheckInfo MinorPriority = 0 Kind = kind IsOwnMember = false - Type = ty - Unresolved = assemblySymbol |> Option.map (fun x -> x.UnresolvedSymbol) } + Type = match ty with ValueSome x -> Some x | _ -> None + Unresolved = match assemblySymbol with ValueSome x -> Some x.UnresolvedSymbol | _ -> None } - let DefaultCompletionItem item = CompletionItem None None item + let DefaultCompletionItem item = CompletionItem ValueNone ValueNone item let getItem (x: ItemWithInst) = x.Item let GetDeclaredItems (parseResultsOpt: FSharpParseFileResults option, lineStr: string, origLongIdentOpt, colAtEndOfNamesAndResidue, residueOpt, lastDotPos, line, loc, @@ -635,29 +635,27 @@ type TypeCheckInfo let pos = mkPos line loc let (nenv, ad), m = GetBestEnvForPos pos - let getType() = - let tref = - match NameResolution.TryToResolveLongIdentAsType ncenv nenv m plid with - | Some x -> Some x - | None -> - match lastDotPos |> Option.orElseWith (fun _ -> FindFirstNonWhitespacePosition lineStr (colAtEndOfNamesAndResidue - 1)) with - | Some p when lineStr.[p] = '.' -> - match FindFirstNonWhitespacePosition lineStr (p - 1) with - | Some colAtEndOfNames -> - let colAtEndOfNames = colAtEndOfNames + 1 // convert 0-based to 1-based - let tyconRef = TryGetTypeFromNameResolution(line, colAtEndOfNames, residueOpt, resolveOverloads) - tyconRef - | None -> None - | _ -> None - - tref |> Option.bind (tryDestAppTy g) + let getType() = + match NameResolution.TryToResolveLongIdentAsType ncenv nenv m plid with + | Some x -> tryDestAppTy g x + | None -> + match lastDotPos |> Option.orElseWith (fun _ -> FindFirstNonWhitespacePosition lineStr (colAtEndOfNamesAndResidue - 1)) with + | Some p when lineStr.[p] = '.' -> + match FindFirstNonWhitespacePosition lineStr (p - 1) with + | Some colAtEndOfNames -> + let colAtEndOfNames = colAtEndOfNames + 1 // convert 0-based to 1-based + match TryGetTypeFromNameResolution(line, colAtEndOfNames, residueOpt, resolveOverloads) with + | Some x -> tryDestAppTy g x + | _ -> ValueNone + | None -> ValueNone + | _ -> ValueNone match nameResItems with | NameResResult.TypecheckStaleAndTextChanged -> None // second-chance intellisense will try again | NameResResult.Cancel(denv,m) -> Some([], denv, m) | NameResResult.Members(FilterRelevantItems getItem exactMatchResidueOpt (items, denv, m)) -> // lookup based on name resolution results successful - Some (items |> List.map (CompletionItem (getType()) None), denv, m) + Some (items |> List.map (CompletionItem (getType()) ValueNone), denv, m) | _ -> match origLongIdentOpt with | None -> None @@ -690,9 +688,9 @@ type TypeCheckInfo // These come through as an empty plid and residue "". Otherwise we try an environment lookup // and then return to the qualItems. This is because the expression typings are a little inaccurate, primarily because // it appears we're getting some typings recorded for non-atomic expressions like "f x" - when (match plid with [] -> true | _ -> false) -> + when isNil plid -> // lookup based on expression typings successful - Some (items |> List.map (CompletionItem (tryDestAppTy g ty) None), denv, m) + Some (items |> List.map (CompletionItem (tryDestAppTy g ty) ValueNone), denv, m) | GetPreciseCompletionListFromExprTypingsResult.NoneBecauseThereWereTypeErrors, _ -> // There was an error, e.g. we have "." and there is an error determining the type of // In this case, we don't want any of the fallback logic, rather, we want to produce zero results. @@ -700,7 +698,7 @@ type TypeCheckInfo | GetPreciseCompletionListFromExprTypingsResult.NoneBecauseTypecheckIsStaleAndTextChanged, _ -> // we want to report no result and let second-chance intellisense kick in None - | _, true when (match plid with [] -> true | _ -> false) -> + | _, true when isNil plid -> // If the user just pressed '.' after an _expression_ (not a plid), it is never right to show environment-lookup top-level completions. // The user might by typing quickly, and the LS didn't have an expression type right before the dot yet. // Second-chance intellisense will bring up the correct list in a moment. @@ -715,19 +713,19 @@ type TypeCheckInfo // First, use unfiltered name resolution items, if they're not empty | NameResResult.Members(items, denv, m), _, _ when not (isNil items) -> // lookup based on name resolution results successful - Some(items |> List.map (CompletionItem (getType()) None), denv, m) + ValueSome(items |> List.map (CompletionItem (getType()) ValueNone), denv, m) // If we have nonempty items from environment that were resolved from a type, then use them... // (that's better than the next case - here we'd return 'int' as a type) | _, FilterRelevantItems getItem exactMatchResidueOpt (items, denv, m), _ when not (isNil items) -> // lookup based on name and environment successful - Some(items |> List.map (CompletionItem (getType()) None), denv, m) + ValueSome(items |> List.map (CompletionItem (getType()) ValueNone), denv, m) // Try again with the qualItems | _, _, GetPreciseCompletionListFromExprTypingsResult.Some(FilterRelevantItems getItem exactMatchResidueOpt (items, denv, m), ty) -> - Some(items |> List.map (CompletionItem (tryDestAppTy g ty) None), denv, m) + ValueSome(items |> List.map (CompletionItem (tryDestAppTy g ty) ValueNone), denv, m) - | _ -> None + | _ -> ValueNone let globalResult = match origLongIdentOpt with @@ -745,16 +743,16 @@ type TypeCheckInfo match globalItems, denv, m with | FilterRelevantItems getItem exactMatchResidueOpt (globalItemsFiltered, denv, m) when not (isNil globalItemsFiltered) -> globalItemsFiltered - |> List.map(fun globalItem -> CompletionItem (getType()) (Some globalItem) (ItemWithNoInst globalItem.Symbol.Item)) - |> fun r -> Some(r, denv, m) - | _ -> None - | _ -> None // do not return unresolved items after dot + |> List.map(fun globalItem -> CompletionItem (getType()) (ValueSome globalItem) (ItemWithNoInst globalItem.Symbol.Item)) + |> fun r -> ValueSome(r, denv, m) + | _ -> ValueNone + | _ -> ValueNone // do not return unresolved items after dot match envResult, globalResult with - | Some (items, denv, m), Some (gItems,_,_) -> Some (items @ gItems, denv, m) - | Some x, None -> Some x - | None, Some y -> Some y - | None, None -> None + | ValueSome (items, denv, m), ValueSome (gItems,_,_) -> Some (items @ gItems, denv, m) + | ValueSome x, ValueNone -> Some x + | ValueNone, ValueSome y -> Some y + | ValueNone, ValueNone -> None let toCompletionItems (items: ItemWithInst list, denv: DisplayEnv, m: range ) = @@ -1161,22 +1159,22 @@ type TypeCheckInfo match item.Item with | Item.CtorGroup (_, (ILMeth (_,ilinfo,_)) :: _) -> match ilinfo.MetadataScope with - | ILScopeRef.Assembly assref -> + | ILScopeRef.Assembly assemblyRef -> let typeVarNames = getTypeVarNames ilinfo ParamTypeSymbol.tryOfILTypes typeVarNames ilinfo.ILMethodRef.ArgTypes |> Option.map (fun args -> let externalSym = ExternalSymbol.Constructor (ilinfo.ILMethodRef.DeclaringTypeRef.FullName, args) - FSharpFindDeclResult.ExternalDecl (assref.Name, externalSym)) + FSharpFindDeclResult.ExternalDecl (assemblyRef.Name, externalSym)) | _ -> None | Item.MethodGroup (name, (ILMeth (_,ilinfo,_)) :: _, _) -> match ilinfo.MetadataScope with - | ILScopeRef.Assembly assref -> + | ILScopeRef.Assembly assemblyRef -> let typeVarNames = getTypeVarNames ilinfo ParamTypeSymbol.tryOfILTypes typeVarNames ilinfo.ILMethodRef.ArgTypes |> Option.map (fun args -> let externalSym = ExternalSymbol.Method (ilinfo.ILMethodRef.DeclaringTypeRef.FullName, name, args, ilinfo.ILMethodRef.GenericArity) - FSharpFindDeclResult.ExternalDecl (assref.Name, externalSym)) + FSharpFindDeclResult.ExternalDecl (assemblyRef.Name, externalSym)) | _ -> None | Item.Property (name, ILProp propInfo :: _) -> @@ -1188,24 +1186,24 @@ type TypeCheckInfo match methInfo with | Some methInfo -> match methInfo.MetadataScope with - | ILScopeRef.Assembly assref -> + | ILScopeRef.Assembly assemblyRef -> let externalSym = ExternalSymbol.Property (methInfo.ILMethodRef.DeclaringTypeRef.FullName, name) - Some (FSharpFindDeclResult.ExternalDecl (assref.Name, externalSym)) + Some (FSharpFindDeclResult.ExternalDecl (assemblyRef.Name, externalSym)) | _ -> None | None -> None | Item.ILField (ILFieldInfo (typeInfo, fieldDef)) when not typeInfo.TyconRefOfRawMetadata.IsLocalRef -> match typeInfo.ILScopeRef with - | ILScopeRef.Assembly assref -> + | ILScopeRef.Assembly assemblyRef -> let externalSym = ExternalSymbol.Field (typeInfo.ILTypeRef.FullName, fieldDef.Name) - Some (FSharpFindDeclResult.ExternalDecl (assref.Name, externalSym)) + Some (FSharpFindDeclResult.ExternalDecl (assemblyRef.Name, externalSym)) | _ -> None | Item.Event (ILEvent (ILEventInfo (typeInfo, eventDef))) when not typeInfo.TyconRefOfRawMetadata.IsLocalRef -> match typeInfo.ILScopeRef with - | ILScopeRef.Assembly assref -> + | ILScopeRef.Assembly assemblyRef -> let externalSym = ExternalSymbol.Event (typeInfo.ILTypeRef.FullName, eventDef.Name) - Some (FSharpFindDeclResult.ExternalDecl (assref.Name, externalSym)) + Some (FSharpFindDeclResult.ExternalDecl (assemblyRef.Name, externalSym)) | _ -> None | Item.ImplicitOp(_, {contents = Some(TraitConstraintSln.FSMethSln(_, _vref, _))}) -> @@ -1216,9 +1214,9 @@ type TypeCheckInfo | Item.Types (_, [ AppTy g (tr, _) ]) when not tr.IsLocalRef -> match tr.TypeReprInfo, tr.PublicPath with - | TILObjectRepr(TILObjectReprData (ILScopeRef.Assembly assref, _, _)), Some (PubPath parts) -> + | TILObjectRepr(TILObjectReprData (ILScopeRef.Assembly assemblyRef, _, _)), Some (PubPath parts) -> let fullName = parts |> String.concat "." - Some (FSharpFindDeclResult.ExternalDecl (assref.Name, ExternalSymbol.Type fullName)) + Some (FSharpFindDeclResult.ExternalDecl (assemblyRef.Name, ExternalSymbol.Type fullName)) | _ -> None | _ -> None match result with @@ -1609,7 +1607,7 @@ module internal Parser = let isExe = options.IsExe try Some (ParseInput(lexfun, errHandler.ErrorLogger, lexbuf, None, fileName, (isLastCompiland, isExe))) with e -> - errHandler.ErrorLogger.ErrorR(e) + errHandler.ErrorLogger.StopProcessingRecovery e Range.range0 // don't re-raise any exceptions, we must return None. None) errHandler.CollectedDiagnostics, parseResult, errHandler.AnyErrors @@ -1626,6 +1624,7 @@ module internal Parser = tcGlobals: TcGlobals, tcImports: TcImports, tcState: TcState, + moduleNamesDict: ModuleNamesDict, loadClosure: LoadClosure option, // These are the errors and warnings seen by the background compiler for the entire antecedent backgroundDiagnostics: (PhasedDiagnostic * FSharpErrorSeverity)[], @@ -1729,6 +1728,9 @@ module internal Parser = async { try let checkForErrors() = (parseResults.ParseHadErrors || errHandler.ErrorCount > 0) + + let parsedMainInput, _moduleNamesDict = DeduplicateParsedInputModuleName moduleNamesDict parsedMainInput + // Typecheck is potentially a long running operation. We chop it up here with an Eventually continuation and, at each slice, give a chance // for the client to claim the result as obsolete and have the typecheck abort. @@ -1915,7 +1917,8 @@ type FSharpCheckProjectResults(projectFileName:string, tcConfigOption, keepAssem let cenv = SymbolEnv(tcGlobals, thisCcu, Some ccuSig, tcImports) [| for r in tcSymbolUses do - for symbolUse in r.AllUsesOfSymbols do + for symbolUseChunk in r.AllUsesOfSymbols do + for symbolUse in symbolUseChunk do if symbolUse.ItemOccurence <> ItemOccurence.RelatedText then let symbol = FSharpSymbol.Create(cenv, symbolUse.Item) yield FSharpSymbolUse(tcGlobals, symbolUse.DisplayEnv, symbol, symbolUse.ItemOccurence, symbolUse.Range) |] @@ -2109,7 +2112,8 @@ type FSharpCheckFileResults(filename: string, errors: FSharpErrorInfo[], scopeOp (fun () -> [| |]) (fun scope -> let cenv = scope.SymbolEnv - [| for symbolUse in scope.ScopeSymbolUses.AllUsesOfSymbols do + [| for symbolUseChunk in scope.ScopeSymbolUses.AllUsesOfSymbols do + for symbolUse in symbolUseChunk do if symbolUse.ItemOccurence <> ItemOccurence.RelatedText then let symbol = FSharpSymbol.Create(cenv, symbolUse.Item) yield FSharpSymbolUse(scope.TcGlobals, symbolUse.DisplayEnv, symbol, symbolUse.ItemOccurence, symbolUse.Range) |]) @@ -2607,7 +2611,7 @@ type BackgroundCompiler(legacyReferenceResolver, projectCacheSize, keepAssemblyC let loadClosure = scriptClosureCacheLock.AcquireLock (fun ltok -> scriptClosureCache.TryGet (ltok, options)) let! tcErrors, tcFileResult = Parser.CheckOneFile(parseResults, source, fileName, options.ProjectFileName, tcPrior.TcConfig, tcPrior.TcGlobals, tcPrior.TcImports, - tcPrior.TcState, loadClosure, tcPrior.TcErrors, reactorOps, (fun () -> builder.IsAlive), textSnapshotInfo, userOpName) + tcPrior.TcState, tcPrior.ModuleNamesDict, loadClosure, tcPrior.TcErrors, reactorOps, (fun () -> builder.IsAlive), textSnapshotInfo, userOpName) let parsingOptions = FSharpParsingOptions.FromTcConfig(tcPrior.TcConfig, Array.ofList builder.SourceFiles, options.UseScriptResolutionRules) let checkAnswer = MakeCheckFileAnswer(fileName, tcFileResult, options, builder, Array.ofList tcPrior.TcDependencyFiles, creationErrors, parseResults.Errors, tcErrors) bc.RecordTypeCheckFileInProjectResults(fileName, options, parsingOptions, parseResults, fileVersion, tcPrior.TimeStamp, Some checkAnswer, source) @@ -2688,9 +2692,7 @@ type BackgroundCompiler(legacyReferenceResolver, projectCacheSize, keepAssemblyC | _ -> Trace.TraceInformation("FCS: {0}.{1} ({2})", userOpName, "CheckFileInProject.CacheMiss", filename) let! tcPrior = execWithReactorAsync <| fun ctok -> builder.GetCheckResultsBeforeFileInProject (ctok, filename) - let parseTreeOpt = parseResults.ParseTree |> Option.map builder.DeduplicateParsedInputModuleNameInProject - let parseResultsAterDeDuplication = FSharpParseFileResults(parseResults.Errors, parseTreeOpt, parseResults.ParseHadErrors, parseResults.DependencyFiles) - let! checkAnswer = bc.CheckOneFileImpl(parseResultsAterDeDuplication, source, filename, options, textSnapshotInfo, fileVersion, builder, tcPrior, creationErrors, userOpName) + let! checkAnswer = bc.CheckOneFileImpl(parseResults, source, filename, options, textSnapshotInfo, fileVersion, builder, tcPrior, creationErrors, userOpName) return checkAnswer finally bc.ImplicitlyStartCheckProjectInBackground(options, userOpName) @@ -2733,7 +2735,6 @@ type BackgroundCompiler(legacyReferenceResolver, projectCacheSize, keepAssemblyC // Do the parsing. let parsingOptions = FSharpParsingOptions.FromTcConfig(builder.TcConfig, Array.ofList (builder.SourceFiles), options.UseScriptResolutionRules) let parseErrors, parseTreeOpt, anyErrors = Parser.parseFile (source, filename, parsingOptions, userOpName) - let parseTreeOpt = parseTreeOpt |> Option.map builder.DeduplicateParsedInputModuleNameInProject let parseResults = FSharpParseFileResults(parseErrors, parseTreeOpt, anyErrors, builder.AllDependenciesDeprecated) let! checkResults = bc.CheckOneFileImpl(parseResults, source, filename, options, textSnapshotInfo, fileVersion, builder, tcPrior, creationErrors, userOpName) @@ -3290,23 +3291,23 @@ type FSharpChecker(legacyReferenceResolver, projectCacheSize, keepAssemblyConten member internal __.FrameworkImportsCache = backgroundCompiler.FrameworkImportsCache /// Tokenize a single line, returning token information and a tokenization state represented by an integer - member x.TokenizeLine (line: string, state: int64) : FSharpTokenInfo[] * int64 = + member x.TokenizeLine (line: string, state: FSharpTokenizerLexState) = let tokenizer = FSharpSourceTokenizer([], None) let lineTokenizer = tokenizer.CreateLineTokenizer line - let state = ref (None, state) + let mutable state = (None, state) let tokens = - [| while (state := lineTokenizer.ScanToken (snd !state); (fst !state).IsSome) do - yield (fst !state).Value |] - tokens, snd !state + [| while (state <- lineTokenizer.ScanToken (snd state); (fst state).IsSome) do + yield (fst state).Value |] + tokens, snd state /// Tokenize an entire file, line by line member x.TokenizeFile (source: string) : FSharpTokenInfo[][] = let lines = source.Split('\n') let tokens = - [| let state = ref 0L + [| let mutable state = FSharpTokenizerLexState.Initial for line in lines do - let tokens, n = x.TokenizeLine(line, !state) - state := n + let tokens, n = x.TokenizeLine(line, state) + state <- n yield tokens |] tokens @@ -3333,7 +3334,7 @@ type FsiInteractiveChecker(legacyReferenceResolver, reactorOps: IReactorOperatio CompileOptions.ParseCompilerOptions (ignore, fsiCompilerOptions, [ ]) let loadClosure = LoadClosure.ComputeClosureOfScriptText(ctok, legacyReferenceResolver, defaultFSharpBinariesDir, filename, source, CodeContext.Editing, tcConfig.useSimpleResolution, tcConfig.useFsiAuxLib, new Lexhelp.LexResourceManager(), applyCompilerOptions, assumeDotNetFramework, tryGetMetadataSnapshot=(fun _ -> None), reduceMemoryUsage=reduceMemoryUsage) - let! tcErrors, tcFileResult = Parser.CheckOneFile(parseResults, source, filename, "project", tcConfig, tcGlobals, tcImports, tcState, Some loadClosure, backgroundDiagnostics, reactorOps, (fun () -> true), None, userOpName) + let! tcErrors, tcFileResult = Parser.CheckOneFile(parseResults, source, filename, "project", tcConfig, tcGlobals, tcImports, tcState, Map.empty, Some loadClosure, backgroundDiagnostics, reactorOps, (fun () -> true), None, userOpName) return match tcFileResult with @@ -3343,7 +3344,7 @@ type FsiInteractiveChecker(legacyReferenceResolver, reactorOps: IReactorOperatio let projectResults = FSharpCheckProjectResults (filename, Some tcConfig, keepAssemblyContents, errors, Some(tcGlobals, tcImports, tcFileInfo.ThisCcu, tcFileInfo.CcuSigForFile, - [tcFileInfo.ScopeSymbolUses], None, None, mkSimpleAssRef "stdin", + [tcFileInfo.ScopeSymbolUses], None, None, mkSimpleAssemblyRef "stdin", tcState.TcEnvFromImpls.AccessRights, None, dependencyFiles)) parseResults, typeCheckResults, projectResults | _ -> diff --git a/src/fsharp/service/service.fsi b/src/fsharp/service/service.fsi index 5ccb31e4502..2d07c235614 100755 --- a/src/fsharp/service/service.fsi +++ b/src/fsharp/service/service.fsi @@ -711,7 +711,7 @@ type public FSharpChecker = member internal ReferenceResolver : ReferenceResolver.Resolver /// Tokenize a single line, returning token information and a tokenization state represented by an integer - member TokenizeLine: line:string * state:int64 -> FSharpTokenInfo [] * int64 + member TokenizeLine: line:string * state:FSharpTokenizerLexState-> FSharpTokenInfo [] * FSharpTokenizerLexState /// Tokenize an entire file, line by line member TokenizeFile: source:string -> FSharpTokenInfo [] [] diff --git a/src/fsharp/symbols/Exprs.fs b/src/fsharp/symbols/Exprs.fs index f6213ef2ff6..4da520daedd 100644 --- a/src/fsharp/symbols/Exprs.fs +++ b/src/fsharp/symbols/Exprs.fs @@ -1033,7 +1033,7 @@ module FSharpExprConvert = // is not sufficient to resolve to a symbol unambiguously in these cases. let argtys = [ ilMethRef.ArgTypes |> List.map (ImportILTypeFromMetadata cenv.amap m scoref tinst1 tinst2) ] let rty = - match ImportReturnTypeFromMetaData cenv.amap m ilMethRef.ReturnType scoref tinst1 tinst2 with + match ImportReturnTypeFromMetadata cenv.amap m ilMethRef.ReturnType emptyILCustomAttrs scoref tinst1 tinst2 with | None -> if isCtor then enclosingType else cenv.g.unit_ty | Some ty -> ty @@ -1223,7 +1223,7 @@ and FSharpImplementationFileDeclaration = | InitAction of FSharpExpr and FSharpImplementationFileContents(cenv, mimpl) = - let (TImplFile(qname, _pragmas, ModuleOrNamespaceExprWithSig(_, mdef, _), hasExplicitEntryPoint, isScript)) = mimpl + let (TImplFile(qname, _pragmas, ModuleOrNamespaceExprWithSig(_, mdef, _), hasExplicitEntryPoint, isScript, _anonRecdTypes)) = mimpl let rec getDecls2 (ModuleOrNamespaceExprWithSig(_mty, def, _m)) = getDecls def and getBind (bind: Binding) = let v = bind.Var diff --git a/src/fsharp/symbols/SymbolHelpers.fs b/src/fsharp/symbols/SymbolHelpers.fs index 2a3031e004d..f4fb7c02383 100644 --- a/src/fsharp/symbols/SymbolHelpers.fs +++ b/src/fsharp/symbols/SymbolHelpers.fs @@ -361,11 +361,12 @@ module internal SymbolHelpers = | Item.UnionCase(ucinfo, _) -> Some (rangeOfUnionCaseInfo preferFlag ucinfo) | Item.ActivePatternCase apref -> Some (rangeOfValRef preferFlag apref.ActivePatternVal) | Item.ExnCase tcref -> Some tcref.Range + | Item.AnonRecdField (_,_,_,m) -> Some m | Item.RecdField rfinfo -> Some (rangeOfRecdFieldInfo preferFlag rfinfo) | Item.Event einfo -> rangeOfEventInfo preferFlag einfo | Item.ILField _ -> None | Item.Property(_, pinfos) -> rangeOfPropInfo preferFlag pinfos.Head - | Item.Types(_, tys) -> tys |> List.tryPick (tryNiceEntityRefOfTy >> Option.map (rangeOfEntityRef preferFlag)) + | Item.Types(_, tys) -> tys |> List.tryPick (tryNiceEntityRefOfTyOption >> Option.map (rangeOfEntityRef preferFlag)) | Item.CustomOperation (_, _, Some minfo) -> rangeOfMethInfo g preferFlag minfo | Item.TypeVar (_, tp) -> Some tp.Range | Item.ModuleOrNamespaces(modrefs) -> modrefs |> List.tryPick (rangeOfEntityRef preferFlag >> Some) @@ -379,7 +380,7 @@ module internal SymbolHelpers = | Item.ImplicitOp _ -> None | Item.UnqualifiedType tcrefs -> tcrefs |> List.tryPick (rangeOfEntityRef preferFlag >> Some) | Item.DelegateCtor ty - | Item.FakeInterfaceCtor ty -> ty |> tryNiceEntityRefOfTy |> Option.map (rangeOfEntityRef preferFlag) + | Item.FakeInterfaceCtor ty -> ty |> tryNiceEntityRefOfTyOption |> Option.map (rangeOfEntityRef preferFlag) | Item.NewDef _ -> None // Provided type definitions do not have a useful F# CCU for the purposes of goto-definition. @@ -419,7 +420,7 @@ module internal SymbolHelpers = | Item.CtorGroup(_, minfos) -> minfos |> List.tryPick (ccuOfMethInfo g) | Item.CustomOperation (_, _, Some minfo) -> ccuOfMethInfo g minfo - | Item.Types(_, tys) -> tys |> List.tryPick (tryNiceEntityRefOfTy >> Option.bind computeCcuOfTyconRef) + | Item.Types(_, tys) -> tys |> List.tryPick (tryNiceEntityRefOfTyOption >> Option.bind computeCcuOfTyconRef) | Item.ArgName (_, _, Some (ArgumentContainer.Type eref)) -> computeCcuOfTyconRef eref @@ -427,6 +428,7 @@ module internal SymbolHelpers = | Item.UnqualifiedType(erefs) -> erefs |> List.tryPick computeCcuOfTyconRef | Item.SetterArg (_, item) -> ccuOfItem g item + | Item.AnonRecdField (info, _, _, _) -> Some info.Assembly | Item.TypeVar _ -> None | _ -> None @@ -713,8 +715,12 @@ module internal SymbolHelpers = // In this case just bail out and assume items are not equal protectAssemblyExploration false (fun () -> let equalHeadTypes(ty1, ty2) = - if isAppTy g ty1 && isAppTy g ty2 then tyconRefEq g (tcrefOfAppTy g ty1) (tcrefOfAppTy g ty2) - else typeEquiv g ty1 ty2 + match tryDestAppTy g ty1 with + | ValueSome tcref1 -> + match tryDestAppTy g ty2 with + | ValueSome tcref2 -> tyconRefEq g tcref1 tcref2 + | _ -> typeEquiv g ty1 ty2 + | _ -> typeEquiv g ty1 ty2 ItemsAreEffectivelyEqual g item1 item2 || @@ -752,6 +758,8 @@ module internal SymbolHelpers = List.zip pi1s pi2s |> List.forall(fun (pi1, pi2) -> PropInfo.PropInfosUseIdenticalDefinitions pi1 pi2) | Item.Event(evt1), Item.Event(evt2) -> EventInfo.EventInfosUseIdenticalDefintions evt1 evt2 + | Item.AnonRecdField(anon1, _, i1, _), Item.AnonRecdField(anon2, _, i2, _) -> + Tastops.anonInfoEquiv anon1 anon2 && i1 = i2 | Item.CtorGroup(_, meths1), Item.CtorGroup(_, meths2) -> List.zip meths1 meths2 |> List.forall (fun (minfo1, minfo2) -> MethInfo.MethInfosUseIdenticalDefinitions minfo1 minfo2) @@ -768,8 +776,9 @@ module internal SymbolHelpers = protectAssemblyExploration 1027 (fun () -> match item with | ItemWhereTypIsPreferred ty -> - if isAppTy g ty then hash (tcrefOfAppTy g ty).LogicalName - else 1010 + match tryDestAppTy g ty with + | ValueSome tcref -> hash (tcref).LogicalName + | _ -> 1010 | Item.ILField(ILFieldInfo(_, fld)) -> System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode fld // hash on the object identity of the AbstractIL metadata blob for the field | Item.TypeVar (nm, _tp) -> hash nm @@ -784,6 +793,7 @@ module internal SymbolHelpers = | Item.ExnCase(tcref) -> hash tcref.LogicalName | Item.UnionCase(UnionCaseInfo(_, UCRef(tcref, n)), _) -> hash(tcref.Stamp, n) | Item.RecdField(RecdFieldInfo(_, RFRef(tcref, n))) -> hash(tcref.Stamp, n) + | Item.AnonRecdField(anon, _, i, _) -> hash anon.SortedNames.[i] | Item.Event evt -> evt.ComputeHashCode() | Item.Property(_name, pis) -> hash (pis |> List.map (fun pi -> pi.ComputeHashCode())) | Item.UnqualifiedType(tcref :: _) -> hash tcref.LogicalName @@ -864,6 +874,7 @@ module internal SymbolHelpers = | Item.ActivePatternResult(apinfo, _ty, idx, _) -> apinfo.Names.[idx] | Item.ActivePatternCase apref -> FullNameOfItem g (Item.Value apref.ActivePatternVal) + "." + apref.Name | Item.ExnCase ecref -> fullDisplayTextOfExnRef ecref + | Item.AnonRecdField(anon, _argTys, i, _) -> anon.SortedNames.[i] | Item.RecdField rfinfo -> fullDisplayTextOfRecdFieldRef rfinfo.RecdFieldRef | Item.NewDef id -> id.idText | Item.ILField finfo -> bufs (fun os -> NicePrint.outputILTypeRef denv os finfo.ILTypeRef; bprintf os ".%s" finfo.FieldName) @@ -878,7 +889,7 @@ module internal SymbolHelpers = | Item.DelegateCtor ty | Item.Types(_, ty:: _) -> match tryDestAppTy g ty with - | Some tcref -> bufs (fun os -> NicePrint.outputTyconRef denv os tcref) + | ValueSome tcref -> bufs (fun os -> NicePrint.outputTyconRef denv os tcref) | _ -> "" | Item.ModuleOrNamespaces((modref :: _) as modrefs) -> let definiteNamespace = modrefs |> List.forall (fun modref -> modref.IsNamespace) @@ -1180,7 +1191,7 @@ module internal SymbolHelpers = ([], modrefs) ||> Seq.fold (fun st modref -> match fullDisplayTextOfParentOfModRef modref with - | Some(txt) -> txt::st + | ValueSome txt -> txt::st | _ -> st) |> Seq.mapi (fun i x -> i, x) |> Seq.toList @@ -1201,6 +1212,17 @@ module internal SymbolHelpers = else FSharpStructuredToolTipElement.Single (layout, xml) + | Item.AnonRecdField(anon, argTys, i, _) -> + let argTy = argTys.[i] + let nm = anon.SortedNames.[i] + let argTy, _ = PrettyTypes.PrettifyType g argTy + let layout = + wordL (tagText (FSComp.SR.typeInfoAnonRecdField())) ^^ + wordL (tagRecordField nm) ^^ + RightL.colon ^^ + NicePrint.layoutType denv argTy + FSharpStructuredToolTipElement.Single (layout, FSharpXmlDoc.None) + // Named parameters | Item.ArgName (id, argTy, _) -> let argTy, _ = PrettyTypes.PrettifyType g argTy @@ -1320,6 +1342,8 @@ module internal SymbolHelpers = | Item.RecdField rfi -> (rfi.TyconRef |> ticksAndArgCountTextOfTyconRef)+"."+rfi.Name |> Some + | Item.AnonRecdField _ -> None + | Item.ILField finfo -> match finfo with | ILFieldInfo(tinfo, fdef) -> diff --git a/src/fsharp/symbols/SymbolPatterns.fs b/src/fsharp/symbols/SymbolPatterns.fs index 74b9bcf60c6..eb12229f7c6 100644 --- a/src/fsharp/symbols/SymbolPatterns.fs +++ b/src/fsharp/symbols/SymbolPatterns.fs @@ -186,7 +186,9 @@ module Symbol = let (|RecordField|_|) (e: FSharpSymbol) = match e with | :? FSharpField as field -> - if field.DeclaringEntity.IsFSharpRecord then Some field else None + match field.DeclaringEntity with + | None -> None + | Some e -> if e.IsFSharpRecord then Some field else None | _ -> None let (|ActivePatternCase|_|) (symbol: FSharpSymbol) = diff --git a/src/fsharp/symbols/Symbols.fs b/src/fsharp/symbols/Symbols.fs index 00e3c6a303c..fa3fcccfc82 100644 --- a/src/fsharp/symbols/Symbols.fs +++ b/src/fsharp/symbols/Symbols.fs @@ -80,13 +80,13 @@ module Impl = | None -> mkLocalEntityRef entity | Some viewedCcu -> match tryRescopeEntity viewedCcu entity with - | None -> mkLocalEntityRef entity - | Some eref -> eref + | ValueNone -> mkLocalEntityRef entity + | ValueSome eref -> eref let entityIsUnresolved(entity:EntityRef) = match entity with | ERefNonLocal(NonLocalEntityRef(ccu, _)) -> - ccu.IsUnresolvedReference && entity.TryDeref.IsNone + ccu.IsUnresolvedReference && ValueOptionInternal.isNone entity.TryDeref | _ -> false let checkEntityIsResolved(entity:EntityRef) = @@ -245,6 +245,8 @@ type FSharpSymbol(cenv: SymbolEnv, item: (unit -> Item), access: (FSharpSymbol - | Item.RecdField rfinfo -> FSharpField(cenv, RecdOrClass rfinfo.RecdFieldRef) :> _ | Item.ILField finfo -> FSharpField(cenv, ILField finfo) :> _ + + | Item.AnonRecdField (anonInfo, tinst, n, m) -> FSharpField(cenv, AnonField (anonInfo, tinst, n, m)) :> _ | Item.Event einfo -> FSharpMemberOrFunctionOrValue(cenv, E einfo, item) :> _ @@ -753,11 +755,12 @@ and FSharpUnionCase(cenv, v: UnionCaseRef) = ) - let isUnresolved() = - entityIsUnresolved v.TyconRef || v.TryUnionCase.IsNone + let isUnresolved() = + entityIsUnresolved v.TyconRef || ValueOptionInternal.isNone v.TryUnionCase + let checkIsResolved() = checkEntityIsResolved v.TyconRef - if v.TryUnionCase.IsNone then + if ValueOptionInternal.isNone v.TryUnionCase then invalidOp (sprintf "The union case '%s' could not be found in the target type" v.CaseName) member __.IsUnresolved = @@ -815,26 +818,43 @@ and FSharpUnionCase(cenv, v: UnionCaseRef) = and FSharpFieldData = + | AnonField of AnonRecdTypeInfo * TTypes * int * range | ILField of ILFieldInfo | RecdOrClass of RecdFieldRef | Union of UnionCaseRef * int member x.TryRecdField = match x with - | RecdOrClass v -> v.RecdField |> Choice1Of2 - | Union (v, n) -> v.FieldByIndex(n) |> Choice1Of2 - | ILField f -> f |> Choice2Of2 + | AnonField (anonInfo, tinst, n, m) -> (anonInfo, tinst, n, m) |> Choice3Of3 + | RecdOrClass v -> v.RecdField |> Choice1Of3 + | Union (v, n) -> v.FieldByIndex(n) |> Choice1Of3 + | ILField f -> f |> Choice2Of3 - member x.DeclaringTyconRef = + member x.TryDeclaringTyconRef = match x with - | RecdOrClass v -> v.TyconRef - | Union (v, _) -> v.TyconRef - | ILField f -> f.DeclaringTyconRef + | AnonField _ -> None + | RecdOrClass v -> Some v.TyconRef + | Union (v, _) -> Some v.TyconRef + | ILField f -> Some f.DeclaringTyconRef + +and FSharpAnonRecordTypeDetails(cenv: SymbolEnv, anonInfo: AnonRecdTypeInfo) = + member __.Assembly = FSharpAssembly (cenv, anonInfo.Assembly) + + /// Names of any enclosing types of the compiled form of the anonymous type (if the anonymous type was defined as a nested type) + member __.EnclosingCompiledTypeNames = anonInfo.ILTypeRef.Enclosing + + /// The name of the compiled form of the anonymous type + member __.CompiledName = anonInfo.ILTypeRef.Name + + /// The sorted labels of the anonymous type + member __.SortedFieldNames = anonInfo.SortedNames and FSharpField(cenv: SymbolEnv, d: FSharpFieldData) = inherit FSharpSymbol (cenv, (fun () -> match d with + | AnonField (anonInfo, tinst, n, m) -> + Item.AnonRecdField(anonInfo, tinst, n, m) | RecdOrClass v -> checkEntityIsResolved v.TyconRef Item.RecdField(RecdFieldInfo(generalizeTypars v.TyconRef.TyparsNoRange, v)) @@ -852,20 +872,22 @@ and FSharpField(cenv: SymbolEnv, d: FSharpFieldData) = ) let isUnresolved() = - entityIsUnresolved d.DeclaringTyconRef || - match d with - | RecdOrClass v -> v.TryRecdField.IsNone - | Union (v, _) -> v.TryUnionCase.IsNone + d.TryDeclaringTyconRef |> Option.exists entityIsUnresolved || + match d with + | AnonField _ -> false + | RecdOrClass v -> ValueOptionInternal.isNone v.TryRecdField + | Union (v, _) -> ValueOptionInternal.isNone v.TryUnionCase | ILField _ -> false let checkIsResolved() = - checkEntityIsResolved d.DeclaringTyconRef + d.TryDeclaringTyconRef |> Option.iter checkEntityIsResolved match d with + | AnonField _ -> () | RecdOrClass v -> - if v.TryRecdField.IsNone then + if ValueOptionInternal.isNone v.TryRecdField then invalidOp (sprintf "The record field '%s' could not be found in the target type" v.FieldName) | Union (v, _) -> - if v.TryUnionCase.IsNone then + if ValueOptionInternal.isNone v.TryUnionCase then invalidOp (sprintf "The union case '%s' could not be found in the target type" v.CaseName) | ILField _ -> () @@ -874,7 +896,7 @@ and FSharpField(cenv: SymbolEnv, d: FSharpFieldData) = new (cenv, rfref) = FSharpField(cenv, FSharpFieldData.RecdOrClass(rfref)) member __.DeclaringEntity = - FSharpEntity(cenv, d.DeclaringTyconRef) + d.TryDeclaringTyconRef |> Option.map (fun tcref -> FSharpEntity(cenv, tcref)) member __.IsUnresolved = isUnresolved() @@ -882,32 +904,47 @@ and FSharpField(cenv: SymbolEnv, d: FSharpFieldData) = member __.IsMutable = if isUnresolved() then false else match d.TryRecdField with - | Choice1Of2 r -> r.IsMutable - | Choice2Of2 f -> not f.IsInitOnly && f.LiteralValue.IsNone + | Choice1Of3 r -> r.IsMutable + | Choice2Of3 f -> not f.IsInitOnly && f.LiteralValue.IsNone + | Choice3Of3 _ -> false member __.IsLiteral = if isUnresolved() then false else match d.TryRecdField with - | Choice1Of2 r -> r.LiteralValue.IsSome - | Choice2Of2 f -> f.LiteralValue.IsSome + | Choice1Of3 r -> r.LiteralValue.IsSome + | Choice2Of3 f -> f.LiteralValue.IsSome + | Choice3Of3 _ -> false member __.LiteralValue = if isUnresolved() then None else match d.TryRecdField with - | Choice1Of2 r -> getLiteralValue r.LiteralValue - | Choice2Of2 f -> f.LiteralValue |> Option.map AbstractIL.ILRuntimeWriter.convFieldInit + | Choice1Of3 r -> getLiteralValue r.LiteralValue + | Choice2Of3 f -> f.LiteralValue |> Option.map AbstractIL.ILRuntimeWriter.convFieldInit + | Choice3Of3 _ -> None member __.IsVolatile = if isUnresolved() then false else match d.TryRecdField with - | Choice1Of2 r -> r.IsVolatile - | Choice2Of2 _ -> false // F# doesn't actually respect "volatile" from other assemblies in any case + | Choice1Of3 r -> r.IsVolatile + | Choice2Of3 _ -> false // F# doesn't actually respect "volatile" from other assemblies in any case + | Choice3Of3 _ -> false member __.IsDefaultValue = if isUnresolved() then false else match d.TryRecdField with - | Choice1Of2 r -> r.IsZeroInit - | Choice2Of2 _ -> false + | Choice1Of3 r -> r.IsZeroInit + | Choice2Of3 _ -> false + | Choice3Of3 _ -> false + + member __.IsAnonRecordField = + match d with + | AnonField _ -> true + | _ -> false + + member __.AnonRecordFieldDetails = + match d with + | AnonField (anonInfo, types, n, _) -> FSharpAnonRecordTypeDetails(cenv, anonInfo), [| for ty in types -> FSharpType(cenv, ty) |], n + | _ -> invalidOp "not an anonymous record field" member __.XmlDocSig = checkIsResolved() @@ -921,6 +958,7 @@ and FSharpField(cenv: SymbolEnv, d: FSharpFieldData) = SymbolHelpers.GetXmlDocSigOfUnionCaseInfo unionCase | ILField f -> SymbolHelpers.GetXmlDocSigOfILFieldInfo cenv.infoReader range0 f + | AnonField _ -> None match xmlsig with | Some (_, docsig) -> docsig | _ -> "" @@ -928,68 +966,77 @@ and FSharpField(cenv: SymbolEnv, d: FSharpFieldData) = member __.XmlDoc = if isUnresolved() then XmlDoc.Empty |> makeXmlDoc else match d.TryRecdField with - | Choice1Of2 r -> r.XmlDoc - | Choice2Of2 _ -> XmlDoc.Empty + | Choice1Of3 r -> r.XmlDoc + | Choice2Of3 _ -> XmlDoc.Empty + | Choice3Of3 _ -> XmlDoc.Empty |> makeXmlDoc member __.FieldType = checkIsResolved() let fty = match d.TryRecdField with - | Choice1Of2 r -> r.FormalType - | Choice2Of2 f -> f.FieldType(cenv.amap, range0) + | Choice1Of3 r -> r.FormalType + | Choice2Of3 f -> f.FieldType(cenv.amap, range0) + | Choice3Of3 (_,tinst,n,_) -> tinst.[n] FSharpType(cenv, fty) member __.IsStatic = if isUnresolved() then false else match d.TryRecdField with - | Choice1Of2 r -> r.IsStatic - | Choice2Of2 f -> f.IsStatic + | Choice1Of3 r -> r.IsStatic + | Choice2Of3 f -> f.IsStatic + | Choice3Of3 _ -> false member __.Name = checkIsResolved() match d.TryRecdField with - | Choice1Of2 r -> r.Name - | Choice2Of2 f -> f.FieldName + | Choice1Of3 r -> r.Name + | Choice2Of3 f -> f.FieldName + | Choice3Of3 (anonInfo, _tinst, n, _) -> anonInfo.SortedNames.[n] member __.IsCompilerGenerated = if isUnresolved() then false else match d.TryRecdField with - | Choice1Of2 r -> r.IsCompilerGenerated - | Choice2Of2 _ -> false + | Choice1Of3 r -> r.IsCompilerGenerated + | Choice2Of3 _ -> false + | Choice3Of3 _ -> false member __.IsNameGenerated = if isUnresolved() then false else match d.TryRecdField with - | Choice1Of2 r -> r.rfield_name_generated + | Choice1Of3 r -> r.rfield_name_generated | _ -> false member __.DeclarationLocation = checkIsResolved() match d.TryRecdField with - | Choice1Of2 r -> r.Range - | Choice2Of2 _ -> range0 + | Choice1Of3 r -> r.Range + | Choice2Of3 _ -> range0 + | Choice3Of3 (_anonInfo, _tinst, _n, m) -> m member __.FieldAttributes = if isUnresolved() then makeReadOnlyCollection [] else match d.TryRecdField with - | Choice1Of2 r -> r.FieldAttribs |> List.map (fun a -> FSharpAttribute(cenv, AttribInfo.FSAttribInfo(cenv.g, a))) - | Choice2Of2 _ -> [] + | Choice1Of3 r -> r.FieldAttribs |> List.map (fun a -> FSharpAttribute(cenv, AttribInfo.FSAttribInfo(cenv.g, a))) + | Choice2Of3 _ -> [] + | Choice3Of3 _ -> [] |> makeReadOnlyCollection member __.PropertyAttributes = if isUnresolved() then makeReadOnlyCollection [] else match d.TryRecdField with - | Choice1Of2 r -> r.PropertyAttribs |> List.map (fun a -> FSharpAttribute(cenv, AttribInfo.FSAttribInfo(cenv.g, a))) - | Choice2Of2 _ -> [] + | Choice1Of3 r -> r.PropertyAttribs |> List.map (fun a -> FSharpAttribute(cenv, AttribInfo.FSAttribInfo(cenv.g, a))) + | Choice2Of3 _ -> [] + | Choice3Of3 _ -> [] |> makeReadOnlyCollection member __.Accessibility: FSharpAccessibility = if isUnresolved() then FSharpAccessibility(taccessPublic) else let access = match d.TryRecdField with - | Choice1Of2 r -> r.Accessibility - | Choice2Of2 _ -> taccessPublic + | Choice1Of3 r -> r.Accessibility + | Choice2Of3 _ -> taccessPublic + | Choice3Of3 _ -> taccessPublic FSharpAccessibility(access) member private x.V = d @@ -1001,6 +1048,7 @@ and FSharpField(cenv: SymbolEnv, d: FSharpFieldData) = match d, uc.V with | RecdOrClass r1, RecdOrClass r2 -> recdFieldRefOrder.Compare(r1, r2) = 0 | Union (u1, n1), Union (u2, n2) -> cenv.g.unionCaseRefEq u1 u2 && n1 = n2 + | AnonField (anonInfo1, _, _, _) , AnonField (anonInfo2, _, _, _) -> x.Name = uc.Name && anonInfoEquiv anonInfo1 anonInfo2 | _ -> false | _ -> false @@ -1331,7 +1379,7 @@ and FSharpMemberOrFunctionOrValue(cenv, d:FSharpMemberOrValData, item) = let isUnresolved() = match fsharpInfo() with | None -> false - | Some v -> v.TryDeref.IsNone + | Some v -> ValueOptionInternal.isNone v.TryDeref let checkIsResolved() = if isUnresolved() then @@ -2032,6 +2080,7 @@ and FSharpType(cenv, ty:TType) = member __.GenericArguments = protect <| fun () -> match stripTyparEqns ty with + | TType_anon (_, tyargs) | TType_app (_, tyargs) | TType_tuple (_, tyargs) -> (tyargs |> List.map (fun ty -> FSharpType(cenv, ty)) |> makeReadOnlyCollection) | TType_fun(d, r) -> [| FSharpType(cenv, d); FSharpType(cenv, r) |] |> makeReadOnlyCollection @@ -2063,6 +2112,19 @@ and FSharpType(cenv, ty:TType) = | TType_fun _ -> true | _ -> false + member __.IsAnonRecordType = + isResolved() && + protect <| fun () -> + match stripTyparEqns ty with + | TType_anon _ -> true + | _ -> false + + member __.AnonRecordTypeDetails = + protect <| fun () -> + match stripTyparEqns ty with + | TType_anon (anonInfo, _) -> FSharpAnonRecordTypeDetails(cenv, anonInfo) + | _ -> invalidOp "not an anonymous record type" + member __.IsGenericParameter = protect <| fun () -> match stripTyparEqns ty with @@ -2117,6 +2179,7 @@ and FSharpType(cenv, ty:TType) = | TType_tuple (_, l1) -> 10400 + List.sumBy hashType l1 | TType_fun (dty, rty) -> 10500 + hashType dty + hashType rty | TType_measure _ -> 10600 + | TType_anon (_,l1) -> 10800 + List.sumBy hashType l1 hashType ty member x.Format(denv: FSharpDisplayContext) = diff --git a/src/fsharp/symbols/Symbols.fsi b/src/fsharp/symbols/Symbols.fsi index 7b7f565fdcf..3f3a3f0e0eb 100644 --- a/src/fsharp/symbols/Symbols.fsi +++ b/src/fsharp/symbols/Symbols.fsi @@ -401,7 +401,20 @@ and [] public FSharpUnionCase = /// Indicates if the union case is for a type in an unresolved assembly member IsUnresolved : bool +/// A subtype of FSharpSymbol that represents a record or union case field as seen by the F# language +and [] public FSharpAnonRecordTypeDetails = + + /// The assembly where the compiled form of the anonymous type is defined + member Assembly : FSharpAssembly + + /// Names of any enclosing types of the compiled form of the anonymous type (if the anonymous type was defined as a nested type) + member EnclosingCompiledTypeNames : string list + + /// The name of the compiled form of the anonymous type + member CompiledName : string + /// The sorted labels of the anonymous type + member SortedFieldNames : string[] /// A subtype of FSharpSymbol that represents a record or union case field as seen by the F# language and [] public FSharpField = @@ -410,8 +423,14 @@ and [] public FSharpField = internal new : SymbolEnv * RecdFieldRef -> FSharpField internal new : SymbolEnv * UnionCaseRef * int -> FSharpField - /// Get the declaring entity of this field - member DeclaringEntity: FSharpEntity + /// Get the declaring entity of this field, if any. Fields from anonymous types do not have a declaring entity + member DeclaringEntity: FSharpEntity option + + /// Is this a field from an anonymous record type? + member IsAnonRecordField: bool + + /// If the field is from an anonymous record type then get the details of the field including the index in the sorted array of fields + member AnonRecordFieldDetails: FSharpAnonRecordTypeDetails * FSharpType[] * int /// Indicates if the field is declared 'static' member IsMutable: bool @@ -934,6 +953,12 @@ and [] public FSharpType = /// Indicates if the type is a function type. The GenericArguments property returns the domain and range of the function type. member IsFunctionType : bool + /// Indicates if the type is an anonymous record type. The GenericArguments property returns the type instantiation of the anonymous record type + member IsAnonRecordType: bool + + /// Get the details of the anonymous record type. + member AnonRecordTypeDetails: FSharpAnonRecordTypeDetails + /// Indicates if the type is a variable type, whether declared, generalized or an inference type parameter member IsGenericParameter : bool diff --git a/src/fsharp/tast.fs b/src/fsharp/tast.fs index 3f5adf7a634..2653a9809bd 100644 --- a/src/fsharp/tast.fs +++ b/src/fsharp/tast.fs @@ -270,8 +270,8 @@ type TyparKind = member x.AttrName = match x with - | TyparKind.Type -> None - | TyparKind.Measure -> Some "Measure" + | TyparKind.Type -> ValueNone + | TyparKind.Measure -> ValueSome "Measure" //[] //member x.DebugText = x.ToString() @@ -480,10 +480,11 @@ let KeyTyconByDemangledNameAndArity nm (typars: _ list) x = /// Generic types can be accessed either by 'List' or 'List`1'. This lists both keys. The second form should really be deprecated. let KeyTyconByAccessNames nm x = - if IsMangledGenericName nm then - let dnm = DemangleGenericTypeName nm + match TryDemangleGenericNameAndPos nm with + | ValueSome pos -> + let dnm = DemangleGenericTypeNameWithPos pos nm [| KeyValuePair(nm,x); KeyValuePair(dnm,x) |] - else + | _ -> [| KeyValuePair(nm,x) |] type ModuleOrNamespaceKind = @@ -965,14 +966,14 @@ and /// Represents a type definition, exception definition, module definition or /// Get the union cases and other union-type information for a type, if any member x.UnionTypeInfo = match x.TypeReprInfo with - | TUnionRepr x -> Some x - | _ -> None + | TUnionRepr x -> ValueSome x + | _ -> ValueNone /// Get the union cases for a type, if any member x.UnionCasesArray = match x.UnionTypeInfo with - | Some x -> x.CasesTable.CasesByIndex - | None -> [| |] + | ValueSome x -> x.CasesTable.CasesByIndex + | ValueNone -> [| |] /// Get the union cases for a type, if any, as a list member x.UnionCasesAsList = x.UnionCasesArray |> Array.toList @@ -980,8 +981,8 @@ and /// Represents a type definition, exception definition, module definition or /// Get a union case of a type by name member x.GetUnionCaseByName n = match x.UnionTypeInfo with - | Some x -> NameMap.tryFind n x.CasesTable.CasesByName - | None -> None + | ValueSome x -> NameMap.tryFind n x.CasesTable.CasesByName + | ValueNone -> None /// Create a new entity with empty, unlinked data. Only used during unpickling of F# metadata. @@ -1900,7 +1901,7 @@ and [] |> List.tryFind (fun v -> match key.TypeForLinkage with | None -> true | Some keyTy -> ccu.MemberSignatureEquality(keyTy,v.Type)) - |> ValueOption.ofOption + |> ValueOptionInternal.ofOption /// Get a table of values indexed by logical name member mtyp.AllValsByLogicalName = @@ -2395,6 +2396,9 @@ and /// isSetProp -- indicates if this is a set of a record field | FSRecdFieldSln of TypeInst * RecdFieldRef * bool + /// Indicates a trait is solved by an F# anonymous record field. + | FSAnonRecdFieldSln of AnonRecdTypeInfo * TypeInst * int + /// ILMethSln(ty, extOpt, ilMethodRef, minst) /// /// Indicates a trait is solved by a .NET method. @@ -3045,13 +3049,12 @@ and static member TryDerefEntityPath(ccu: CcuThunk, path:string[], i:int, entity:Entity) = if i >= path.Length then ValueSome entity else - let next = entity.ModuleOrNamespaceType.AllEntitiesByCompiledAndLogicalMangledNames.TryFind(path.[i]) - match next with - | Some res -> NonLocalEntityRef.TryDerefEntityPath(ccu, path, (i+1), res) + match entity.ModuleOrNamespaceType.AllEntitiesByCompiledAndLogicalMangledNames.TryGetValue path.[i] with + | true, res -> NonLocalEntityRef.TryDerefEntityPath(ccu, path, (i+1), res) #if !NO_EXTENSIONTYPING - | None -> NonLocalEntityRef.TryDerefEntityPathViaProvidedType(ccu, path, i, entity) + | _ -> NonLocalEntityRef.TryDerefEntityPathViaProvidedType(ccu, path, i, entity) #else - | None -> ValueNone + | _ -> ValueNone #endif #if !NO_EXTENSIONTYPING @@ -3260,7 +3263,7 @@ and ValueSome tcr.binding /// Is the destination assembly available? - member tcr.CanDeref = tcr.TryDeref.IsSome + member tcr.CanDeref = ValueOptionInternal.isSome tcr.TryDeref /// Gets the data indicating the compiled representation of a type or module in terms of Abstract IL data structures. member x.CompiledRepresentation = x.Deref.CompiledRepresentation @@ -3811,7 +3814,7 @@ and | None -> error(InternalError(sprintf "union case %s not found in type %s" x.CaseName x.TyconRef.LogicalName, x.TyconRef.Range)) /// Try to dereference the reference - member x.TryUnionCase = x.TyconRef.TryDeref |> ValueOption.bind (fun tcref -> tcref.GetUnionCaseByName x.CaseName |> ValueOption.ofOption) + member x.TryUnionCase = x.TyconRef.TryDeref |> ValueOptionInternal.bind (fun tcref -> tcref.GetUnionCaseByName x.CaseName |> ValueOptionInternal.ofOption) /// Get the attributes associated with the union case member x.Attribs = x.UnionCase.Attribs @@ -3870,7 +3873,7 @@ and | None -> error(InternalError(sprintf "field %s not found in type %s" id tcref.LogicalName, tcref.Range)) /// Try to dereference the reference - member x.TryRecdField = x.TyconRef.TryDeref |> ValueOption.bind (fun tcref -> tcref.GetFieldByName x.FieldName |> ValueOption.ofOption) + member x.TryRecdField = x.TyconRef.TryDeref |> ValueOptionInternal.bind (fun tcref -> tcref.GetFieldByName x.FieldName |> ValueOptionInternal.ofOption) /// Get the attributes associated with the compiled property of the record field member x.PropertyAttribs = x.RecdField.PropertyAttribs @@ -3915,6 +3918,11 @@ and /// Indicates the type is built from a named type and a number of type arguments | TType_app of TyconRef * TypeInst + /// TType_anon + /// + /// Indicates the type is an anonymous record type whose compiled representation is located in the given assembly + | TType_anon of AnonRecdTypeInfo * TType list + /// TType_tuple(elementTypes). /// /// Indicates the type is a tuple type. elementTypes must be of length 2 or greater. @@ -3945,6 +3953,7 @@ and | TType_forall (_tps, ty) -> ty.GetAssemblyName() | TType_app (tcref, _tinst) -> tcref.CompilationPath.ILScopeRef.QualifiedName | TType_tuple (_tupInfo, _tinst) -> "" + | TType_anon (anonInfo, _tinst) -> defaultArg anonInfo.Assembly.QualifiedName "" | TType_fun (_d,_r) -> "" | TType_measure _ms -> "" | TType_var tp -> tp.Solution |> function Some sln -> sln.GetAssemblyName() | None -> "" @@ -3963,7 +3972,12 @@ and (match tupInfo with | TupInfo.Const false -> "" | TupInfo.Const true -> "struct ") - + String.concat "," (List.map string tinst) + ")" + + String.concat "," (List.map string tinst) + | TType_anon (anonInfo, tinst) -> + (match anonInfo.TupInfo with + | TupInfo.Const false -> "" + | TupInfo.Const true -> "struct ") + + "{|" + String.concat "," (Seq.map2 (fun nm ty -> nm + " " + string ty + ";") anonInfo.SortedNames tinst) + ")" + "|}" | TType_fun (d,r) -> "(" + string d + " -> " + string r + ")" | TType_ucase (uc,tinst) -> "ucase " + uc.CaseName + (match tinst with [] -> "" | tys -> "<" + String.concat "," (List.map string tys) + ">") | TType_var tp -> @@ -3975,7 +3989,50 @@ and and TypeInst = TType list and TTypes = TType list - +and [] AnonRecdTypeInfo = + // Mutability for pickling/unpickling only + { mutable Assembly: CcuThunk + mutable TupInfo: TupInfo + mutable SortedIds: Ident[] + mutable Stamp: Stamp + mutable SortedNames: string[] } + + /// Create an AnonRecdTypeInfo from the basic data + static member Create(ccu: CcuThunk, tupInfo, ids: Ident[]) = + let sortedIds = ids |> Array.sortBy (fun id -> id.idText) + // Hash all the data to form a unique stamp + let stamp = + sha1HashInt64 + [| for c in ccu.AssemblyName do yield byte c; yield byte (int32 c >>> 8); + match tupInfo with + | TupInfo.Const b -> yield (if b then 0uy else 1uy) + for id in sortedIds do + for c in id.idText do yield byte c; yield byte (int32 c >>> 8) |] + let sortedNames = Array.map textOfId sortedIds + { Assembly = ccu; TupInfo = tupInfo; SortedIds = sortedIds; Stamp = stamp; SortedNames = sortedNames } + + /// Get the ILTypeRef for the generated type implied by the anonymous type + member x.ILTypeRef = + let ilTypeName = sprintf "<>f__AnonymousType%s%u`%d'" (match x.TupInfo with TupInfo.Const b -> if b then "1000" else "") (uint32 x.Stamp) x.SortedIds.Length + mkILTyRef(x.Assembly.ILScopeRef,ilTypeName) + + static member NewUnlinked() : AnonRecdTypeInfo = + { Assembly = Unchecked.defaultof<_> + TupInfo = Unchecked.defaultof<_> + SortedIds = Unchecked.defaultof<_> + Stamp = Unchecked.defaultof<_> + SortedNames = Unchecked.defaultof<_> } + + member x.Link d = + let sortedNames = Array.map textOfId d.SortedIds + x.Assembly <- d.Assembly + x.TupInfo <- d.TupInfo + x.SortedIds <- d.SortedIds + x.Stamp <- d.Stamp + x.SortedNames <- sortedNames + + member x.IsLinked = (match x.SortedIds with null -> true | _ -> false) + and [] TupInfo = /// Some constant, e.g. true or false for tupInfo | Const of bool @@ -4201,9 +4258,10 @@ and /// Try to resolve a path into the CCU by referencing the .NET/CLI type forwarder table of the CCU member ccu.TryForward(nlpath:string[],item:string) : EntityRef option = ccu.EnsureDerefable(nlpath) - match ccu.TypeForwarders.TryFind(nlpath,item) with - | Some entity -> Some(entity.Force()) - | None -> None + let key = nlpath,item + match ccu.TypeForwarders.TryGetValue key with + | true, entity -> Some(entity.Force()) + | _ -> None //printfn "trying to forward %A::%s from ccu '%s', res = '%A'" p n ccu.AssemblyName res.IsSome /// Used to make forward calls into the type/assembly loader when comparing member signatures during linking @@ -4653,6 +4711,12 @@ and /// An operation representing the creation of a tuple value | Tuple of TupInfo + /// An operation representing the creation of an anonymous record + | AnonRecd of AnonRecdTypeInfo + + /// An operation representing the get of a property from an anonymous record + | AnonRecdGet of AnonRecdTypeInfo * int + /// An operation representing the creation of an array value | Array @@ -4964,7 +5028,7 @@ and and [] TypedImplFile = - | TImplFile of QualifiedNameOfFile * ScopedPragma list * ModuleOrNamespaceExprWithSig * bool * bool + | TImplFile of QualifiedNameOfFile * ScopedPragma list * ModuleOrNamespaceExprWithSig * bool * bool * StampMap [] member x.DebugText = x.ToString() @@ -5138,6 +5202,7 @@ let arityOfVal (v:Val) = (match v.ValReprInfo with None -> ValReprInfo.emptyValD let tupInfoRef = TupInfo.Const false let tupInfoStruct = TupInfo.Const true +let mkTupInfo b = if b then tupInfoStruct else tupInfoRef let structnessDefault = false let mkRawRefTupleTy tys = TType_tuple (tupInfoRef, tys) let mkRawStructTupleTy tys = TType_tuple (tupInfoStruct, tys) @@ -5147,9 +5212,9 @@ let mkRawStructTupleTy tys = TType_tuple (tupInfoStruct, tys) // make up the entire compilation unit //--------------------------------------------------------------------------- -let mapTImplFile f (TImplFile(fragName,pragmas,moduleExpr,hasExplicitEntryPoint,isScript)) = TImplFile(fragName, pragmas,f moduleExpr,hasExplicitEntryPoint,isScript) -let mapAccImplFile f z (TImplFile(fragName,pragmas,moduleExpr,hasExplicitEntryPoint,isScript)) = let moduleExpr,z = f z moduleExpr in TImplFile(fragName,pragmas,moduleExpr,hasExplicitEntryPoint,isScript), z -let foldTImplFile f z (TImplFile(_,_,moduleExpr,_,_)) = f z moduleExpr +let mapTImplFile f (TImplFile(fragName,pragmas,moduleExpr,hasExplicitEntryPoint,isScript,anonRecdTypes)) = TImplFile(fragName, pragmas,f moduleExpr,hasExplicitEntryPoint,isScript,anonRecdTypes) +let mapAccImplFile f z (TImplFile(fragName,pragmas,moduleExpr,hasExplicitEntryPoint,isScript,anonRecdTypes)) = let moduleExpr,z = f z moduleExpr in TImplFile(fragName,pragmas,moduleExpr,hasExplicitEntryPoint,isScript,anonRecdTypes), z +let foldTImplFile f z (TImplFile(_,_,moduleExpr,_,_,_)) = f z moduleExpr //--------------------------------------------------------------------------- // Equality relations on locally defined things @@ -5425,7 +5490,7 @@ let fslibValRefEq fslibCcu vref1 vref2 = // is not significant nlr1.ItemKey.PartialKey = nm2.PartialKey && fslibRefEq nlr1.EnclosingEntity.nlr pp2 - | None -> + | _ -> false // Note: I suspect this private-to-private reference comparison is not needed | (VRefLocal e1, VRefLocal e2) -> @@ -5449,9 +5514,9 @@ let primEntityRefEq compilingFslib fslibCcu (x : EntityRef) (y : EntityRef) = // The tcrefs may have forwarders. If they may possibly be equal then resolve them to get their canonical references // and compare those using pointer equality. (not (nonLocalRefDefinitelyNotEq x.nlr y.nlr) && - let v1 = x.TryDeref - let v2 = y.TryDeref - v1.IsSome && v2.IsSome && v1.Value === v2.Value)) then + match x.TryDeref with + | ValueSome v1 -> match y.TryDeref with ValueSome v2 -> v1 === v2 | _ -> false + | _ -> match y.TryDeref with ValueNone -> true | _ -> false)) then true else compilingFslib && fslibEntityRefEq fslibCcu x y @@ -5475,9 +5540,9 @@ let primValRefEq compilingFslib fslibCcu (x : ValRef) (y : ValRef) = else (// Use TryDeref to guard against the platforms/times when certain F# language features aren't available, // e.g. CompactFramework doesn't have support for quotations. - let v1 = x.TryDeref - let v2 = y.TryDeref - v1.IsSome && v2.IsSome && v1.Value === v2.Value) + match x.TryDeref with + | ValueSome v1 -> match y.TryDeref with ValueSome v2 -> v1 === v2 | _ -> false + | _ -> match y.TryDeref with ValueNone -> true | _ -> false) || (if compilingFslib then fslibValRefEq fslibCcu x y else false) //--------------------------------------------------------------------------- @@ -5721,13 +5786,13 @@ let CombineCcuContentFragments m l = let tab2 = mty2.AllEntitiesByLogicalMangledName let entities = [ for e1 in mty1.AllEntities do - match tab2.TryFind e1.LogicalName with - | Some e2 -> yield CombineEntites path e1 e2 - | None -> yield e1 + match tab2.TryGetValue e1.LogicalName with + | true, e2 -> yield CombineEntites path e1 e2 + | _ -> yield e1 for e2 in mty2.AllEntities do - match tab1.TryFind e2.LogicalName with - | Some _ -> () - | None -> yield e2 ] + match tab1.TryGetValue e2.LogicalName with + | true, _ -> () + | _ -> yield e2 ] let vals = QueueList.append mty1.AllValsAndMembers mty2.AllValsAndMembers @@ -5777,3 +5842,4 @@ let FSharpOptimizationDataResourceName2 = "FSharpOptimizationInfo." let FSharpSignatureDataResourceName2 = "FSharpSignatureInfo." + diff --git a/src/fsharp/xlf/FSComp.txt.cs.xlf b/src/fsharp/xlf/FSComp.txt.cs.xlf index a55f03383b1..4e1e34ea11c 100644 --- a/src/fsharp/xlf/FSComp.txt.cs.xlf +++ b/src/fsharp/xlf/FSComp.txt.cs.xlf @@ -1,4 +1,4 @@ - + @@ -109,7 +109,7 @@ All branches of a pattern match expression must return values of the same type as the first branch, which here is '{0}'. This branch returns a value of type '{1}'. - Všechny větve výrazu porovnání vzorů musí vracet hodnoty stejného typu. První větev vrátila hodnotu typu {0}, ale tato větev vrátila hodnotu typu {1}. + Všechny větve výrazu porovnávacího vzorku musí vracet hodnoty stejného typu. První větev vrátila hodnotu typu {0}, ale tato větev vrátila hodnotu typu {1}. @@ -1949,7 +1949,7 @@ Syntax error - Chyba syntaxe + chyba syntaxe @@ -4069,7 +4069,7 @@ Copyright (c) Microsoft Corporation. All Rights Reserved. - Copyright (c) Microsoft Corporation. Všechna práva vyhrazena. + Copyright (C) Microsoft Corporation. Všechna práva vyhrazena. @@ -4544,7 +4544,7 @@ argument - argument + Argument @@ -5123,13 +5123,13 @@ - Type parameters must be placed directly adjacent to the type name, e.g. \"type C<'T>\", not type \"C <'T>\" - Parametry typu je potřeba zadat bezprostředně za název typu, třeba \"type C<'T>\", ne type \"C <'T>\". + Remove spaces between the type name and type parameter, e.g. \"type C<'T>\", not type \"C <'T>\". Type parameters must be placed directly adjacent to the type name. + Parametry typu je potřeba zadat bezprostředně za název typu, třeba \"type C<'T>\", ne type \"C <'T>\". - Type arguments must be placed directly adjacent to the type name, e.g. \"C<'T>\", not \"C <'T>\" - Argumenty typu je potřeba zadat bezprostředně za název typu, třeba \"C<'T>\", ne \"C <'T>\". + Remove spaces between the type name and type parameter, e.g. \"C<'T>\", not \"C <'T>\". Type parameters must be placed directly adjacent to the type name. + Argumenty typu je potřeba zadat bezprostředně za název typu, třeba \"C<'T>\", ne \"C <'T>\". @@ -6328,8 +6328,8 @@ - Union case/exception '{0}' does not have field named '{1}'. - Výjimka nebo případ typu union {0} nemá pole s názvem {1}. + The union case '{0}' does not have a field named '{1}'. + Výjimka nebo případ typu union {0} nemá pole s názvem {1}. @@ -7057,9 +7057,54 @@ Adresa hodnoty vrácená výrazem nejde převzít. Před převzetím adresy přiřaďte vrácenou hodnotu hodnotě s vazbou na klauzuli Let. - - The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. - The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + + Unmatched '{{|' + Unmatched '{{|' + + + + anonymous record field + anonymous record field + + + + The exception '{0}' does not have a field named '{1}'. + The exception '{0}' does not have a field named '{1}'. + + + + Active patterns do not have fields. This syntax is invalid. + Active patterns do not have fields. This syntax is invalid. + + + + The constructor does not have a field named '{0}'. + The constructor does not have a field named '{0}'. + + + + Two anonymous record types are from different assemblies '{0}' and '{1}' + Two anonymous record types are from different assemblies '{0}' and '{1}' + + + + Two anonymous record types have mismatched sets of field names '{0}' and '{1}' + Two anonymous record types have mismatched sets of field names '{0}' and '{1}' + + + + Cannot call the byref extension method '{0}. The first parameter requires the value to be mutable or a non-readonly byref type. + Cannot call the byref extension method '{0}. The first parameter requires the value to be mutable or a non-readonly byref type. + + + + Byref types are not allowed to have optional type extensions. + Byref types are not allowed to have optional type extensions. + + + + Cannot partially apply the extension method '{0}' because the first parameter is a byref type. + Cannot partially apply the extension method '{0}' because the first parameter is a byref type. @@ -7067,6 +7112,31 @@ This type does not inherit Attribute, it will not work correctly with other .NET languages. + + Invalid anonymous record expression + Invalid anonymous record expression + + + + Invalid anonymous record type + Invalid anonymous record type + + + + The input to a copy-and-update expression that creates an anonymous record must be either an anonymous record or a record + The input to a copy-and-update expression that creates an anonymous record must be either an anonymous record or a record + + + + The parameter '{0}' has an invalid type '{1}'. This is not permitted by the rules of Common IL. + The parameter '{0}' has an invalid type '{1}'. This is not permitted by the rules of Common IL. + + + + The function or method has an invalid return type '{0}'. This is not permitted by the rules of Common IL. + The function or method has an invalid return type '{0}'. This is not permitted by the rules of Common IL. + + \ No newline at end of file diff --git a/src/fsharp/xlf/FSComp.txt.de.xlf b/src/fsharp/xlf/FSComp.txt.de.xlf index f1694c10973..a0bf99f05bb 100644 --- a/src/fsharp/xlf/FSComp.txt.de.xlf +++ b/src/fsharp/xlf/FSComp.txt.de.xlf @@ -1,4 +1,4 @@ - + @@ -109,7 +109,7 @@ All branches of a pattern match expression must return values of the same type as the first branch, which here is '{0}'. This branch returns a value of type '{1}'. - Alle Branches eines Musterübereinstimmungsausdrucks müssen Werte des gleichen Typs zurückgeben. Der erste Branch hat einen Wert vom Typ "{0}" zurückgegeben, aber dieser Branch gab einen Wert vom Typ "{1}" zurück. + Alle Verzweigungen eines Musterübereinstimmungsausdrucks müssen Werte des gleichen Typs zurückgeben. Die erste Verzweigung hat einen Wert vom Typ "{0}", diese Verzweigung jedoch einen Wert vom Typ "{1}" zurückgegeben. @@ -4069,7 +4069,7 @@ Copyright (c) Microsoft Corporation. All Rights Reserved. - Copyright (c) Microsoft Corporation. Alle Rechte vorbehalten. + Copyright (C) Microsoft Corporation. Alle Rechte vorbehalten. @@ -5123,13 +5123,13 @@ - Type parameters must be placed directly adjacent to the type name, e.g. \"type C<'T>\", not type \"C <'T>\" - Typparameter müssen direkt neben dem Typnamen platziert werden, z.B. \"type C<'T>\", nicht type \"C <'T>\". + Remove spaces between the type name and type parameter, e.g. \"type C<'T>\", not type \"C <'T>\". Type parameters must be placed directly adjacent to the type name. + Typparameter müssen direkt neben dem Typnamen platziert werden, z.B. \"type C<'T>\", nicht type \"C <'T>\". - Type arguments must be placed directly adjacent to the type name, e.g. \"C<'T>\", not \"C <'T>\" - Typargumente müssen direkt neben dem Typnamen platziert werden. Beispiel: \"C<'T>\", nicht \"C <'T>\". + Remove spaces between the type name and type parameter, e.g. \"C<'T>\", not \"C <'T>\". Type parameters must be placed directly adjacent to the type name. + Typargumente müssen direkt neben dem Typnamen platziert werden. Beispiel: \"C<'T>\", nicht \"C <'T>\". @@ -6328,8 +6328,8 @@ - Union case/exception '{0}' does not have field named '{1}'. - Union-Fall/Ausnahme '{0}' verfügt nicht über ein Feld mit dem Namen '{1}'. + The union case '{0}' does not have a field named '{1}'. + Union-Fall/Ausnahme '{0}' verfügt nicht über ein Feld mit dem Namen '{1}'. @@ -7057,9 +7057,54 @@ Die Adresse des über den Ausdruck zurückgegebenen Werts kann nicht abgerufen werden. Weisen Sie den zurückgegebenen Wert einem let-bound-Wert zu, bevor Sie die Adresse abrufen. - - The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. - The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + + Unmatched '{{|' + Unmatched '{{|' + + + + anonymous record field + anonymous record field + + + + The exception '{0}' does not have a field named '{1}'. + The exception '{0}' does not have a field named '{1}'. + + + + Active patterns do not have fields. This syntax is invalid. + Active patterns do not have fields. This syntax is invalid. + + + + The constructor does not have a field named '{0}'. + The constructor does not have a field named '{0}'. + + + + Two anonymous record types are from different assemblies '{0}' and '{1}' + Two anonymous record types are from different assemblies '{0}' and '{1}' + + + + Two anonymous record types have mismatched sets of field names '{0}' and '{1}' + Two anonymous record types have mismatched sets of field names '{0}' and '{1}' + + + + Cannot call the byref extension method '{0}. The first parameter requires the value to be mutable or a non-readonly byref type. + Cannot call the byref extension method '{0}. The first parameter requires the value to be mutable or a non-readonly byref type. + + + + Byref types are not allowed to have optional type extensions. + Byref types are not allowed to have optional type extensions. + + + + Cannot partially apply the extension method '{0}' because the first parameter is a byref type. + Cannot partially apply the extension method '{0}' because the first parameter is a byref type. @@ -7067,6 +7112,31 @@ This type does not inherit Attribute, it will not work correctly with other .NET languages. + + Invalid anonymous record expression + Invalid anonymous record expression + + + + Invalid anonymous record type + Invalid anonymous record type + + + + The input to a copy-and-update expression that creates an anonymous record must be either an anonymous record or a record + The input to a copy-and-update expression that creates an anonymous record must be either an anonymous record or a record + + + + The parameter '{0}' has an invalid type '{1}'. This is not permitted by the rules of Common IL. + The parameter '{0}' has an invalid type '{1}'. This is not permitted by the rules of Common IL. + + + + The function or method has an invalid return type '{0}'. This is not permitted by the rules of Common IL. + The function or method has an invalid return type '{0}'. This is not permitted by the rules of Common IL. + + \ No newline at end of file diff --git a/src/fsharp/xlf/FSComp.txt.en.xlf b/src/fsharp/xlf/FSComp.txt.en.xlf index 214bc542ec4..9af1fa19c42 100644 --- a/src/fsharp/xlf/FSComp.txt.en.xlf +++ b/src/fsharp/xlf/FSComp.txt.en.xlf @@ -5123,13 +5123,13 @@ - Type parameters must be placed directly adjacent to the type name, e.g. \"type C<'T>\", not type \"C <'T>\" - Type parameters must be placed directly adjacent to the type name, e.g. \"type C<'T>\", not type \"C <'T>\" + Remove spaces between the type name and type parameter, e.g. \"type C<'T>\", not type \"C <'T>\". Type parameters must be placed directly adjacent to the type name. + Remove spaces between the type name and type parameter, e.g. \"type C<'T>\", not type \"C <'T>\". Type parameters must be placed directly adjacent to the type name. - Type arguments must be placed directly adjacent to the type name, e.g. \"C<'T>\", not \"C <'T>\" - Type arguments must be placed directly adjacent to the type name, e.g. \"C<'T>\", not \"C <'T>\" + Remove spaces between the type name and type parameter, e.g. \"C<'T>\", not \"C <'T>\". Type parameters must be placed directly adjacent to the type name. + Remove spaces between the type name and type parameter, e.g. \"C<'T>\", not \"C <'T>\". Type parameters must be placed directly adjacent to the type name. @@ -6328,8 +6328,8 @@ - Union case/exception '{0}' does not have field named '{1}'. - Union case/exception '{0}' does not have field named '{1}'. + The union case '{0}' does not have a field named '{1}'. + The union case '{0}' does not have a field named '{1}'. @@ -7057,9 +7057,54 @@ Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. - - The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. - The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + + Unmatched '{{|' + Unmatched '{{|' + + + + anonymous record field + anonymous record field + + + + The exception '{0}' does not have a field named '{1}'. + The exception '{0}' does not have a field named '{1}'. + + + + Active patterns do not have fields. This syntax is invalid. + Active patterns do not have fields. This syntax is invalid. + + + + The constructor does not have a field named '{0}'. + The constructor does not have a field named '{0}'. + + + + Two anonymous record types are from different assemblies '{0}' and '{1}' + Two anonymous record types are from different assemblies '{0}' and '{1}' + + + + Two anonymous record types have mismatched sets of field names '{0}' and '{1}' + Two anonymous record types have mismatched sets of field names '{0}' and '{1}' + + + + Cannot call the byref extension method '{0}. The first parameter requires the value to be mutable or a non-readonly byref type. + Cannot call the byref extension method '{0}. The first parameter requires the value to be mutable or a non-readonly byref type. + + + + Byref types are not allowed to have optional type extensions. + Byref types are not allowed to have optional type extensions. + + + + Cannot partially apply the extension method '{0}' because the first parameter is a byref type. + Cannot partially apply the extension method '{0}' because the first parameter is a byref type. @@ -7067,6 +7112,31 @@ This type does not inherit Attribute, it will not work correctly with other .NET languages. + + Invalid anonymous record expression + Invalid anonymous record expression + + + + Invalid anonymous record type + Invalid anonymous record type + + + + The input to a copy-and-update expression that creates an anonymous record must be either an anonymous record or a record + The input to a copy-and-update expression that creates an anonymous record must be either an anonymous record or a record + + + + The parameter '{0}' has an invalid type '{1}'. This is not permitted by the rules of Common IL. + The parameter '{0}' has an invalid type '{1}'. This is not permitted by the rules of Common IL. + + + + The function or method has an invalid return type '{0}'. This is not permitted by the rules of Common IL. + The function or method has an invalid return type '{0}'. This is not permitted by the rules of Common IL. + + \ No newline at end of file diff --git a/src/fsharp/xlf/FSComp.txt.es.xlf b/src/fsharp/xlf/FSComp.txt.es.xlf index e553d7e8149..a4110506d8a 100644 --- a/src/fsharp/xlf/FSComp.txt.es.xlf +++ b/src/fsharp/xlf/FSComp.txt.es.xlf @@ -1,4 +1,4 @@ - + @@ -109,7 +109,7 @@ All branches of a pattern match expression must return values of the same type as the first branch, which here is '{0}'. This branch returns a value of type '{1}'. - Todas las ramas de una expresión de coincidencia de patrón deben devolver valores del mismo tipo. La primera rama devolvió un valor de tipo "{0}", pero esta rama devolvió un valor de tipo "\{1 \}". + Todas las ramas de una expresión de coincidencia de patrón deben devolver valores del mismo tipo. La primera rama devuelve un valor de tipo "{0}", pero esta rama devuelve un valor de tipo "{1}". @@ -1949,7 +1949,7 @@ Syntax error - Error de sintaxis + error de sintaxis @@ -4069,7 +4069,7 @@ Copyright (c) Microsoft Corporation. All Rights Reserved. - (C) Microsoft Corporation. Todos los derechos reservados. + Copyright (C) Microsoft Corporation. Todos los derechos reservados. @@ -4289,7 +4289,7 @@ Read response file for more options - Leer el archivo de respuesta para ver más opciones + Leer el archivo de respuesta para obtener más opciones @@ -4519,7 +4519,7 @@ field - campo + Campo @@ -4529,12 +4529,12 @@ property - propiedad + Propiedad extension - extensión + Extensión @@ -4544,7 +4544,7 @@ argument - argumento + Argumento @@ -5123,13 +5123,13 @@ - Type parameters must be placed directly adjacent to the type name, e.g. \"type C<'T>\", not type \"C <'T>\" - Los parámetros de tipo se deben colocar directamente adyacentes al nombre de tipo; por ejemplo, \"type C<'T>\", no type \"C <'T>\". + Remove spaces between the type name and type parameter, e.g. \"type C<'T>\", not type \"C <'T>\". Type parameters must be placed directly adjacent to the type name. + Los parámetros de tipo se deben colocar directamente adyacentes al nombre de tipo; por ejemplo, \"type C<'T>\", no type \"C <'T>\". - Type arguments must be placed directly adjacent to the type name, e.g. \"C<'T>\", not \"C <'T>\" - Los argumentos de tipo se deben colocar directamente adyacentes al nombre de tipo; por ejemplo, \"C<'T>\", no \"C <'T>\". + Remove spaces between the type name and type parameter, e.g. \"C<'T>\", not \"C <'T>\". Type parameters must be placed directly adjacent to the type name. + Los argumentos de tipo se deben colocar directamente adyacentes al nombre de tipo; por ejemplo, \"C<'T>\", no \"C <'T>\". @@ -5229,7 +5229,7 @@ The FieldOffset attribute can only be placed on members of types marked with the StructLayout(LayoutKind.Explicit) - El atributo FieldOffset sólo se puede colocar en miembros de tipos marcados con StructLayout(LayoutKind.Explicit) + El atributo FieldOffset solo se puede colocar en miembros de tipos marcados con StructLayout(LayoutKind.Explicit) @@ -6328,8 +6328,8 @@ - Union case/exception '{0}' does not have field named '{1}'. - La excepción o el caso de unión '{0}' no tiene un campo denominado '{1}'. + The union case '{0}' does not have a field named '{1}'. + La excepción o el caso de unión '{0}' no tiene un campo denominado '{1}'. @@ -7057,9 +7057,54 @@ No se puede tomar la dirección del valor devuelto de la expresión. Asigne el valor devuelto a un valor enlazado con let antes de tomar la dirección. - - The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. - The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + + Unmatched '{{|' + Unmatched '{{|' + + + + anonymous record field + anonymous record field + + + + The exception '{0}' does not have a field named '{1}'. + The exception '{0}' does not have a field named '{1}'. + + + + Active patterns do not have fields. This syntax is invalid. + Active patterns do not have fields. This syntax is invalid. + + + + The constructor does not have a field named '{0}'. + The constructor does not have a field named '{0}'. + + + + Two anonymous record types are from different assemblies '{0}' and '{1}' + Two anonymous record types are from different assemblies '{0}' and '{1}' + + + + Two anonymous record types have mismatched sets of field names '{0}' and '{1}' + Two anonymous record types have mismatched sets of field names '{0}' and '{1}' + + + + Cannot call the byref extension method '{0}. The first parameter requires the value to be mutable or a non-readonly byref type. + Cannot call the byref extension method '{0}. The first parameter requires the value to be mutable or a non-readonly byref type. + + + + Byref types are not allowed to have optional type extensions. + Byref types are not allowed to have optional type extensions. + + + + Cannot partially apply the extension method '{0}' because the first parameter is a byref type. + Cannot partially apply the extension method '{0}' because the first parameter is a byref type. @@ -7067,6 +7112,31 @@ This type does not inherit Attribute, it will not work correctly with other .NET languages. + + Invalid anonymous record expression + Invalid anonymous record expression + + + + Invalid anonymous record type + Invalid anonymous record type + + + + The input to a copy-and-update expression that creates an anonymous record must be either an anonymous record or a record + The input to a copy-and-update expression that creates an anonymous record must be either an anonymous record or a record + + + + The parameter '{0}' has an invalid type '{1}'. This is not permitted by the rules of Common IL. + The parameter '{0}' has an invalid type '{1}'. This is not permitted by the rules of Common IL. + + + + The function or method has an invalid return type '{0}'. This is not permitted by the rules of Common IL. + The function or method has an invalid return type '{0}'. This is not permitted by the rules of Common IL. + + \ No newline at end of file diff --git a/src/fsharp/xlf/FSComp.txt.fr.xlf b/src/fsharp/xlf/FSComp.txt.fr.xlf index ace9b0593e8..bddd70ea557 100644 --- a/src/fsharp/xlf/FSComp.txt.fr.xlf +++ b/src/fsharp/xlf/FSComp.txt.fr.xlf @@ -1,4 +1,4 @@ - + @@ -109,7 +109,7 @@ All branches of a pattern match expression must return values of the same type as the first branch, which here is '{0}'. This branch returns a value of type '{1}'. - Toutes les branches d'une expression comportant des critères spéciaux doivent retourner des valeurs du même type. La première branche a retourné une valeur de type '{0}', mais cette branche a retourné une valeur de type '{1}'. + Toutes les branches d'une expression de correspondance de modèle doivent retourner des valeurs du même type. La première branche a retourné une valeur de type « {0} », mais cette branche a retourné une valeur de type « {1} ». @@ -1949,7 +1949,7 @@ Syntax error - Erreur de syntaxe + erreur de syntaxe @@ -4069,7 +4069,7 @@ Copyright (c) Microsoft Corporation. All Rights Reserved. - Copyright (c) Microsoft Corporation. Tous droits réservés. + Copyright (C) Microsoft Corporation. Tous droits réservés. @@ -4519,7 +4519,7 @@ field - champ + Champ @@ -4534,7 +4534,7 @@ extension - extension + Extension @@ -4544,7 +4544,7 @@ argument - argument + Argument @@ -5123,13 +5123,13 @@ - Type parameters must be placed directly adjacent to the type name, e.g. \"type C<'T>\", not type \"C <'T>\" - Les paramètres de type doivent être directement adjacents au nom de type, par exemple \"type C<'T>\" et non type \"C <'T>\" + Remove spaces between the type name and type parameter, e.g. \"type C<'T>\", not type \"C <'T>\". Type parameters must be placed directly adjacent to the type name. + Les paramètres de type doivent être directement adjacents au nom de type, par exemple \"type C<'T>\" et non type \"C <'T>\" - Type arguments must be placed directly adjacent to the type name, e.g. \"C<'T>\", not \"C <'T>\" - Les arguments de type doivent être directement adjacents au nom de type, par exemple \"C<'T>\" et non \"C <'T>\" + Remove spaces between the type name and type parameter, e.g. \"C<'T>\", not \"C <'T>\". Type parameters must be placed directly adjacent to the type name. + Les arguments de type doivent être directement adjacents au nom de type, par exemple \"C<'T>\" et non \"C <'T>\" @@ -6328,8 +6328,8 @@ - Union case/exception '{0}' does not have field named '{1}'. - Le cas ou l'exception d'union '{0}' ne possède pas de champ nommé '{1}'. + The union case '{0}' does not have a field named '{1}'. + Le cas ou l'exception d'union '{0}' ne possède pas de champ nommé '{1}'. @@ -7057,9 +7057,54 @@ Impossible de prendre l'adresse de la valeur retournée par l'expression. Assignez la valeur retournée à une valeur liée à let avant de prendre l'adresse. - - The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. - The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + + Unmatched '{{|' + Unmatched '{{|' + + + + anonymous record field + anonymous record field + + + + The exception '{0}' does not have a field named '{1}'. + The exception '{0}' does not have a field named '{1}'. + + + + Active patterns do not have fields. This syntax is invalid. + Active patterns do not have fields. This syntax is invalid. + + + + The constructor does not have a field named '{0}'. + The constructor does not have a field named '{0}'. + + + + Two anonymous record types are from different assemblies '{0}' and '{1}' + Two anonymous record types are from different assemblies '{0}' and '{1}' + + + + Two anonymous record types have mismatched sets of field names '{0}' and '{1}' + Two anonymous record types have mismatched sets of field names '{0}' and '{1}' + + + + Cannot call the byref extension method '{0}. The first parameter requires the value to be mutable or a non-readonly byref type. + Cannot call the byref extension method '{0}. The first parameter requires the value to be mutable or a non-readonly byref type. + + + + Byref types are not allowed to have optional type extensions. + Byref types are not allowed to have optional type extensions. + + + + Cannot partially apply the extension method '{0}' because the first parameter is a byref type. + Cannot partially apply the extension method '{0}' because the first parameter is a byref type. @@ -7067,6 +7112,31 @@ This type does not inherit Attribute, it will not work correctly with other .NET languages. + + Invalid anonymous record expression + Invalid anonymous record expression + + + + Invalid anonymous record type + Invalid anonymous record type + + + + The input to a copy-and-update expression that creates an anonymous record must be either an anonymous record or a record + The input to a copy-and-update expression that creates an anonymous record must be either an anonymous record or a record + + + + The parameter '{0}' has an invalid type '{1}'. This is not permitted by the rules of Common IL. + The parameter '{0}' has an invalid type '{1}'. This is not permitted by the rules of Common IL. + + + + The function or method has an invalid return type '{0}'. This is not permitted by the rules of Common IL. + The function or method has an invalid return type '{0}'. This is not permitted by the rules of Common IL. + + \ No newline at end of file diff --git a/src/fsharp/xlf/FSComp.txt.it.xlf b/src/fsharp/xlf/FSComp.txt.it.xlf index da96371da26..0ea5fab97c6 100644 --- a/src/fsharp/xlf/FSComp.txt.it.xlf +++ b/src/fsharp/xlf/FSComp.txt.it.xlf @@ -1,4 +1,4 @@ - + @@ -1949,7 +1949,7 @@ Syntax error - Errore di sintassi + errore di sintassi @@ -3029,7 +3029,7 @@ Objects must be initialized by an object construction expression that calls an inherited object constructor and assigns a value to each field - Gli oggetti devono essere inizializzati da un'espressione di costruzione degli oggetti che chiama un costruttore di oggetti ereditato e assegna un valore a ogni campo + Gli oggetti devono essere inizializzati da un'espressione di costruzione degli oggetti che chiama un costruttore di oggetto ereditato e assegna un valore a ogni campo @@ -4069,7 +4069,7 @@ Copyright (c) Microsoft Corporation. All Rights Reserved. - Copyright (c) Microsoft Corporation. Tutti i diritti sono riservati. + Copyright (C) Microsoft Corporation. Tutti i diritti sono riservati. @@ -4289,7 +4289,7 @@ Read response file for more options - Legge il file di risposta per ulteriori opzioni + Per ulteriori opzioni, leggere il file di risposta @@ -4529,12 +4529,12 @@ property - proprietà + Proprietà. extension - estensione + Estensione @@ -4544,7 +4544,7 @@ argument - argomento + Argomento @@ -5123,13 +5123,13 @@ - Type parameters must be placed directly adjacent to the type name, e.g. \"type C<'T>\", not type \"C <'T>\" - I parametri di tipo devono trovarsi immediatamente accanto al nome del tipo, ad esempio \"type C<'T>\", non type \"C <'T>\" + Remove spaces between the type name and type parameter, e.g. \"type C<'T>\", not type \"C <'T>\". Type parameters must be placed directly adjacent to the type name. + I parametri di tipo devono trovarsi immediatamente accanto al nome del tipo, ad esempio \"type C<'T>\", non type \"C <'T>\" - Type arguments must be placed directly adjacent to the type name, e.g. \"C<'T>\", not \"C <'T>\" - Gli argomenti tipo devono trovarsi immediatamente accanto al nome del tipo, ad esempio \"C<'T>\", non \"C <'T>\" + Remove spaces between the type name and type parameter, e.g. \"C<'T>\", not \"C <'T>\". Type parameters must be placed directly adjacent to the type name. + Gli argomenti tipo devono trovarsi immediatamente accanto al nome del tipo, ad esempio \"C<'T>\", non \"C <'T>\" @@ -6328,8 +6328,8 @@ - Union case/exception '{0}' does not have field named '{1}'. - Il case di unione/eccezione '{0}' non contiene il campo denominato '{1}'. + The union case '{0}' does not have a field named '{1}'. + Il case di unione/eccezione '{0}' non contiene il campo denominato '{1}'. @@ -7057,9 +7057,54 @@ Non è possibile accettare l'indirizzo del valore restituito dall'espressione. Assegnare il valore restituito a un valore associato a let prima di accettare l'indirizzo. - - The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. - The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + + Unmatched '{{|' + Unmatched '{{|' + + + + anonymous record field + anonymous record field + + + + The exception '{0}' does not have a field named '{1}'. + The exception '{0}' does not have a field named '{1}'. + + + + Active patterns do not have fields. This syntax is invalid. + Active patterns do not have fields. This syntax is invalid. + + + + The constructor does not have a field named '{0}'. + The constructor does not have a field named '{0}'. + + + + Two anonymous record types are from different assemblies '{0}' and '{1}' + Two anonymous record types are from different assemblies '{0}' and '{1}' + + + + Two anonymous record types have mismatched sets of field names '{0}' and '{1}' + Two anonymous record types have mismatched sets of field names '{0}' and '{1}' + + + + Cannot call the byref extension method '{0}. The first parameter requires the value to be mutable or a non-readonly byref type. + Cannot call the byref extension method '{0}. The first parameter requires the value to be mutable or a non-readonly byref type. + + + + Byref types are not allowed to have optional type extensions. + Byref types are not allowed to have optional type extensions. + + + + Cannot partially apply the extension method '{0}' because the first parameter is a byref type. + Cannot partially apply the extension method '{0}' because the first parameter is a byref type. @@ -7067,6 +7112,31 @@ This type does not inherit Attribute, it will not work correctly with other .NET languages. + + Invalid anonymous record expression + Invalid anonymous record expression + + + + Invalid anonymous record type + Invalid anonymous record type + + + + The input to a copy-and-update expression that creates an anonymous record must be either an anonymous record or a record + The input to a copy-and-update expression that creates an anonymous record must be either an anonymous record or a record + + + + The parameter '{0}' has an invalid type '{1}'. This is not permitted by the rules of Common IL. + The parameter '{0}' has an invalid type '{1}'. This is not permitted by the rules of Common IL. + + + + The function or method has an invalid return type '{0}'. This is not permitted by the rules of Common IL. + The function or method has an invalid return type '{0}'. This is not permitted by the rules of Common IL. + + \ No newline at end of file diff --git a/src/fsharp/xlf/FSComp.txt.ja.xlf b/src/fsharp/xlf/FSComp.txt.ja.xlf index 65ace493654..cee24364394 100644 --- a/src/fsharp/xlf/FSComp.txt.ja.xlf +++ b/src/fsharp/xlf/FSComp.txt.ja.xlf @@ -109,7 +109,7 @@ All branches of a pattern match expression must return values of the same type as the first branch, which here is '{0}'. This branch returns a value of type '{1}'. - パターン マッチ式のすべてのブランチは、同じ型の値を返す必要があります。最初のブランチが返した値の型は '{0}' ですが、このブランチが返した値の型は '{1}' です。 + パターン一致式のすべてのブランチは同じ型の値を返す必要があります。最初のブランチは、型 '{0}' の値を返しましたが、このブランチは型 '{1}' の値を返しました。 @@ -209,7 +209,7 @@ Unrecognized privacy setting '{0}' for managed resource, valid options are 'public' and 'private' - マネージド リソースの認識されないプライバシー設定 '{0}'。有効なオプションは 'public' および 'private' です。 + マネージ リソースの認識されないプライバシー設定 '{0}'。有効なオプションは 'public' および 'private' です。 @@ -354,7 +354,7 @@ Error reading/writing metadata for the F# compiled DLL '{0}'. Was the DLL compiled with an earlier version of the F# compiler? (error: '{1}'). - F# でコンパイルした DLL '{0}' のメタデータの読み取り/書き込み中にエラーが発生しました。旧バージョンの F# コンパイラでコンパイルした DLL ですか? (エラー: '{1}') + F# でコンパイルした DLL '{0}' のメタデータの読み取り/書き込み中にエラーが発生しました。旧バージョンの F# コンパイラーでコンパイルした DLL ですか? (エラー: '{1}') @@ -1949,7 +1949,7 @@ Syntax error - 構文エラー + 構文エラーです @@ -2969,7 +2969,7 @@ The member '{0}' does not correspond to any abstract or virtual method available to override or implement. - メンバー '{0}' は、オーバーライドまたは実装に使用できるどの抽象メソッドまたは仮想メソッドにも対応していません。 + メンバー '{0}' は、無視または実装に使用できるどの抽象メソッドまたは仮想メソッドにも対応していません。 @@ -4069,7 +4069,7 @@ Copyright (c) Microsoft Corporation. All Rights Reserved. - Copyright (c) Microsoft Corporation. All Rights Reserved. + Copyright (C) Microsoft Corporation. All rights reserved. @@ -4279,7 +4279,7 @@ @@ -4434,7 +4434,7 @@ The command-line option '{0}' has been deprecated - コマンド ライン オプション '{0}' は非推奨になりました + コマンド ライン オプション '{0}' は使用されなくなりました @@ -4444,7 +4444,7 @@ The command-line option '{0}' has been deprecated. HTML document generation is now part of the F# Power Pack, via the tool FsHtmlDoc.exe. - コマンド ライン オプション '{0}' は非推奨になりました。HTML ドキュメントの生成は、F# Power Pack のツール FsHtmlDoc.exe で実行できるようになりました。 + コマンド ライン オプション '{0}' は使用されなくなりました。HTML ドキュメントの生成は、F# Power Pack のツール FsHtmlDoc.exe で実行できるようになりました。 @@ -5123,13 +5123,13 @@ - Type parameters must be placed directly adjacent to the type name, e.g. \"type C<'T>\", not type \"C <'T>\" - 型パラメーターと型名は隣接している必要があります。たとえば、type \"C <'T>\" ではなく \"type C<'T>\" と指定します。 + Remove spaces between the type name and type parameter, e.g. \"type C<'T>\", not type \"C <'T>\". Type parameters must be placed directly adjacent to the type name. + 型パラメーターと型名は隣接している必要があります。たとえば、type \"C <'T>\" ではなく \"type C<'T>\" と指定します。 - Type arguments must be placed directly adjacent to the type name, e.g. \"C<'T>\", not \"C <'T>\" - 型引数と型名は隣接している必要があります。たとえば、\"C <'T>\" ではなく \"C<'T>\" と指定します。 + Remove spaces between the type name and type parameter, e.g. \"C<'T>\", not \"C <'T>\". Type parameters must be placed directly adjacent to the type name. + 型引数と型名は隣接している必要があります。たとえば、\"C <'T>\" ではなく \"C<'T>\" と指定します。 @@ -5459,7 +5459,7 @@ Static linking may not include a mixed managed/unmanaged DLL - 静的リンクでは、混合マネージド/アンマネージド DLL がインクルードされない可能性があります + 静的リンクでは、混合マネージ/アンマネージ DLL がインクルードされない可能性があります @@ -6328,8 +6328,8 @@ - Union case/exception '{0}' does not have field named '{1}'. - 共用体ケース/例外 '{0}' には、'{1}' という名前のフィールドがありません。 + The union case '{0}' does not have a field named '{1}'. + 共用体ケース/例外 '{0}' には、'{1}' という名前のフィールドがありません。 @@ -6504,7 +6504,7 @@ The CallerMemberNameAttribute applied to parameter '{0}' will have no effect. It is overridden by the CallerFilePathAttribute. - パラメーター '{0}' に適用される CallerMemberNameAttribute は無効になります。CallerFilePathAttribute に上書きされます。 + パラメーター '{0}' に適用された CallerMemberNameAttribute は、CallerFilePathAttribute.によってオーバーライドされるため無効となります。 @@ -7057,9 +7057,54 @@ 式から返された値のアドレスを取得できません。アドレスを取得する前に、let でバインドされた値に戻り値を割り当ててください。 - - The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. - The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + + Unmatched '{{|' + Unmatched '{{|' + + + + anonymous record field + anonymous record field + + + + The exception '{0}' does not have a field named '{1}'. + The exception '{0}' does not have a field named '{1}'. + + + + Active patterns do not have fields. This syntax is invalid. + Active patterns do not have fields. This syntax is invalid. + + + + The constructor does not have a field named '{0}'. + The constructor does not have a field named '{0}'. + + + + Two anonymous record types are from different assemblies '{0}' and '{1}' + Two anonymous record types are from different assemblies '{0}' and '{1}' + + + + Two anonymous record types have mismatched sets of field names '{0}' and '{1}' + Two anonymous record types have mismatched sets of field names '{0}' and '{1}' + + + + Cannot call the byref extension method '{0}. The first parameter requires the value to be mutable or a non-readonly byref type. + Cannot call the byref extension method '{0}. The first parameter requires the value to be mutable or a non-readonly byref type. + + + + Byref types are not allowed to have optional type extensions. + Byref types are not allowed to have optional type extensions. + + + + Cannot partially apply the extension method '{0}' because the first parameter is a byref type. + Cannot partially apply the extension method '{0}' because the first parameter is a byref type. @@ -7067,6 +7112,31 @@ This type does not inherit Attribute, it will not work correctly with other .NET languages. + + Invalid anonymous record expression + Invalid anonymous record expression + + + + Invalid anonymous record type + Invalid anonymous record type + + + + The input to a copy-and-update expression that creates an anonymous record must be either an anonymous record or a record + The input to a copy-and-update expression that creates an anonymous record must be either an anonymous record or a record + + + + The parameter '{0}' has an invalid type '{1}'. This is not permitted by the rules of Common IL. + The parameter '{0}' has an invalid type '{1}'. This is not permitted by the rules of Common IL. + + + + The function or method has an invalid return type '{0}'. This is not permitted by the rules of Common IL. + The function or method has an invalid return type '{0}'. This is not permitted by the rules of Common IL. + + \ No newline at end of file diff --git a/src/fsharp/xlf/FSComp.txt.ko.xlf b/src/fsharp/xlf/FSComp.txt.ko.xlf index 22fbe5d88eb..5fa1678b110 100644 --- a/src/fsharp/xlf/FSComp.txt.ko.xlf +++ b/src/fsharp/xlf/FSComp.txt.ko.xlf @@ -1,4 +1,4 @@ - + @@ -109,7 +109,7 @@ All branches of a pattern match expression must return values of the same type as the first branch, which here is '{0}'. This branch returns a value of type '{1}'. - 패턴 일치 식의 모든 분기는 동일한 형식의 값을 반환해야 합니다. 첫 번째 분기는 '{0}' 형식의 값을 반환했지만 이 분기는 '{1}' 형식의 값을 반환했습니다. + 패턴 일치 식의 모든 분기는 동일한 형식의 값을 반환해야 합니다. 첫 번째 분기는 '{0}' 형식의 값을 반환했지만, 이 분기는 '{1}' 형식의 값을 반환했습니다. @@ -814,7 +814,7 @@ Invalid value - 값이 잘못되었습니다. + 잘못된 값 @@ -1949,7 +1949,7 @@ Syntax error - 구문 오류 + 구문 오류입니다. @@ -4069,7 +4069,7 @@ Copyright (c) Microsoft Corporation. All Rights Reserved. - Copyright (c) Microsoft Corporation. All rights reserved. + Copyright (C) Microsoft Corporation. All rights reserved. @@ -5123,13 +5123,13 @@ - Type parameters must be placed directly adjacent to the type name, e.g. \"type C<'T>\", not type \"C <'T>\" - 형식 매개 변수는 형식 이름 바로 옆에 배치해야 합니다(예: type \"C <'T>\"가 아니라 \"type C<'T>\"). + Remove spaces between the type name and type parameter, e.g. \"type C<'T>\", not type \"C <'T>\". Type parameters must be placed directly adjacent to the type name. + 형식 매개 변수는 형식 이름 바로 옆에 배치해야 합니다(예: type \"C <'T>\"가 아니라 \"type C<'T>\"). - Type arguments must be placed directly adjacent to the type name, e.g. \"C<'T>\", not \"C <'T>\" - 형식 인수는 형식 이름 바로 옆에 배치해야 합니다(예: \"C <'T>\"가 아니라 \"C<'T>\"). + Remove spaces between the type name and type parameter, e.g. \"C<'T>\", not \"C <'T>\". Type parameters must be placed directly adjacent to the type name. + 형식 인수는 형식 이름 바로 옆에 배치해야 합니다(예: \"C <'T>\"가 아니라 \"C<'T>\"). @@ -6328,8 +6328,8 @@ - Union case/exception '{0}' does not have field named '{1}'. - 공용 구조체 케이스/예외 '{0}'에 이름이 '{1}'인 필드가 없습니다. + The union case '{0}' does not have a field named '{1}'. + 공용 구조체 케이스/예외 '{0}'에 이름이 '{1}'인 필드가 없습니다. @@ -6504,7 +6504,7 @@ The CallerMemberNameAttribute applied to parameter '{0}' will have no effect. It is overridden by the CallerFilePathAttribute. - '{0}' 매개 변수에 적용된 CallerMemberNameAttribute는 효과가 없습니다. CallerFilePathAttribute로 재정의됩니다. + {0}' 매개 변수에 적용되는 CallerMemberNameAttribute는 효과가 없습니다. CallerFilePathAttribute에서 재정의합니다. @@ -7057,9 +7057,54 @@ 식에서 반환된 값의 주소를 가져올 수 없습니다. 주소를 가져오기 전에 반환된 값을 let 바인딩 값에 할당하세요. - - The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. - The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + + Unmatched '{{|' + Unmatched '{{|' + + + + anonymous record field + anonymous record field + + + + The exception '{0}' does not have a field named '{1}'. + The exception '{0}' does not have a field named '{1}'. + + + + Active patterns do not have fields. This syntax is invalid. + Active patterns do not have fields. This syntax is invalid. + + + + The constructor does not have a field named '{0}'. + The constructor does not have a field named '{0}'. + + + + Two anonymous record types are from different assemblies '{0}' and '{1}' + Two anonymous record types are from different assemblies '{0}' and '{1}' + + + + Two anonymous record types have mismatched sets of field names '{0}' and '{1}' + Two anonymous record types have mismatched sets of field names '{0}' and '{1}' + + + + Cannot call the byref extension method '{0}. The first parameter requires the value to be mutable or a non-readonly byref type. + Cannot call the byref extension method '{0}. The first parameter requires the value to be mutable or a non-readonly byref type. + + + + Byref types are not allowed to have optional type extensions. + Byref types are not allowed to have optional type extensions. + + + + Cannot partially apply the extension method '{0}' because the first parameter is a byref type. + Cannot partially apply the extension method '{0}' because the first parameter is a byref type. @@ -7067,6 +7112,31 @@ This type does not inherit Attribute, it will not work correctly with other .NET languages. + + Invalid anonymous record expression + Invalid anonymous record expression + + + + Invalid anonymous record type + Invalid anonymous record type + + + + The input to a copy-and-update expression that creates an anonymous record must be either an anonymous record or a record + The input to a copy-and-update expression that creates an anonymous record must be either an anonymous record or a record + + + + The parameter '{0}' has an invalid type '{1}'. This is not permitted by the rules of Common IL. + The parameter '{0}' has an invalid type '{1}'. This is not permitted by the rules of Common IL. + + + + The function or method has an invalid return type '{0}'. This is not permitted by the rules of Common IL. + The function or method has an invalid return type '{0}'. This is not permitted by the rules of Common IL. + + \ No newline at end of file diff --git a/src/fsharp/xlf/FSComp.txt.pl.xlf b/src/fsharp/xlf/FSComp.txt.pl.xlf index 23ffa36bdd5..6f93b850c47 100644 --- a/src/fsharp/xlf/FSComp.txt.pl.xlf +++ b/src/fsharp/xlf/FSComp.txt.pl.xlf @@ -1,4 +1,4 @@ - + @@ -109,7 +109,7 @@ All branches of a pattern match expression must return values of the same type as the first branch, which here is '{0}'. This branch returns a value of type '{1}'. - Wszystkie gałęzie wyrażenia dopasowania do wzorca muszą zwracać wartości tego samego typu. Pierwsza gałąź zwróciła wartość typu „{0}”, ale ta gałąź zwróciła wartość typu „{1}” + Wszystkie gałęzie wyrażenia dopasowywania wzorca muszą zwracać wartości tego samego typu. Pierwsza gałąź zwróciła wartość typu „{0}”, ale ta gałąź zwróciła wartość typu „{1}”. @@ -1949,7 +1949,7 @@ Syntax error - Błąd składni + błąd składni @@ -4069,7 +4069,7 @@ Copyright (c) Microsoft Corporation. All Rights Reserved. - Copyright (c) Microsoft Corporation. Wszelkie prawa zastrzeżone. + Copyright (C) Microsoft Corporation. Wszelkie prawa zastrzeżone. @@ -4544,7 +4544,7 @@ argument - argument + Argument @@ -5123,13 +5123,13 @@ - Type parameters must be placed directly adjacent to the type name, e.g. \"type C<'T>\", not type \"C <'T>\" - Parametry typu muszą być umieszczone w bezpośrednim sąsiedztwie nazwy typu (np. \"type C<'T>\", a nie type \"C <'T>\") + Remove spaces between the type name and type parameter, e.g. \"type C<'T>\", not type \"C <'T>\". Type parameters must be placed directly adjacent to the type name. + Parametry typu muszą być umieszczone w bezpośrednim sąsiedztwie nazwy typu (np. \"type C<'T>\", a nie type \"C <'T>\") - Type arguments must be placed directly adjacent to the type name, e.g. \"C<'T>\", not \"C <'T>\" - Argumenty typu muszą być umieszczone w bezpośrednim sąsiedztwie nazwy typu (np. \"C<'T>\", a nie \"C <'T>\") + Remove spaces between the type name and type parameter, e.g. \"C<'T>\", not \"C <'T>\". Type parameters must be placed directly adjacent to the type name. + Argumenty typu muszą być umieszczone w bezpośrednim sąsiedztwie nazwy typu (np. \"C<'T>\", a nie \"C <'T>\") @@ -5229,7 +5229,7 @@ The FieldOffset attribute can only be placed on members of types marked with the StructLayout(LayoutKind.Explicit) - Atrybut FieldOffset można umieścić tylko w elementach członkowskich o typie oznaczonym przy użyciu atrybutu StructLayout(LayoutKind.Explicit). + Atrybut FieldOffset można umieścić tylko w składowych o typie oznaczonym przy użyciu atrybutu StructLayout(LayoutKind.Explicit). @@ -6328,8 +6328,8 @@ - Union case/exception '{0}' does not have field named '{1}'. - Przypadek unii/wyjątek „{0}” nie ma pola o nazwie „{1}”. + The union case '{0}' does not have a field named '{1}'. + Przypadek unii/wyjątek „{0}” nie ma pola o nazwie „{1}”. @@ -6504,7 +6504,7 @@ The CallerMemberNameAttribute applied to parameter '{0}' will have no effect. It is overridden by the CallerFilePathAttribute. - Zastosowanie elementu CallerMemberNameAttribute do parametru „{0}” nie odniesie żadnego skutku. Jest on przesłonięty przez element CallerFilePathAttribute. + Zastosowanie elementu CallerMemberNameAttribute do parametru „{0}” nie odniesie żadnego skutku. Jest on przesłaniany przez element CallerFilePathAttribute. @@ -7057,9 +7057,54 @@ Nie można uzyskać adresu wartości zwróconej przez wyrażenie. Przypisz zwróconą wartość do wartości powiązanej za pomocą instrukcji let przed uzyskaniem adresu. - - The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. - The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + + Unmatched '{{|' + Unmatched '{{|' + + + + anonymous record field + anonymous record field + + + + The exception '{0}' does not have a field named '{1}'. + The exception '{0}' does not have a field named '{1}'. + + + + Active patterns do not have fields. This syntax is invalid. + Active patterns do not have fields. This syntax is invalid. + + + + The constructor does not have a field named '{0}'. + The constructor does not have a field named '{0}'. + + + + Two anonymous record types are from different assemblies '{0}' and '{1}' + Two anonymous record types are from different assemblies '{0}' and '{1}' + + + + Two anonymous record types have mismatched sets of field names '{0}' and '{1}' + Two anonymous record types have mismatched sets of field names '{0}' and '{1}' + + + + Cannot call the byref extension method '{0}. The first parameter requires the value to be mutable or a non-readonly byref type. + Cannot call the byref extension method '{0}. The first parameter requires the value to be mutable or a non-readonly byref type. + + + + Byref types are not allowed to have optional type extensions. + Byref types are not allowed to have optional type extensions. + + + + Cannot partially apply the extension method '{0}' because the first parameter is a byref type. + Cannot partially apply the extension method '{0}' because the first parameter is a byref type. @@ -7067,6 +7112,31 @@ This type does not inherit Attribute, it will not work correctly with other .NET languages. + + Invalid anonymous record expression + Invalid anonymous record expression + + + + Invalid anonymous record type + Invalid anonymous record type + + + + The input to a copy-and-update expression that creates an anonymous record must be either an anonymous record or a record + The input to a copy-and-update expression that creates an anonymous record must be either an anonymous record or a record + + + + The parameter '{0}' has an invalid type '{1}'. This is not permitted by the rules of Common IL. + The parameter '{0}' has an invalid type '{1}'. This is not permitted by the rules of Common IL. + + + + The function or method has an invalid return type '{0}'. This is not permitted by the rules of Common IL. + The function or method has an invalid return type '{0}'. This is not permitted by the rules of Common IL. + + \ No newline at end of file diff --git a/src/fsharp/xlf/FSComp.txt.pt-BR.xlf b/src/fsharp/xlf/FSComp.txt.pt-BR.xlf index 5e22244bf74..73ad77b0ee8 100644 --- a/src/fsharp/xlf/FSComp.txt.pt-BR.xlf +++ b/src/fsharp/xlf/FSComp.txt.pt-BR.xlf @@ -1,4 +1,4 @@ - + @@ -109,7 +109,7 @@ All branches of a pattern match expression must return values of the same type as the first branch, which here is '{0}'. This branch returns a value of type '{1}'. - Todos os branches de uma expressão correspondente ao padrão precisam retornar valores do mesmo tipo. O primeiro branch retornou um valor do tipo '{0}', mas este branch retornou um valor do tipo '{1}'. + Todos as ramificações de uma expressão de correspondência de padrão devem retornar valores do mesmo tipo. A primeira ramificação retornou um valor de tipo '{0}', mas este ramo retornou um valor de tipo '{1}'. @@ -1949,7 +1949,7 @@ Syntax error - Erro de sintaxe + erro de sintaxe @@ -4069,7 +4069,7 @@ Copyright (c) Microsoft Corporation. All Rights Reserved. - Copyright (c) Microsoft Corporation. Todos direitos reservados. + Copyright (C) Microsoft Corporation. Todos os direitos reservados. @@ -4519,7 +4519,7 @@ field - campo + Campo @@ -4529,12 +4529,12 @@ property - propriedade + Propriedade. extension - extensão + Extensão @@ -4544,7 +4544,7 @@ argument - argumento + Argumento @@ -5123,13 +5123,13 @@ - Type parameters must be placed directly adjacent to the type name, e.g. \"type C<'T>\", not type \"C <'T>\" - Parâmetros de tipo devem ser colocados diretamente ao lado do nome do tipo, por exemplo: \"type C<'T>\", não type \"C <'T>\" + Remove spaces between the type name and type parameter, e.g. \"type C<'T>\", not type \"C <'T>\". Type parameters must be placed directly adjacent to the type name. + Parâmetros de tipo devem ser colocados diretamente ao lado do nome do tipo, por exemplo: \"type C<'T>\", não type \"C <'T>\" - Type arguments must be placed directly adjacent to the type name, e.g. \"C<'T>\", not \"C <'T>\" - Argumentos de tipo devem ser colocados diretamente ao lado do nome do tipo, por exemplo: \"C<'T>\", não \"C <'T>\" + Remove spaces between the type name and type parameter, e.g. \"C<'T>\", not \"C <'T>\". Type parameters must be placed directly adjacent to the type name. + Argumentos de tipo devem ser colocados diretamente ao lado do nome do tipo, por exemplo: \"C<'T>\", não \"C <'T>\" @@ -6328,8 +6328,8 @@ - Union case/exception '{0}' does not have field named '{1}'. - O caso união/exceção '{0}' não possui um campo chamado '{1}'. + The union case '{0}' does not have a field named '{1}'. + O caso união/exceção '{0}' não possui um campo chamado '{1}'. @@ -6504,7 +6504,7 @@ The CallerMemberNameAttribute applied to parameter '{0}' will have no effect. It is overridden by the CallerFilePathAttribute. - O CallerMemberNameAttribute aplicado ao parâmetro '{0}' não terá nenhum efeito. Ele será substituído pelo CallerFilePathAttribute. + O CallerMemberNameAttribute aplicado ao parâmetro "{0}" não terá efeito. Ele é substituído pelo CallerFilePathAttribute. @@ -7057,9 +7057,54 @@ Não é possível obter o endereço do valor retornado da expressão. Atribua o valor retornado a um valor associado a let antes de obter o endereço. - - The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. - The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + + Unmatched '{{|' + Unmatched '{{|' + + + + anonymous record field + anonymous record field + + + + The exception '{0}' does not have a field named '{1}'. + The exception '{0}' does not have a field named '{1}'. + + + + Active patterns do not have fields. This syntax is invalid. + Active patterns do not have fields. This syntax is invalid. + + + + The constructor does not have a field named '{0}'. + The constructor does not have a field named '{0}'. + + + + Two anonymous record types are from different assemblies '{0}' and '{1}' + Two anonymous record types are from different assemblies '{0}' and '{1}' + + + + Two anonymous record types have mismatched sets of field names '{0}' and '{1}' + Two anonymous record types have mismatched sets of field names '{0}' and '{1}' + + + + Cannot call the byref extension method '{0}. The first parameter requires the value to be mutable or a non-readonly byref type. + Cannot call the byref extension method '{0}. The first parameter requires the value to be mutable or a non-readonly byref type. + + + + Byref types are not allowed to have optional type extensions. + Byref types are not allowed to have optional type extensions. + + + + Cannot partially apply the extension method '{0}' because the first parameter is a byref type. + Cannot partially apply the extension method '{0}' because the first parameter is a byref type. @@ -7067,6 +7112,31 @@ This type does not inherit Attribute, it will not work correctly with other .NET languages. + + Invalid anonymous record expression + Invalid anonymous record expression + + + + Invalid anonymous record type + Invalid anonymous record type + + + + The input to a copy-and-update expression that creates an anonymous record must be either an anonymous record or a record + The input to a copy-and-update expression that creates an anonymous record must be either an anonymous record or a record + + + + The parameter '{0}' has an invalid type '{1}'. This is not permitted by the rules of Common IL. + The parameter '{0}' has an invalid type '{1}'. This is not permitted by the rules of Common IL. + + + + The function or method has an invalid return type '{0}'. This is not permitted by the rules of Common IL. + The function or method has an invalid return type '{0}'. This is not permitted by the rules of Common IL. + + \ No newline at end of file diff --git a/src/fsharp/xlf/FSComp.txt.ru.xlf b/src/fsharp/xlf/FSComp.txt.ru.xlf index 34090ba9646..f539d85c4bc 100644 --- a/src/fsharp/xlf/FSComp.txt.ru.xlf +++ b/src/fsharp/xlf/FSComp.txt.ru.xlf @@ -1,4 +1,4 @@ - + @@ -109,7 +109,7 @@ All branches of a pattern match expression must return values of the same type as the first branch, which here is '{0}'. This branch returns a value of type '{1}'. - Все ветви выражения сопоставления шаблонов должны возвращать значения одного типа. Первая ветвь возвратила значение типа "{0}", а эта ветвь — типа "{1}". + Все ветви выражения сопоставления шаблона должны возвращать значения одного и того же типа. Первая ветвь возвратила значение типа "{0}", однако эта ветвь возвратила выражение типа "{1}". @@ -1949,7 +1949,7 @@ Syntax error - Синтаксическая ошибка + синтаксическая ошибка @@ -4069,7 +4069,7 @@ Copyright (c) Microsoft Corporation. All Rights Reserved. - (c) Корпорация Майкрософт (Microsoft Corp.). Все права защищены. + © Корпорация Майкрософт (Microsoft Corporation). Все права защищены. @@ -4519,7 +4519,7 @@ field - поле + Поле @@ -4529,12 +4529,12 @@ property - свойство + Свойство extension - расширение + Расширение @@ -4544,7 +4544,7 @@ argument - аргумент + Аргумент @@ -5123,13 +5123,13 @@ - Type parameters must be placed directly adjacent to the type name, e.g. \"type C<'T>\", not type \"C <'T>\" - Параметры типа необходимо указывать непосредственно после имени типа, например, \"type C<'T>\", но не type \"C <'T>\" + Remove spaces between the type name and type parameter, e.g. \"type C<'T>\", not type \"C <'T>\". Type parameters must be placed directly adjacent to the type name. + Параметры типа необходимо указывать непосредственно после имени типа, например, \"type C<'T>\", но не type \"C <'T>\" - Type arguments must be placed directly adjacent to the type name, e.g. \"C<'T>\", not \"C <'T>\" - Аргументы типа необходимо указывать непосредственно после имени типа, например \"C<'T>\", но не \"C <'T>\" + Remove spaces between the type name and type parameter, e.g. \"C<'T>\", not \"C <'T>\". Type parameters must be placed directly adjacent to the type name. + Аргументы типа необходимо указывать непосредственно после имени типа, например \"C<'T>\", но не \"C <'T>\" @@ -6328,8 +6328,8 @@ - Union case/exception '{0}' does not have field named '{1}'. - Ветвь объединения/исключение "{0}" не содержит поля с именем "{1}". + The union case '{0}' does not have a field named '{1}'. + Ветвь объединения/исключение "{0}" не содержит поля с именем "{1}". @@ -7057,9 +7057,54 @@ Невозможно получить адрес значения, возвращенного из выражения. Используйте возвращенное значение в качестве значения с привязкой let, прежде чем получить адрес. - - The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. - The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + + Unmatched '{{|' + Unmatched '{{|' + + + + anonymous record field + anonymous record field + + + + The exception '{0}' does not have a field named '{1}'. + The exception '{0}' does not have a field named '{1}'. + + + + Active patterns do not have fields. This syntax is invalid. + Active patterns do not have fields. This syntax is invalid. + + + + The constructor does not have a field named '{0}'. + The constructor does not have a field named '{0}'. + + + + Two anonymous record types are from different assemblies '{0}' and '{1}' + Two anonymous record types are from different assemblies '{0}' and '{1}' + + + + Two anonymous record types have mismatched sets of field names '{0}' and '{1}' + Two anonymous record types have mismatched sets of field names '{0}' and '{1}' + + + + Cannot call the byref extension method '{0}. The first parameter requires the value to be mutable or a non-readonly byref type. + Cannot call the byref extension method '{0}. The first parameter requires the value to be mutable or a non-readonly byref type. + + + + Byref types are not allowed to have optional type extensions. + Byref types are not allowed to have optional type extensions. + + + + Cannot partially apply the extension method '{0}' because the first parameter is a byref type. + Cannot partially apply the extension method '{0}' because the first parameter is a byref type. @@ -7067,6 +7112,31 @@ This type does not inherit Attribute, it will not work correctly with other .NET languages. + + Invalid anonymous record expression + Invalid anonymous record expression + + + + Invalid anonymous record type + Invalid anonymous record type + + + + The input to a copy-and-update expression that creates an anonymous record must be either an anonymous record or a record + The input to a copy-and-update expression that creates an anonymous record must be either an anonymous record or a record + + + + The parameter '{0}' has an invalid type '{1}'. This is not permitted by the rules of Common IL. + The parameter '{0}' has an invalid type '{1}'. This is not permitted by the rules of Common IL. + + + + The function or method has an invalid return type '{0}'. This is not permitted by the rules of Common IL. + The function or method has an invalid return type '{0}'. This is not permitted by the rules of Common IL. + + \ No newline at end of file diff --git a/src/fsharp/xlf/FSComp.txt.tr.xlf b/src/fsharp/xlf/FSComp.txt.tr.xlf index 42e1af2de94..9f3993f415b 100644 --- a/src/fsharp/xlf/FSComp.txt.tr.xlf +++ b/src/fsharp/xlf/FSComp.txt.tr.xlf @@ -1,4 +1,4 @@ - + @@ -109,7 +109,7 @@ All branches of a pattern match expression must return values of the same type as the first branch, which here is '{0}'. This branch returns a value of type '{1}'. - Bir desen eşleştirme ifadesinin tüm dalları aynı türdeki değerleri döndürmelidir. Birinci dal '{0}' türünde bir değer döndürdü ancak bu dal '{1}' türünde bir değer döndürdü. + Desen eşleştirme ifadesinin tüm dalları aynı türde değerler döndürmelidir. İlk dal '{0}' türünde değer döndürdü ancak bu dal '{1}' türünde değer döndürdü. @@ -1949,7 +1949,7 @@ Syntax error - Sözdizimi hatası + sözdizimi hatası @@ -4069,7 +4069,7 @@ Copyright (c) Microsoft Corporation. All Rights Reserved. - Telif hakkı (c) Microsoft Corporation. Tüm hakları saklıdır. + Telif hakkı (C) Microsoft Corporation. Tüm hakları saklıdır. @@ -4544,7 +4544,7 @@ argument - bağımsız değişken + Bağımsız değişken @@ -4569,7 +4569,7 @@ from {0} - {0} dalından + Şuradan: {0} @@ -5123,13 +5123,13 @@ - Type parameters must be placed directly adjacent to the type name, e.g. \"type C<'T>\", not type \"C <'T>\" - Tür parametreleri doğrudan tür adının bitişiğine yerleştirilmelidir, örn. type \"C <'T>\" değil \"type C<'T>\" + Remove spaces between the type name and type parameter, e.g. \"type C<'T>\", not type \"C <'T>\". Type parameters must be placed directly adjacent to the type name. + Tür parametreleri doğrudan tür adının bitişiğine yerleştirilmelidir, örn. type \"C <'T>\" değil \"type C<'T>\" - Type arguments must be placed directly adjacent to the type name, e.g. \"C<'T>\", not \"C <'T>\" - Tür bağımsız değişkenleri doğrudan tür adının bitişiğine yerleştirilmelidir, örn. \"C <'T>\" değil \"C<'T>\" + Remove spaces between the type name and type parameter, e.g. \"C<'T>\", not \"C <'T>\". Type parameters must be placed directly adjacent to the type name. + Tür bağımsız değişkenleri doğrudan tür adının bitişiğine yerleştirilmelidir, örn. \"C <'T>\" değil \"C<'T>\" @@ -6328,8 +6328,8 @@ - Union case/exception '{0}' does not have field named '{1}'. - {0}' birleşim durumu/özel durumunda '{1}' adlı alan yok. + The union case '{0}' does not have a field named '{1}'. + {0}' birleşim durumu/özel durumunda '{1}' adlı alan yok. @@ -6504,7 +6504,7 @@ The CallerMemberNameAttribute applied to parameter '{0}' will have no effect. It is overridden by the CallerFilePathAttribute. - '{0}' parametresine uygulanan CallerMemberNameAttribute etkisiz olacak. Bu işlem CallerFilePathAttribute tarafından geçersiz kılınmış. + {0}' parametresi için geçerli olan CallerMemberNameAttribute öğesinin hiçbir etkisi olmaz. CallerFilePathAttribute tarafından geçersiz kılındı. @@ -6924,7 +6924,7 @@ is - : + olan @@ -7057,9 +7057,54 @@ İfadeden döndürülen değerin adresi alınamaz. Adresi almadan önce, döndürülen değeri let ile bağlanmış bir değere atayın. - - The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. - The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + + Unmatched '{{|' + Unmatched '{{|' + + + + anonymous record field + anonymous record field + + + + The exception '{0}' does not have a field named '{1}'. + The exception '{0}' does not have a field named '{1}'. + + + + Active patterns do not have fields. This syntax is invalid. + Active patterns do not have fields. This syntax is invalid. + + + + The constructor does not have a field named '{0}'. + The constructor does not have a field named '{0}'. + + + + Two anonymous record types are from different assemblies '{0}' and '{1}' + Two anonymous record types are from different assemblies '{0}' and '{1}' + + + + Two anonymous record types have mismatched sets of field names '{0}' and '{1}' + Two anonymous record types have mismatched sets of field names '{0}' and '{1}' + + + + Cannot call the byref extension method '{0}. The first parameter requires the value to be mutable or a non-readonly byref type. + Cannot call the byref extension method '{0}. The first parameter requires the value to be mutable or a non-readonly byref type. + + + + Byref types are not allowed to have optional type extensions. + Byref types are not allowed to have optional type extensions. + + + + Cannot partially apply the extension method '{0}' because the first parameter is a byref type. + Cannot partially apply the extension method '{0}' because the first parameter is a byref type. @@ -7067,6 +7112,31 @@ This type does not inherit Attribute, it will not work correctly with other .NET languages. + + Invalid anonymous record expression + Invalid anonymous record expression + + + + Invalid anonymous record type + Invalid anonymous record type + + + + The input to a copy-and-update expression that creates an anonymous record must be either an anonymous record or a record + The input to a copy-and-update expression that creates an anonymous record must be either an anonymous record or a record + + + + The parameter '{0}' has an invalid type '{1}'. This is not permitted by the rules of Common IL. + The parameter '{0}' has an invalid type '{1}'. This is not permitted by the rules of Common IL. + + + + The function or method has an invalid return type '{0}'. This is not permitted by the rules of Common IL. + The function or method has an invalid return type '{0}'. This is not permitted by the rules of Common IL. + + \ No newline at end of file diff --git a/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf b/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf index ba86113d4d9..157f72579be 100644 --- a/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf +++ b/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf @@ -109,7 +109,7 @@ All branches of a pattern match expression must return values of the same type as the first branch, which here is '{0}'. This branch returns a value of type '{1}'. - 模式匹配表达式的所有分支必须返回相同类型的值。第一个分支返回“{0}”类型的值,但此分支返回“{1}”类型的值。 + 模式匹配表达式的所有分支必须返回相同类型的值。第一个分支返回类型为“{0}”的值,但此分支返回类型为“{1}”的值。 @@ -344,7 +344,7 @@ Unrecognized option: '{0}' - 无法识别的选项: '{0}' + 无法识别的选项:“{0}” @@ -814,7 +814,7 @@ Invalid value - 值无效 + 无效值 @@ -5123,13 +5123,13 @@ - Type parameters must be placed directly adjacent to the type name, e.g. \"type C<'T>\", not type \"C <'T>\" - 必须将类型参数直接放置到类型名称的旁边,例如 \"type C<'T>\",而非 type \"C <'T>\" + Remove spaces between the type name and type parameter, e.g. \"type C<'T>\", not type \"C <'T>\". Type parameters must be placed directly adjacent to the type name. + 必须将类型参数直接放置到类型名称的旁边,例如 \"type C<'T>\",而非 type \"C <'T>\" - Type arguments must be placed directly adjacent to the type name, e.g. \"C<'T>\", not \"C <'T>\" - 必须将类型参数直接放置到类型名称的旁边,例如 \"C<'T>\",而非 \"C <'T>\" + Remove spaces between the type name and type parameter, e.g. \"C<'T>\", not \"C <'T>\". Type parameters must be placed directly adjacent to the type name. + 必须将类型参数直接放置到类型名称的旁边,例如 \"C<'T>\",而非 \"C <'T>\" @@ -6328,8 +6328,8 @@ - Union case/exception '{0}' does not have field named '{1}'. - 联合用例/异常“{0}”没有名为“{1}”的字段。 + The union case '{0}' does not have a field named '{1}'. + 联合用例/异常“{0}”没有名为“{1}”的字段。 @@ -7057,9 +7057,54 @@ 无法采用从表达式返回的地址值。在采用地址前将返回值分配给 let 绑定值。 - - The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. - The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + + Unmatched '{{|' + Unmatched '{{|' + + + + anonymous record field + anonymous record field + + + + The exception '{0}' does not have a field named '{1}'. + The exception '{0}' does not have a field named '{1}'. + + + + Active patterns do not have fields. This syntax is invalid. + Active patterns do not have fields. This syntax is invalid. + + + + The constructor does not have a field named '{0}'. + The constructor does not have a field named '{0}'. + + + + Two anonymous record types are from different assemblies '{0}' and '{1}' + Two anonymous record types are from different assemblies '{0}' and '{1}' + + + + Two anonymous record types have mismatched sets of field names '{0}' and '{1}' + Two anonymous record types have mismatched sets of field names '{0}' and '{1}' + + + + Cannot call the byref extension method '{0}. The first parameter requires the value to be mutable or a non-readonly byref type. + Cannot call the byref extension method '{0}. The first parameter requires the value to be mutable or a non-readonly byref type. + + + + Byref types are not allowed to have optional type extensions. + Byref types are not allowed to have optional type extensions. + + + + Cannot partially apply the extension method '{0}' because the first parameter is a byref type. + Cannot partially apply the extension method '{0}' because the first parameter is a byref type. @@ -7067,6 +7112,31 @@ This type does not inherit Attribute, it will not work correctly with other .NET languages. + + Invalid anonymous record expression + Invalid anonymous record expression + + + + Invalid anonymous record type + Invalid anonymous record type + + + + The input to a copy-and-update expression that creates an anonymous record must be either an anonymous record or a record + The input to a copy-and-update expression that creates an anonymous record must be either an anonymous record or a record + + + + The parameter '{0}' has an invalid type '{1}'. This is not permitted by the rules of Common IL. + The parameter '{0}' has an invalid type '{1}'. This is not permitted by the rules of Common IL. + + + + The function or method has an invalid return type '{0}'. This is not permitted by the rules of Common IL. + The function or method has an invalid return type '{0}'. This is not permitted by the rules of Common IL. + + \ No newline at end of file diff --git a/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf b/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf index 84d6951594e..2dcc65e9fb3 100644 --- a/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf +++ b/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf @@ -1,4 +1,4 @@ - + @@ -109,7 +109,7 @@ All branches of a pattern match expression must return values of the same type as the first branch, which here is '{0}'. This branch returns a value of type '{1}'. - 模式比對運算式的所有分支,都必須傳回相同類型的值。第一個分支傳回了類型 '{0}' 的值,但此分支卻傳回了類型 '{1}' 的值。 + 符合運算式的所有模式分支都必須傳回相同類型的值。第一個分支傳回了類型 '{0}' 的值,但此分支卻傳回類型 '{1}' 的值。 @@ -814,7 +814,7 @@ Invalid value - 無效值 + 值無效 @@ -4069,7 +4069,7 @@ Copyright (c) Microsoft Corporation. All Rights Reserved. - Copyright (c) Microsoft Corporation. 著作權所有,並保留一切權利。 + Copyright (C) Microsoft Corporation. 著作權所有,並保留一切權利。 @@ -5123,13 +5123,13 @@ - Type parameters must be placed directly adjacent to the type name, e.g. \"type C<'T>\", not type \"C <'T>\" - 型別參數必須放在緊鄰類型名稱的位置,例如 \"type C<'T>\",而不是 type \"C <'T>\" + Remove spaces between the type name and type parameter, e.g. \"type C<'T>\", not type \"C <'T>\". Type parameters must be placed directly adjacent to the type name. + 型別參數必須放在緊鄰類型名稱的位置,例如 \"type C<'T>\",而不是 type \"C <'T>\" - Type arguments must be placed directly adjacent to the type name, e.g. \"C<'T>\", not \"C <'T>\" - 型別引數必須放在緊鄰類型名稱的位置,例如 \"C<'T>\",而不是 \"C <'T>\" + Remove spaces between the type name and type parameter, e.g. \"C<'T>\", not \"C <'T>\". Type parameters must be placed directly adjacent to the type name. + 型別引數必須放在緊鄰類型名稱的位置,例如 \"C<'T>\",而不是 \"C <'T>\" @@ -5459,7 +5459,7 @@ Static linking may not include a mixed managed/unmanaged DLL - 靜態連結不可包含混合的受控/非受控 DLL + 靜態連結不可包含混合的 Managed/Unmanaged DLL @@ -6328,8 +6328,8 @@ - Union case/exception '{0}' does not have field named '{1}'. - 等位/例外狀況 '{0}' 沒有名為 '{1}' 的欄位。 + The union case '{0}' does not have a field named '{1}'. + 等位/例外狀況 '{0}' 沒有名為 '{1}' 的欄位。 @@ -7057,9 +7057,54 @@ 無法使用運算式傳回值的位址。在使用位址前,先將傳回值指派給以 let 繫結的值。 - - The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. - The Span or IsByRefLike expression cannot be returned from this function or method, because it is composed using elements that may escape their scope. + + Unmatched '{{|' + Unmatched '{{|' + + + + anonymous record field + anonymous record field + + + + The exception '{0}' does not have a field named '{1}'. + The exception '{0}' does not have a field named '{1}'. + + + + Active patterns do not have fields. This syntax is invalid. + Active patterns do not have fields. This syntax is invalid. + + + + The constructor does not have a field named '{0}'. + The constructor does not have a field named '{0}'. + + + + Two anonymous record types are from different assemblies '{0}' and '{1}' + Two anonymous record types are from different assemblies '{0}' and '{1}' + + + + Two anonymous record types have mismatched sets of field names '{0}' and '{1}' + Two anonymous record types have mismatched sets of field names '{0}' and '{1}' + + + + Cannot call the byref extension method '{0}. The first parameter requires the value to be mutable or a non-readonly byref type. + Cannot call the byref extension method '{0}. The first parameter requires the value to be mutable or a non-readonly byref type. + + + + Byref types are not allowed to have optional type extensions. + Byref types are not allowed to have optional type extensions. + + + + Cannot partially apply the extension method '{0}' because the first parameter is a byref type. + Cannot partially apply the extension method '{0}' because the first parameter is a byref type. @@ -7067,6 +7112,31 @@ This type does not inherit Attribute, it will not work correctly with other .NET languages. + + Invalid anonymous record expression + Invalid anonymous record expression + + + + Invalid anonymous record type + Invalid anonymous record type + + + + The input to a copy-and-update expression that creates an anonymous record must be either an anonymous record or a record + The input to a copy-and-update expression that creates an anonymous record must be either an anonymous record or a record + + + + The parameter '{0}' has an invalid type '{1}'. This is not permitted by the rules of Common IL. + The parameter '{0}' has an invalid type '{1}'. This is not permitted by the rules of Common IL. + + + + The function or method has an invalid return type '{0}'. This is not permitted by the rules of Common IL. + The function or method has an invalid return type '{0}'. This is not permitted by the rules of Common IL. + + \ No newline at end of file diff --git a/src/fsharp/xlf/FSStrings.cs.xlf b/src/fsharp/xlf/FSStrings.cs.xlf index dd20d2c3294..5b1e7457cf5 100644 --- a/src/fsharp/xlf/FSStrings.cs.xlf +++ b/src/fsharp/xlf/FSStrings.cs.xlf @@ -1,4 +1,4 @@ - + @@ -959,7 +959,7 @@ comment - komentář + Komentář @@ -1174,7 +1174,7 @@ keyword - klíčové slovo + Klíčové slovo @@ -1617,6 +1617,16 @@ Vnitřní chyba: {0} + + symbol '{|' + symbol '{|' + + + + symbol '|}' + symbol '|}' + + \ No newline at end of file diff --git a/src/fsharp/xlf/FSStrings.de.xlf b/src/fsharp/xlf/FSStrings.de.xlf index 11c588c25a1..c841087efc3 100644 --- a/src/fsharp/xlf/FSStrings.de.xlf +++ b/src/fsharp/xlf/FSStrings.de.xlf @@ -1,4 +1,4 @@ - + @@ -1174,7 +1174,7 @@ keyword - Schlüsselwort + Schlüsselwort @@ -1617,6 +1617,16 @@ Interner Fehler: {0} + + symbol '{|' + symbol '{|' + + + + symbol '|}' + symbol '|}' + + \ No newline at end of file diff --git a/src/fsharp/xlf/FSStrings.en.xlf b/src/fsharp/xlf/FSStrings.en.xlf index c7f55180a55..63b0d8034ca 100644 --- a/src/fsharp/xlf/FSStrings.en.xlf +++ b/src/fsharp/xlf/FSStrings.en.xlf @@ -1617,6 +1617,16 @@ internal error: {0} + + symbol '{|' + symbol '{|' + + + + symbol '|}' + symbol '|}' + + \ No newline at end of file diff --git a/src/fsharp/xlf/FSStrings.es.xlf b/src/fsharp/xlf/FSStrings.es.xlf index a64fb622684..94bdc6b94db 100644 --- a/src/fsharp/xlf/FSStrings.es.xlf +++ b/src/fsharp/xlf/FSStrings.es.xlf @@ -1,4 +1,4 @@ - + @@ -959,7 +959,7 @@ comment - comentario + Comentario @@ -1174,7 +1174,7 @@ keyword - palabra clave + Palabra clave @@ -1617,6 +1617,16 @@ error interno: {0} + + symbol '{|' + symbol '{|' + + + + symbol '|}' + symbol '|}' + + \ No newline at end of file diff --git a/src/fsharp/xlf/FSStrings.fr.xlf b/src/fsharp/xlf/FSStrings.fr.xlf index a56bd5baadd..da8c884f9b2 100644 --- a/src/fsharp/xlf/FSStrings.fr.xlf +++ b/src/fsharp/xlf/FSStrings.fr.xlf @@ -1,4 +1,4 @@ - + @@ -959,7 +959,7 @@ comment - commentaire + Commentaire @@ -1174,7 +1174,7 @@ keyword - mot clé + Mot clé @@ -1617,6 +1617,16 @@ erreur interne : {0} + + symbol '{|' + symbol '{|' + + + + symbol '|}' + symbol '|}' + + \ No newline at end of file diff --git a/src/fsharp/xlf/FSStrings.it.xlf b/src/fsharp/xlf/FSStrings.it.xlf index b8a0c2aa385..2d190fb5862 100644 --- a/src/fsharp/xlf/FSStrings.it.xlf +++ b/src/fsharp/xlf/FSStrings.it.xlf @@ -1,4 +1,4 @@ - + @@ -959,7 +959,7 @@ comment - commento + Commento @@ -1174,7 +1174,7 @@ keyword - parola chiave + Parola chiave @@ -1617,6 +1617,16 @@ errore interno: {0} + + symbol '{|' + symbol '{|' + + + + symbol '|}' + symbol '|}' + + \ No newline at end of file diff --git a/src/fsharp/xlf/FSStrings.ja.xlf b/src/fsharp/xlf/FSStrings.ja.xlf index e2bc61160be..bc6947a7672 100644 --- a/src/fsharp/xlf/FSStrings.ja.xlf +++ b/src/fsharp/xlf/FSStrings.ja.xlf @@ -1174,7 +1174,7 @@ keyword - キーワード + キーワード @@ -1617,6 +1617,16 @@ 内部エラー: {0} + + symbol '{|' + symbol '{|' + + + + symbol '|}' + symbol '|}' + + \ No newline at end of file diff --git a/src/fsharp/xlf/FSStrings.ko.xlf b/src/fsharp/xlf/FSStrings.ko.xlf index 8f398f713c4..abf9de4c4e2 100644 --- a/src/fsharp/xlf/FSStrings.ko.xlf +++ b/src/fsharp/xlf/FSStrings.ko.xlf @@ -1,4 +1,4 @@ - + @@ -1174,7 +1174,7 @@ keyword - 키워드 + 키워드 @@ -1454,7 +1454,7 @@ . {0} - {0} + . {0} @@ -1617,6 +1617,16 @@ 내부 오류: {0} + + symbol '{|' + symbol '{|' + + + + symbol '|}' + symbol '|}' + + \ No newline at end of file diff --git a/src/fsharp/xlf/FSStrings.pl.xlf b/src/fsharp/xlf/FSStrings.pl.xlf index b634fb8ab9d..ff77b583a31 100644 --- a/src/fsharp/xlf/FSStrings.pl.xlf +++ b/src/fsharp/xlf/FSStrings.pl.xlf @@ -1,4 +1,4 @@ - + @@ -959,7 +959,7 @@ comment - komentarz + Komentarz @@ -1174,7 +1174,7 @@ keyword - słowo kluczowe + Słowo kluczowe @@ -1617,6 +1617,16 @@ błąd wewnętrzny: {0} + + symbol '{|' + symbol '{|' + + + + symbol '|}' + symbol '|}' + + \ No newline at end of file diff --git a/src/fsharp/xlf/FSStrings.pt-BR.xlf b/src/fsharp/xlf/FSStrings.pt-BR.xlf index 0d185ea82f5..51ea01ee2a5 100644 --- a/src/fsharp/xlf/FSStrings.pt-BR.xlf +++ b/src/fsharp/xlf/FSStrings.pt-BR.xlf @@ -1,4 +1,4 @@ - + @@ -959,7 +959,7 @@ comment - comentário + Comentário @@ -1174,7 +1174,7 @@ keyword - palavra-chave + Palavra-chave @@ -1617,6 +1617,16 @@ erro interno: {0} + + symbol '{|' + symbol '{|' + + + + symbol '|}' + symbol '|}' + + \ No newline at end of file diff --git a/src/fsharp/xlf/FSStrings.ru.xlf b/src/fsharp/xlf/FSStrings.ru.xlf index ebae0bf0ec3..e5d185af0df 100644 --- a/src/fsharp/xlf/FSStrings.ru.xlf +++ b/src/fsharp/xlf/FSStrings.ru.xlf @@ -1,4 +1,4 @@ - + @@ -959,7 +959,7 @@ comment - комментарий + Комментарий @@ -1174,7 +1174,7 @@ keyword - ключевое слово + Ключевое слово @@ -1617,6 +1617,16 @@ внутренняя ошибка: {0} + + symbol '{|' + symbol '{|' + + + + symbol '|}' + symbol '|}' + + \ No newline at end of file diff --git a/src/fsharp/xlf/FSStrings.tr.xlf b/src/fsharp/xlf/FSStrings.tr.xlf index bc70825fa2c..8bb5fdbeb23 100644 --- a/src/fsharp/xlf/FSStrings.tr.xlf +++ b/src/fsharp/xlf/FSStrings.tr.xlf @@ -1,4 +1,4 @@ - + @@ -959,7 +959,7 @@ comment - açıklama + Açıklama @@ -1174,7 +1174,7 @@ keyword - anahtar sözcük + Anahtar Sözcük @@ -1617,6 +1617,16 @@ iç hata: {0} + + symbol '{|' + symbol '{|' + + + + symbol '|}' + symbol '|}' + + \ No newline at end of file diff --git a/src/fsharp/xlf/FSStrings.zh-Hans.xlf b/src/fsharp/xlf/FSStrings.zh-Hans.xlf index 12be2851596..ad4a06f8c33 100644 --- a/src/fsharp/xlf/FSStrings.zh-Hans.xlf +++ b/src/fsharp/xlf/FSStrings.zh-Hans.xlf @@ -1,4 +1,4 @@ - + @@ -1174,7 +1174,7 @@ keyword - 关键字 + 关键字 @@ -1617,6 +1617,16 @@ 内部错误: {0} + + symbol '{|' + symbol '{|' + + + + symbol '|}' + symbol '|}' + + \ No newline at end of file diff --git a/src/fsharp/xlf/FSStrings.zh-Hant.xlf b/src/fsharp/xlf/FSStrings.zh-Hant.xlf index 81cad28dd59..3dcbf9ac1e3 100644 --- a/src/fsharp/xlf/FSStrings.zh-Hant.xlf +++ b/src/fsharp/xlf/FSStrings.zh-Hant.xlf @@ -1,4 +1,4 @@ - + @@ -1174,7 +1174,7 @@ keyword - 關鍵字 + 關鍵字 @@ -1454,7 +1454,7 @@ . {0} - 。{0} + . {0} @@ -1617,6 +1617,16 @@ 內部錯誤: {0} + + symbol '{|' + symbol '{|' + + + + symbol '|}' + symbol '|}' + + \ No newline at end of file diff --git a/src/ilx/ilxsettings.fs b/src/ilx/ilxsettings.fs index 9033fca0694..520da651c14 100644 --- a/src/ilx/ilxsettings.fs +++ b/src/ilx/ilxsettings.fs @@ -22,7 +22,7 @@ let ilxFsharpCoreLibScopeRef () = if !ilxCompilingFSharpCoreLib then ILScopeRef.Local else - let assref = + let assemblyRef = match !ilxFsharpCoreLibAssemRef with | Some o -> o | None -> @@ -34,6 +34,6 @@ let ilxFsharpCoreLibScopeRef () = Some (PublicKeyToken(Bytes.ofInt32Array [| 0xb0; 0x3f; 0x5f; 0x7f; 0x11; 0xd5; 0x0a; 0x3a |])), false, Some (IL.parseILVersion "0.0.0.0"), None) - ILScopeRef.Assembly assref + ILScopeRef.Assembly assemblyRef let ilxNamespace () = "Microsoft.FSharp.Core" \ No newline at end of file diff --git a/src/scripts/fssrgen.fsx b/src/scripts/fssrgen.fsx deleted file mode 100644 index 32c5b4fa58c..00000000000 --- a/src/scripts/fssrgen.fsx +++ /dev/null @@ -1,494 +0,0 @@ -// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. -open System -open System.IO - -let PrintErr(filename, line, msg) = - printfn "%s(%d): error : %s" filename line msg - -let Err(filename, line, msg) = - PrintErr(filename, line, msg) - printfn "Note that the syntax of each line is one of these three alternatives:" - printfn "# comment" - printfn "ident,\"string\"" - printfn "errNum,ident,\"string\"" - failwith (sprintf "there were errors in the file '%s'" filename) - -let xmlBoilerPlateString = @" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - -" - - -type HoleType = string - - -// The kinds of 'holes' we can do -let ComputeHoles filename lineNum (txt:string) : ResizeArray * string = - // takes in a %d%s kind of string, returns array of HoleType and {0}{1} kind of string - let mutable i = 0 - let mutable holeNumber = 0 - let mutable holes = ResizeArray() // order - let sb = new System.Text.StringBuilder() - let AddHole holeType = - sb.Append(sprintf "{%d}" holeNumber) |> ignore - holeNumber <- holeNumber + 1 - holes.Add(holeType) - while i < txt.Length do - if txt.[i] = '%' then - if i+1 = txt.Length then - Err(filename, lineNum, "(at end of string) % must be followed by d, f, s, or %") - else - match txt.[i+1] with - | 'd' -> AddHole "System.Int32" - | 'f' -> AddHole "System.Double" - | 's' -> AddHole "System.String" - | '%' -> sb.Append('%') |> ignore - | c -> Err(filename, lineNum, sprintf "'%%%c' is not a valid sequence, only %%d %%f %%s or %%%%" c) - i <- i + 2 - else - match txt.[i] with - | '{' -> sb.Append "{{" |> ignore - | '}' -> sb.Append "}}" |> ignore - | c -> sb.Append c |> ignore - i <- i + 1 - //printfn "holes.Length = %d, lineNum = %d" holes.Length //lineNum txt - (holes, sb.ToString()) - -let Unquote (s : string) = - if s.StartsWith "\"" && s.EndsWith "\"" then s.Substring(1, s.Length - 2) - else failwith "error message string should be quoted" - -let ParseLine filename lineNum (txt:string) = - let mutable errNum = None - let identB = new System.Text.StringBuilder() - let mutable i = 0 - // parse optional error number - if i < txt.Length && System.Char.IsDigit txt.[i] then - let numB = new System.Text.StringBuilder() - while i < txt.Length && System.Char.IsDigit txt.[i] do - numB.Append txt.[i] |> ignore - i <- i + 1 - errNum <- Some(int (numB.ToString())) - if i = txt.Length || not(txt.[i] = ',') then - Err(filename, lineNum, sprintf "After the error number '%d' there should be a comma" errNum.Value) - // Skip the comma - i <- i + 1 - // parse short identifier - if i < txt.Length && not(System.Char.IsLetter(txt.[i])) then - Err(filename, lineNum, sprintf "The first character in the short identifier should be a letter, but found '%c'" txt.[i]) - while i < txt.Length && System.Char.IsLetterOrDigit txt.[i] do - identB.Append txt.[i] |> ignore - i <- i + 1 - let ident = identB.ToString() - if ident.Length = 0 then - Err(filename, lineNum, "Did not find the short identifier") - else - if i = txt.Length || not(txt.[i] = ',') then - Err(filename, lineNum, sprintf "After the identifier '%s' there should be a comma" ident) - else - // Skip the comma - i <- i + 1 - if i = txt.Length then - Err(filename, lineNum, sprintf "After the identifier '%s' and comma, there should be the quoted string resource" ident) - else - let str = - try - System.String.Format(Unquote(txt.Substring i)) // Format turns e.g '\n' into that char, but also requires that we 'escape' curlies in the original .txt file, e.g. "{{" - with - e -> Err(filename, lineNum, sprintf "Error calling System.String.Format (note that curly braces must be escaped, and there cannot be trailing space on the line): >>>%s<<< -- %s" (txt.Substring i) e.Message) - let holes, netFormatString = ComputeHoles filename lineNum str - (lineNum, (errNum,ident), str, holes.ToArray(), netFormatString) - -let stringBoilerPlatePrefix = @" -open Microsoft.FSharp.Core.LanguagePrimitives.IntrinsicOperators -open Microsoft.FSharp.Reflection -open System.Reflection -// (namespaces below for specific case of using the tool to compile FSharp.Core itself) -open Microsoft.FSharp.Core -open Microsoft.FSharp.Core.Operators -open Microsoft.FSharp.Text -open Microsoft.FSharp.Collections -open Printf -" -let StringBoilerPlate filename = - - @" - // BEGIN BOILERPLATE - - static let getCurrentAssembly () = - #if FX_RESHAPED_REFLECTION - typeof.GetTypeInfo().Assembly - #else - System.Reflection.Assembly.GetExecutingAssembly() - #endif - - static let getTypeInfo (t: System.Type) = - #if FX_RESHAPED_REFLECTION - t.GetTypeInfo() - #else - t - #endif - - static let resources = lazy (new System.Resources.ResourceManager(""" + filename + @""", getCurrentAssembly())) - - static let GetString(name:string) = - let s = resources.Value.GetString(name, System.Globalization.CultureInfo.CurrentUICulture) - #if DEBUG - if null = s then - System.Diagnostics.Debug.Assert(false, sprintf ""**RESOURCE ERROR**: Resource token %s does not exist!"" name) - #endif - s - - static let mkFunctionValue (tys: System.Type[]) (impl:obj->obj) = - FSharpValue.MakeFunction(FSharpType.MakeFunctionType(tys.[0],tys.[1]), impl) - - static let funTyC = typeof<(obj -> obj)>.GetGenericTypeDefinition() - - static let isNamedType(ty:System.Type) = not (ty.IsArray || ty.IsByRef || ty.IsPointer) - static let isFunctionType (ty1:System.Type) = - isNamedType(ty1) && getTypeInfo(ty1).IsGenericType && (ty1.GetGenericTypeDefinition()).Equals(funTyC) - - static let rec destFunTy (ty:System.Type) = - if isFunctionType ty then - ty, ty.GetGenericArguments() - else - match getTypeInfo(ty).BaseType with - | null -> failwith ""destFunTy: not a function type"" - | b -> destFunTy b - - static let buildFunctionForOneArgPat (ty: System.Type) impl = - let _,tys = destFunTy ty - let rty = tys.[1] - // PERF: this technique is a bit slow (e.g. in simple cases, like 'sprintf ""%x""') - mkFunctionValue tys (fun inp -> impl rty inp) - - static let capture1 (fmt:string) i args ty (go : obj list -> System.Type -> int -> obj) : obj = - match fmt.[i] with - | '%' -> go args ty (i+1) - | 'd' - | 'f' - | 's' -> buildFunctionForOneArgPat ty (fun rty n -> go (n::args) rty (i+1)) - | _ -> failwith ""bad format specifier"" - - // newlines and tabs get converted to strings when read from a resource file - // this will preserve their original intention - static let postProcessString (s : string) = - s.Replace(""\\n"",""\n"").Replace(""\\t"",""\t"").Replace(""\\r"",""\r"").Replace(""\\\"""", ""\"""") - - static let createMessageString (messageString : string) (fmt : Printf.StringFormat<'T>) : 'T = - let fmt = fmt.Value // here, we use the actual error string, as opposed to the one stored as fmt - let len = fmt.Length - - /// Function to capture the arguments and then run. - let rec capture args ty i = - if i >= len || (fmt.[i] = '%' && i+1 >= len) then - let b = new System.Text.StringBuilder() - b.AppendFormat(messageString, [| for x in List.rev args -> x |]) |> ignore - box(b.ToString()) - // REVIEW: For these purposes, this should be a nop, but I'm leaving it - // in incase we ever decide to support labels for the error format string - // E.g., ""%s%d"" - elif System.Char.IsSurrogatePair(fmt,i) then - capture args ty (i+2) - else - match fmt.[i] with - | '%' -> - let i = i+1 - capture1 fmt i args ty capture - | _ -> - capture args ty (i+1) - - (unbox (capture [] (typeof<'T>) 0) : 'T) - - static let mutable swallowResourceText = false - - static let GetStringFunc((messageID : string),(fmt : Printf.StringFormat<'T>)) : 'T = - if swallowResourceText then - sprintf fmt - else - let mutable messageString = GetString(messageID) - messageString <- postProcessString messageString - createMessageString messageString fmt - - /// If set to true, then all error messages will just return the filled 'holes' delimited by ',,,'s - this is for language-neutral testing (e.g. localization-invariant baselines). - static member SwallowResourceText with get () = swallowResourceText - and set (b) = swallowResourceText <- b - // END BOILERPLATE -" - -let RunMain(filename, outFilename, outXmlFilenameOpt, projectNameOpt) = - try - let justfilename = System.IO.Path.GetFileNameWithoutExtension(filename) - if justfilename |> Seq.exists (fun c -> not(System.Char.IsLetterOrDigit(c))) then - Err(filename, 0, sprintf "The filename '%s' is not allowed; only letters and digits can be used, as the filename also becomes the namespace for the SR class" justfilename) - - printfn "fssrgen.fsx: Reading %s" filename - let lines = System.IO.File.ReadAllLines(filename) - |> Array.mapi (fun i s -> i,s) // keep line numbers - |> Array.filter (fun (i,s) -> not(s.StartsWith "#")) // filter out comments - - printfn "fssrgen.fsx: Parsing %s" filename - let stringInfos = lines |> Array.map (fun (i,s) -> ParseLine filename i s) - // now we have array of (lineNum, ident, str, holes, netFormatString) // str has %d, netFormatString has {0} - - printfn "fssrgen.fsx: Validating %s" filename - // validate that all the idents are unique - let allIdents = new System.Collections.Generic.Dictionary() - for (line,(_,ident),_,_,_) in stringInfos do - if allIdents.ContainsKey(ident) then - Err(filename,line,sprintf "Identifier '%s' is already used previously on line %d - each identifier must be unique" ident allIdents.[ident]) - allIdents.Add(ident,line) - - printfn "fssrgen.fsx: Validating uniqueness of %s" filename - // validate that all the strings themselves are unique - let allStrs = new System.Collections.Generic.Dictionary() - for (line,(_,ident),str,_,_) in stringInfos do - if allStrs.ContainsKey(str) then - let prevLine,prevIdent = allStrs.[str] - Err(filename,line,sprintf "String '%s' already appears on line %d with identifier '%s' - each string must be unique" str prevLine prevIdent) - allStrs.Add(str,(line,ident)) - - printfn "fssrgen.fsx: Generating %s" outFilename - - use out = new System.IO.StringWriter() - fprintfn out "// This is a generated file; the original input is '%s'" filename - fprintfn out "namespace %s" justfilename - if Option.isNone outXmlFilenameOpt then - fprintfn out "type internal SR private() =" - else - fprintfn out "%s" stringBoilerPlatePrefix - fprintfn out "type internal SR private() =" - let theResourceName = match projectNameOpt with Some p -> sprintf "%s.%s" p justfilename | None -> justfilename - fprintfn out "%s" (StringBoilerPlate theResourceName) - - printfn "fssrgen.fsx: Generating resource methods for %s" outFilename - // gen each resource method - stringInfos |> Seq.iter (fun (lineNum, (optErrNum,ident), str, holes, netFormatString) -> - let formalArgs = System.Text.StringBuilder() - let actualArgs = System.Text.StringBuilder() - let firstTime = ref true - let n = ref 0 - formalArgs.Append "(" |> ignore - for hole in holes do - if !firstTime then - firstTime := false - else - formalArgs.Append ", " |> ignore - actualArgs.Append " " |> ignore - formalArgs.Append(sprintf "a%d : %s" !n hole) |> ignore - actualArgs.Append(sprintf "a%d" !n) |> ignore - n := !n + 1 - formalArgs.Append ")" |> ignore - fprintfn out " /// %s" str - fprintfn out " /// (Originally from %s:%d)" filename (lineNum+1) - let justPercentsFromFormatString = - (holes |> Array.fold (fun acc holeType -> - acc + match holeType with - | "System.Int32" -> ",,,%d" - | "System.Double" -> ",,,%f" - | "System.String" -> ",,,%s" - | _ -> failwith "unreachable") "") + ",,," - let errPrefix = match optErrNum with - | None -> "" - | Some n -> sprintf "%d, " n - if Option.isNone outXmlFilenameOpt then - fprintfn out " static member %s%s = (%ssprintf \"%s\" %s)" ident (formalArgs.ToString()) errPrefix str (actualArgs.ToString()) - else - fprintfn out " static member %s%s = (%sGetStringFunc(\"%s\",\"%s\") %s)" ident (formalArgs.ToString()) errPrefix ident justPercentsFromFormatString (actualArgs.ToString()) - ) - - if Option.isSome outXmlFilenameOpt then - printfn "fssrgen.fsx: Generating .resx for %s" outFilename - fprintfn out "" - // gen validation method - fprintfn out " /// Call this method once to validate that all known resources are valid; throws if not" - fprintfn out " static member RunStartupValidation() =" - stringInfos |> Seq.iter (fun (lineNum, (optErrNum,ident), str, holes, netFormatString) -> - fprintfn out " ignore(GetString(\"%s\"))" ident - ) - fprintfn out " ()" // in case there are 0 strings, we need the generated code to parse - - let outFileNewText = out.ToString() - let nothingChanged = try File.Exists(outFilename) && File.ReadAllText(outFilename) = outFileNewText with _ -> false - if not nothingChanged then - File.WriteAllText(outFilename, outFileNewText, System.Text.Encoding.UTF8) - - if Option.isSome outXmlFilenameOpt then - // gen resx - let xd = new System.Xml.XmlDocument() - xd.LoadXml(xmlBoilerPlateString) - stringInfos |> Seq.iter (fun (lineNum, (optErrNum,ident), str, holes, netFormatString) -> - let xn = xd.CreateElement("data") - xn.SetAttribute("name",ident) |> ignore - xn.SetAttribute("xml:space","preserve") |> ignore - let xnc = xd.CreateElement "value" - xn.AppendChild xnc |> ignore - xnc.AppendChild(xd.CreateTextNode netFormatString) |> ignore - xd.LastChild.AppendChild xn |> ignore - ) - let outXmlFileNewText = - use outXmlStream = new System.IO.StringWriter() - xd.Save outXmlStream - outXmlStream.ToString() - let outXmlFile = outXmlFilenameOpt.Value - let nothingChanged = try File.Exists(outXmlFile) && File.ReadAllText(outXmlFile) = outXmlFileNewText with _ -> false - if not nothingChanged then - File.WriteAllText(outXmlFile, outXmlFileNewText, System.Text.Encoding.Unicode) - - - printfn "fssrgen.fsx: Done %s" outFilename - 0 - with e -> - PrintErr(filename, 0, sprintf "An exception occurred when processing '%s'\n%s" filename (e.ToString())) - 1 - -#if COMPILED -[] -#endif -let Main args = - - match args |> List.ofArray with - | [ inputFile; outFile; ] -> - let filename = System.IO.Path.GetFullPath(inputFile) - let outFilename = System.IO.Path.GetFullPath(outFile) - - RunMain(filename, outFilename, None, None) - - | [ inputFile; outFile; outXml ] -> - let filename = System.IO.Path.GetFullPath inputFile - let outFilename = System.IO.Path.GetFullPath outFile - let outXmlFilename = System.IO.Path.GetFullPath outXml - - RunMain(filename, outFilename, Some outXmlFilename, None) - - | [ inputFile; outFile; outXml; projectName ] -> - let filename = System.IO.Path.GetFullPath inputFile - let outFilename = System.IO.Path.GetFullPath outFile - let outXmlFilename = System.IO.Path.GetFullPath outXml - - RunMain(filename, outFilename, Some outXmlFilename, Some projectName) - - | _ -> - printfn "Error: invalid arguments." - printfn "Usage: " - 1 -#if !COMPILED -printfn "fssrgen: args = %A" fsi.CommandLineArgs -Main (fsi.CommandLineArgs |> Seq.skip 1 |> Seq.toArray) -#endif diff --git a/src/scripts/fssrgen.targets b/src/scripts/fssrgen.targets deleted file mode 100644 index 3458dd5bff5..00000000000 --- a/src/scripts/fssrgen.targets +++ /dev/null @@ -1,57 +0,0 @@ - - - - - ProcessFsSrGen;$(BuildDependsOn) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - false - - - diff --git a/src/scripts/scriptlib.fsx b/src/scripts/scriptlib.fsx index 6835b9418fe..df3c548cbc4 100644 --- a/src/scripts/scriptlib.fsx +++ b/src/scripts/scriptlib.fsx @@ -60,15 +60,15 @@ module Scripting = let (++) a b = Path.Combine(a,b) - let getBasename a = Path.GetFileNameWithoutExtension a - let getFullPath a = Path.GetFullPath a - let getFilename a = Path.GetFileName a - let getDirectoryName a = Path.GetDirectoryName a + let getBasename (a:string) = Path.GetFileNameWithoutExtension a + let getFullPath (a:string) = Path.GetFullPath a + let getFilename (a:string) = Path.GetFileName a + let getDirectoryName (a:string) = Path.GetDirectoryName a - let copyFile source dir = + let copyFile (source:string) dir = let dest = if not (Directory.Exists dir) then Directory.CreateDirectory dir |>ignore - let result = Path.Combine(dir, Path.GetFileName source) + let result = Path.Combine(dir, getFilename source) result //printfn "Copy %s --> %s" source dest File.Copy(source, dest, true) @@ -93,10 +93,10 @@ module Scripting = module Process = - let processExePath baseDir exe = + let processExePath baseDir (exe:string) = if Path.IsPathRooted(exe) then exe else - match Path.GetDirectoryName(exe) with + match getDirectoryName exe with | "" -> exe | _ -> Path.Combine(baseDir,exe) |> Path.GetFullPath @@ -108,7 +108,7 @@ module Scripting = processInfo.UseShellExecute <- false processInfo.WorkingDirectory <- workDir -#if NETSTANDARD1_6 +#if !NET46 ignore envs // work out what to do about this #else envs @@ -159,9 +159,9 @@ module Scripting = match p.ExitCode with | 0 -> Success - | err -> + | errCode -> let msg = sprintf "Error running command '%s' with args '%s' in directory '%s'.\n---- stdout below --- \n%s\n---- stderr below --- \n%s " exePath arguments workDir (out.ToString()) (err.ToString()) - ErrorLevel (msg, err) + ErrorLevel (msg, errCode) type OutPipe (writer: TextWriter) = member x.Post (msg:string) = lock writer (fun () -> writer.WriteLine(msg)) diff --git a/src/scripts/subst.fsx b/src/scripts/subst.fsx deleted file mode 100644 index 4e8199e0abb..00000000000 --- a/src/scripts/subst.fsx +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. -// -//========================================================================================= - -#load "scriptlib.fsx" - -open System.IO -open System.Text.RegularExpressions - -try - let input = getCmdLineArgReqd "--in:" - let output = getCmdLineArgReqd "--out:" - let pattern1 = getCmdLineArgReqd "--pattern1:" - let replacement1 = getCmdLineArgReqd "--replacement1:" - let pattern2 = getCmdLineArgOptional "--pattern2:" - let replacement2 = getCmdLineArgOptional "--replacement2:" - - let inp0 = File.ReadAllText(input) - let inp1 = Regex.Replace(inp0, pattern1, replacement1) - let inp2 = match pattern2, replacement2 with Some p2, Some r2 -> Regex.Replace(inp1, p2, r2) | None, None -> inp1 | _ -> failwith "if pattern2 is given, replacement2 must also be given" - File.WriteAllText(output,inp2) - exit 0 -with e -> - eprintfn "%A" e - exit 1 diff --git a/src/utils/CompilerLocationUtils.fs b/src/utils/CompilerLocationUtils.fs index 3499e7e5b21..55dcac8ccc0 100644 --- a/src/utils/CompilerLocationUtils.fs +++ b/src/utils/CompilerLocationUtils.fs @@ -37,19 +37,6 @@ module internal FSharpEnvironment = | s -> Some(s) with _ -> None - - // The F# team version number. This version number is used for - // - the F# version number reported by the fsc.exe and fsi.exe banners in the CTP release - // - the F# version number printed in the HTML documentation generator - // - the .NET DLL version number for all VS2008 DLLs - // - the VS2008 registry key, written by the VS2008 installer - // HKEY_LOCAL_MACHINE\Software\Microsoft\.NETFramework\AssemblyFolders\Microsoft.FSharp-" + FSharpTeamVersionNumber - // Also - // - for Beta2, the language revision number indicated on the F# language spec - // - // It is NOT the version number listed on FSharp.Core.dll - let FSharpTeamVersionNumber = "2.0.0.0" - // The F# binary format revision number. The first three digits of this form the significant part of the // format revision number for F# binary signature and optimization metadata. The last digit is not significant. // diff --git a/src/utils/EditDistance.fs b/src/utils/EditDistance.fs index 6beac0c408f..503662400ff 100644 --- a/src/utils/EditDistance.fs +++ b/src/utils/EditDistance.fs @@ -23,33 +23,45 @@ let jaro (s1: string) (s2: string) = let matchRadius = let minLen = Math.Min(s1.Length, s2.Length) minLen / 2 + minLen % 2 - - // An inner function which recursively finds the number - // of matched characters within the radius. - let commonChars (chars1: string) (chars2: string) = - let result = ResizeArray(chars1.Length) - for i = 0 to chars1.Length - 1 do - let c = chars1.[i] - if existsInWin c chars2 i matchRadius then - result.Add c - result - - // The sets of common characters and their lengths as floats - let c1 = commonChars s1 s2 - let c2 = commonChars s2 s1 - let c1length = float c1.Count - let c2length = float c2.Count - + + let rec nextChar (s1:string) (s2:string) i c = + if i < s1.Length then + let c = s1.[i] + if not (existsInWin c s2 i matchRadius) then + nextChar s1 s2 (i + 1) c + else + struct (i, c) + else + struct (i, c) + + // The sets of common characters and their lengths as floats // The number of transpositions within the sets of common characters. - let transpositions = - let mutable mismatches = 0.0 - for i = 0 to (Math.Min(c1.Count, c2.Count)) - 1 do - if c1.[i] <> c2.[i] then - mismatches <- mismatches + 1.0 - - // If one common string is longer than the other - // each additional char counts as half a transposition - (mismatches + abs (c1length - c2length)) / 2.0 + let struct (transpositions, c1length, c2length) = + let rec loop i j mismatches c1length c2length = + if i < s1.Length && j < s2.Length then + let struct (ti, ci) = nextChar s1 s2 i ' ' + let struct (tj, cj) = nextChar s2 s1 j ' ' + if ci <> cj then + loop (ti + 1) (tj + 1) (mismatches + 1) (c1length + 1) (c2length + 1) + else + loop (ti + 1) (tj + 1) mismatches (c1length + 1) (c2length + 1) + else struct (i, j, mismatches, c1length, c2length) + + let struct (i, j, mismatches, c1length, c2length) = loop 0 0 0 0 0 + + let rec loop (s1:string) (s2:string) i length = + if i < s1.Length - 1 then + let c = s1.[i] + if existsInWin c s2 i matchRadius then + loop s1 s2 (i + 1) (length + 1) + else + loop s1 s2 (i + 1) length + else + length + let c1length = loop s1 s2 i c1length |> float + let c2length = loop s2 s1 j c2length |> float + + struct ((float mismatches + abs (c1length - c2length)) / 2.0, c1length, c2length) let tLength = Math.Max(c1length, c2length) diff --git a/src/utils/prim-lexing.fs b/src/utils/prim-lexing.fs index 531e3e5f183..2a49afc5799 100644 --- a/src/utils/prim-lexing.fs +++ b/src/utils/prim-lexing.fs @@ -2,6 +2,7 @@ #nowarn "47" // recursive initialization of LexBuffer +// NOTE: the code in this file is a drop-in replacement runtime for Lexing.fs from the FsLexYacc repository namespace Internal.Utilities.Text.Lexing diff --git a/src/utils/prim-lexing.fsi b/src/utils/prim-lexing.fsi index 49eb2e6bc40..9ee890b8d19 100644 --- a/src/utils/prim-lexing.fsi +++ b/src/utils/prim-lexing.fsi @@ -2,7 +2,10 @@ // LexBuffers are for use with automatically generated lexical analyzers, // in particular those produced by 'fslex'. - +// +// NOTE: the code in this file is a drop-in replacement runtime for Lexing.fsi from the FsLexYacc repository +// and is referenced by generated code for the three FsLex generated lexers in the F# compiler. +// The underlying table format intepreted must precisely match the format generated by FsLex. namespace Internal.Utilities.Text.Lexing open System.Collections.Generic @@ -14,27 +17,35 @@ open Microsoft.FSharp.Control type internal Position = /// The file index for the file associated with the input stream, use fileOfFileIndex in range.fs to decode val FileIndex : int + /// The line number in the input stream, assuming fresh positions have been updated /// for the new line by modifying the EndPos property of the LexBuffer. val Line : int + /// The line number for the position in the input stream, assuming fresh positions have been updated /// using for the new line. val OriginalLine : int + /// The character number in the input stream. val AbsoluteOffset : int + /// Return absolute offset of the start of the line marked by the position. val StartOfLineAbsoluteOffset : int + /// Return the column number marked by the position, /// i.e. the difference between the AbsoluteOffset and the StartOfLineAbsoluteOffset member Column : int - // Given a position just beyond the end of a line, return a position at the start of the next line. + + /// Given a position just beyond the end of a line, return a position at the start of the next line. member NextLine : Position /// Given a position at the start of a token of length n, return a position just beyond the end of the token. member EndOfToken: n:int -> Position + /// Gives a position shifted by specified number of characters. member ShiftColumnBy: by:int -> Position - // Same line, column -1. + + /// Same line, column -1. member ColumnMinusOne : Position /// Apply a #line directive. @@ -47,11 +58,15 @@ type internal Position = [] /// Input buffers consumed by lexers generated by fslex.exe. +/// The type must be generic to match the code generated by FsLex and FsYacc (if you would like to +/// fix this, please submit a PR to the FsLexYacc repository allowing for optional emit of a non-generic type reference). type internal LexBuffer<'Char> = /// The start position for the lexeme. member StartPos: Position with get,set + /// The end position for the lexeme. member EndPos: Position with get,set + /// The matched string. member Lexeme: 'Char [] @@ -67,13 +82,17 @@ type internal LexBuffer<'Char> = /// Create a lex buffer suitable for Unicode lexing that reads characters from the given array. /// Important: does take ownership of the array. static member FromChars: char[] -> LexBuffer + /// Create a lex buffer that reads character or byte inputs by using the given function. static member FromFunction: ('Char[] * int * int -> int) -> LexBuffer<'Char> /// The type of tables for an unicode lexer generated by fslex.exe. [] type internal UnicodeTables = + + /// Create the tables from raw data static member Create : uint16[][] * uint16[] -> UnicodeTables + /// Interpret tables for a unicode lexer generated by fslex.exe. member Interpret: initialState:int * LexBuffer -> int diff --git a/src/utils/prim-parsing.fs b/src/utils/prim-parsing.fs index b5e87d19f2d..c9ff1bb595f 100644 --- a/src/utils/prim-parsing.fs +++ b/src/utils/prim-parsing.fs @@ -1,6 +1,9 @@ // Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. +// NOTE: the code in this file is a drop-in replacement runtime for Parsing.fs from the FsLexYacc repository + namespace Internal.Utilities.Text.Parsing + open Internal.Utilities open Internal.Utilities.Text.Lexing @@ -11,21 +14,29 @@ exception RecoverableParseError exception Accept of obj [] -type internal IParseState(ruleStartPoss:Position[],ruleEndPoss:Position[],lhsPos:Position[],ruleValues:obj[],lexbuf:LexBuffer) = +type internal IParseState(ruleStartPoss:Position[], ruleEndPoss:Position[], lhsPos:Position[], ruleValues:obj[], lexbuf:LexBuffer) = member p.LexBuffer = lexbuf - member p.InputRange n = ruleStartPoss.[n-1], ruleEndPoss.[n-1]; + + member p.InputRange n = ruleStartPoss.[n-1], ruleEndPoss.[n-1] + member p.InputStartPosition n = ruleStartPoss.[n-1] - member p.InputEndPosition n = ruleEndPoss.[n-1]; + + member p.InputEndPosition n = ruleEndPoss.[n-1] + member p.ResultStartPosition = lhsPos.[0] - member p.ResultEndPosition = lhsPos.[1]; - member p.GetInput n = ruleValues.[n-1]; - member p.ResultRange = (lhsPos.[0], lhsPos.[1]); - member p.RaiseError() = raise RecoverableParseError (* NOTE: this binding tests the fairly complex logic associated with an object expression implementing a generic abstract method *) -//------------------------------------------------------------------------- -// This context is passed to the error reporter when a syntax error occurs + member p.ResultEndPosition = lhsPos.[1] + + member p.GetInput n = ruleValues.[n-1] + + member p.ResultRange = (lhsPos.[0], lhsPos.[1]) + + // Side note: this definition coincidentally tests the fairly complex logic associated with an object expression implementing a generic abstract method. + member p.RaiseError() = raise RecoverableParseError + [] +/// This context is passed to the error reporter when a syntax error occurs type internal ParseErrorContext<'tok> (//lexbuf: LexBuffer<_>, stateStack:int list, @@ -49,24 +60,24 @@ type internal ParseErrorContext<'tok> // This is the data structure emitted as code by FSYACC. type internal Tables<'tok> = - { reductions: (IParseState -> obj)[]; - endOfInputTag: int; - tagOfToken: 'tok -> int; - dataOfToken: 'tok -> obj; - actionTableElements: uint16[]; - actionTableRowOffsets: uint16[]; - reductionSymbolCounts: uint16[]; - immediateActions: uint16[]; - gotos: uint16[]; - sparseGotoTableRowOffsets: uint16[]; - stateToProdIdxsTableElements: uint16[]; - stateToProdIdxsTableRowOffsets: uint16[]; - productionToNonTerminalTable: uint16[]; + { reductions: (IParseState -> obj)[] + endOfInputTag: int + tagOfToken: 'tok -> int + dataOfToken: 'tok -> obj + actionTableElements: uint16[] + actionTableRowOffsets: uint16[] + reductionSymbolCounts: uint16[] + immediateActions: uint16[] + gotos: uint16[] + sparseGotoTableRowOffsets: uint16[] + stateToProdIdxsTableElements: uint16[] + stateToProdIdxsTableRowOffsets: uint16[] + productionToNonTerminalTable: uint16[] /// For fsyacc.exe, this entry is filled in by context from the generated parser file. If no 'parse_error' function /// is defined by the user then ParseHelpers.parse_error is used by default (ParseHelpers is opened /// at the top of the generated parser file) - parseError: ParseErrorContext<'tok> -> unit; - numTerminals: int; + parseError: ParseErrorContext<'tok> -> unit + numTerminals: int tagOfErrorTerminal: int } //------------------------------------------------------------------------- @@ -91,8 +102,8 @@ type Stack<'a>(n) = member buf.Peep() = contents.[count - 1] member buf.Top(n) = [ for x in contents.[max 0 (count-n)..count - 1] -> x ] |> List.rev member buf.Push(x) = - buf.Ensure(count + 1); - contents.[count] <- x; + buf.Ensure(count + 1) + contents.[count] <- x count <- count + 1 member buf.IsEmpty = (count = 0) @@ -197,10 +208,10 @@ module internal Implementation = let interpret (tables: Tables<'tok>) lexer (lexbuf : LexBuffer<_>) initialState = #if DEBUG - if Flags.debug then System.Console.WriteLine("\nParser: interpret tables"); + if Flags.debug then System.Console.WriteLine("\nParser: interpret tables") #endif let stateStack : Stack = new Stack<_>(100) - stateStack.Push(initialState); + stateStack.Push(initialState) let valueStack = new Stack(100) let mutable haveLookahead = false let mutable lookaheadToken = Unchecked.defaultof<'tok> @@ -244,19 +255,19 @@ module internal Implementation = let rec popStackUntilErrorShifted(tokenOpt) = // Keep popping the stack until the "error" terminal is shifted #if DEBUG - if Flags.debug then System.Console.WriteLine("popStackUntilErrorShifted"); + if Flags.debug then System.Console.WriteLine("popStackUntilErrorShifted") #endif if stateStack.IsEmpty then #if DEBUG if Flags.debug then - System.Console.WriteLine("state stack empty during error recovery - generating parse error"); + System.Console.WriteLine("state stack empty during error recovery - generating parse error") #endif - failwith "parse error"; + failwith "parse error" let currState = stateStack.Peep() #if DEBUG if Flags.debug then - System.Console.WriteLine("In state {0} during error recovery", currState); + System.Console.WriteLine("In state {0} during error recovery", currState) #endif let action = actionTable.Read(currState, tables.tagOfErrorTerminal) @@ -269,22 +280,22 @@ module internal Implementation = actionKind (actionTable.Read(nextState, tables.tagOfToken(token))) = shiftFlag) then #if DEBUG - if Flags.debug then System.Console.WriteLine("shifting error, continuing with error recovery"); + if Flags.debug then System.Console.WriteLine("shifting error, continuing with error recovery") #endif let nextState = actionValue action // The "error" non terminal needs position information, though it tends to be unreliable. // Use the StartPos/EndPos from the lex buffer. - valueStack.Push(ValueInfo(box (), lexbuf.StartPos, lexbuf.EndPos)); + valueStack.Push(ValueInfo(box (), lexbuf.StartPos, lexbuf.EndPos)) stateStack.Push(nextState) else if valueStack.IsEmpty then - failwith "parse error"; + failwith "parse error" #if DEBUG if Flags.debug then - System.Console.WriteLine("popping stack during error recovery"); + System.Console.WriteLine("popping stack during error recovery") #endif - valueStack.Pop(); - stateStack.Pop(); + valueStack.Pop() + stateStack.Pop() popStackUntilErrorShifted(tokenOpt) while not finished do @@ -316,7 +327,7 @@ module internal Implementation = lookaheadToken <- lexer lexbuf lookaheadStartPos <- lexbuf.StartPos lookaheadEndPos <- lexbuf.EndPos - haveLookahead <- true; + haveLookahead <- true let tag = if haveLookahead then tables.tagOfToken lookaheadToken @@ -328,17 +339,17 @@ module internal Implementation = let kind = actionKind action if kind = shiftFlag then ( if errorSuppressionCountDown > 0 then - errorSuppressionCountDown <- errorSuppressionCountDown - 1; + errorSuppressionCountDown <- errorSuppressionCountDown - 1 #if DEBUG - if Flags.debug then Console.WriteLine("shifting, reduced errorRecoverylevel to {0}\n", errorSuppressionCountDown); + if Flags.debug then Console.WriteLine("shifting, reduced errorRecoverylevel to {0}\n", errorSuppressionCountDown) #endif let nextState = actionValue action - if not haveLookahead then failwith "shift on end of input!"; + if not haveLookahead then failwith "shift on end of input!" let data = tables.dataOfToken lookaheadToken - valueStack.Push(ValueInfo(data, lookaheadStartPos, lookaheadEndPos)); - stateStack.Push(nextState); + valueStack.Push(ValueInfo(data, lookaheadStartPos, lookaheadEndPos)) + stateStack.Push(nextState) #if DEBUG - if Flags.debug then Console.WriteLine("shift/consume input {0}, shift to state {1}", report haveLookahead lookaheadToken, nextState); + if Flags.debug then Console.WriteLine("shift/consume input {0}, shift to state {1}", report haveLookahead lookaheadToken, nextState) #endif haveLookahead <- false @@ -348,31 +359,31 @@ module internal Implementation = let n = int tables.reductionSymbolCounts.[prod] // pop the symbols, populate the values and populate the locations #if DEBUG - if Flags.debug then Console.Write("reduce popping {0} values/states, lookahead {1}", n, report haveLookahead lookaheadToken); + if Flags.debug then Console.Write("reduce popping {0} values/states, lookahead {1}", n, report haveLookahead lookaheadToken) #endif for i = 0 to n - 1 do - if valueStack.IsEmpty then failwith "empty symbol stack"; + if valueStack.IsEmpty then failwith "empty symbol stack" let topVal = valueStack.Peep() - valueStack.Pop(); - stateStack.Pop(); - ruleValues.[(n-i)-1] <- topVal.value; - ruleStartPoss.[(n-i)-1] <- topVal.startPos; - ruleEndPoss.[(n-i)-1] <- topVal.endPos; - if i = 0 then lhsPos.[1] <- topVal.endPos; + valueStack.Pop() + stateStack.Pop() + ruleValues.[(n-i)-1] <- topVal.value + ruleStartPoss.[(n-i)-1] <- topVal.startPos + ruleEndPoss.[(n-i)-1] <- topVal.endPos + if i = 0 then lhsPos.[1] <- topVal.endPos if i = n - 1 then lhsPos.[0] <- topVal.startPos // Use the lookahead token to populate the locations if the rhs is empty if n = 0 then if haveLookahead then - lhsPos.[0] <- lookaheadStartPos; - lhsPos.[1] <- lookaheadEndPos; + lhsPos.[0] <- lookaheadStartPos + lhsPos.[1] <- lookaheadEndPos else - lhsPos.[0] <- lexbuf.StartPos; - lhsPos.[1] <- lexbuf.EndPos; + lhsPos.[0] <- lexbuf.StartPos + lhsPos.[1] <- lexbuf.EndPos try - // printf "reduce %d\n" prod; + // printf "reduce %d\n" prod let redResult = reduction parseState - valueStack.Push(ValueInfo(redResult, lhsPos.[0], lhsPos.[1])); + valueStack.Push(ValueInfo(redResult, lhsPos.[0], lhsPos.[1])) let currState = stateStack.Peep() let newGotoState = gotoTable.Read(int tables.productionToNonTerminalTable.[prod], currState) stateStack.Push(newGotoState) @@ -381,23 +392,23 @@ module internal Implementation = #endif with | Accept res -> - finished <- true; + finished <- true valueStack.Push(ValueInfo(res, lhsPos.[0], lhsPos.[1])) | RecoverableParseError -> #if DEBUG - if Flags.debug then Console.WriteLine("RecoverableParseErrorException...\n"); + if Flags.debug then Console.WriteLine("RecoverableParseErrorException...\n") #endif - popStackUntilErrorShifted(None); + popStackUntilErrorShifted(None) // User code raised a Parse_error. Don't report errors again until three tokens have been shifted errorSuppressionCountDown <- 3 elif kind = errorFlag then ( #if DEBUG - if Flags.debug then Console.Write("ErrorFlag... "); + if Flags.debug then Console.Write("ErrorFlag... ") #endif // Silently discard inputs and don't report errors // until three tokens in a row have been shifted #if DEBUG - if Flags.debug then printfn "error on token '%s' " (report haveLookahead lookaheadToken); + if Flags.debug then printfn "error on token '%s' " (report haveLookahead lookaheadToken) #endif if errorSuppressionCountDown > 0 then // If we're in the end-of-file count down then we're very keen to 'Accept'. @@ -405,16 +416,16 @@ module internal Implementation = // and an EOF token. if inEofCountDown && eofCountDown < 10 then #if DEBUG - if Flags.debug then printfn "popping stack, looking to shift both 'error' and that token, during end-of-file error recovery" ; + if Flags.debug then printfn "popping stack, looking to shift both 'error' and that token, during end-of-file error recovery" #endif - popStackUntilErrorShifted(if haveLookahead then Some(lookaheadToken) else None); + popStackUntilErrorShifted(if haveLookahead then Some(lookaheadToken) else None) // If we don't haveLookahead then the end-of-file count down is over and we have no further options. if not haveLookahead then failwith "parse error: unexpected end of file" #if DEBUG - if Flags.debug then printfn "discarding token '%s' during error suppression" (report haveLookahead lookaheadToken); + if Flags.debug then printfn "discarding token '%s' during error suppression" (report haveLookahead lookaheadToken) #endif // Discard the token haveLookahead <- false @@ -449,28 +460,30 @@ module internal Implementation = if not (explicit.Contains(tag)) then yield tag ] in //let activeRules = stateStack |> List.iter (fun state -> - let errorContext = new ParseErrorContext<'tok>(stateStack,parseState, reduceTokens,currentToken,reducibleProductions, shiftableTokens, "syntax error") - tables.parseError(errorContext); - popStackUntilErrorShifted(None); - errorSuppressionCountDown <- 3; + let errorContext = new ParseErrorContext<'tok>(stateStack, parseState, reduceTokens, currentToken, reducibleProductions, shiftableTokens, "syntax error") + tables.parseError(errorContext) + popStackUntilErrorShifted(None) + errorSuppressionCountDown <- 3 #if DEBUG - if Flags.debug then System.Console.WriteLine("generated syntax error and shifted error token, haveLookahead = {0}\n", haveLookahead); + if Flags.debug then System.Console.WriteLine("generated syntax error and shifted error token, haveLookahead = {0}\n", haveLookahead) #endif ) ) elif kind = acceptFlag then finished <- true #if DEBUG else - if Flags.debug then System.Console.WriteLine("ALARM!!! drop through case in parser"); + if Flags.debug then System.Console.WriteLine("ALARM!!! drop through case in parser") #endif - done; + done // OK, we're done - read off the overall generated value valueStack.Peep().value type internal Tables<'tok> with - member tables.Interpret (lexer,lexbuf,initialState) = + member tables.Interpret (lexer, lexbuf, initialState) = Implementation.interpret tables lexer lexbuf initialState module internal ParseHelpers = + let parse_error (_s:string) = () + let parse_error_rich = (None : (ParseErrorContext<_> -> unit) option) diff --git a/src/utils/prim-parsing.fsi b/src/utils/prim-parsing.fsi index d6502da55ba..7ec3e7a0a80 100644 --- a/src/utils/prim-parsing.fsi +++ b/src/utils/prim-parsing.fsi @@ -1,6 +1,9 @@ // Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. +// NOTE: the code in this file is a drop-in replacement runtime for Parsing.fsi from the FsLexYacc repository + namespace Internal.Utilities.Text.Parsing + open Internal.Utilities open Internal.Utilities.Text.Lexing @@ -8,22 +11,31 @@ open System.Collections.Generic [] type internal IParseState = + /// Get the start and end position for the terminal or non-terminal at a given index matched by the production. member InputRange: index:int -> Position * Position + /// Get the end position for the terminal or non-terminal at a given index matched by the production. member InputEndPosition: int -> Position + /// Get the start position for the terminal or non-terminal at a given index matched by the production. member InputStartPosition: int -> Position + /// Get the start of the range of positions matched by the production. member ResultStartPosition: Position + /// Get the end of the range of positions matched by the production. member ResultEndPosition: Position + /// Get the full range of positions matched by the production. member ResultRange: Position * Position + /// Get the value produced by the terminal or non-terminal at the given position. member GetInput : int -> obj + /// Raise an error in this parse context. member RaiseError<'b> : unit -> 'b + /// Return the LexBuffer for this parser instance. member LexBuffer : LexBuffer @@ -33,16 +45,22 @@ type internal IParseState = type internal ParseErrorContext<'tok> = /// The stack of state indexes active at the parse error . member StateStack : int list + /// The state active at the parse error. member ParseState : IParseState + /// The tokens that would cause a reduction at the parse error. member ReduceTokens: int list + /// The stack of productions that would be reduced at the parse error. member ReducibleProductions : int list list + /// The token that caused the parse error. member CurrentToken : 'tok option + /// The token that would cause a shift at the parse error. member ShiftTokens : int list + /// The message associated with the parse error. member Message : string @@ -51,35 +69,50 @@ type internal ParseErrorContext<'tok> = type internal Tables<'tok> = { /// The reduction table. - reductions: (IParseState -> obj) array ; + reductions: (IParseState -> obj)[] + /// The token number indicating the end of input. - endOfInputTag: int; + endOfInputTag: int + /// A function to compute the tag of a token. - tagOfToken: 'tok -> int; + tagOfToken: 'tok -> int + /// A function to compute the data carried by a token. - dataOfToken: 'tok -> obj; + dataOfToken: 'tok -> obj + /// The sparse action table elements. - actionTableElements: uint16[]; + actionTableElements: uint16[] + /// The sparse action table row offsets. - actionTableRowOffsets: uint16[]; + actionTableRowOffsets: uint16[] + /// The number of symbols for each reduction. - reductionSymbolCounts: uint16[]; + reductionSymbolCounts: uint16[] + /// The immediate action table. - immediateActions: uint16[]; + immediateActions: uint16[] + /// The sparse goto table. - gotos: uint16[]; + gotos: uint16[] + /// The sparse goto table row offsets. - sparseGotoTableRowOffsets: uint16[]; + sparseGotoTableRowOffsets: uint16[] + /// The sparse table for the productions active for each state. - stateToProdIdxsTableElements: uint16[]; + stateToProdIdxsTableElements: uint16[] + /// The sparse table offsets for the productions active for each state. - stateToProdIdxsTableRowOffsets: uint16[]; + stateToProdIdxsTableRowOffsets: uint16[] + /// This table is logically part of the Goto table. - productionToNonTerminalTable: uint16[]; + productionToNonTerminalTable: uint16[] + /// This function is used to hold the user specified "parse_error" or "parse_error_rich" functions. - parseError: ParseErrorContext<'tok> -> unit; + parseError: ParseErrorContext<'tok> -> unit + /// The total number of terminals. - numTerminals: int; + numTerminals: int + /// The tag of the error terminal. tagOfErrorTerminal: int } @@ -89,6 +122,7 @@ type internal Tables<'tok> = /// Indicates an accept action has occurred. exception internal Accept of obj + /// Indicates a parse error has occurred and parse recovery is in progress. exception internal RecoverableParseError @@ -99,8 +133,10 @@ module internal Flags = /// Helpers used by generated parsers. module internal ParseHelpers = + /// The default implementation of the parse_error_rich function. val parse_error_rich: (ParseErrorContext<'tok> -> unit) option + /// The default implementation of the parse_error function. val parse_error: string -> unit diff --git a/src/utils/reshapedmsbuild.fs b/src/utils/reshapedmsbuild.fs index 925b904e3e2..f84e8a5d319 100644 --- a/src/utils/reshapedmsbuild.fs +++ b/src/utils/reshapedmsbuild.fs @@ -85,6 +85,10 @@ module internal MsBuildAdapters = | Version46 = 7 | Version461 = 8 | Version452 = 9 + | Version462 = 10 + | Version47 = 11 + | Version471 = 12 + | Version472 = 13 | VersionLatest = 8 //TargetDotNetFrameworkVersion.Version461 /// diff --git a/src/utils/sformat.fs b/src/utils/sformat.fs index d2d35117771..7620a2c411c 100644 --- a/src/utils/sformat.fs +++ b/src/utils/sformat.fs @@ -199,6 +199,8 @@ namespace Microsoft.FSharp.Text.StructuredPrintfImpl let rightBracket = tagPunctuation "]" let leftBrace= tagPunctuation "{" let rightBrace = tagPunctuation "}" + let leftBraceBar = tagPunctuation "{|" + let rightBraceBar = tagPunctuation "|}" let equals = tagOperator "=" let arrow = tagPunctuation "->" let questionMark = tagPunctuation "?" diff --git a/src/utils/sformat.fsi b/src/utils/sformat.fsi index fb768703e17..afdd931f900 100644 --- a/src/utils/sformat.fsi +++ b/src/utils/sformat.fsi @@ -148,6 +148,8 @@ namespace Microsoft.FSharp.Text.StructuredPrintfImpl val rightBracket : TaggedText val leftBrace: TaggedText val rightBrace : TaggedText + val leftBraceBar: TaggedText + val rightBraceBar : TaggedText val equals : TaggedText val arrow : TaggedText val questionMark : TaggedText diff --git a/tests/.gitignore b/tests/.gitignore index 2de72583ada..bf970a32fde 100644 --- a/tests/.gitignore +++ b/tests/.gitignore @@ -1,6 +1,5 @@ FSharp_* net40-fsharpqa-suite-* CoreUnit_* -TestResults *.il dont.run.peverify \ No newline at end of file diff --git a/tests/EndToEndBuildTests/BasicProvider/TestBasicProvider.cmd b/tests/EndToEndBuildTests/BasicProvider/TestBasicProvider.cmd index 7d8475c39c3..56af32e144b 100644 --- a/tests/EndToEndBuildTests/BasicProvider/TestBasicProvider.cmd +++ b/tests/EndToEndBuildTests/BasicProvider/TestBasicProvider.cmd @@ -16,17 +16,18 @@ rem Test it with both desktop and coreclr compilers rem if not '%NUGET_PACKAGES%' == '' rd %NUGET_PACKAGES%\BasicProvider /s /q +taskkill /F /IM dotnet.exe -@echo %__scriptpath%..\..\..\tools\dotnet20\dotnet.exe pack BasicProvider\BasicProvider.fsproj -o %~dp0artifacts -c release -v minimal -p:FSharpTestCompilerVersion=net40 -%__scriptpath%..\..\..\tools\dotnet20\dotnet.exe pack BasicProvider\BasicProvider.fsproj -o %~dp0artifacts -c release -v minimal -p:FSharpTestCompilerVersion=net40 +@echo %__scriptpath%..\..\..\artifacts\toolset\dotnet\dotnet.exe pack BasicProvider\BasicProvider.fsproj -o %~dp0artifacts -c release -v minimal -p:FSharpTestCompilerVersion=net40 -nr=false +%__scriptpath%..\..\..\artifacts\toolset\dotnet\dotnet.exe pack BasicProvider\BasicProvider.fsproj -o %~dp0artifacts -c release -v minimal -p:FSharpTestCompilerVersion=net40 -nr=false @if ERRORLEVEL 1 echo Error: TestBasicProvider failed && goto :failure -@echo %__scriptpath%..\..\..\tools\dotnet20\dotnet.exe test BasicProvider.Tests\BasicProvider.Tests.fsproj -c release -v minimal -p:TestTargetFramework=net461 -p:FSharpTestCompilerVersion=net40 -%__scriptpath%..\..\..\tools\dotnet20\dotnet.exe test BasicProvider.Tests\BasicProvider.Tests.fsproj -c release -v minimal -p:TestTargetFramework=net461 -p:FSharpTestCompilerVersion=net40 +@echo %__scriptpath%..\..\..\artifacts\toolset\dotnet\dotnet.exe test BasicProvider.Tests\BasicProvider.Tests.fsproj -c release -v minimal -p:TestTargetFramework=net461 -p:FSharpTestCompilerVersion=net40 -nr=false +%__scriptpath%..\..\..\artifacts\toolset\dotnet\dotnet.exe test BasicProvider.Tests\BasicProvider.Tests.fsproj -c release -v minimal -p:TestTargetFramework=net461 -p:FSharpTestCompilerVersion=net40 -nr=false @if ERRORLEVEL 1 echo Error: TestBasicProvider failed && goto :failure -@echo %__scriptpath%..\..\..\tools\dotnet20\dotnet.exe test BasicProvider.Tests\BasicProvider.Tests.fsproj -c release -v minimal -p:TestTargetFramework=netcoreapp2.0 -p:FSharpTestCompilerVersion=coreclr -%__scriptpath%..\..\..\tools\dotnet20\dotnet.exe test BasicProvider.Tests\BasicProvider.Tests.fsproj -c release -v minimal -p:TestTargetFramework=netcoreapp2.0 -p:FSharpTestCompilerVersion=coreclr +@echo %__scriptpath%..\..\..\artifacts\toolset\dotnet\dotnet.exe test BasicProvider.Tests\BasicProvider.Tests.fsproj -c release -v minimal -p:TestTargetFramework=netcoreapp2.0 -p:FSharpTestCompilerVersion=coreclr -nr=false +%__scriptpath%..\..\..\artifacts\toolset\dotnet\dotnet.exe test BasicProvider.Tests\BasicProvider.Tests.fsproj -c release -v minimal -p:TestTargetFramework=netcoreapp2.0 -p:FSharpTestCompilerVersion=coreclr -nr=false @if ERRORLEVEL 1 echo Error: TestBasicProvider failed && goto :failure rem @@ -35,16 +36,16 @@ rem Test it with both desktop and coreclr compilers rem if not '%NUGET_PACKAGES%' == '' rd %NUGET_PACKAGES%\BasicProvider /s /q -@echo %__scriptpath%..\..\..\tools\dotnet20\dotnet.exe pack BasicProvider\BasicProvider.fsproj -o %~dp0artifacts -c release -v minimal -p:FSharpTestCompilerVersion=coreclr -%__scriptpath%..\..\..\tools\dotnet20\dotnet.exe pack BasicProvider\BasicProvider.fsproj -o %~dp0artifacts -c release -v minimal -p:FSharpTestCompilerVersion=coreclr +@echo %__scriptpath%..\..\..\artifacts\toolset\dotnet\dotnet.exe pack BasicProvider\BasicProvider.fsproj -o %~dp0artifacts -c release -v minimal -p:FSharpTestCompilerVersion=coreclr -nr=false +%__scriptpath%..\..\..\artifacts\toolset\dotnet\dotnet.exe pack BasicProvider\BasicProvider.fsproj -o %~dp0artifacts -c release -v minimal -p:FSharpTestCompilerVersion=coreclr -nr=false @if ERRORLEVEL 1 echo Error: TestBasicProvider failed && goto :failure -@echo%__scriptpath%..\..\..\tools\dotnet20\dotnet.exe test BasicProvider.Tests\BasicProvider.Tests.fsproj -c release -v minimal -p:TestTargetFramework=net461 -p:FSharpTestCompilerVersion=net40 -%__scriptpath%..\..\..\tools\dotnet20\dotnet.exe test BasicProvider.Tests\BasicProvider.Tests.fsproj -c release -v minimal -p:TestTargetFramework=net461 -p:FSharpTestCompilerVersion=net40 +@echo%__scriptpath%..\..\..\artifacts\toolset\dotnet\dotnet.exe test BasicProvider.Tests\BasicProvider.Tests.fsproj -c release -v minimal -p:TestTargetFramework=net461 -p:FSharpTestCompilerVersion=net40 -nr=false +%__scriptpath%..\..\..\artifacts\toolset\dotnet\dotnet.exe test BasicProvider.Tests\BasicProvider.Tests.fsproj -c release -v minimal -p:TestTargetFramework=net461 -p:FSharpTestCompilerVersion=net40 -nr=false @if ERRORLEVEL 1 echo Error: TestBasicProvider failed && goto :failure -@echo %__scriptpath%..\..\..\tools\dotnet20\dotnet.exe test BasicProvider.Tests\BasicProvider.Tests.fsproj -c release -v minimal -p:TestTargetFramework=netcoreapp2.0 -p:FSharpTestCompilerVersion=coreclr -%__scriptpath%..\..\..\tools\dotnet20\dotnet.exe test BasicProvider.Tests\BasicProvider.Tests.fsproj -c release -v minimal -p:TestTargetFramework=netcoreapp2.0 -p:FSharpTestCompilerVersion=coreclr +@echo %__scriptpath%..\..\..\artifacts\toolset\dotnet\dotnet.exe test BasicProvider.Tests\BasicProvider.Tests.fsproj -c release -v minimal -p:TestTargetFramework=netcoreapp2.0 -p:FSharpTestCompilerVersion=coreclr -nr=false +%__scriptpath%..\..\..\artifacts\toolset\dotnet\dotnet.exe test BasicProvider.Tests\BasicProvider.Tests.fsproj -c release -v minimal -p:TestTargetFramework=netcoreapp2.0 -p:FSharpTestCompilerVersion=coreclr -nr=false @if ERRORLEVEL 1 echo Error: TestBasicProvider failed && goto :failure :success diff --git a/tests/EndToEndBuildTests/ComboProvider/TestComboProvider.cmd b/tests/EndToEndBuildTests/ComboProvider/TestComboProvider.cmd index ccd8c4d2e3b..74035032e29 100644 --- a/tests/EndToEndBuildTests/ComboProvider/TestComboProvider.cmd +++ b/tests/EndToEndBuildTests/ComboProvider/TestComboProvider.cmd @@ -15,17 +15,18 @@ rem Test it with both desktop and coreclr compilers rem if not '%NUGET_PACKAGES%' == '' rd %NUGET_PACKAGES%\ComboProvider /s /q +taskkill /F /IM dotnet.exe -@echo %__scriptpath%..\..\..\tools\dotnet20\dotnet.exe pack ComboProvider\ComboProvider\ComboProvider.fsproj -o %~dp0artifacts -c release -v minimal -p:FSharpTestCompilerVersion=net40 -%__scriptpath%..\..\..\tools\dotnet20\dotnet.exe pack ComboProvider\ComboProvider\ComboProvider.fsproj -o %~dp0artifacts -c release -v minimal -p:FSharpTestCompilerVersion=net40 +@echo %__scriptpath%..\..\..\artifacts\toolset\dotnet\dotnet.exe pack ComboProvider\ComboProvider\ComboProvider.fsproj -o %~dp0artifacts -c release -v minimal -p:FSharpTestCompilerVersion=net40 -nr=false +%__scriptpath%..\..\..\artifacts\toolset\dotnet\dotnet.exe pack ComboProvider\ComboProvider\ComboProvider.fsproj -o %~dp0artifacts -c release -v minimal -p:FSharpTestCompilerVersion=net40 -nr=false @if ERRORLEVEL 1 echo Error: ComboProvider failed && goto :failure -@echo %__scriptpath%..\..\..\tools\dotnet20\dotnet.exe test ComboProvider\ComboProvider.Tests\ComboProvider.Tests.fsproj -c release -v minimal -p:TestTargetFramework=net461 -p:FSharpTestCompilerVersion=net40 -%__scriptpath%..\..\..\tools\dotnet20\dotnet.exe test ComboProvider\ComboProvider.Tests\ComboProvider.Tests.fsproj -c release -v minimal -p:TestTargetFramework=net461 -p:FSharpTestCompilerVersion=net40 +@echo %__scriptpath%..\..\..\artifacts\toolset\dotnet\dotnet.exe test ComboProvider\ComboProvider.Tests\ComboProvider.Tests.fsproj -c release -v minimal -p:TestTargetFramework=net461 -p:FSharpTestCompilerVersion=net40 -nr=false +%__scriptpath%..\..\..\artifacts\toolset\dotnet\dotnet.exe test ComboProvider\ComboProvider.Tests\ComboProvider.Tests.fsproj -c release -v minimal -p:TestTargetFramework=net461 -p:FSharpTestCompilerVersion=net40 -nr=false @if ERRORLEVEL 1 echo Error: ComboProvider failed && goto :failure -@echo %__scriptpath%..\..\..\tools\dotnet20\dotnet.exe test ComboProvider\ComboProvider.Tests\ComboProvider.Tests.fsproj -c release -v minimal -p:TestTargetFramework=netcoreapp2.0 -p:FSharpTestCompilerVersion=coreclr -%__scriptpath%..\..\..\tools\dotnet20\dotnet.exe test ComboProvider\ComboProvider.Tests\ComboProvider.Tests.fsproj -c release -v minimal -p:TestTargetFramework=netcoreapp2.0 -p:FSharpTestCompilerVersion=coreclr +@echo %__scriptpath%..\..\..\artifacts\toolset\dotnet\dotnet.exe test ComboProvider\ComboProvider.Tests\ComboProvider.Tests.fsproj -c release -v minimal -p:TestTargetFramework=netcoreapp2.0 -p:FSharpTestCompilerVersion=coreclr -nr=false +%__scriptpath%..\..\..\artifacts\toolset\dotnet\dotnet.exe test ComboProvider\ComboProvider.Tests\ComboProvider.Tests.fsproj -c release -v minimal -p:TestTargetFramework=netcoreapp2.0 -p:FSharpTestCompilerVersion=coreclr -nr=false @if ERRORLEVEL 1 echo Error: ComboProviderProvider failed && goto :failure rem @@ -34,16 +35,16 @@ rem Test it with both desktop and coreclr compilers rem if not '%NUGET_PACKAGES%' == '' rd %NUGET_PACKAGES%\ComboProvider /s /q -@echo %__scriptpath%..\..\..\tools\dotnet20\dotnet.exe pack ComboProvider\ComboProvider\ComboProvider.fsproj -o %~dp0artifacts -c release -v minimal -p:FSharpTestCompilerVersion=coreclr -%__scriptpath%..\..\..\tools\dotnet20\dotnet.exe pack ComboProvider\ComboProvider\ComboProvider.fsproj -o %~dp0artifacts -c release -v minimal -p:FSharpTestCompilerVersion=coreclr +@echo %__scriptpath%..\..\..\artifacts\toolset\dotnet\dotnet.exe pack ComboProvider\ComboProvider\ComboProvider.fsproj -o %~dp0artifacts -c release -v minimal -p:FSharpTestCompilerVersion=coreclr -nr=false +%__scriptpath%..\..\..\artifacts\toolset\dotnet\dotnet.exe pack ComboProvider\ComboProvider\ComboProvider.fsproj -o %~dp0artifacts -c release -v minimal -p:FSharpTestCompilerVersion=coreclr -nr=false @if ERRORLEVEL 1 echo Error: ComboProviderProvider failed && goto :failure -@echo%__scriptpath%..\..\..\tools\dotnet20\dotnet.exe test ComboProvider\ComboProvider.Tests\ComboProvider.Tests.fsproj -c release -v minimal -p:TestTargetFramework=net461 -p:FSharpTestCompilerVersion=net40 -%__scriptpath%..\..\..\tools\dotnet20\dotnet.exe test ComboProvider\ComboProvider.Tests\ComboProvider.Tests.fsproj -c release -v minimal -p:TestTargetFramework=net461 -p:FSharpTestCompilerVersion=net40 +@echo%__scriptpath%..\..\..\artifacts\toolset\dotnet\dotnet.exe test ComboProvider\ComboProvider.Tests\ComboProvider.Tests.fsproj -c release -v minimal -p:TestTargetFramework=net461 -p:FSharpTestCompilerVersion=net40 -nr=false +%__scriptpath%..\..\..\artifacts\toolset\dotnet\dotnet.exe test ComboProvider\ComboProvider.Tests\ComboProvider.Tests.fsproj -c release -v minimal -p:TestTargetFramework=net461 -p:FSharpTestCompilerVersion=net40 -nr=false @if ERRORLEVEL 1 echo Error: TestBasicProvider failed && goto :failure -@echo %__scriptpath%..\..\..\tools\dotnet20\dotnet.exe test ComboProvider\ComboProvider.Tests\ComboProvider.Tests.fsproj -v minimal -p:TestTargetFramework=netcoreapp2.0 -p:FSharpTestCompilerVersion=coreclr -%__scriptpath%..\..\..\tools\dotnet20\dotnet.exe test ComboProvider\ComboProvider.Tests\ComboProvider.Tests.fsproj -c release -v minimal -p:TestTargetFramework=netcoreapp2.0 -p:FSharpTestCompilerVersion=coreclr +@echo %__scriptpath%..\..\..\artifacts\toolset\dotnet\dotnet.exe test ComboProvider\ComboProvider.Tests\ComboProvider.Tests.fsproj -v minimal -p:TestTargetFramework=netcoreapp2.0 -p:FSharpTestCompilerVersion=coreclr -nr=false +%__scriptpath%..\..\..\artifacts\toolset\dotnet\dotnet.exe test ComboProvider\ComboProvider.Tests\ComboProvider.Tests.fsproj -c release -v minimal -p:TestTargetFramework=netcoreapp2.0 -p:FSharpTestCompilerVersion=coreclr -nr=false @if ERRORLEVEL 1 echo Error: ComboProvider failed && goto :failure :success diff --git a/tests/EndToEndBuildTests/ProvidedTypes/ProvidedTypes.fs b/tests/EndToEndBuildTests/ProvidedTypes/ProvidedTypes.fs index c1494b9081a..45974519909 100644 --- a/tests/EndToEndBuildTests/ProvidedTypes/ProvidedTypes.fs +++ b/tests/EndToEndBuildTests/ProvidedTypes/ProvidedTypes.fs @@ -8409,8 +8409,8 @@ namespace ProviderImplementation.ProvidedTypes | None -> None | Some _ -> let m = mdef.ManifestOfAssembly - let assRef = ILAssemblyRef(m.Name, UNone, (match m.PublicKey with USome k -> USome (PublicKey.KeyAsToken(k)) | UNone -> UNone), m.Retargetable, m.Version, m.Locale) - Some (ILScopeRef.Assembly assRef) + let assemblyRef = ILAssemblyRef(m.Name, UNone, (match m.PublicKey with USome k -> USome (PublicKey.KeyAsToken(k)) | UNone -> UNone), m.Retargetable, m.Version, m.Locale) + Some (ILScopeRef.Assembly assemblyRef) else None with _ -> None ) diff --git a/tests/FSharp.Build.UnitTests/Directory.Build.props b/tests/FSharp.Build.UnitTests/Directory.Build.props new file mode 100644 index 00000000000..bb8eac309b1 --- /dev/null +++ b/tests/FSharp.Build.UnitTests/Directory.Build.props @@ -0,0 +1,3 @@ + + + diff --git a/tests/FSharp.Build.UnitTests/Directory.Build.targets b/tests/FSharp.Build.UnitTests/Directory.Build.targets new file mode 100644 index 00000000000..ccd47cc0a9a --- /dev/null +++ b/tests/FSharp.Build.UnitTests/Directory.Build.targets @@ -0,0 +1,3 @@ + + + diff --git a/tests/FSharp.Build.UnitTests/FSharp.Build.UnitTests.fsproj b/tests/FSharp.Build.UnitTests/FSharp.Build.UnitTests.fsproj index 93cf3dfa3b6..9e04e6e5845 100644 --- a/tests/FSharp.Build.UnitTests/FSharp.Build.UnitTests.fsproj +++ b/tests/FSharp.Build.UnitTests/FSharp.Build.UnitTests.fsproj @@ -1,102 +1,33 @@ - + + - $(MSBuildProjectDirectory)\..\..\src - {400FAB03-786E-40CC-85A8-04B0C2869B14} - true - false - - - - Debug - AnyCPU - 2.0 - true - true + net46;netcoreapp2.0 Library - false - FSharp.Build.UnitTests - netcore - - - $(DefineConstants);$(TargetDotnetProfile.ToLower()) - - - true - false - $(DefineConstants);DEBUG;TRACE - prompt - 3 - - - true - $(DefineConstants);TRACE - prompt - 3 + true + nunit - - - true - True - $(NUnitLibDir)\nunit.framework.dll - - - - - $(FSharpSourcesRoot)\..\packages\Microsoft.Build.Framework.$(MicrosoftBuildFrameworkPackageVersion)\lib\net46\Microsoft.Build.Framework.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.Build.$(MicrosoftBuildPackageVersion)\lib\net46\Microsoft.Build.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.Build.Utilities.Core.$(MicrosoftBuildUtilitiesCorePackageVersion)\lib\net46\Microsoft.Build.Utilities.Core.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.Build.Tasks.Core.$(MicrosoftBuildTasksCorePackageVersion)\lib\net46\Microsoft.Build.Tasks.Core.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.Build.Tasks.Core.$(MicrosoftBuildTasksCorePackageVersion)\lib\net46\Microsoft.Build.Tasks.Core.dll - - - $(FSharpSourcesRoot)\..\packages\System.IO.Compression.$(SystemIoCompressionPackageVersion)\lib\net46\System.IO.Compression.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualFSharp.Type.Providers.Redist.$(MicrosoftVisualFSharpTypeProvidersRedistPackageVersion)\content\4.3.0.0\FSharp.Data.TypeProviders.dll - - - - - $(FSharpSourcesRoot)\..\packages\Microsoft.Build.Framework.14.3.0\lib\net45\Microsoft.Build.Framework.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.Build.14.3.0\lib\net45\Microsoft.Build.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.Build.Utilities.Core.14.3.0\lib\net45\Microsoft.Build.Utilities.Core.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.Build.Tasks.Core.14.3.0\lib\net45\Microsoft.Build.Tasks.Core.dll - - + - - {702A7979-BCF9-4C41-853E-3ADFC9897890} - FSharp.Build - - - {DED3BBD7-53F4-428A-8C9F-27968E768605} - FSharp.Core - + + - - - + + + + + + + - - + + + + + - + diff --git a/tests/FSharp.Build.UnitTests/NuGet.Config b/tests/FSharp.Build.UnitTests/NuGet.Config index 0a86752fee0..3f63fa01d30 100644 --- a/tests/FSharp.Build.UnitTests/NuGet.Config +++ b/tests/FSharp.Build.UnitTests/NuGet.Config @@ -4,7 +4,7 @@ - + diff --git a/tests/FSharp.Build.UnitTests/Program.fs b/tests/FSharp.Build.UnitTests/Program.fs deleted file mode 100644 index d0397a7de09..00000000000 --- a/tests/FSharp.Build.UnitTests/Program.fs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. - -module Program - -open System -open System.Reflection -open NUnitLite -open NUnit.Common - -type HelperType() = inherit System.Object() - -[] -let main argv = - AutoRun(typeof.GetTypeInfo().Assembly).Execute(argv, new ExtendedTextWrapper(Console.Out), Console.In) diff --git a/tests/FSharp.Build.UnitTests/project.json b/tests/FSharp.Build.UnitTests/project.json deleted file mode 100644 index 91e95a04872..00000000000 --- a/tests/FSharp.Build.UnitTests/project.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "version": "1.0.0-*", - "name": "FSharp.Build.UnitTests", - "buildOptions": { - "debugType": "portable", - "emitEntryPoint": true - }, - "dependencies": { - "nunit": "3.5.0", - "nunitlite": "3.5.0", - "Microsoft.Build": "15.1.548", - "Microsoft.Build.Framework": "15.1.548", - "Microsoft.Build.Tasks.Core": "15.1.548", - "Testing.FSharp.Core": "4.2.4", - "Microsoft.Build.Utilities.Core": "15.1.548" - }, - "runtimes": { - "win7-x86": {}, - "win7-x64": {}, - "osx.10.11-x64": {}, - "ubuntu.14.04-x64": {} - }, - "frameworks": { - "netcoreapp1.0": { - "dependencies": { - "Microsoft.NETCore.App": { - "type": "platform", - "version": "1.0.1" - } - }, - "imports": [ "netstandard1.1", "netstandard1.6", "portable-net45+win8+wp8+wpa81" ] - } - } -} diff --git a/tests/FSharp.Compiler.UnitTests/Directory.Build.props b/tests/FSharp.Compiler.UnitTests/Directory.Build.props new file mode 100644 index 00000000000..bb8eac309b1 --- /dev/null +++ b/tests/FSharp.Compiler.UnitTests/Directory.Build.props @@ -0,0 +1,3 @@ + + + diff --git a/tests/FSharp.Compiler.UnitTests/Directory.Build.targets b/tests/FSharp.Compiler.UnitTests/Directory.Build.targets new file mode 100644 index 00000000000..ccd47cc0a9a --- /dev/null +++ b/tests/FSharp.Compiler.UnitTests/Directory.Build.targets @@ -0,0 +1,3 @@ + + + diff --git a/tests/FSharp.Compiler.UnitTests/FSharp.Compiler.UnitTests.fsproj b/tests/FSharp.Compiler.UnitTests/FSharp.Compiler.UnitTests.fsproj index 06b8a4b422a..4b9f4d21a30 100644 --- a/tests/FSharp.Compiler.UnitTests/FSharp.Compiler.UnitTests.fsproj +++ b/tests/FSharp.Compiler.UnitTests/FSharp.Compiler.UnitTests.fsproj @@ -1,52 +1,14 @@  - + + - $(MSBuildProjectDirectory)\..\..\src - {a8d9641a-9170-4cf4-8fe0-6db8c134e1b5} - - - - AnyCPU - 2.0 - true - true + net46;netcoreapp2.0 Library - FSharp.Compiler.UnitTests - - false - false - - - true - false - bin\Debug\ - DEBUG;TRACE - prompt - 3 - - - true - bin\Release\ - TRACE - prompt - 3 + true + nunit - - - True - $(NUnitLibDir)\nunit.framework.dll - - - - - - - - - ..\..\..\packages\System.ValueTuple.$(SystemValueTuplePackageVersion)\lib\netstandard1.0\System.ValueTuple.dll - - + @@ -54,16 +16,13 @@ + + + - - FSharp.Compiler.Private - {2e4d67b4-522d-4cf7-97e4-ba940f0b18f3} - - - {DED3BBD7-53F4-428A-8C9F-27968E768605} - FSharp.Core - + + - - \ No newline at end of file + + diff --git a/tests/FSharp.Compiler.UnitTests/ILHelpers.fs b/tests/FSharp.Compiler.UnitTests/ILHelpers.fs new file mode 100644 index 00000000000..372e11d0702 --- /dev/null +++ b/tests/FSharp.Compiler.UnitTests/ILHelpers.fs @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. + +namespace FSharp.Compiler.UnitTests + +open System +open System.IO +open System.Diagnostics + +open NUnit.Framework + +open Microsoft.FSharp.Compiler.SourceCodeServices + +module ILChecker = + + let checker = FSharpChecker.Create() + + let private (++) a b = Path.Combine(a,b) + + let private getfullpath workDir path = + let rooted = + if Path.IsPathRooted(path) then path + else Path.Combine(workDir, path) + rooted |> Path.GetFullPath + + let private fileExists workDir path = + if path |> getfullpath workDir |> File.Exists then Some path else None + + let private requireFile nm = + if fileExists __SOURCE_DIRECTORY__ nm |> Option.isSome then nm else failwith (sprintf "couldn't find %s. Running 'build test' once might solve this issue" nm) + + let private exec exe args = + let startInfo = ProcessStartInfo(exe, String.concat " " args) + startInfo.RedirectStandardError <- true + startInfo.UseShellExecute <- false + use p = Process.Start(startInfo) + p.WaitForExit() + p.StandardError.ReadToEnd(), p.ExitCode + + /// Compile the source and check to see if the expected IL exists. + /// The first line of each expected IL string is found first. + let check source expectedIL = + let packagesDir = Environment.GetEnvironmentVariable("USERPROFILE") ++ ".nuget" ++ "packages" + let Is64BitOperatingSystem = sizeof = 8 + let architectureMoniker = if Is64BitOperatingSystem then "x64" else "x86" + let ildasmExe = requireFile (packagesDir ++ ("runtime.win-" + architectureMoniker + ".Microsoft.NETCore.ILDAsm") ++ "2.0.3" ++ "runtimes" ++ ("win-" + architectureMoniker) ++ "native" ++ "ildasm.exe") + let coreclrDll = requireFile (packagesDir ++ ("runtime.win-" + architectureMoniker + ".Microsoft.NETCore.Runtime.CoreCLR") ++ "2.0.3" ++ "runtimes" ++ ("win-" + architectureMoniker) ++ "native" ++ "coreclr.dll") + + let tmp = Path.GetTempFileName() + let tmpFs = Path.ChangeExtension(tmp, ".fs") + let tmpDll = Path.ChangeExtension(tmp, ".dll") + let tmpIL = Path.ChangeExtension(tmp, ".il") + + let mutable errorMsgOpt = None + try + // ildasm requires coreclr.dll to run which has already been restored to the packages directory + File.Copy(coreclrDll, Path.GetDirectoryName(ildasmExe) ++ "coreclr.dll", overwrite=true) + + File.WriteAllText(tmpFs, source) + + let errors, exitCode = checker.Compile([| "fsc.exe"; "--optimize+"; "-o"; tmpDll; "-a"; tmpFs |]) |> Async.RunSynchronously + let errors = + String.concat "\n" (errors |> Array.map (fun x -> x.Message)) + + if exitCode = 0 then + exec ildasmExe [ sprintf "%s /out=%s" tmpDll tmpIL ] |> ignore + + let text = File.ReadAllText(tmpIL) + let blockComments = @"/\*(.*?)\*/" + let lineComments = @"//(.*?)\r?\n" + let strings = @"""((\\[^\n]|[^""\n])*)""" + let verbatimStrings = @"@(""[^""]*"")+" + let textNoComments = + System.Text.RegularExpressions.Regex.Replace(text, + blockComments + "|" + lineComments + "|" + strings + "|" + verbatimStrings, + (fun me -> + if (me.Value.StartsWith("/*") || me.Value.StartsWith("//")) then + if me.Value.StartsWith("//") then Environment.NewLine else String.Empty + else + me.Value), System.Text.RegularExpressions.RegexOptions.Singleline) + + expectedIL + |> List.iter (fun (ilCode: string) -> + let expectedLines = ilCode.Split('\n') + let startIndex = textNoComments.IndexOf(expectedLines.[0]) + if startIndex = -1 || textNoComments.Length < startIndex + ilCode.Length then + errorMsgOpt <- Some("==EXPECTED CONTAINS==\n" + ilCode + "\n") + else + let errors = ResizeArray() + let actualLines = textNoComments.Substring(startIndex, textNoComments.Length - startIndex).Split('\n') + for i = 0 to expectedLines.Length - 1 do + let expected = expectedLines.[i].Trim() + let actual = actualLines.[i].Trim() + if expected <> actual then + errors.Add(sprintf "\n==\nName: %s\n\nExpected:\t %s\nActual:\t\t %s\n==" actualLines.[0] expected actual) + + if errors.Count > 0 then + let msg = String.concat "\n" errors + "\n\n\n==EXPECTED==\n" + ilCode + "\n" + errorMsgOpt <- Some(msg + "\n\n\n==ACTUAL==\n" + String.Join("\n", actualLines, 0, expectedLines.Length)) + ) + + match errorMsgOpt with + | Some(msg) -> errorMsgOpt <- Some(msg + "\n\n\n==ENTIRE ACTUAL==\n" + textNoComments) + | _ -> () + else + errorMsgOpt <- Some(errors) + finally + try File.Delete(tmp) with | _ -> () + try File.Delete(tmpFs) with | _ -> () + try File.Delete(tmpDll) with | _ -> () + try File.Delete(tmpIL) with | _ -> () + + match errorMsgOpt with + | Some(errorMsg) -> + Assert.Fail(errorMsg) + | _ -> () + diff --git a/tests/FSharp.Compiler.UnitTests/Language/StringConcat.fs b/tests/FSharp.Compiler.UnitTests/Language/StringConcat.fs new file mode 100644 index 00000000000..fa18e7bb427 --- /dev/null +++ b/tests/FSharp.Compiler.UnitTests/Language/StringConcat.fs @@ -0,0 +1,845 @@ +// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. + +namespace FSharp.Compiler.UnitTests + +open System +open NUnit.Framework + +[] +module StringConcat = + + [] + let Optimizations () = + let baseSource = """ +module Test + +open System + +let arr = ResizeArray() + +let inline ss (x: int) = + arr.Add(x) + "_" + x.ToString() + "_" +""" + + let test1Source = """ +let test1 () = + ss 1 + ss 2 + ss 3 +""" + let test1IL = """.method public static string test1() cil managed + { + + .maxstack 7 + .locals init (int32 V_0) + IL_0000: ldc.i4.1 + IL_0001: stloc.0 + IL_0002: call class [mscorlib]System.Collections.Generic.List`1 Test::get_arr() + IL_0007: ldc.i4.1 + IL_0008: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_000d: ldstr "_" + IL_0012: ldloca.s V_0 + IL_0014: constrained. [mscorlib]System.Int32 + IL_001a: callvirt instance string [mscorlib]System.Object::ToString() + IL_001f: ldstr "_" + IL_0024: call string [mscorlib]System.String::Concat(string, + string, + string) + IL_0029: ldc.i4.2 + IL_002a: stloc.0 + IL_002b: call class [mscorlib]System.Collections.Generic.List`1 Test::get_arr() + IL_0030: ldc.i4.2 + IL_0031: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_0036: ldstr "_" + IL_003b: ldloca.s V_0 + IL_003d: constrained. [mscorlib]System.Int32 + IL_0043: callvirt instance string [mscorlib]System.Object::ToString() + IL_0048: ldstr "_" + IL_004d: call string [mscorlib]System.String::Concat(string, + string, + string) + IL_0052: ldc.i4.3 + IL_0053: stloc.0 + IL_0054: call class [mscorlib]System.Collections.Generic.List`1 Test::get_arr() + IL_0059: ldc.i4.3 + IL_005a: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_005f: ldstr "_" + IL_0064: ldloca.s V_0 + IL_0066: constrained. [mscorlib]System.Int32 + IL_006c: callvirt instance string [mscorlib]System.Object::ToString() + IL_0071: ldstr "_" + IL_0076: call string [mscorlib]System.String::Concat(string, + string, + string) + IL_007b: call string [mscorlib]System.String::Concat(string, + string, + string) + IL_0080: ret + }""" + + let test2Source = """ +let test2 () = + ss 1 + ss 2 + ss 3 + ss 4 +""" + let test2IL = """.method public static string test2() cil managed + { + + .maxstack 8 + .locals init (int32 V_0) + IL_0000: ldc.i4.1 + IL_0001: stloc.0 + IL_0002: call class [mscorlib]System.Collections.Generic.List`1 Test::get_arr() + IL_0007: ldc.i4.1 + IL_0008: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_000d: ldstr "_" + IL_0012: ldloca.s V_0 + IL_0014: constrained. [mscorlib]System.Int32 + IL_001a: callvirt instance string [mscorlib]System.Object::ToString() + IL_001f: ldstr "_" + IL_0024: call string [mscorlib]System.String::Concat(string, + string, + string) + IL_0029: ldc.i4.2 + IL_002a: stloc.0 + IL_002b: call class [mscorlib]System.Collections.Generic.List`1 Test::get_arr() + IL_0030: ldc.i4.2 + IL_0031: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_0036: ldstr "_" + IL_003b: ldloca.s V_0 + IL_003d: constrained. [mscorlib]System.Int32 + IL_0043: callvirt instance string [mscorlib]System.Object::ToString() + IL_0048: ldstr "_" + IL_004d: call string [mscorlib]System.String::Concat(string, + string, + string) + IL_0052: ldc.i4.3 + IL_0053: stloc.0 + IL_0054: call class [mscorlib]System.Collections.Generic.List`1 Test::get_arr() + IL_0059: ldc.i4.3 + IL_005a: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_005f: ldstr "_" + IL_0064: ldloca.s V_0 + IL_0066: constrained. [mscorlib]System.Int32 + IL_006c: callvirt instance string [mscorlib]System.Object::ToString() + IL_0071: ldstr "_" + IL_0076: call string [mscorlib]System.String::Concat(string, + string, + string) + IL_007b: ldc.i4.4 + IL_007c: stloc.0 + IL_007d: call class [mscorlib]System.Collections.Generic.List`1 Test::get_arr() + IL_0082: ldc.i4.4 + IL_0083: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_0088: ldstr "_" + IL_008d: ldloca.s V_0 + IL_008f: constrained. [mscorlib]System.Int32 + IL_0095: callvirt instance string [mscorlib]System.Object::ToString() + IL_009a: ldstr "_" + IL_009f: call string [mscorlib]System.String::Concat(string, + string, + string) + IL_00a4: call string [mscorlib]System.String::Concat(string, + string, + string, + string) + IL_00a9: ret + }""" + + let test3Source = """ +let test3 () = + ss 1 + ss 2 + ss 3 + ss 4 + ss 5 +""" + let test3IL = """.method public static string test3() cil managed + { + + .maxstack 8 + .locals init (int32 V_0) + IL_0000: ldc.i4.5 + IL_0001: newarr [mscorlib]System.String + IL_0006: dup + IL_0007: ldc.i4.0 + IL_0008: ldc.i4.1 + IL_0009: stloc.0 + IL_000a: call class [mscorlib]System.Collections.Generic.List`1 Test::get_arr() + IL_000f: ldc.i4.1 + IL_0010: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_0015: ldstr "_" + IL_001a: ldloca.s V_0 + IL_001c: constrained. [mscorlib]System.Int32 + IL_0022: callvirt instance string [mscorlib]System.Object::ToString() + IL_0027: ldstr "_" + IL_002c: call string [mscorlib]System.String::Concat(string, + string, + string) + IL_0031: stelem [mscorlib]System.String + IL_0036: dup + IL_0037: ldc.i4.1 + IL_0038: ldc.i4.2 + IL_0039: stloc.0 + IL_003a: call class [mscorlib]System.Collections.Generic.List`1 Test::get_arr() + IL_003f: ldc.i4.2 + IL_0040: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_0045: ldstr "_" + IL_004a: ldloca.s V_0 + IL_004c: constrained. [mscorlib]System.Int32 + IL_0052: callvirt instance string [mscorlib]System.Object::ToString() + IL_0057: ldstr "_" + IL_005c: call string [mscorlib]System.String::Concat(string, + string, + string) + IL_0061: stelem [mscorlib]System.String + IL_0066: dup + IL_0067: ldc.i4.2 + IL_0068: ldc.i4.3 + IL_0069: stloc.0 + IL_006a: call class [mscorlib]System.Collections.Generic.List`1 Test::get_arr() + IL_006f: ldc.i4.3 + IL_0070: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_0075: ldstr "_" + IL_007a: ldloca.s V_0 + IL_007c: constrained. [mscorlib]System.Int32 + IL_0082: callvirt instance string [mscorlib]System.Object::ToString() + IL_0087: ldstr "_" + IL_008c: call string [mscorlib]System.String::Concat(string, + string, + string) + IL_0091: stelem [mscorlib]System.String + IL_0096: dup + IL_0097: ldc.i4.3 + IL_0098: ldc.i4.4 + IL_0099: stloc.0 + IL_009a: call class [mscorlib]System.Collections.Generic.List`1 Test::get_arr() + IL_009f: ldc.i4.4 + IL_00a0: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_00a5: ldstr "_" + IL_00aa: ldloca.s V_0 + IL_00ac: constrained. [mscorlib]System.Int32 + IL_00b2: callvirt instance string [mscorlib]System.Object::ToString() + IL_00b7: ldstr "_" + IL_00bc: call string [mscorlib]System.String::Concat(string, + string, + string) + IL_00c1: stelem [mscorlib]System.String + IL_00c6: dup + IL_00c7: ldc.i4.4 + IL_00c8: ldc.i4.5 + IL_00c9: stloc.0 + IL_00ca: call class [mscorlib]System.Collections.Generic.List`1 Test::get_arr() + IL_00cf: ldc.i4.5 + IL_00d0: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_00d5: ldstr "_" + IL_00da: ldloca.s V_0 + IL_00dc: constrained. [mscorlib]System.Int32 + IL_00e2: callvirt instance string [mscorlib]System.Object::ToString() + IL_00e7: ldstr "_" + IL_00ec: call string [mscorlib]System.String::Concat(string, + string, + string) + IL_00f1: stelem [mscorlib]System.String + IL_00f6: call string [mscorlib]System.String::Concat(string[]) + IL_00fb: ret + }""" + + let test4Source = """ +let test4 () = + ss 5 + ss 6 + ss 7 + String.Concat(ss 8, ss 9) + ss 10 + "_50_" + "_60_" + String.Concat(ss 100, String.Concat(ss 101, ss 102), ss 103) + String.Concat([|"_104_";"_105_"|]) + ss 106 +""" + let test4IL = """.method public static string test4() cil managed + { + + .maxstack 8 + .locals init (int32 V_0) + IL_0000: ldc.i4.s 13 + IL_0002: newarr [mscorlib]System.String + IL_0007: dup + IL_0008: ldc.i4.0 + IL_0009: ldc.i4.5 + IL_000a: stloc.0 + IL_000b: call class [mscorlib]System.Collections.Generic.List`1 Test::get_arr() + IL_0010: ldc.i4.5 + IL_0011: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_0016: ldstr "_" + IL_001b: ldloca.s V_0 + IL_001d: constrained. [mscorlib]System.Int32 + IL_0023: callvirt instance string [mscorlib]System.Object::ToString() + IL_0028: ldstr "_" + IL_002d: call string [mscorlib]System.String::Concat(string, + string, + string) + IL_0032: stelem [mscorlib]System.String + IL_0037: dup + IL_0038: ldc.i4.1 + IL_0039: ldc.i4.6 + IL_003a: stloc.0 + IL_003b: call class [mscorlib]System.Collections.Generic.List`1 Test::get_arr() + IL_0040: ldc.i4.6 + IL_0041: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_0046: ldstr "_" + IL_004b: ldloca.s V_0 + IL_004d: constrained. [mscorlib]System.Int32 + IL_0053: callvirt instance string [mscorlib]System.Object::ToString() + IL_0058: ldstr "_" + IL_005d: call string [mscorlib]System.String::Concat(string, + string, + string) + IL_0062: stelem [mscorlib]System.String + IL_0067: dup + IL_0068: ldc.i4.2 + IL_0069: ldc.i4.7 + IL_006a: stloc.0 + IL_006b: call class [mscorlib]System.Collections.Generic.List`1 Test::get_arr() + IL_0070: ldc.i4.7 + IL_0071: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_0076: ldstr "_" + IL_007b: ldloca.s V_0 + IL_007d: constrained. [mscorlib]System.Int32 + IL_0083: callvirt instance string [mscorlib]System.Object::ToString() + IL_0088: ldstr "_" + IL_008d: call string [mscorlib]System.String::Concat(string, + string, + string) + IL_0092: stelem [mscorlib]System.String + IL_0097: dup + IL_0098: ldc.i4.3 + IL_0099: ldc.i4.8 + IL_009a: stloc.0 + IL_009b: call class [mscorlib]System.Collections.Generic.List`1 Test::get_arr() + IL_00a0: ldc.i4.8 + IL_00a1: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_00a6: ldstr "_" + IL_00ab: ldloca.s V_0 + IL_00ad: constrained. [mscorlib]System.Int32 + IL_00b3: callvirt instance string [mscorlib]System.Object::ToString() + IL_00b8: ldstr "_" + IL_00bd: call string [mscorlib]System.String::Concat(string, + string, + string) + IL_00c2: stelem [mscorlib]System.String + IL_00c7: dup + IL_00c8: ldc.i4.4 + IL_00c9: ldc.i4.s 9 + IL_00cb: stloc.0 + IL_00cc: call class [mscorlib]System.Collections.Generic.List`1 Test::get_arr() + IL_00d1: ldc.i4.s 9 + IL_00d3: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_00d8: ldstr "_" + IL_00dd: ldloca.s V_0 + IL_00df: constrained. [mscorlib]System.Int32 + IL_00e5: callvirt instance string [mscorlib]System.Object::ToString() + IL_00ea: ldstr "_" + IL_00ef: call string [mscorlib]System.String::Concat(string, + string, + string) + IL_00f4: stelem [mscorlib]System.String + IL_00f9: dup + IL_00fa: ldc.i4.5 + IL_00fb: ldc.i4.s 10 + IL_00fd: stloc.0 + IL_00fe: call class [mscorlib]System.Collections.Generic.List`1 Test::get_arr() + IL_0103: ldc.i4.s 10 + IL_0105: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_010a: ldstr "_" + IL_010f: ldloca.s V_0 + IL_0111: constrained. [mscorlib]System.Int32 + IL_0117: callvirt instance string [mscorlib]System.Object::ToString() + IL_011c: ldstr "_" + IL_0121: call string [mscorlib]System.String::Concat(string, + string, + string) + IL_0126: stelem [mscorlib]System.String + IL_012b: dup + IL_012c: ldc.i4.6 + IL_012d: ldstr "_50__60_" + IL_0132: stelem [mscorlib]System.String + IL_0137: dup + IL_0138: ldc.i4.7 + IL_0139: ldc.i4.s 100 + IL_013b: stloc.0 + IL_013c: call class [mscorlib]System.Collections.Generic.List`1 Test::get_arr() + IL_0141: ldc.i4.s 100 + IL_0143: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_0148: ldstr "_" + IL_014d: ldloca.s V_0 + IL_014f: constrained. [mscorlib]System.Int32 + IL_0155: callvirt instance string [mscorlib]System.Object::ToString() + IL_015a: ldstr "_" + IL_015f: call string [mscorlib]System.String::Concat(string, + string, + string) + IL_0164: stelem [mscorlib]System.String + IL_0169: dup + IL_016a: ldc.i4.8 + IL_016b: ldc.i4.s 101 + IL_016d: stloc.0 + IL_016e: call class [mscorlib]System.Collections.Generic.List`1 Test::get_arr() + IL_0173: ldc.i4.s 101 + IL_0175: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_017a: ldstr "_" + IL_017f: ldloca.s V_0 + IL_0181: constrained. [mscorlib]System.Int32 + IL_0187: callvirt instance string [mscorlib]System.Object::ToString() + IL_018c: ldstr "_" + IL_0191: call string [mscorlib]System.String::Concat(string, + string, + string) + IL_0196: stelem [mscorlib]System.String + IL_019b: dup + IL_019c: ldc.i4.s 9 + IL_019e: ldc.i4.s 102 + IL_01a0: stloc.0 + IL_01a1: call class [mscorlib]System.Collections.Generic.List`1 Test::get_arr() + IL_01a6: ldc.i4.s 102 + IL_01a8: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_01ad: ldstr "_" + IL_01b2: ldloca.s V_0 + IL_01b4: constrained. [mscorlib]System.Int32 + IL_01ba: callvirt instance string [mscorlib]System.Object::ToString() + IL_01bf: ldstr "_" + IL_01c4: call string [mscorlib]System.String::Concat(string, + string, + string) + IL_01c9: stelem [mscorlib]System.String + IL_01ce: dup + IL_01cf: ldc.i4.s 10 + IL_01d1: ldc.i4.s 103 + IL_01d3: stloc.0 + IL_01d4: call class [mscorlib]System.Collections.Generic.List`1 Test::get_arr() + IL_01d9: ldc.i4.s 103 + IL_01db: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_01e0: ldstr "_" + IL_01e5: ldloca.s V_0 + IL_01e7: constrained. [mscorlib]System.Int32 + IL_01ed: callvirt instance string [mscorlib]System.Object::ToString() + IL_01f2: ldstr "_" + IL_01f7: call string [mscorlib]System.String::Concat(string, + string, + string) + IL_01fc: stelem [mscorlib]System.String + IL_0201: dup + IL_0202: ldc.i4.s 11 + IL_0204: ldstr "_104__105_" + IL_0209: stelem [mscorlib]System.String + IL_020e: dup + IL_020f: ldc.i4.s 12 + IL_0211: ldc.i4.s 106 + IL_0213: stloc.0 + IL_0214: call class [mscorlib]System.Collections.Generic.List`1 Test::get_arr() + IL_0219: ldc.i4.s 106 + IL_021b: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_0220: ldstr "_" + IL_0225: ldloca.s V_0 + IL_0227: constrained. [mscorlib]System.Int32 + IL_022d: callvirt instance string [mscorlib]System.Object::ToString() + IL_0232: ldstr "_" + IL_0237: call string [mscorlib]System.String::Concat(string, + string, + string) + IL_023c: stelem [mscorlib]System.String + IL_0241: call string [mscorlib]System.String::Concat(string[]) + IL_0246: ret + }""" + + let test5Source = """ +let test5 () = + ss 5 + ss 6 + ss 7 + String.Concat(ss 8, ss 9) + ss 10 + "_50_" + "_60_" + String.Concat(ss 100, (let x = String.Concat(ss 101, ss 102) in Console.WriteLine(x);x), ss 103) + String.Concat([|"_104_";"_105_"|]) + ss 106 +""" + let test5IL = """.method public static string test5() cil managed + { + + .maxstack 9 + .locals init (int32 V_0, + string V_1) + IL_0000: ldc.i4.s 12 + IL_0002: newarr [mscorlib]System.String + IL_0007: dup + IL_0008: ldc.i4.0 + IL_0009: ldc.i4.5 + IL_000a: stloc.0 + IL_000b: call class [mscorlib]System.Collections.Generic.List`1 Test::get_arr() + IL_0010: ldc.i4.5 + IL_0011: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_0016: ldstr "_" + IL_001b: ldloca.s V_0 + IL_001d: constrained. [mscorlib]System.Int32 + IL_0023: callvirt instance string [mscorlib]System.Object::ToString() + IL_0028: ldstr "_" + IL_002d: call string [mscorlib]System.String::Concat(string, + string, + string) + IL_0032: stelem [mscorlib]System.String + IL_0037: dup + IL_0038: ldc.i4.1 + IL_0039: ldc.i4.6 + IL_003a: stloc.0 + IL_003b: call class [mscorlib]System.Collections.Generic.List`1 Test::get_arr() + IL_0040: ldc.i4.6 + IL_0041: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_0046: ldstr "_" + IL_004b: ldloca.s V_0 + IL_004d: constrained. [mscorlib]System.Int32 + IL_0053: callvirt instance string [mscorlib]System.Object::ToString() + IL_0058: ldstr "_" + IL_005d: call string [mscorlib]System.String::Concat(string, + string, + string) + IL_0062: stelem [mscorlib]System.String + IL_0067: dup + IL_0068: ldc.i4.2 + IL_0069: ldc.i4.7 + IL_006a: stloc.0 + IL_006b: call class [mscorlib]System.Collections.Generic.List`1 Test::get_arr() + IL_0070: ldc.i4.7 + IL_0071: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_0076: ldstr "_" + IL_007b: ldloca.s V_0 + IL_007d: constrained. [mscorlib]System.Int32 + IL_0083: callvirt instance string [mscorlib]System.Object::ToString() + IL_0088: ldstr "_" + IL_008d: call string [mscorlib]System.String::Concat(string, + string, + string) + IL_0092: stelem [mscorlib]System.String + IL_0097: dup + IL_0098: ldc.i4.3 + IL_0099: ldc.i4.8 + IL_009a: stloc.0 + IL_009b: call class [mscorlib]System.Collections.Generic.List`1 Test::get_arr() + IL_00a0: ldc.i4.8 + IL_00a1: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_00a6: ldstr "_" + IL_00ab: ldloca.s V_0 + IL_00ad: constrained. [mscorlib]System.Int32 + IL_00b3: callvirt instance string [mscorlib]System.Object::ToString() + IL_00b8: ldstr "_" + IL_00bd: call string [mscorlib]System.String::Concat(string, + string, + string) + IL_00c2: stelem [mscorlib]System.String + IL_00c7: dup + IL_00c8: ldc.i4.4 + IL_00c9: ldc.i4.s 9 + IL_00cb: stloc.0 + IL_00cc: call class [mscorlib]System.Collections.Generic.List`1 Test::get_arr() + IL_00d1: ldc.i4.s 9 + IL_00d3: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_00d8: ldstr "_" + IL_00dd: ldloca.s V_0 + IL_00df: constrained. [mscorlib]System.Int32 + IL_00e5: callvirt instance string [mscorlib]System.Object::ToString() + IL_00ea: ldstr "_" + IL_00ef: call string [mscorlib]System.String::Concat(string, + string, + string) + IL_00f4: stelem [mscorlib]System.String + IL_00f9: dup + IL_00fa: ldc.i4.5 + IL_00fb: ldc.i4.s 10 + IL_00fd: stloc.0 + IL_00fe: call class [mscorlib]System.Collections.Generic.List`1 Test::get_arr() + IL_0103: ldc.i4.s 10 + IL_0105: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_010a: ldstr "_" + IL_010f: ldloca.s V_0 + IL_0111: constrained. [mscorlib]System.Int32 + IL_0117: callvirt instance string [mscorlib]System.Object::ToString() + IL_011c: ldstr "_" + IL_0121: call string [mscorlib]System.String::Concat(string, + string, + string) + IL_0126: stelem [mscorlib]System.String + IL_012b: dup + IL_012c: ldc.i4.6 + IL_012d: ldstr "_50__60_" + IL_0132: stelem [mscorlib]System.String + IL_0137: dup + IL_0138: ldc.i4.7 + IL_0139: ldc.i4.s 100 + IL_013b: stloc.0 + IL_013c: call class [mscorlib]System.Collections.Generic.List`1 Test::get_arr() + IL_0141: ldc.i4.s 100 + IL_0143: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_0148: ldstr "_" + IL_014d: ldloca.s V_0 + IL_014f: constrained. [mscorlib]System.Int32 + IL_0155: callvirt instance string [mscorlib]System.Object::ToString() + IL_015a: ldstr "_" + IL_015f: call string [mscorlib]System.String::Concat(string, + string, + string) + IL_0164: stelem [mscorlib]System.String + IL_0169: dup + IL_016a: ldc.i4.8 + IL_016b: ldc.i4.s 101 + IL_016d: stloc.0 + IL_016e: call class [mscorlib]System.Collections.Generic.List`1 Test::get_arr() + IL_0173: ldc.i4.s 101 + IL_0175: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_017a: ldstr "_" + IL_017f: ldloca.s V_0 + IL_0181: constrained. [mscorlib]System.Int32 + IL_0187: callvirt instance string [mscorlib]System.Object::ToString() + IL_018c: ldstr "_" + IL_0191: call string [mscorlib]System.String::Concat(string, + string, + string) + IL_0196: ldc.i4.s 102 + IL_0198: stloc.0 + IL_0199: call class [mscorlib]System.Collections.Generic.List`1 Test::get_arr() + IL_019e: ldc.i4.s 102 + IL_01a0: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_01a5: ldstr "_" + IL_01aa: ldloca.s V_0 + IL_01ac: constrained. [mscorlib]System.Int32 + IL_01b2: callvirt instance string [mscorlib]System.Object::ToString() + IL_01b7: ldstr "_" + IL_01bc: call string [mscorlib]System.String::Concat(string, + string, + string) + IL_01c1: call string [mscorlib]System.String::Concat(string, + string) + IL_01c6: stloc.1 + IL_01c7: ldloc.1 + IL_01c8: call void [mscorlib]System.Console::WriteLine(string) + IL_01cd: ldloc.1 + IL_01ce: stelem [mscorlib]System.String + IL_01d3: dup + IL_01d4: ldc.i4.s 9 + IL_01d6: ldc.i4.s 103 + IL_01d8: stloc.0 + IL_01d9: call class [mscorlib]System.Collections.Generic.List`1 Test::get_arr() + IL_01de: ldc.i4.s 103 + IL_01e0: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_01e5: ldstr "_" + IL_01ea: ldloca.s V_0 + IL_01ec: constrained. [mscorlib]System.Int32 + IL_01f2: callvirt instance string [mscorlib]System.Object::ToString() + IL_01f7: ldstr "_" + IL_01fc: call string [mscorlib]System.String::Concat(string, + string, + string) + IL_0201: stelem [mscorlib]System.String + IL_0206: dup + IL_0207: ldc.i4.s 10 + IL_0209: ldstr "_104__105_" + IL_020e: stelem [mscorlib]System.String + IL_0213: dup + IL_0214: ldc.i4.s 11 + IL_0216: ldc.i4.s 106 + IL_0218: stloc.0 + IL_0219: call class [mscorlib]System.Collections.Generic.List`1 Test::get_arr() + IL_021e: ldc.i4.s 106 + IL_0220: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_0225: ldstr "_" + IL_022a: ldloca.s V_0 + IL_022c: constrained. [mscorlib]System.Int32 + IL_0232: callvirt instance string [mscorlib]System.Object::ToString() + IL_0237: ldstr "_" + IL_023c: call string [mscorlib]System.String::Concat(string, + string, + string) + IL_0241: stelem [mscorlib]System.String + IL_0246: call string [mscorlib]System.String::Concat(string[]) + IL_024b: ret + }""" + + let test6Source = """ +let inline inlineStringConcat str1 str2 = str1 + str2 + +let test6 () = + inlineStringConcat (inlineStringConcat (ss 1) (ss 2)) (ss 3) + ss 4 +""" + let test6IL = """.method public static string test6() cil managed + { + + .maxstack 8 + .locals init (int32 V_0) + IL_0000: ldc.i4.1 + IL_0001: stloc.0 + IL_0002: call class [mscorlib]System.Collections.Generic.List`1 Test::get_arr() + IL_0007: ldc.i4.1 + IL_0008: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_000d: ldstr "_" + IL_0012: ldloca.s V_0 + IL_0014: constrained. [mscorlib]System.Int32 + IL_001a: callvirt instance string [mscorlib]System.Object::ToString() + IL_001f: ldstr "_" + IL_0024: call string [mscorlib]System.String::Concat(string, + string, + string) + IL_0029: ldc.i4.2 + IL_002a: stloc.0 + IL_002b: call class [mscorlib]System.Collections.Generic.List`1 Test::get_arr() + IL_0030: ldc.i4.2 + IL_0031: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_0036: ldstr "_" + IL_003b: ldloca.s V_0 + IL_003d: constrained. [mscorlib]System.Int32 + IL_0043: callvirt instance string [mscorlib]System.Object::ToString() + IL_0048: ldstr "_" + IL_004d: call string [mscorlib]System.String::Concat(string, + string, + string) + IL_0052: ldc.i4.3 + IL_0053: stloc.0 + IL_0054: call class [mscorlib]System.Collections.Generic.List`1 Test::get_arr() + IL_0059: ldc.i4.3 + IL_005a: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_005f: ldstr "_" + IL_0064: ldloca.s V_0 + IL_0066: constrained. [mscorlib]System.Int32 + IL_006c: callvirt instance string [mscorlib]System.Object::ToString() + IL_0071: ldstr "_" + IL_0076: call string [mscorlib]System.String::Concat(string, + string, + string) + IL_007b: ldc.i4.4 + IL_007c: stloc.0 + IL_007d: call class [mscorlib]System.Collections.Generic.List`1 Test::get_arr() + IL_0082: ldc.i4.4 + IL_0083: callvirt instance void class [mscorlib]System.Collections.Generic.List`1::Add(!0) + IL_0088: ldstr "_" + IL_008d: ldloca.s V_0 + IL_008f: constrained. [mscorlib]System.Int32 + IL_0095: callvirt instance string [mscorlib]System.Object::ToString() + IL_009a: ldstr "_" + IL_009f: call string [mscorlib]System.String::Concat(string, + string, + string) + IL_00a4: call string [mscorlib]System.String::Concat(string, + string, + string, + string) + IL_00a9: ret + }""" + + let test7Source = """ +let test7 () = + let x = 1 + x.ToString() + x.ToString() + x.ToString() +""" + let test7IL = """.method public static string test7() cil managed + { + + .maxstack 5 + .locals init (int32 V_0) + IL_0000: ldc.i4.1 + IL_0001: stloc.0 + IL_0002: ldloca.s V_0 + IL_0004: constrained. [mscorlib]System.Int32 + IL_000a: callvirt instance string [mscorlib]System.Object::ToString() + IL_000f: ldloca.s V_0 + IL_0011: constrained. [mscorlib]System.Int32 + IL_0017: callvirt instance string [mscorlib]System.Object::ToString() + IL_001c: ldloca.s V_0 + IL_001e: constrained. [mscorlib]System.Int32 + IL_0024: callvirt instance string [mscorlib]System.Object::ToString() + IL_0029: call string [mscorlib]System.String::Concat(string, + string, + string) + IL_002e: ret + }""" + + let test8Source = """ +let test8 () = + let x = 1 + x.ToString() + x.ToString() + x.ToString() + x.ToString() +""" + let test8IL = """.method public static string test8() cil managed + { + + .maxstack 6 + .locals init (int32 V_0) + IL_0000: ldc.i4.1 + IL_0001: stloc.0 + IL_0002: ldloca.s V_0 + IL_0004: constrained. [mscorlib]System.Int32 + IL_000a: callvirt instance string [mscorlib]System.Object::ToString() + IL_000f: ldloca.s V_0 + IL_0011: constrained. [mscorlib]System.Int32 + IL_0017: callvirt instance string [mscorlib]System.Object::ToString() + IL_001c: ldloca.s V_0 + IL_001e: constrained. [mscorlib]System.Int32 + IL_0024: callvirt instance string [mscorlib]System.Object::ToString() + IL_0029: ldloca.s V_0 + IL_002b: constrained. [mscorlib]System.Int32 + IL_0031: callvirt instance string [mscorlib]System.Object::ToString() + IL_0036: call string [mscorlib]System.String::Concat(string, + string, + string, + string) + IL_003b: ret + }""" + + let test9Source = """ +let test9 () = + let x = 1 + x.ToString() + x.ToString() + x.ToString() + x.ToString() + x.ToString() +""" + let test9IL = """.method public static string test9() cil managed + { + + .maxstack 6 + .locals init (int32 V_0) + IL_0000: ldc.i4.1 + IL_0001: stloc.0 + IL_0002: ldc.i4.5 + IL_0003: newarr [mscorlib]System.String + IL_0008: dup + IL_0009: ldc.i4.0 + IL_000a: ldloca.s V_0 + IL_000c: constrained. [mscorlib]System.Int32 + IL_0012: callvirt instance string [mscorlib]System.Object::ToString() + IL_0017: stelem [mscorlib]System.String + IL_001c: dup + IL_001d: ldc.i4.1 + IL_001e: ldloca.s V_0 + IL_0020: constrained. [mscorlib]System.Int32 + IL_0026: callvirt instance string [mscorlib]System.Object::ToString() + IL_002b: stelem [mscorlib]System.String + IL_0030: dup + IL_0031: ldc.i4.2 + IL_0032: ldloca.s V_0 + IL_0034: constrained. [mscorlib]System.Int32 + IL_003a: callvirt instance string [mscorlib]System.Object::ToString() + IL_003f: stelem [mscorlib]System.String + IL_0044: dup + IL_0045: ldc.i4.3 + IL_0046: ldloca.s V_0 + IL_0048: constrained. [mscorlib]System.Int32 + IL_004e: callvirt instance string [mscorlib]System.Object::ToString() + IL_0053: stelem [mscorlib]System.String + IL_0058: dup + IL_0059: ldc.i4.4 + IL_005a: ldloca.s V_0 + IL_005c: constrained. [mscorlib]System.Int32 + IL_0062: callvirt instance string [mscorlib]System.Object::ToString() + IL_0067: stelem [mscorlib]System.String + IL_006c: call string [mscorlib]System.String::Concat(string[]) + IL_0071: ret + }""" + + let sources = + [ + baseSource + test1Source + test2Source + test3Source + test4Source + test5Source + test6Source + test7Source + test8Source + test9Source + ] + let source = String.Join("", sources) + ILChecker.check source + [ + test1IL + test2IL + test3IL + test4IL + test5IL + test6IL + test7IL + test8IL + test9IL + ] diff --git a/tests/FSharp.Compiler.UnitTests/ProductVersion.fs b/tests/FSharp.Compiler.UnitTests/ProductVersion.fs index 6395d2e39ac..f0c6862a3f7 100644 --- a/tests/FSharp.Compiler.UnitTests/ProductVersion.fs +++ b/tests/FSharp.Compiler.UnitTests/ProductVersion.fs @@ -91,8 +91,10 @@ module TypeProviderDesignTimeComponentLoading = [] let ``check tooling paths for type provider design time component loading`` () = - let expected = - [ Path.Combine("typeproviders", "fsharp41", "net461") + let expected = + [ +#if NET46 // only available on net46 + Path.Combine("typeproviders", "fsharp41", "net461") Path.Combine("tools", "fsharp41", "net461") Path.Combine("typeproviders", "fsharp41", "net452") Path.Combine("tools", "fsharp41", "net452") @@ -100,9 +102,13 @@ module TypeProviderDesignTimeComponentLoading = Path.Combine("tools", "fsharp41", "net451") Path.Combine("typeproviders", "fsharp41", "net45") Path.Combine("tools", "fsharp41", "net45") +#else // only available on netcoreapp2.0 + Path.Combine("typeproviders", "fsharp41", "netcoreapp2.0") + Path.Combine("tools", "fsharp41", "netcoreapp2.0") +#endif // available in both Path.Combine("typeproviders", "fsharp41", "netstandard2.0") Path.Combine("tools", "fsharp41", "netstandard2.0") - ] + ] let actual = Microsoft.FSharp.Compiler.ExtensionTyping.toolingCompatiblePaths() printfn "actual = %A" actual printfn "expected = %A" expected diff --git a/tests/FSharp.Core.UnitTests/.gitignore b/tests/FSharp.Core.UnitTests/.gitignore new file mode 100644 index 00000000000..3345def5b31 --- /dev/null +++ b/tests/FSharp.Core.UnitTests/.gitignore @@ -0,0 +1 @@ +FSharp.Core.Unittests.nuget.props diff --git a/tests/FSharp.Core.UnitTests/Directory.Build.props b/tests/FSharp.Core.UnitTests/Directory.Build.props new file mode 100644 index 00000000000..bb8eac309b1 --- /dev/null +++ b/tests/FSharp.Core.UnitTests/Directory.Build.props @@ -0,0 +1,3 @@ + + + diff --git a/tests/FSharp.Core.UnitTests/Directory.Build.targets b/tests/FSharp.Core.UnitTests/Directory.Build.targets new file mode 100644 index 00000000000..ccd47cc0a9a --- /dev/null +++ b/tests/FSharp.Core.UnitTests/Directory.Build.targets @@ -0,0 +1,3 @@ + + + diff --git a/tests/FSharp.Core.UnitTests/FSharp.Core.UnitTests.dll.config b/tests/FSharp.Core.UnitTests/FSharp.Core.UnitTests.dll.config index e400a559411..ce6637101bb 100644 --- a/tests/FSharp.Core.UnitTests/FSharp.Core.UnitTests.dll.config +++ b/tests/FSharp.Core.UnitTests/FSharp.Core.UnitTests.dll.config @@ -4,9 +4,9 @@ - - + + - \ No newline at end of file + diff --git a/tests/FSharp.Core.UnitTests/FSharp.Core.UnitTests.fsproj b/tests/FSharp.Core.UnitTests/FSharp.Core.UnitTests.fsproj index 689f832ee5b..5e56fd9d395 100644 --- a/tests/FSharp.Core.UnitTests/FSharp.Core.UnitTests.fsproj +++ b/tests/FSharp.Core.UnitTests/FSharp.Core.UnitTests.fsproj @@ -1,73 +1,17 @@  - + + - $(MSBuildProjectDirectory)\..\..\src - {88e2d422-6852-46e3-a740-83e391dc7973} - true - false - - - - Debug - AnyCPU - 2.0 - true - true + net46;netcoreapp2.0 Library - false - FSharp.Core.UnitTests - - false - false - netcore - $(NoWarn);217 - - - $(DefineConstants);$(TargetDotnetProfile.ToLower()) + true + nunit + + + false - - true - false - $(DefineConstants);DEBUG;TRACE - prompt - 3 - - - true - $(DefineConstants);TRACE - prompt - 3 - - - - - true - True - $(NUnitLibDir)\nunit.framework.dll - - - true - True - $(FsCheckLibDir)\net452\FsCheck.dll - - - ..\..\packages\System.ValueTuple.$(SystemValueTuplePackageVersion)\lib\portable-net40+sl4+win8+wp8\System.ValueTuple.dll - True - - - - - {DED3BBD7-53F4-428A-8C9F-27968E768605} - FSharp.Core - - - - - - - - + @@ -94,6 +38,7 @@ + @@ -117,13 +62,21 @@ - - + + FSharp.Core.UnitTests.dll.config FSCoreVersion $(FSCoreVersion) - - \ No newline at end of file + + + + + + + + + + diff --git a/tests/FSharp.Core.UnitTests/FSharp.Core/DiscrimantedUnionType.fs b/tests/FSharp.Core.UnitTests/FSharp.Core/DiscrimantedUnionType.fs index 597258bdbe4..90d30f40a6c 100644 --- a/tests/FSharp.Core.UnitTests/FSharp.Core/DiscrimantedUnionType.fs +++ b/tests/FSharp.Core.UnitTests/FSharp.Core/DiscrimantedUnionType.fs @@ -249,3 +249,10 @@ let [] ``can properly construct a struct union using FSharpValue.MakeUnion let c2 = (fieldVals.[1] :?> int) Assert.AreEqual (3456, c2) +let [] ``struct unions does optimization correctly on pattern matching`` () = + let arr = ResizeArray() + match arr.Add(1); ValueSome () with + | ValueSome () -> () + | ValueNone -> () + + Assert.AreEqual(1, arr.Count) diff --git a/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Collections/ArrayModule.fs b/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Collections/ArrayModule.fs index 725775bf751..ef82fde2761 100644 --- a/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Collections/ArrayModule.fs +++ b/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Collections/ArrayModule.fs @@ -125,44 +125,41 @@ type ArrayModule() = CheckThrowsArgumentNullException (fun () -> Array.average nullArr |> ignore) () - + [] - member this.AverageBy() = - - // empty double array + member this.AverageBy() = + + // empty double array let emptyDouArray = Array.empty - let funcd x = x + 6.7 - CheckThrowsArgumentException(fun () -> Array.averageBy funcd emptyDouArray |> ignore) - + CheckThrowsArgumentException(fun () -> Array.averageBy (fun x -> x + 6.7) emptyDouArray |> ignore) + // empty float32 array let emptyFloat32Array: float32[] = [||] - let funcf x = x + 9.8f - CheckThrowsArgumentException(fun () -> Array.averageBy funcf emptyFloat32Array |> ignore) - + CheckThrowsArgumentException(fun () -> Array.averageBy (fun x -> x + 9.8f) emptyFloat32Array |> ignore) + // empty decimal array let emptyDecimalArray = Array.empty - let funcDecimal x = x + 9.8M - CheckThrowsArgumentException(fun () -> Array.averageBy funcDecimal emptyDecimalArray |> ignore) - + CheckThrowsArgumentException(fun () -> Array.averageBy (fun x -> x + 9.8M) emptyDecimalArray |> ignore) + // float32 array - let floatArray: float32[] = [| 1.2f;3.5f;6.7f |] - let averageOfFloat = Array.averageBy funcf floatArray - if averageOfFloat <> 13.5999994f then Assert.Fail() - + let floatArray: float32[] = [| 1.5f; 2.5f; 3.5f; 4.5f |] // using values that behave nicely with IEEE floats + let averageOfFloat = Array.averageBy (fun x -> x + 1.0f) floatArray + Assert.AreEqual(4.0f, averageOfFloat) + // double array - let doubleArray: System.Double[] = [| 1.0;8.0 |] - let averageOfDouble = Array.averageBy funcd doubleArray - if averageOfDouble <> 11.2 then Assert.Fail() - + let doubleArray: System.Double[] = [| 1.0; 8.0 |] // using values that behave nicely with IEEE doubles + let averageOfDouble = Array.averageBy (fun x -> x + 1.0) doubleArray + Assert.AreEqual(5.5, averageOfDouble) + // decimal array let decimalArray: decimal[] = [| 0M;19M;19.03M |] - let averageOfDecimal = Array.averageBy funcDecimal decimalArray - if averageOfDecimal <> 22.476666666666666666666666667M then Assert.Fail() - + let averageOfDecimal = Array.averageBy (fun x -> x + 9.8M) decimalArray + Assert.AreEqual(22.476666666666666666666666667M, averageOfDecimal) + // null array let nullArr : double[] = null - CheckThrowsArgumentNullException (fun () -> Array.averageBy funcd nullArr |> ignore) - + CheckThrowsArgumentNullException (fun () -> Array.averageBy (fun x -> x + 6.7) nullArr |> ignore) + () [] @@ -1186,6 +1183,24 @@ type ArrayModule() = member this.``exactlyOne should fail on arrays with more than one element``() = CheckThrowsArgumentException(fun () -> Array.exactlyOne [|"1"; "2"|] |> ignore) + [] + member this.``tryExactlyOne should return the element from singleton arrays``() = + Assert.AreEqual(Some 1, Array.tryExactlyOne [|1|]) + Assert.AreEqual(Some "2", Array.tryExactlyOne [|"2"|]) + () + + [] + member this.``tryExactlyOne should return None on empty array``() = + Assert.AreEqual(None, Array.tryExactlyOne [||]) + + [] + member this.``tryExactlyOne should return None for arrays with more than one element``() = + Assert.AreEqual(None, Array.tryExactlyOne [|"1"; "2"|]) + + [] + member this.``tryExactlyOne should fail on null array``() = + CheckThrowsArgumentNullException(fun () -> Array.tryExactlyOne null |> ignore) + [] member this.GroupBy() = let funcInt x = x%5 diff --git a/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Collections/CollectionModulesConsistency.fs b/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Collections/CollectionModulesConsistency.fs index c85ff999f67..53897216c2b 100644 --- a/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Collections/CollectionModulesConsistency.fs +++ b/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Collections/CollectionModulesConsistency.fs @@ -200,6 +200,18 @@ let ``exactlyOne is consistent`` () = smallerSizeCheck exactlyOne smallerSizeCheck exactlyOne +let tryExactlyOne<'a when 'a : comparison> (xs : 'a []) = + let s = runAndCheckErrorType (fun () -> xs |> Seq.tryExactlyOne) + let l = runAndCheckErrorType (fun () -> xs |> List.ofArray |> List.tryExactlyOne) + let a = runAndCheckErrorType (fun () -> xs |> Array.tryExactlyOne) + consistency "tryExactlyOne" s l a + +[] +let ``tryExactlyOne is consistent`` () = + smallerSizeCheck tryExactlyOne + smallerSizeCheck tryExactlyOne + smallerSizeCheck tryExactlyOne + let except<'a when 'a : equality> (xs : 'a []) (itemsToExclude: 'a []) = let s = xs |> Seq.except itemsToExclude |> Seq.toArray let l = xs |> List.ofArray |> List.except itemsToExclude |> List.toArray diff --git a/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Collections/ListModule.fs b/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Collections/ListModule.fs index e9784237119..188dadc3b93 100644 --- a/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Collections/ListModule.fs +++ b/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Collections/ListModule.fs @@ -98,36 +98,36 @@ type ListModule() = () - + [] - member this.AverageBy() = - // empty double List + member this.AverageBy() = + // empty double List let emptyDouList = List.empty - CheckThrowsArgumentException (fun () -> List.averageBy (fun x -> x + 6.7) emptyDouList |> ignore ) - + CheckThrowsArgumentException (fun () -> List.averageBy (fun x -> x + 6.7) emptyDouList |> ignore) + // empty float32 List let emptyFloat32List: float32 list = [] - CheckThrowsArgumentException (fun () -> List.averageBy (fun x -> x + 9.8f ) emptyFloat32List |> ignore) - + CheckThrowsArgumentException (fun () -> List.averageBy (fun x -> x + 9.8f) emptyFloat32List |> ignore) + // empty decimal List let emptyDecimalList = List.empty - CheckThrowsArgumentException (fun () -> List.averageBy (fun x -> x + 9.8M) emptyDecimalList |>ignore ) + CheckThrowsArgumentException (fun () -> List.averageBy (fun x -> x + 9.8M) emptyDecimalList |> ignore) // float32 List - let floatList: float32 list = [ 1.2f;3.5f;6.7f ] - let averageOfFloat = List.averageBy (fun x -> x + 9.8f ) floatList - Assert.AreEqual(averageOfFloat, 13.5999994f) - + let floatList: float32 list = [ 1.5f; 2.5f; 3.5f; 4.5f ] // using values that behave nicely with IEEE floats + let averageOfFloat = List.averageBy (fun x -> x + 1.0f) floatList + Assert.AreEqual(4.0f, averageOfFloat) + // double List - let doubleList: System.Double list = [ 1.0;8.0 ] - let averageOfDouble = List.averageBy (fun x -> x + 6.7) doubleList - Assert.AreEqual(11.2, averageOfDouble) - + let doubleList: System.Double list = [ 1.0; 8.0 ] // using values that behave nicely with IEEE doubles + let averageOfDouble = List.averageBy (fun x -> x + 1.0) doubleList + Assert.AreEqual(5.5, averageOfDouble) + // decimal List let decimalList: decimal list = [ 0M;19M;19.03M ] - let averageOfDecimal = List.averageBy (fun x -> x + 9.8M) decimalList + let averageOfDecimal = List.averageBy (fun x -> x + 9.8M) decimalList Assert.AreEqual(22.476666666666666666666666667M, averageOfDecimal) - + () [] @@ -808,6 +808,20 @@ type ListModule() = member this.``exactlyOne should fail on lists with more than one element``() = CheckThrowsArgumentException(fun () -> List.exactlyOne ["1"; "2"] |> ignore) + [] + member this.``tryExactlyOne should return the element from singleton lists``() = + Assert.AreEqual(Some 1, List.tryExactlyOne [1]) + Assert.AreEqual(Some "2", List.tryExactlyOne ["2"]) + () + + [] + member this.``tryExactlyOne should return None for empty list``() = + Assert.AreEqual(None, List.tryExactlyOne []) + + [] + member this.``tryExactlyOne should return None for lists with more than one element``() = + Assert.AreEqual(None, List.tryExactlyOne ["1"; "2"]) + [] member this.TryHead() = // integer List diff --git a/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Collections/SeqModule2.fs b/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Collections/SeqModule2.fs index 87483598568..700e4582934 100644 --- a/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Collections/SeqModule2.fs +++ b/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Collections/SeqModule2.fs @@ -139,17 +139,41 @@ type SeqModule2() = // Empty Seq let emptySeq = Seq.empty CheckThrowsArgumentException ( fun() -> Seq.exactlyOne emptySeq) - + // non-singleton Seq + let nonSingletonSeq = [ 0 .. 1 ] + CheckThrowsArgumentException ( fun() -> Seq.exactlyOne nonSingletonSeq |> ignore ) + + // null Seq + let nullSeq:seq<'a> = null + CheckThrowsArgumentNullException (fun () -> Seq.exactlyOne nullSeq) + () + + [] + member this.TryExactlyOne() = + let IntSeq = + seq { for i in 7 .. 7 do + yield i } + + Assert.AreEqual(Some 7, Seq.tryExactlyOne IntSeq) + + // string Seq + let strSeq = seq ["second"] + Assert.AreEqual(Some "second", Seq.tryExactlyOne strSeq) + + // Empty Seq let emptySeq = Seq.empty - CheckThrowsArgumentException ( fun() -> Seq.exactlyOne [ 0 .. 1 ] |> ignore ) - + Assert.AreEqual(None, Seq.tryExactlyOne emptySeq) + + // non-singleton Seq + let nonSingletonSeq = [ 0 .. 1 ] + Assert.AreEqual(None, Seq.tryExactlyOne nonSingletonSeq) + // null Seq let nullSeq:seq<'a> = null - CheckThrowsArgumentNullException (fun () ->Seq.exactlyOne nullSeq) - () - - + CheckThrowsArgumentNullException (fun () -> Seq.tryExactlyOne nullSeq |> ignore) + () + [] member this.Init() = diff --git a/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Collections/SeqMultipleIteration.fs b/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Collections/SeqMultipleIteration.fs new file mode 100644 index 00000000000..cc53b254676 --- /dev/null +++ b/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Collections/SeqMultipleIteration.fs @@ -0,0 +1,47 @@ +namespace FSharp.Core.UnitTests.FSharp_Core.Microsoft_FSharp_Collections + +open NUnit.Framework + +[] +module SeqMultipleIteration = + let makeNewSeq () = + let haveCalled = false |> ref + seq { + if !haveCalled then failwith "Should not have iterated this sequence before" + haveCalled := true + yield 3 + }, haveCalled + + [] + let ``Seq.distinct only evaluates the seq once`` () = + let s, haveCalled = makeNewSeq () + let distincts = Seq.distinct s + Assert.IsFalse !haveCalled + CollectionAssert.AreEqual (distincts |> Seq.toList, [3]) + Assert.IsTrue !haveCalled + + [] + let ``Seq.distinctBy only evaluates the seq once`` () = + let s, haveCalled = makeNewSeq () + let distincts = Seq.distinctBy id s + Assert.IsFalse !haveCalled + CollectionAssert.AreEqual (distincts |> Seq.toList, [3]) + Assert.IsTrue !haveCalled + + [] + let ``Seq.groupBy only evaluates the seq once`` () = + let s, haveCalled = makeNewSeq () + let groups : seq> = Seq.groupBy id s + Assert.IsFalse !haveCalled + let groups : list> = Seq.toList groups + // Seq.groupBy iterates the entire sequence as soon as it begins iteration. + Assert.IsTrue !haveCalled + + [] + let ``Seq.countBy only evaluates the seq once`` () = + let s, haveCalled = makeNewSeq () + let counts : seq = Seq.countBy id s + Assert.IsFalse !haveCalled + let counts : list = Seq.toList counts + Assert.IsTrue !haveCalled + CollectionAssert.AreEqual (counts |> Seq.toList, [(3, 1)]) diff --git a/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Control/AsyncModule.fs b/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Control/AsyncModule.fs index c2afaa88d5f..a08beb890e4 100644 --- a/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Control/AsyncModule.fs +++ b/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Control/AsyncModule.fs @@ -441,7 +441,7 @@ type AsyncModule() = member this.``RaceBetweenCancellationAndError.Sleep``() = testErrorAndCancelRace (Async.Sleep (-5)) -#if !coreclr +#if NET46 [] // takes 3 minutes! member this.``Async.Choice specification test``() = ThreadPool.SetMinThreads(100,100) |> ignore diff --git a/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Control/AsyncType.fs b/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Control/AsyncType.fs index d2fe26e0c00..701e8ff1575 100644 --- a/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Control/AsyncType.fs +++ b/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Control/AsyncType.fs @@ -134,7 +134,7 @@ type AsyncType() = member this.CreateTask () = let s = "Hello tasks!" let a = async { return s } -#if NETSTANDARD1_6 +#if !NET46 let t : Task = #else use t : Task = @@ -151,7 +151,7 @@ type AsyncType() = let a = async { cts.CancelAfter (100) do! tcs.Task |> Async.AwaitTask } -#if NETSTANDARD1_6 +#if !NET46 let t : Task = #else use t : Task = @@ -178,7 +178,7 @@ type AsyncType() = member this.StartTask () = let s = "Hello tasks!" let a = async { return s } -#if NETSTANDARD1_6 +#if !NET46 let t = #else use t = @@ -208,7 +208,7 @@ type AsyncType() = let a = async { do raise (Exception ()) } -#if NETSTANDARD1_6 +#if !NET46 let t = #else use t = @@ -227,7 +227,7 @@ type AsyncType() = let a = async { while true do () } -#if NETSTANDARD1_6 +#if !NET46 let t = #else use t = @@ -252,7 +252,7 @@ type AsyncType() = } let cts = new CancellationTokenSource() let token = cts.Token -#if NETSTANDARD1_6 +#if !NET46 let t = #else use t = @@ -274,7 +274,7 @@ type AsyncType() = member this.CreateImmediateAsTask () = let s = "Hello tasks!" let a = async { return s } -#if FSCORE_PORTABLE_NEW || coreclr +#if !NET46 let t : Task = #else use t : Task = @@ -288,7 +288,7 @@ type AsyncType() = member this.StartImmediateAsTask () = let s = "Hello tasks!" let a = async { return s } -#if FSCORE_PORTABLE_NEW || coreclr +#if !NET46 let t = #else use t = @@ -304,7 +304,7 @@ type AsyncType() = let a = async { do raise (Exception ()) } -#if FSCORE_PORTABLE_NEW || coreclr +#if !NET46 let t = #else use t = @@ -324,7 +324,7 @@ type AsyncType() = let a = async { while true do () } -#if FSCORE_PORTABLE_NEW || coreclr +#if !NET46 let t = #else use t = @@ -350,7 +350,7 @@ type AsyncType() = } let cts = new CancellationTokenSource() let token = cts.Token -#if FSCORE_PORTABLE_NEW || coreclr +#if !NET46 let t = #else use t = @@ -372,7 +372,7 @@ type AsyncType() = [] member this.TaskAsyncValue () = let s = "Test" -#if NETSTANDARD1_6 +#if !NET46 let t = #else use t = @@ -412,7 +412,7 @@ type AsyncType() = [] member this.TaskAsyncValueException () = -#if NETSTANDARD1_6 +#if !NET46 let t = #else use t = @@ -431,7 +431,7 @@ type AsyncType() = use ewh = new ManualResetEvent(false) let cts = new CancellationTokenSource() let token = cts.Token -#if NETSTANDARD1_6 +#if !NET46 let t : Task= #else use t : Task= @@ -450,7 +450,7 @@ type AsyncType() = [] member this.NonGenericTaskAsyncValue () = let hasBeenCalled = ref false -#if NETSTANDARD1_6 +#if !NET46 let t = #else use t = @@ -465,7 +465,7 @@ type AsyncType() = [] member this.NonGenericTaskAsyncValueException () = -#if NETSTANDARD1_6 +#if !NET46 let t = #else use t = @@ -484,7 +484,7 @@ type AsyncType() = use ewh = new ManualResetEvent(false) let cts = new CancellationTokenSource() let token = cts.Token -#if NETSTANDARD1_6 +#if !NET46 let t = #else use t = diff --git a/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Control/MailboxProcessorType.fs b/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Control/MailboxProcessorType.fs index de56a4b1455..5dfafab8770 100644 --- a/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Control/MailboxProcessorType.fs +++ b/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Control/MailboxProcessorType.fs @@ -292,7 +292,7 @@ type MailboxProcessorType() = test() - [] + //[] // need to re-visit this member this.PostAndAsyncReply_Cancellation() = use cancel = new CancellationTokenSource(500) @@ -329,6 +329,6 @@ type MailboxProcessorType() = |> Async.Parallel |> Async.Ignore |> fun x -> Async.Start(x, cancel.Token) - System.Threading.Thread.Sleep(1000) // cancellation after 500 + System.Threading.Thread.Sleep(5000) // cancellation after 500 pause for 5 seconds if not gotGood || not gotBad then - failwith "Exected both good and bad async's to be cancelled afteMailbox should not fail!" + failwith <| sprintf "Exected both good and bad async's to be cancelled afteMailbox should not fail! gotGood: %A, gotBad: %A" gotGood gotBad diff --git a/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Core/OptionModule.fs b/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Core/OptionModule.fs index 5726775deff..3fb4395cd69 100644 --- a/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Core/OptionModule.fs +++ b/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Core/OptionModule.fs @@ -224,28 +224,224 @@ type ValueOptionTests() = [] member this.ValueOptionBasics () = - Assert.AreEqual( (ValueNone: int voption), (ValueNone: int voption)) - Assert.True( (ValueNone: int voption) <= (ValueNone: int voption)) - Assert.True( (ValueNone: int voption) >= (ValueNone: int voption)) - Assert.True( (ValueNone: int voption) < (ValueSome 1: int voption)) - Assert.True( (ValueSome 0: int voption) < (ValueSome 1: int voption)) - Assert.True( (ValueSome 1: int voption) > (ValueSome 0: int voption)) - Assert.False( (ValueSome 1: int voption) < (ValueNone : int voption)) - Assert.True( (ValueSome 1: int voption) <= (ValueSome 1: int voption)) - Assert.AreEqual( compare (ValueSome 1) (ValueSome 1), 0) - Assert.True( compare (ValueSome 0) (ValueSome 1) < 0) - Assert.True( compare (ValueNone: int voption) (ValueSome 1) < 0) - Assert.True( compare (ValueSome 1) (ValueNone : int voption) > 0) - Assert.AreEqual( ValueSome 1, ValueSome 1) - Assert.AreNotEqual( ValueSome 2, ValueSome 1) - Assert.AreEqual( ValueSome 2, ValueSome 2) - Assert.AreEqual( ValueSome (ValueSome 2), ValueSome (ValueSome 2)) - Assert.AreNotEqual( ValueSome (ValueSome 2), ValueSome (ValueSome 1)) - Assert.AreNotEqual( ValueSome (ValueSome 0), ValueSome ValueNone) - Assert.AreEqual( ValueSome (ValueNone: int voption), ValueSome (ValueNone: int voption)) - Assert.AreEqual( (ValueSome (ValueNone: int voption)).Value, (ValueNone: int voption)) - Assert.AreEqual( (ValueSome 1).Value, 1) - Assert.AreEqual( (ValueSome (1,2)).Value, (1,2)) + Assert.AreEqual((ValueNone: int voption), (ValueNone: int voption)) + Assert.True((ValueNone: int voption) <= (ValueNone: int voption)) + Assert.True((ValueNone: int voption) >= (ValueNone: int voption)) + Assert.True((ValueNone: int voption) < (ValueSome 1: int voption)) + Assert.True((ValueSome 0: int voption) < (ValueSome 1: int voption)) + Assert.True((ValueSome 1: int voption) > (ValueSome 0: int voption)) + Assert.False((ValueSome 1: int voption) < (ValueNone : int voption)) + Assert.True((ValueSome 1: int voption) <= (ValueSome 1: int voption)) + Assert.AreEqual(compare (ValueSome 1) (ValueSome 1), 0) + Assert.True(compare (ValueSome 0) (ValueSome 1) < 0) + Assert.True(compare (ValueNone: int voption) (ValueSome 1) < 0) + Assert.True(compare (ValueSome 1) (ValueNone : int voption) > 0) + Assert.AreEqual(ValueSome 1, ValueSome 1) + Assert.AreNotEqual(ValueSome 2, ValueSome 1) + Assert.AreEqual(ValueSome 2, ValueSome 2) + Assert.AreEqual(ValueSome (ValueSome 2), ValueSome (ValueSome 2)) + Assert.AreNotEqual(ValueSome (ValueSome 2), ValueSome (ValueSome 1)) + Assert.AreNotEqual(ValueSome (ValueSome 0), ValueSome ValueNone) + Assert.AreEqual(ValueSome (ValueNone: int voption), ValueSome (ValueNone: int voption)) + Assert.AreEqual((ValueSome (ValueNone: int voption)).Value, (ValueNone: int voption)) + Assert.AreEqual((ValueSome 1).Value, 1) + Assert.AreEqual((ValueSome (1,2)).Value, (1,2)) Assert.AreEqual(defaultValueArg ValueNone 1, 1) Assert.AreEqual(defaultValueArg (ValueSome 3) 1, 3) + + [] + member this.Flatten () = + Assert.AreEqual(ValueOption.flatten ValueNone, ValueNone) + Assert.AreEqual(ValueOption.flatten (ValueSome ValueNone), ValueNone) + Assert.AreEqual(ValueOption.flatten (ValueSome <| ValueSome 1), ValueSome 1) + Assert.AreEqual(ValueOption.flatten (ValueSome <| ValueSome ""), ValueSome "") + + [] + member this.FilterValueSomeIntegerWhenPredicateReturnsTrue () = + let test x = + let actual = x |> ValueSome |> ValueOption.filter (fun _ -> true) + + actual = ValueSome x + |> Assert.True + [0;1;-1;42] |> List.iter test + + [] + member this.FilterValueSomeStringWhenPredicateReturnsTrue () = + let test x = + let actual = x |> ValueSome |> ValueOption.filter (fun _ -> true) + + actual = ValueSome x + |> Assert.True + [""; " "; "Foo"; "Bar"] |> List.iter test + + [] + member this.FilterValueSomeIntegerWhenPredicateReturnsFalse () = + let test x = + let actual = x |> ValueSome |> ValueOption.filter (fun _ -> false) + + actual = ValueNone + |> Assert.True + [0; 1; -1; 1337] |> List.iter test + + [] + member this.FilterValueSomeStringWhenPredicateReturnsFalse () = + let test x = + let actual = x |> ValueSome |> ValueOption.filter (fun _ -> false) + + actual= ValueNone + |> Assert.True + [""; " "; "Ploeh"; "Fnaah"] |> List.iter test + [] + member this.FilterValueNoneReturnsCorrectResult () = + let test x = + let actual = ValueNone |> ValueOption.filter (fun _ -> x) + + actual = ValueNone + |> Assert.True + [false; true] |> List.iter test + + [] + member this.FilterValueSomeIntegerWhenPredicateEqualsInput () = + let test x = + let actual = x |> ValueSome |> ValueOption.filter ((=) x) + + actual = ValueSome x + |> Assert.True + [0; 1; -1; -2001] |> List.iter test + + [] + member this.FilterValueSomeStringWhenPredicateEqualsInput () = + let test x = + let actual = x |> ValueSome |> ValueOption.filter ((=) x) + + actual = ValueSome x + |> Assert.True + [""; " "; "Xyzz"; "Sgryt"] |> List.iter test + + [] + member this.FilterValueSomeIntegerWhenPredicateDoesNotEqualsInput () = + let test x = + let actual = x |> ValueSome |> ValueOption.filter ((<>) x) + + actual = ValueNone + |> Assert.True + [0; 1; -1; 927] |> List.iter test + + [] + member this.FilterValueSomeStringWhenPredicateDoesNotEqualsInput () = + let test x = + let actual = x |> ValueSome |> ValueOption.filter ((<>) x) + + actual = ValueNone + |> Assert.True + [""; " "; "Baz Quux"; "Corge grault"] |> List.iter test + + [] + member this.Contains() = + Assert.IsFalse(ValueOption.contains 1 ValueNone) + Assert.IsTrue(ValueOption.contains 1 (ValueSome 1)) + + Assert.IsFalse(ValueOption.contains "" ValueNone) + Assert.IsTrue(ValueOption.contains "" (ValueSome "")) + + Assert.IsFalse(ValueOption.contains ValueNone ValueNone) + Assert.IsTrue(ValueOption.contains ValueNone (ValueSome ValueNone)) + [] + member this.OfToNullable() = + Assert.IsTrue(ValueOption.ofNullable (System.Nullable()) = ValueNone) + Assert.IsTrue(ValueOption.ofNullable (System.Nullable(3)) = ValueSome 3) + + Assert.IsTrue(ValueOption.toNullable (ValueNone : int voption) = System.Nullable()) + Assert.IsTrue(ValueOption.toNullable (ValueNone : System.DateTime voption) = System.Nullable()) + Assert.IsTrue(ValueOption.toNullable (ValueSome 3) = System.Nullable(3)) + + [] + member this.OfToObj() = + Assert.IsTrue(ValueOption.toObj (ValueSome "3") = "3") + Assert.IsTrue(ValueOption.toObj (ValueSome "") = "") + Assert.IsTrue(ValueOption.toObj (ValueSome null) = null) + Assert.IsTrue(ValueOption.toObj ValueNone = null) + + Assert.IsTrue(ValueOption.ofObj "3" = ValueSome "3") + Assert.IsTrue(ValueOption.ofObj "" = ValueSome "") + Assert.IsTrue(ValueOption.ofObj [| "" |] = ValueSome [| "" |]) + Assert.IsTrue(ValueOption.ofObj (null : string array) = ValueNone) + Assert.IsTrue(ValueOption.ofObj null = ValueNone) + Assert.IsTrue(ValueOption.ofObj null = ValueNone) + Assert.IsTrue(ValueOption.ofObj null = ValueNone) + + [] + member this.DefaultValue() = + Assert.AreEqual(ValueOption.defaultValue 3 ValueNone, 3) + Assert.AreEqual(ValueOption.defaultValue 3 (ValueSome 42), 42) + Assert.AreEqual(ValueOption.defaultValue "" ValueNone, "") + Assert.AreEqual(ValueOption.defaultValue "" (ValueSome "x"), "x") + + [] + member this.DefaultWith() = + Assert.AreEqual(ValueOption.defaultWith (fun () -> 3) ValueNone, 3) + Assert.AreEqual(ValueOption.defaultWith (fun () -> "") ValueNone, "") + + Assert.AreEqual(ValueOption.defaultWith assertWasNotCalledThunk (ValueSome 42), 42) + Assert.AreEqual(ValueOption.defaultWith assertWasNotCalledThunk (ValueSome ""), "") + + [] + member this.OrElse() = + Assert.AreEqual(ValueOption.orElse ValueNone ValueNone, ValueNone) + Assert.AreEqual(ValueOption.orElse (ValueSome 3) ValueNone, ValueSome 3) + Assert.AreEqual(ValueOption.orElse ValueNone (ValueSome 42), ValueSome 42) + Assert.AreEqual(ValueOption.orElse (ValueSome 3) (ValueSome 42), ValueSome 42) + + Assert.AreEqual(ValueOption.orElse (ValueSome "") ValueNone, ValueSome "") + Assert.AreEqual(ValueOption.orElse ValueNone (ValueSome "x"), ValueSome "x") + Assert.AreEqual(ValueOption.orElse (ValueSome "") (ValueSome "x"), ValueSome "x") + + [] + member this.OrElseWith() = + Assert.AreEqual(ValueOption.orElseWith (fun () -> ValueNone) ValueNone, ValueNone) + Assert.AreEqual(ValueOption.orElseWith (fun () -> ValueSome 3) ValueNone, ValueSome 3) + Assert.AreEqual(ValueOption.orElseWith (fun () -> ValueSome "") ValueNone, ValueSome "") + + Assert.AreEqual(ValueOption.orElseWith assertWasNotCalledThunk (ValueSome 42), ValueSome 42) + Assert.AreEqual(ValueOption.orElseWith assertWasNotCalledThunk (ValueSome ""), ValueSome "") + + [] + member this.Map2() = + Assert.True(ValueOption.map2 (-) ValueNone ValueNone = ValueNone) + Assert.True(ValueOption.map2 (-) (ValueSome 1) ValueNone = ValueNone) + Assert.True(ValueOption.map2 (-) ValueNone (ValueSome 2) = ValueNone) + Assert.True(ValueOption.map2 (-) (ValueSome 1) (ValueSome 2) = ValueSome -1) + + Assert.True(ValueOption.map2 (+) ValueNone ValueNone = ValueNone) + Assert.True(ValueOption.map2 (+) (ValueSome "x") ValueNone = ValueNone) + Assert.True(ValueOption.map2 (+) (ValueSome "x") (ValueSome "y") = ValueSome "xy") + Assert.True(ValueOption.map2 (+) ValueNone (ValueSome "y") = ValueNone) + + [] + member this.Map3() = + let add3 x y z = string x + string y + string z + Assert.True(ValueOption.map3 add3 ValueNone ValueNone ValueNone = ValueNone) + Assert.True(ValueOption.map3 add3 (ValueSome 1) ValueNone ValueNone = ValueNone) + Assert.True(ValueOption.map3 add3 ValueNone (ValueSome 2) ValueNone = ValueNone) + Assert.True(ValueOption.map3 add3 (ValueSome 1) (ValueSome 2) ValueNone = ValueNone) + Assert.True(ValueOption.map3 add3 ValueNone ValueNone (ValueSome 3) = ValueNone) + Assert.True(ValueOption.map3 add3 (ValueSome 1) ValueNone (ValueSome 3) = ValueNone) + Assert.True(ValueOption.map3 add3 ValueNone (ValueSome 2) (ValueSome 3) = ValueNone) + Assert.True(ValueOption.map3 add3 (ValueSome 1) (ValueSome 2) (ValueSome 3) = ValueSome "123") + + let concat3 x y z = x + y + z + Assert.True(ValueOption.map3 concat3 ValueNone ValueNone ValueNone = ValueNone) + Assert.True(ValueOption.map3 concat3 (ValueSome "x") ValueNone ValueNone = ValueNone) + Assert.True(ValueOption.map3 concat3 ValueNone (ValueSome "y") ValueNone = ValueNone) + Assert.True(ValueOption.map3 concat3 (ValueSome "x") (ValueSome "y") ValueNone = ValueNone) + Assert.True(ValueOption.map3 concat3 ValueNone ValueNone (ValueSome "z") = ValueNone) + Assert.True(ValueOption.map3 concat3 (ValueSome "x") ValueNone (ValueSome "z") = ValueNone) + Assert.True(ValueOption.map3 concat3 ValueNone (ValueSome "y") (ValueSome "z") = ValueNone) + Assert.True(ValueOption.map3 concat3 (ValueSome "x") (ValueSome "y") (ValueSome "z") = ValueSome "xyz") + + [] + member this.MapBindEquivalenceProperties () = + let fn x = x + 3 + Assert.AreEqual(ValueOption.map fn ValueNone, ValueOption.bind (fn >> ValueSome) ValueNone) + Assert.AreEqual(ValueOption.map fn (ValueSome 5), ValueOption.bind (fn >> ValueSome) (ValueSome 5)) \ No newline at end of file diff --git a/tests/FSharp.Core.UnitTests/LibraryTestFx.fs b/tests/FSharp.Core.UnitTests/LibraryTestFx.fs index b58653a1de1..c4d6e147fe0 100644 --- a/tests/FSharp.Core.UnitTests/LibraryTestFx.fs +++ b/tests/FSharp.Core.UnitTests/LibraryTestFx.fs @@ -143,7 +143,8 @@ module SurfaceArea = let logFile = let workDir = TestContext.CurrentContext.WorkDirectory - sprintf "%s\\CoreUnit_%s_Xml.xml" workDir platform + sprintf "%s\\FSharp.Core.SurfaceArea.%s.txt" workDir platform + System.IO.File.WriteAllText(logFile, String.Join("\r\n", actual)) // The surface areas don't match; prepare an easily-readable output message. let msg = diff --git a/tests/FSharp.Core.UnitTests/NuGet.Config b/tests/FSharp.Core.UnitTests/NuGet.Config deleted file mode 100644 index 0a86752fee0..00000000000 --- a/tests/FSharp.Core.UnitTests/NuGet.Config +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/tests/FSharp.Core.UnitTests/Program.fs b/tests/FSharp.Core.UnitTests/Program.fs deleted file mode 100644 index 28ff2aa8434..00000000000 --- a/tests/FSharp.Core.UnitTests/Program.fs +++ /dev/null @@ -1,12 +0,0 @@ -module Program - -open System -open System.Reflection -open NUnitLite -open NUnit.Common - -type HelperType() = inherit System.Object() - -[] -let main argv = - AutoRun(typeof.GetTypeInfo().Assembly).Execute(argv, new ExtendedTextWrapper(Console.Out), Console.In) diff --git a/tests/FSharp.Core.UnitTests/SurfaceArea.coreclr.fs b/tests/FSharp.Core.UnitTests/SurfaceArea.coreclr.fs index 841b5092f23..9de6db290bd 100644 --- a/tests/FSharp.Core.UnitTests/SurfaceArea.coreclr.fs +++ b/tests/FSharp.Core.UnitTests/SurfaceArea.coreclr.fs @@ -102,7 +102,6 @@ Microsoft.FSharp.Collections.ArrayModule: System.Tuple`2[System.Int32,T][] Index Microsoft.FSharp.Collections.ArrayModule: System.Tuple`2[T,T][] Pairwise[T](T[]) Microsoft.FSharp.Collections.ArrayModule: System.Tuple`2[T1,T2][] AllPairs[T1,T2](T1[], T2[]) Microsoft.FSharp.Collections.ArrayModule: System.Tuple`2[T1,T2][] Zip[T1,T2](T1[], T2[]) -Microsoft.FSharp.Collections.ArrayModule: System.Tuple`2[T1,T2][] AllPairs[T1,T2](T1[], T2[]) Microsoft.FSharp.Collections.ArrayModule: System.Tuple`2[T1[],T2[]] Unzip[T1,T2](System.Tuple`2[T1,T2][]) Microsoft.FSharp.Collections.ArrayModule: System.Tuple`2[TKey,System.Int32][] CountBy[T,TKey](Microsoft.FSharp.Core.FSharpFunc`2[T,TKey], T[]) Microsoft.FSharp.Collections.ArrayModule: System.Tuple`2[TKey,T[]][] GroupBy[T,TKey](Microsoft.FSharp.Core.FSharpFunc`2[T,TKey], T[]) @@ -115,6 +114,7 @@ Microsoft.FSharp.Collections.ArrayModule: System.Tuple`3[T1[],T2[],T3[]] Unzip3[ Microsoft.FSharp.Collections.ArrayModule: System.Type GetType() Microsoft.FSharp.Collections.ArrayModule: T Average[T](T[]) Microsoft.FSharp.Collections.ArrayModule: T ExactlyOne[T](T[]) +Microsoft.FSharp.Collections.ArrayModule: Microsoft.FSharp.Core.FSharpOption`1[T] TryExactlyOne[T](T[]) Microsoft.FSharp.Collections.ArrayModule: T FindBack[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean], T[]) Microsoft.FSharp.Collections.ArrayModule: T Find[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean], T[]) Microsoft.FSharp.Collections.ArrayModule: T Get[T](T[], Int32) @@ -189,18 +189,6 @@ Microsoft.FSharp.Collections.ArrayModule: Void Set[T](T[], Int32, T) Microsoft.FSharp.Collections.ArrayModule: Void SortInPlaceBy[T,TKey](Microsoft.FSharp.Core.FSharpFunc`2[T,TKey], T[]) Microsoft.FSharp.Collections.ArrayModule: Void SortInPlaceWith[T](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpFunc`2[T,System.Int32]], T[]) Microsoft.FSharp.Collections.ArrayModule: Void SortInPlace[T](T[]) -Microsoft.FSharp.Collections.ArrayModule+Parallel: Boolean Equals(System.Object) -Microsoft.FSharp.Collections.ArrayModule+Parallel: Int32 GetHashCode() -Microsoft.FSharp.Collections.ArrayModule+Parallel: System.String ToString() -Microsoft.FSharp.Collections.ArrayModule+Parallel: System.Tuple`2[T[],T[]] Partition[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean], T[]) -Microsoft.FSharp.Collections.ArrayModule+Parallel: System.Type GetType() -Microsoft.FSharp.Collections.ArrayModule+Parallel: TResult[] Choose[T,TResult](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpOption`1[TResult]], T[]) -Microsoft.FSharp.Collections.ArrayModule+Parallel: TResult[] Collect[T,TResult](Microsoft.FSharp.Core.FSharpFunc`2[T,TResult[]], T[]) -Microsoft.FSharp.Collections.ArrayModule+Parallel: TResult[] MapIndexed[T,TResult](Microsoft.FSharp.Core.FSharpFunc`2[System.Int32,Microsoft.FSharp.Core.FSharpFunc`2[T,TResult]], T[]) -Microsoft.FSharp.Collections.ArrayModule+Parallel: TResult[] Map[T,TResult](Microsoft.FSharp.Core.FSharpFunc`2[T,TResult], T[]) -Microsoft.FSharp.Collections.ArrayModule+Parallel: T[] Initialize[T](Int32, Microsoft.FSharp.Core.FSharpFunc`2[System.Int32,T]) -Microsoft.FSharp.Collections.ArrayModule+Parallel: Void IterateIndexed[T](Microsoft.FSharp.Core.FSharpFunc`2[System.Int32,Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.Unit]], T[]) -Microsoft.FSharp.Collections.ArrayModule+Parallel: Void Iterate[T](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.Unit], T[]) Microsoft.FSharp.Collections.ComparisonIdentity: Boolean Equals(System.Object) Microsoft.FSharp.Collections.ComparisonIdentity: Int32 GetHashCode() Microsoft.FSharp.Collections.ComparisonIdentity: System.Collections.Generic.IComparer`1[T] FromFunction[T](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpFunc`2[T,System.Int32]]) @@ -251,6 +239,7 @@ Microsoft.FSharp.Collections.FSharpList`1[T]: Void .ctor(T, Microsoft.FSharp.Col Microsoft.FSharp.Collections.FSharpMap`2[TKey,TValue]: Boolean ContainsKey(TKey) Microsoft.FSharp.Collections.FSharpMap`2[TKey,TValue]: Boolean Equals(System.Object) Microsoft.FSharp.Collections.FSharpMap`2[TKey,TValue]: Boolean IsEmpty +Microsoft.FSharp.Collections.FSharpMap`2[TKey,TValue]: Boolean TryGetValue(TKey, TValue ByRef) Microsoft.FSharp.Collections.FSharpMap`2[TKey,TValue]: Boolean get_IsEmpty() Microsoft.FSharp.Collections.FSharpMap`2[TKey,TValue]: Int32 Count Microsoft.FSharp.Collections.FSharpMap`2[TKey,TValue]: Int32 GetHashCode() @@ -258,7 +247,6 @@ Microsoft.FSharp.Collections.FSharpMap`2[TKey,TValue]: Int32 get_Count() Microsoft.FSharp.Collections.FSharpMap`2[TKey,TValue]: Microsoft.FSharp.Collections.FSharpMap`2[TKey,TValue] Add(TKey, TValue) Microsoft.FSharp.Collections.FSharpMap`2[TKey,TValue]: Microsoft.FSharp.Collections.FSharpMap`2[TKey,TValue] Remove(TKey) Microsoft.FSharp.Collections.FSharpMap`2[TKey,TValue]: Microsoft.FSharp.Core.FSharpOption`1[TValue] TryFind(TKey) -Microsoft.FSharp.Collections.FSharpMap`2[TKey,TValue]: Boolean TryGetValue(TKey, TValue ByRef) Microsoft.FSharp.Collections.FSharpMap`2[TKey,TValue]: System.String ToString() Microsoft.FSharp.Collections.FSharpMap`2[TKey,TValue]: System.Type GetType() Microsoft.FSharp.Collections.FSharpMap`2[TKey,TValue]: TValue Item [TKey] @@ -373,6 +361,7 @@ Microsoft.FSharp.Collections.ListModule: System.Tuple`3[Microsoft.FSharp.Collect Microsoft.FSharp.Collections.ListModule: System.Type GetType() Microsoft.FSharp.Collections.ListModule: T Average[T](Microsoft.FSharp.Collections.FSharpList`1[T]) Microsoft.FSharp.Collections.ListModule: T ExactlyOne[T](Microsoft.FSharp.Collections.FSharpList`1[T]) +Microsoft.FSharp.Collections.ListModule: Microsoft.FSharp.Core.FSharpOption`1[T] TryExactlyOne[T](Microsoft.FSharp.Collections.FSharpList`1[T]) Microsoft.FSharp.Collections.ListModule: T FindBack[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean], Microsoft.FSharp.Collections.FSharpList`1[T]) Microsoft.FSharp.Collections.ListModule: T Find[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean], Microsoft.FSharp.Collections.FSharpList`1[T]) Microsoft.FSharp.Collections.ListModule: T Get[T](Microsoft.FSharp.Collections.FSharpList`1[T], Int32) @@ -507,6 +496,7 @@ Microsoft.FSharp.Collections.SeqModule: System.Tuple`2[System.Collections.Generi Microsoft.FSharp.Collections.SeqModule: System.Type GetType() Microsoft.FSharp.Collections.SeqModule: T Average[T](System.Collections.Generic.IEnumerable`1[T]) Microsoft.FSharp.Collections.SeqModule: T ExactlyOne[T](System.Collections.Generic.IEnumerable`1[T]) +Microsoft.FSharp.Collections.SeqModule: Microsoft.FSharp.Core.FSharpOption`1[T] TryExactlyOne[T](System.Collections.Generic.IEnumerable`1[T]) Microsoft.FSharp.Collections.SeqModule: T FindBack[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean], System.Collections.Generic.IEnumerable`1[T]) Microsoft.FSharp.Collections.SeqModule: T Find[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean], System.Collections.Generic.IEnumerable`1[T]) Microsoft.FSharp.Collections.SeqModule: T Get[T](Int32, System.Collections.Generic.IEnumerable`1[T]) @@ -573,10 +563,10 @@ Microsoft.FSharp.Control.AsyncActivation`1[T]: Boolean IsCancellationRequested Microsoft.FSharp.Control.AsyncActivation`1[T]: Boolean get_IsCancellationRequested() Microsoft.FSharp.Control.AsyncActivation`1[T]: Int32 GetHashCode() Microsoft.FSharp.Control.AsyncActivation`1[T]: Microsoft.FSharp.Control.AsyncReturn OnCancellation() -Microsoft.FSharp.Control.AsyncActivation`1[T]: Void OnExceptionRaised() Microsoft.FSharp.Control.AsyncActivation`1[T]: Microsoft.FSharp.Control.AsyncReturn OnSuccess(T) Microsoft.FSharp.Control.AsyncActivation`1[T]: System.String ToString() Microsoft.FSharp.Control.AsyncActivation`1[T]: System.Type GetType() +Microsoft.FSharp.Control.AsyncActivation`1[T]: Void OnExceptionRaised() Microsoft.FSharp.Control.AsyncPrimitives: Boolean Equals(System.Object) Microsoft.FSharp.Control.AsyncPrimitives: Int32 GetHashCode() Microsoft.FSharp.Control.AsyncPrimitives: Microsoft.FSharp.Control.AsyncReturn Bind[T,TResult](Microsoft.FSharp.Control.AsyncActivation`1[T], Microsoft.FSharp.Control.FSharpAsync`1[TResult], Microsoft.FSharp.Core.FSharpFunc`2[TResult,Microsoft.FSharp.Control.FSharpAsync`1[T]]) @@ -703,6 +693,7 @@ Microsoft.FSharp.Control.FSharpHandler`1[T]: Boolean Equals(System.Object) Microsoft.FSharp.Control.FSharpHandler`1[T]: Int32 GetHashCode() Microsoft.FSharp.Control.FSharpHandler`1[T]: System.Delegate[] GetInvocationList() Microsoft.FSharp.Control.FSharpHandler`1[T]: System.IAsyncResult BeginInvoke(System.Object, T, System.AsyncCallback, System.Object) +Microsoft.FSharp.Control.FSharpHandler`1[T]: System.Object Clone() Microsoft.FSharp.Control.FSharpHandler`1[T]: System.Object DynamicInvoke(System.Object[]) Microsoft.FSharp.Control.FSharpHandler`1[T]: System.Object Target Microsoft.FSharp.Control.FSharpHandler`1[T]: System.Object get_Target() @@ -712,6 +703,7 @@ Microsoft.FSharp.Control.FSharpHandler`1[T]: System.String ToString() Microsoft.FSharp.Control.FSharpHandler`1[T]: System.Type GetType() Microsoft.FSharp.Control.FSharpHandler`1[T]: Void .ctor(System.Object, IntPtr) Microsoft.FSharp.Control.FSharpHandler`1[T]: Void EndInvoke(System.IAsyncResult) +Microsoft.FSharp.Control.FSharpHandler`1[T]: Void GetObjectData(System.Runtime.Serialization.SerializationInfo, System.Runtime.Serialization.StreamingContext) Microsoft.FSharp.Control.FSharpHandler`1[T]: Void Invoke(System.Object, T) Microsoft.FSharp.Control.FSharpMailboxProcessor`1[TMsg]: Boolean Equals(System.Object) Microsoft.FSharp.Control.FSharpMailboxProcessor`1[TMsg]: Int32 CurrentQueueLength @@ -766,23 +758,32 @@ Microsoft.FSharp.Control.WebExtensions: Microsoft.FSharp.Control.FSharpAsync`1[S Microsoft.FSharp.Control.WebExtensions: System.String ToString() Microsoft.FSharp.Control.WebExtensions: System.Type GetType() Microsoft.FSharp.Core.AbstractClassAttribute: Boolean Equals(System.Object) +Microsoft.FSharp.Core.AbstractClassAttribute: Boolean IsDefaultAttribute() Microsoft.FSharp.Core.AbstractClassAttribute: Boolean Match(System.Object) Microsoft.FSharp.Core.AbstractClassAttribute: Int32 GetHashCode() +Microsoft.FSharp.Core.AbstractClassAttribute: System.Object TypeId +Microsoft.FSharp.Core.AbstractClassAttribute: System.Object get_TypeId() Microsoft.FSharp.Core.AbstractClassAttribute: System.String ToString() Microsoft.FSharp.Core.AbstractClassAttribute: System.Type GetType() Microsoft.FSharp.Core.AbstractClassAttribute: Void .ctor() Microsoft.FSharp.Core.AllowNullLiteralAttribute: Boolean Equals(System.Object) +Microsoft.FSharp.Core.AllowNullLiteralAttribute: Boolean IsDefaultAttribute() Microsoft.FSharp.Core.AllowNullLiteralAttribute: Boolean Match(System.Object) Microsoft.FSharp.Core.AllowNullLiteralAttribute: Boolean Value Microsoft.FSharp.Core.AllowNullLiteralAttribute: Boolean get_Value() Microsoft.FSharp.Core.AllowNullLiteralAttribute: Int32 GetHashCode() +Microsoft.FSharp.Core.AllowNullLiteralAttribute: System.Object TypeId +Microsoft.FSharp.Core.AllowNullLiteralAttribute: System.Object get_TypeId() Microsoft.FSharp.Core.AllowNullLiteralAttribute: System.String ToString() Microsoft.FSharp.Core.AllowNullLiteralAttribute: System.Type GetType() Microsoft.FSharp.Core.AllowNullLiteralAttribute: Void .ctor() Microsoft.FSharp.Core.AllowNullLiteralAttribute: Void .ctor(Boolean) Microsoft.FSharp.Core.AutoOpenAttribute: Boolean Equals(System.Object) +Microsoft.FSharp.Core.AutoOpenAttribute: Boolean IsDefaultAttribute() Microsoft.FSharp.Core.AutoOpenAttribute: Boolean Match(System.Object) Microsoft.FSharp.Core.AutoOpenAttribute: Int32 GetHashCode() +Microsoft.FSharp.Core.AutoOpenAttribute: System.Object TypeId +Microsoft.FSharp.Core.AutoOpenAttribute: System.Object get_TypeId() Microsoft.FSharp.Core.AutoOpenAttribute: System.String Path Microsoft.FSharp.Core.AutoOpenAttribute: System.String ToString() Microsoft.FSharp.Core.AutoOpenAttribute: System.String get_Path() @@ -790,10 +791,13 @@ Microsoft.FSharp.Core.AutoOpenAttribute: System.Type GetType() Microsoft.FSharp.Core.AutoOpenAttribute: Void .ctor() Microsoft.FSharp.Core.AutoOpenAttribute: Void .ctor(System.String) Microsoft.FSharp.Core.AutoSerializableAttribute: Boolean Equals(System.Object) +Microsoft.FSharp.Core.AutoSerializableAttribute: Boolean IsDefaultAttribute() Microsoft.FSharp.Core.AutoSerializableAttribute: Boolean Match(System.Object) Microsoft.FSharp.Core.AutoSerializableAttribute: Boolean Value Microsoft.FSharp.Core.AutoSerializableAttribute: Boolean get_Value() Microsoft.FSharp.Core.AutoSerializableAttribute: Int32 GetHashCode() +Microsoft.FSharp.Core.AutoSerializableAttribute: System.Object TypeId +Microsoft.FSharp.Core.AutoSerializableAttribute: System.Object get_TypeId() Microsoft.FSharp.Core.AutoSerializableAttribute: System.String ToString() Microsoft.FSharp.Core.AutoSerializableAttribute: System.Type GetType() Microsoft.FSharp.Core.AutoSerializableAttribute: Void .ctor(Boolean) @@ -817,38 +821,54 @@ Microsoft.FSharp.Core.ByRefKinds: Microsoft.FSharp.Core.ByRefKinds+Out Microsoft.FSharp.Core.ByRefKinds: System.String ToString() Microsoft.FSharp.Core.ByRefKinds: System.Type GetType() Microsoft.FSharp.Core.CLIEventAttribute: Boolean Equals(System.Object) +Microsoft.FSharp.Core.CLIEventAttribute: Boolean IsDefaultAttribute() Microsoft.FSharp.Core.CLIEventAttribute: Boolean Match(System.Object) Microsoft.FSharp.Core.CLIEventAttribute: Int32 GetHashCode() +Microsoft.FSharp.Core.CLIEventAttribute: System.Object TypeId +Microsoft.FSharp.Core.CLIEventAttribute: System.Object get_TypeId() Microsoft.FSharp.Core.CLIEventAttribute: System.String ToString() Microsoft.FSharp.Core.CLIEventAttribute: System.Type GetType() Microsoft.FSharp.Core.CLIEventAttribute: Void .ctor() Microsoft.FSharp.Core.CLIMutableAttribute: Boolean Equals(System.Object) +Microsoft.FSharp.Core.CLIMutableAttribute: Boolean IsDefaultAttribute() Microsoft.FSharp.Core.CLIMutableAttribute: Boolean Match(System.Object) Microsoft.FSharp.Core.CLIMutableAttribute: Int32 GetHashCode() +Microsoft.FSharp.Core.CLIMutableAttribute: System.Object TypeId +Microsoft.FSharp.Core.CLIMutableAttribute: System.Object get_TypeId() Microsoft.FSharp.Core.CLIMutableAttribute: System.String ToString() Microsoft.FSharp.Core.CLIMutableAttribute: System.Type GetType() Microsoft.FSharp.Core.CLIMutableAttribute: Void .ctor() Microsoft.FSharp.Core.ClassAttribute: Boolean Equals(System.Object) +Microsoft.FSharp.Core.ClassAttribute: Boolean IsDefaultAttribute() Microsoft.FSharp.Core.ClassAttribute: Boolean Match(System.Object) Microsoft.FSharp.Core.ClassAttribute: Int32 GetHashCode() +Microsoft.FSharp.Core.ClassAttribute: System.Object TypeId +Microsoft.FSharp.Core.ClassAttribute: System.Object get_TypeId() Microsoft.FSharp.Core.ClassAttribute: System.String ToString() Microsoft.FSharp.Core.ClassAttribute: System.Type GetType() Microsoft.FSharp.Core.ClassAttribute: Void .ctor() Microsoft.FSharp.Core.ComparisonConditionalOnAttribute: Boolean Equals(System.Object) +Microsoft.FSharp.Core.ComparisonConditionalOnAttribute: Boolean IsDefaultAttribute() Microsoft.FSharp.Core.ComparisonConditionalOnAttribute: Boolean Match(System.Object) Microsoft.FSharp.Core.ComparisonConditionalOnAttribute: Int32 GetHashCode() +Microsoft.FSharp.Core.ComparisonConditionalOnAttribute: System.Object TypeId +Microsoft.FSharp.Core.ComparisonConditionalOnAttribute: System.Object get_TypeId() Microsoft.FSharp.Core.ComparisonConditionalOnAttribute: System.String ToString() Microsoft.FSharp.Core.ComparisonConditionalOnAttribute: System.Type GetType() Microsoft.FSharp.Core.ComparisonConditionalOnAttribute: Void .ctor() Microsoft.FSharp.Core.CompilationArgumentCountsAttribute: Boolean Equals(System.Object) +Microsoft.FSharp.Core.CompilationArgumentCountsAttribute: Boolean IsDefaultAttribute() Microsoft.FSharp.Core.CompilationArgumentCountsAttribute: Boolean Match(System.Object) Microsoft.FSharp.Core.CompilationArgumentCountsAttribute: Int32 GetHashCode() Microsoft.FSharp.Core.CompilationArgumentCountsAttribute: System.Collections.Generic.IEnumerable`1[System.Int32] Counts Microsoft.FSharp.Core.CompilationArgumentCountsAttribute: System.Collections.Generic.IEnumerable`1[System.Int32] get_Counts() +Microsoft.FSharp.Core.CompilationArgumentCountsAttribute: System.Object TypeId +Microsoft.FSharp.Core.CompilationArgumentCountsAttribute: System.Object get_TypeId() Microsoft.FSharp.Core.CompilationArgumentCountsAttribute: System.String ToString() Microsoft.FSharp.Core.CompilationArgumentCountsAttribute: System.Type GetType() Microsoft.FSharp.Core.CompilationArgumentCountsAttribute: Void .ctor(Int32[]) Microsoft.FSharp.Core.CompilationMappingAttribute: Boolean Equals(System.Object) +Microsoft.FSharp.Core.CompilationMappingAttribute: Boolean IsDefaultAttribute() Microsoft.FSharp.Core.CompilationMappingAttribute: Boolean Match(System.Object) Microsoft.FSharp.Core.CompilationMappingAttribute: Int32 GetHashCode() Microsoft.FSharp.Core.CompilationMappingAttribute: Int32 SequenceNumber @@ -857,6 +877,8 @@ Microsoft.FSharp.Core.CompilationMappingAttribute: Int32 get_SequenceNumber() Microsoft.FSharp.Core.CompilationMappingAttribute: Int32 get_VariantNumber() Microsoft.FSharp.Core.CompilationMappingAttribute: Microsoft.FSharp.Core.SourceConstructFlags SourceConstructFlags Microsoft.FSharp.Core.CompilationMappingAttribute: Microsoft.FSharp.Core.SourceConstructFlags get_SourceConstructFlags() +Microsoft.FSharp.Core.CompilationMappingAttribute: System.Object TypeId +Microsoft.FSharp.Core.CompilationMappingAttribute: System.Object get_TypeId() Microsoft.FSharp.Core.CompilationMappingAttribute: System.String ResourceName Microsoft.FSharp.Core.CompilationMappingAttribute: System.String ToString() Microsoft.FSharp.Core.CompilationMappingAttribute: System.String get_ResourceName() @@ -868,10 +890,13 @@ Microsoft.FSharp.Core.CompilationMappingAttribute: Void .ctor(Microsoft.FSharp.C Microsoft.FSharp.Core.CompilationMappingAttribute: Void .ctor(Microsoft.FSharp.Core.SourceConstructFlags, Int32, Int32) Microsoft.FSharp.Core.CompilationMappingAttribute: Void .ctor(System.String, System.Type[]) Microsoft.FSharp.Core.CompilationRepresentationAttribute: Boolean Equals(System.Object) +Microsoft.FSharp.Core.CompilationRepresentationAttribute: Boolean IsDefaultAttribute() Microsoft.FSharp.Core.CompilationRepresentationAttribute: Boolean Match(System.Object) Microsoft.FSharp.Core.CompilationRepresentationAttribute: Int32 GetHashCode() Microsoft.FSharp.Core.CompilationRepresentationAttribute: Microsoft.FSharp.Core.CompilationRepresentationFlags Flags Microsoft.FSharp.Core.CompilationRepresentationAttribute: Microsoft.FSharp.Core.CompilationRepresentationFlags get_Flags() +Microsoft.FSharp.Core.CompilationRepresentationAttribute: System.Object TypeId +Microsoft.FSharp.Core.CompilationRepresentationAttribute: System.Object get_TypeId() Microsoft.FSharp.Core.CompilationRepresentationAttribute: System.String ToString() Microsoft.FSharp.Core.CompilationRepresentationAttribute: System.Type GetType() Microsoft.FSharp.Core.CompilationRepresentationAttribute: Void .ctor(Microsoft.FSharp.Core.CompilationRepresentationFlags) @@ -893,22 +918,29 @@ Microsoft.FSharp.Core.CompilationRepresentationFlags: System.String ToString(Sys Microsoft.FSharp.Core.CompilationRepresentationFlags: System.Type GetType() Microsoft.FSharp.Core.CompilationRepresentationFlags: System.TypeCode GetTypeCode() Microsoft.FSharp.Core.CompilationSourceNameAttribute: Boolean Equals(System.Object) +Microsoft.FSharp.Core.CompilationSourceNameAttribute: Boolean IsDefaultAttribute() Microsoft.FSharp.Core.CompilationSourceNameAttribute: Boolean Match(System.Object) Microsoft.FSharp.Core.CompilationSourceNameAttribute: Int32 GetHashCode() +Microsoft.FSharp.Core.CompilationSourceNameAttribute: System.Object TypeId +Microsoft.FSharp.Core.CompilationSourceNameAttribute: System.Object get_TypeId() Microsoft.FSharp.Core.CompilationSourceNameAttribute: System.String SourceName Microsoft.FSharp.Core.CompilationSourceNameAttribute: System.String ToString() Microsoft.FSharp.Core.CompilationSourceNameAttribute: System.String get_SourceName() Microsoft.FSharp.Core.CompilationSourceNameAttribute: System.Type GetType() Microsoft.FSharp.Core.CompilationSourceNameAttribute: Void .ctor(System.String) Microsoft.FSharp.Core.CompiledNameAttribute: Boolean Equals(System.Object) +Microsoft.FSharp.Core.CompiledNameAttribute: Boolean IsDefaultAttribute() Microsoft.FSharp.Core.CompiledNameAttribute: Boolean Match(System.Object) Microsoft.FSharp.Core.CompiledNameAttribute: Int32 GetHashCode() +Microsoft.FSharp.Core.CompiledNameAttribute: System.Object TypeId +Microsoft.FSharp.Core.CompiledNameAttribute: System.Object get_TypeId() Microsoft.FSharp.Core.CompiledNameAttribute: System.String CompiledName Microsoft.FSharp.Core.CompiledNameAttribute: System.String ToString() Microsoft.FSharp.Core.CompiledNameAttribute: System.String get_CompiledName() Microsoft.FSharp.Core.CompiledNameAttribute: System.Type GetType() Microsoft.FSharp.Core.CompiledNameAttribute: Void .ctor(System.String) Microsoft.FSharp.Core.CompilerMessageAttribute: Boolean Equals(System.Object) +Microsoft.FSharp.Core.CompilerMessageAttribute: Boolean IsDefaultAttribute() Microsoft.FSharp.Core.CompilerMessageAttribute: Boolean IsError Microsoft.FSharp.Core.CompilerMessageAttribute: Boolean IsHidden Microsoft.FSharp.Core.CompilerMessageAttribute: Boolean Match(System.Object) @@ -917,6 +949,8 @@ Microsoft.FSharp.Core.CompilerMessageAttribute: Boolean get_IsHidden() Microsoft.FSharp.Core.CompilerMessageAttribute: Int32 GetHashCode() Microsoft.FSharp.Core.CompilerMessageAttribute: Int32 MessageNumber Microsoft.FSharp.Core.CompilerMessageAttribute: Int32 get_MessageNumber() +Microsoft.FSharp.Core.CompilerMessageAttribute: System.Object TypeId +Microsoft.FSharp.Core.CompilerMessageAttribute: System.Object get_TypeId() Microsoft.FSharp.Core.CompilerMessageAttribute: System.String Message Microsoft.FSharp.Core.CompilerMessageAttribute: System.String ToString() Microsoft.FSharp.Core.CompilerMessageAttribute: System.String get_Message() @@ -973,8 +1007,11 @@ Microsoft.FSharp.Core.CompilerServices.RuntimeHelpers: System.Collections.Generi Microsoft.FSharp.Core.CompilerServices.RuntimeHelpers: System.String ToString() Microsoft.FSharp.Core.CompilerServices.RuntimeHelpers: System.Type GetType() Microsoft.FSharp.Core.CompilerServices.TypeProviderAssemblyAttribute: Boolean Equals(System.Object) +Microsoft.FSharp.Core.CompilerServices.TypeProviderAssemblyAttribute: Boolean IsDefaultAttribute() Microsoft.FSharp.Core.CompilerServices.TypeProviderAssemblyAttribute: Boolean Match(System.Object) Microsoft.FSharp.Core.CompilerServices.TypeProviderAssemblyAttribute: Int32 GetHashCode() +Microsoft.FSharp.Core.CompilerServices.TypeProviderAssemblyAttribute: System.Object TypeId +Microsoft.FSharp.Core.CompilerServices.TypeProviderAssemblyAttribute: System.Object get_TypeId() Microsoft.FSharp.Core.CompilerServices.TypeProviderAssemblyAttribute: System.String AssemblyName Microsoft.FSharp.Core.CompilerServices.TypeProviderAssemblyAttribute: System.String ToString() Microsoft.FSharp.Core.CompilerServices.TypeProviderAssemblyAttribute: System.String get_AssemblyName() @@ -982,8 +1019,11 @@ Microsoft.FSharp.Core.CompilerServices.TypeProviderAssemblyAttribute: System.Typ Microsoft.FSharp.Core.CompilerServices.TypeProviderAssemblyAttribute: Void .ctor() Microsoft.FSharp.Core.CompilerServices.TypeProviderAssemblyAttribute: Void .ctor(System.String) Microsoft.FSharp.Core.CompilerServices.TypeProviderAttribute: Boolean Equals(System.Object) +Microsoft.FSharp.Core.CompilerServices.TypeProviderAttribute: Boolean IsDefaultAttribute() Microsoft.FSharp.Core.CompilerServices.TypeProviderAttribute: Boolean Match(System.Object) Microsoft.FSharp.Core.CompilerServices.TypeProviderAttribute: Int32 GetHashCode() +Microsoft.FSharp.Core.CompilerServices.TypeProviderAttribute: System.Object TypeId +Microsoft.FSharp.Core.CompilerServices.TypeProviderAttribute: System.Object get_TypeId() Microsoft.FSharp.Core.CompilerServices.TypeProviderAttribute: System.String ToString() Microsoft.FSharp.Core.CompilerServices.TypeProviderAttribute: System.Type GetType() Microsoft.FSharp.Core.CompilerServices.TypeProviderAttribute: Void .ctor() @@ -1015,12 +1055,15 @@ Microsoft.FSharp.Core.CompilerServices.TypeProviderConfig: Void set_RuntimeAssem Microsoft.FSharp.Core.CompilerServices.TypeProviderConfig: Void set_SystemRuntimeAssemblyVersion(System.Version) Microsoft.FSharp.Core.CompilerServices.TypeProviderConfig: Void set_TemporaryFolder(System.String) Microsoft.FSharp.Core.CompilerServices.TypeProviderDefinitionLocationAttribute: Boolean Equals(System.Object) +Microsoft.FSharp.Core.CompilerServices.TypeProviderDefinitionLocationAttribute: Boolean IsDefaultAttribute() Microsoft.FSharp.Core.CompilerServices.TypeProviderDefinitionLocationAttribute: Boolean Match(System.Object) Microsoft.FSharp.Core.CompilerServices.TypeProviderDefinitionLocationAttribute: Int32 Column Microsoft.FSharp.Core.CompilerServices.TypeProviderDefinitionLocationAttribute: Int32 GetHashCode() Microsoft.FSharp.Core.CompilerServices.TypeProviderDefinitionLocationAttribute: Int32 Line Microsoft.FSharp.Core.CompilerServices.TypeProviderDefinitionLocationAttribute: Int32 get_Column() Microsoft.FSharp.Core.CompilerServices.TypeProviderDefinitionLocationAttribute: Int32 get_Line() +Microsoft.FSharp.Core.CompilerServices.TypeProviderDefinitionLocationAttribute: System.Object TypeId +Microsoft.FSharp.Core.CompilerServices.TypeProviderDefinitionLocationAttribute: System.Object get_TypeId() Microsoft.FSharp.Core.CompilerServices.TypeProviderDefinitionLocationAttribute: System.String FilePath Microsoft.FSharp.Core.CompilerServices.TypeProviderDefinitionLocationAttribute: System.String ToString() Microsoft.FSharp.Core.CompilerServices.TypeProviderDefinitionLocationAttribute: System.String get_FilePath() @@ -1030,8 +1073,11 @@ Microsoft.FSharp.Core.CompilerServices.TypeProviderDefinitionLocationAttribute: Microsoft.FSharp.Core.CompilerServices.TypeProviderDefinitionLocationAttribute: Void set_FilePath(System.String) Microsoft.FSharp.Core.CompilerServices.TypeProviderDefinitionLocationAttribute: Void set_Line(Int32) Microsoft.FSharp.Core.CompilerServices.TypeProviderEditorHideMethodsAttribute: Boolean Equals(System.Object) +Microsoft.FSharp.Core.CompilerServices.TypeProviderEditorHideMethodsAttribute: Boolean IsDefaultAttribute() Microsoft.FSharp.Core.CompilerServices.TypeProviderEditorHideMethodsAttribute: Boolean Match(System.Object) Microsoft.FSharp.Core.CompilerServices.TypeProviderEditorHideMethodsAttribute: Int32 GetHashCode() +Microsoft.FSharp.Core.CompilerServices.TypeProviderEditorHideMethodsAttribute: System.Object TypeId +Microsoft.FSharp.Core.CompilerServices.TypeProviderEditorHideMethodsAttribute: System.Object get_TypeId() Microsoft.FSharp.Core.CompilerServices.TypeProviderEditorHideMethodsAttribute: System.String ToString() Microsoft.FSharp.Core.CompilerServices.TypeProviderEditorHideMethodsAttribute: System.Type GetType() Microsoft.FSharp.Core.CompilerServices.TypeProviderEditorHideMethodsAttribute: Void .ctor() @@ -1049,27 +1095,37 @@ Microsoft.FSharp.Core.CompilerServices.TypeProviderTypeAttributes: System.String Microsoft.FSharp.Core.CompilerServices.TypeProviderTypeAttributes: System.Type GetType() Microsoft.FSharp.Core.CompilerServices.TypeProviderTypeAttributes: System.TypeCode GetTypeCode() Microsoft.FSharp.Core.CompilerServices.TypeProviderXmlDocAttribute: Boolean Equals(System.Object) +Microsoft.FSharp.Core.CompilerServices.TypeProviderXmlDocAttribute: Boolean IsDefaultAttribute() Microsoft.FSharp.Core.CompilerServices.TypeProviderXmlDocAttribute: Boolean Match(System.Object) Microsoft.FSharp.Core.CompilerServices.TypeProviderXmlDocAttribute: Int32 GetHashCode() +Microsoft.FSharp.Core.CompilerServices.TypeProviderXmlDocAttribute: System.Object TypeId +Microsoft.FSharp.Core.CompilerServices.TypeProviderXmlDocAttribute: System.Object get_TypeId() Microsoft.FSharp.Core.CompilerServices.TypeProviderXmlDocAttribute: System.String CommentText Microsoft.FSharp.Core.CompilerServices.TypeProviderXmlDocAttribute: System.String ToString() Microsoft.FSharp.Core.CompilerServices.TypeProviderXmlDocAttribute: System.String get_CommentText() Microsoft.FSharp.Core.CompilerServices.TypeProviderXmlDocAttribute: System.Type GetType() Microsoft.FSharp.Core.CompilerServices.TypeProviderXmlDocAttribute: Void .ctor(System.String) Microsoft.FSharp.Core.CustomComparisonAttribute: Boolean Equals(System.Object) +Microsoft.FSharp.Core.CustomComparisonAttribute: Boolean IsDefaultAttribute() Microsoft.FSharp.Core.CustomComparisonAttribute: Boolean Match(System.Object) Microsoft.FSharp.Core.CustomComparisonAttribute: Int32 GetHashCode() +Microsoft.FSharp.Core.CustomComparisonAttribute: System.Object TypeId +Microsoft.FSharp.Core.CustomComparisonAttribute: System.Object get_TypeId() Microsoft.FSharp.Core.CustomComparisonAttribute: System.String ToString() Microsoft.FSharp.Core.CustomComparisonAttribute: System.Type GetType() Microsoft.FSharp.Core.CustomComparisonAttribute: Void .ctor() Microsoft.FSharp.Core.CustomEqualityAttribute: Boolean Equals(System.Object) +Microsoft.FSharp.Core.CustomEqualityAttribute: Boolean IsDefaultAttribute() Microsoft.FSharp.Core.CustomEqualityAttribute: Boolean Match(System.Object) Microsoft.FSharp.Core.CustomEqualityAttribute: Int32 GetHashCode() +Microsoft.FSharp.Core.CustomEqualityAttribute: System.Object TypeId +Microsoft.FSharp.Core.CustomEqualityAttribute: System.Object get_TypeId() Microsoft.FSharp.Core.CustomEqualityAttribute: System.String ToString() Microsoft.FSharp.Core.CustomEqualityAttribute: System.Type GetType() Microsoft.FSharp.Core.CustomEqualityAttribute: Void .ctor() Microsoft.FSharp.Core.CustomOperationAttribute: Boolean AllowIntoPattern Microsoft.FSharp.Core.CustomOperationAttribute: Boolean Equals(System.Object) +Microsoft.FSharp.Core.CustomOperationAttribute: Boolean IsDefaultAttribute() Microsoft.FSharp.Core.CustomOperationAttribute: Boolean IsLikeGroupJoin Microsoft.FSharp.Core.CustomOperationAttribute: Boolean IsLikeJoin Microsoft.FSharp.Core.CustomOperationAttribute: Boolean IsLikeZip @@ -1083,6 +1139,8 @@ Microsoft.FSharp.Core.CustomOperationAttribute: Boolean get_IsLikeZip() Microsoft.FSharp.Core.CustomOperationAttribute: Boolean get_MaintainsVariableSpace() Microsoft.FSharp.Core.CustomOperationAttribute: Boolean get_MaintainsVariableSpaceUsingBind() Microsoft.FSharp.Core.CustomOperationAttribute: Int32 GetHashCode() +Microsoft.FSharp.Core.CustomOperationAttribute: System.Object TypeId +Microsoft.FSharp.Core.CustomOperationAttribute: System.Object get_TypeId() Microsoft.FSharp.Core.CustomOperationAttribute: System.String JoinConditionWord Microsoft.FSharp.Core.CustomOperationAttribute: System.String Name Microsoft.FSharp.Core.CustomOperationAttribute: System.String ToString() @@ -1098,37 +1156,52 @@ Microsoft.FSharp.Core.CustomOperationAttribute: Void set_JoinConditionWord(Syste Microsoft.FSharp.Core.CustomOperationAttribute: Void set_MaintainsVariableSpace(Boolean) Microsoft.FSharp.Core.CustomOperationAttribute: Void set_MaintainsVariableSpaceUsingBind(Boolean) Microsoft.FSharp.Core.DefaultAugmentationAttribute: Boolean Equals(System.Object) +Microsoft.FSharp.Core.DefaultAugmentationAttribute: Boolean IsDefaultAttribute() Microsoft.FSharp.Core.DefaultAugmentationAttribute: Boolean Match(System.Object) Microsoft.FSharp.Core.DefaultAugmentationAttribute: Boolean Value Microsoft.FSharp.Core.DefaultAugmentationAttribute: Boolean get_Value() Microsoft.FSharp.Core.DefaultAugmentationAttribute: Int32 GetHashCode() +Microsoft.FSharp.Core.DefaultAugmentationAttribute: System.Object TypeId +Microsoft.FSharp.Core.DefaultAugmentationAttribute: System.Object get_TypeId() Microsoft.FSharp.Core.DefaultAugmentationAttribute: System.String ToString() Microsoft.FSharp.Core.DefaultAugmentationAttribute: System.Type GetType() Microsoft.FSharp.Core.DefaultAugmentationAttribute: Void .ctor(Boolean) Microsoft.FSharp.Core.DefaultValueAttribute: Boolean Check Microsoft.FSharp.Core.DefaultValueAttribute: Boolean Equals(System.Object) +Microsoft.FSharp.Core.DefaultValueAttribute: Boolean IsDefaultAttribute() Microsoft.FSharp.Core.DefaultValueAttribute: Boolean Match(System.Object) Microsoft.FSharp.Core.DefaultValueAttribute: Boolean get_Check() Microsoft.FSharp.Core.DefaultValueAttribute: Int32 GetHashCode() +Microsoft.FSharp.Core.DefaultValueAttribute: System.Object TypeId +Microsoft.FSharp.Core.DefaultValueAttribute: System.Object get_TypeId() Microsoft.FSharp.Core.DefaultValueAttribute: System.String ToString() Microsoft.FSharp.Core.DefaultValueAttribute: System.Type GetType() Microsoft.FSharp.Core.DefaultValueAttribute: Void .ctor() Microsoft.FSharp.Core.DefaultValueAttribute: Void .ctor(Boolean) Microsoft.FSharp.Core.EntryPointAttribute: Boolean Equals(System.Object) +Microsoft.FSharp.Core.EntryPointAttribute: Boolean IsDefaultAttribute() Microsoft.FSharp.Core.EntryPointAttribute: Boolean Match(System.Object) Microsoft.FSharp.Core.EntryPointAttribute: Int32 GetHashCode() +Microsoft.FSharp.Core.EntryPointAttribute: System.Object TypeId +Microsoft.FSharp.Core.EntryPointAttribute: System.Object get_TypeId() Microsoft.FSharp.Core.EntryPointAttribute: System.String ToString() Microsoft.FSharp.Core.EntryPointAttribute: System.Type GetType() Microsoft.FSharp.Core.EntryPointAttribute: Void .ctor() Microsoft.FSharp.Core.EqualityConditionalOnAttribute: Boolean Equals(System.Object) +Microsoft.FSharp.Core.EqualityConditionalOnAttribute: Boolean IsDefaultAttribute() Microsoft.FSharp.Core.EqualityConditionalOnAttribute: Boolean Match(System.Object) Microsoft.FSharp.Core.EqualityConditionalOnAttribute: Int32 GetHashCode() +Microsoft.FSharp.Core.EqualityConditionalOnAttribute: System.Object TypeId +Microsoft.FSharp.Core.EqualityConditionalOnAttribute: System.Object get_TypeId() Microsoft.FSharp.Core.EqualityConditionalOnAttribute: System.String ToString() Microsoft.FSharp.Core.EqualityConditionalOnAttribute: System.Type GetType() Microsoft.FSharp.Core.EqualityConditionalOnAttribute: Void .ctor() Microsoft.FSharp.Core.ExperimentalAttribute: Boolean Equals(System.Object) +Microsoft.FSharp.Core.ExperimentalAttribute: Boolean IsDefaultAttribute() Microsoft.FSharp.Core.ExperimentalAttribute: Boolean Match(System.Object) Microsoft.FSharp.Core.ExperimentalAttribute: Int32 GetHashCode() +Microsoft.FSharp.Core.ExperimentalAttribute: System.Object TypeId +Microsoft.FSharp.Core.ExperimentalAttribute: System.Object get_TypeId() Microsoft.FSharp.Core.ExperimentalAttribute: System.String Message Microsoft.FSharp.Core.ExperimentalAttribute: System.String ToString() Microsoft.FSharp.Core.ExperimentalAttribute: System.String get_Message() @@ -1157,14 +1230,14 @@ Microsoft.FSharp.Core.ExtraTopLevelOperators: System.Collections.Generic.IReadOn Microsoft.FSharp.Core.ExtraTopLevelOperators: System.String ToString() Microsoft.FSharp.Core.ExtraTopLevelOperators: System.Type GetType() Microsoft.FSharp.Core.ExtraTopLevelOperators: T LazyPattern[T](System.Lazy`1[T]) -Microsoft.FSharp.Core.ExtraTopLevelOperators: T PrintFormat[T](Microsoft.FSharp.Core.PrintfFormat`4[T,System.IO.TextWriter,Microsoft.FSharp.Core.Unit,Microsoft.FSharp.Core.Unit]) -Microsoft.FSharp.Core.ExtraTopLevelOperators: T PrintFormatLine[T](Microsoft.FSharp.Core.PrintfFormat`4[T,System.IO.TextWriter,Microsoft.FSharp.Core.Unit,Microsoft.FSharp.Core.Unit]) Microsoft.FSharp.Core.ExtraTopLevelOperators: T PrintFormatLineToError[T](Microsoft.FSharp.Core.PrintfFormat`4[T,System.IO.TextWriter,Microsoft.FSharp.Core.Unit,Microsoft.FSharp.Core.Unit]) Microsoft.FSharp.Core.ExtraTopLevelOperators: T PrintFormatLineToTextWriter[T](System.IO.TextWriter, Microsoft.FSharp.Core.PrintfFormat`4[T,System.IO.TextWriter,Microsoft.FSharp.Core.Unit,Microsoft.FSharp.Core.Unit]) +Microsoft.FSharp.Core.ExtraTopLevelOperators: T PrintFormatLine[T](Microsoft.FSharp.Core.PrintfFormat`4[T,System.IO.TextWriter,Microsoft.FSharp.Core.Unit,Microsoft.FSharp.Core.Unit]) Microsoft.FSharp.Core.ExtraTopLevelOperators: T PrintFormatToError[T](Microsoft.FSharp.Core.PrintfFormat`4[T,System.IO.TextWriter,Microsoft.FSharp.Core.Unit,Microsoft.FSharp.Core.Unit]) Microsoft.FSharp.Core.ExtraTopLevelOperators: T PrintFormatToStringThenFail[T,TResult](Microsoft.FSharp.Core.PrintfFormat`4[T,Microsoft.FSharp.Core.Unit,System.String,TResult]) Microsoft.FSharp.Core.ExtraTopLevelOperators: T PrintFormatToString[T](Microsoft.FSharp.Core.PrintfFormat`4[T,Microsoft.FSharp.Core.Unit,System.String,System.String]) Microsoft.FSharp.Core.ExtraTopLevelOperators: T PrintFormatToTextWriter[T](System.IO.TextWriter, Microsoft.FSharp.Core.PrintfFormat`4[T,System.IO.TextWriter,Microsoft.FSharp.Core.Unit,Microsoft.FSharp.Core.Unit]) +Microsoft.FSharp.Core.ExtraTopLevelOperators: T PrintFormat[T](Microsoft.FSharp.Core.PrintfFormat`4[T,System.IO.TextWriter,Microsoft.FSharp.Core.Unit,Microsoft.FSharp.Core.Unit]) Microsoft.FSharp.Core.ExtraTopLevelOperators: T SpliceExpression[T](Microsoft.FSharp.Quotations.FSharpExpr`1[T]) Microsoft.FSharp.Core.ExtraTopLevelOperators: T SpliceUntypedExpression[T](Microsoft.FSharp.Quotations.FSharpExpr) Microsoft.FSharp.Core.ExtraTopLevelOperators: T[,] CreateArray2D[?,T](System.Collections.Generic.IEnumerable`1[?]) @@ -2072,6 +2145,7 @@ Microsoft.FSharp.Core.FSharpFunc`2[T,TResult]: W InvokeFast[V,W](Microsoft.FShar Microsoft.FSharp.Core.FSharpFunc`2[T,TResult]: X InvokeFast[V,W,X](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpFunc`2[TResult,Microsoft.FSharp.Core.FSharpFunc`2[V,Microsoft.FSharp.Core.FSharpFunc`2[W,X]]]], T, TResult, V, W) Microsoft.FSharp.Core.FSharpFunc`2[T,TResult]: Y InvokeFast[V,W,X,Y](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpFunc`2[TResult,Microsoft.FSharp.Core.FSharpFunc`2[V,Microsoft.FSharp.Core.FSharpFunc`2[W,Microsoft.FSharp.Core.FSharpFunc`2[X,Y]]]]], T, TResult, V, W, X) Microsoft.FSharp.Core.FSharpInterfaceDataVersionAttribute: Boolean Equals(System.Object) +Microsoft.FSharp.Core.FSharpInterfaceDataVersionAttribute: Boolean IsDefaultAttribute() Microsoft.FSharp.Core.FSharpInterfaceDataVersionAttribute: Boolean Match(System.Object) Microsoft.FSharp.Core.FSharpInterfaceDataVersionAttribute: Int32 GetHashCode() Microsoft.FSharp.Core.FSharpInterfaceDataVersionAttribute: Int32 Major @@ -2080,6 +2154,8 @@ Microsoft.FSharp.Core.FSharpInterfaceDataVersionAttribute: Int32 Release Microsoft.FSharp.Core.FSharpInterfaceDataVersionAttribute: Int32 get_Major() Microsoft.FSharp.Core.FSharpInterfaceDataVersionAttribute: Int32 get_Minor() Microsoft.FSharp.Core.FSharpInterfaceDataVersionAttribute: Int32 get_Release() +Microsoft.FSharp.Core.FSharpInterfaceDataVersionAttribute: System.Object TypeId +Microsoft.FSharp.Core.FSharpInterfaceDataVersionAttribute: System.Object get_TypeId() Microsoft.FSharp.Core.FSharpInterfaceDataVersionAttribute: System.String ToString() Microsoft.FSharp.Core.FSharpInterfaceDataVersionAttribute: System.Type GetType() Microsoft.FSharp.Core.FSharpInterfaceDataVersionAttribute: Void .ctor(Int32, Int32, Int32) @@ -2159,6 +2235,12 @@ Microsoft.FSharp.Core.FSharpResult`2[T,TError]: T ResultValue Microsoft.FSharp.Core.FSharpResult`2[T,TError]: T get_ResultValue() Microsoft.FSharp.Core.FSharpResult`2[T,TError]: TError ErrorValue Microsoft.FSharp.Core.FSharpResult`2[T,TError]: TError get_ErrorValue() +Microsoft.FSharp.Core.FSharpTypeFunc: Boolean Equals(System.Object) +Microsoft.FSharp.Core.FSharpTypeFunc: Int32 GetHashCode() +Microsoft.FSharp.Core.FSharpTypeFunc: System.Object Specialize[T]() +Microsoft.FSharp.Core.FSharpTypeFunc: System.String ToString() +Microsoft.FSharp.Core.FSharpTypeFunc: System.Type GetType() +Microsoft.FSharp.Core.FSharpTypeFunc: Void .ctor() Microsoft.FSharp.Core.FSharpValueOption`1+Tags[T]: Boolean Equals(System.Object) Microsoft.FSharp.Core.FSharpValueOption`1+Tags[T]: Int32 GetHashCode() Microsoft.FSharp.Core.FSharpValueOption`1+Tags[T]: Int32 ValueNone @@ -2168,6 +2250,10 @@ Microsoft.FSharp.Core.FSharpValueOption`1+Tags[T]: System.Type GetType() Microsoft.FSharp.Core.FSharpValueOption`1[T]: Boolean Equals(Microsoft.FSharp.Core.FSharpValueOption`1[T]) Microsoft.FSharp.Core.FSharpValueOption`1[T]: Boolean Equals(System.Object) Microsoft.FSharp.Core.FSharpValueOption`1[T]: Boolean Equals(System.Object, System.Collections.IEqualityComparer) +Microsoft.FSharp.Core.FSharpValueOption`1[T]: Boolean IsValueNone +Microsoft.FSharp.Core.FSharpValueOption`1[T]: Boolean IsValueSome +Microsoft.FSharp.Core.FSharpValueOption`1[T]: Boolean get_IsValueNone() +Microsoft.FSharp.Core.FSharpValueOption`1[T]: Boolean get_IsValueSome() Microsoft.FSharp.Core.FSharpValueOption`1[T]: Int32 CompareTo(Microsoft.FSharp.Core.FSharpValueOption`1[T]) Microsoft.FSharp.Core.FSharpValueOption`1[T]: Int32 CompareTo(System.Object) Microsoft.FSharp.Core.FSharpValueOption`1[T]: Int32 CompareTo(System.Object, System.Collections.IComparer) @@ -2176,12 +2262,8 @@ Microsoft.FSharp.Core.FSharpValueOption`1[T]: Int32 GetHashCode(System.Collectio Microsoft.FSharp.Core.FSharpValueOption`1[T]: Int32 Tag Microsoft.FSharp.Core.FSharpValueOption`1[T]: Int32 get_Tag() Microsoft.FSharp.Core.FSharpValueOption`1[T]: Microsoft.FSharp.Core.FSharpValueOption`1+Tags[T] -Microsoft.FSharp.Core.FSharpValueOption`1[T]: Microsoft.FSharp.Core.FSharpValueOption`1[T] ValueNone -Microsoft.FSharp.Core.FSharpValueOption`1[T]: Boolean IsValueNone -Microsoft.FSharp.Core.FSharpValueOption`1[T]: Boolean IsValueSome -Microsoft.FSharp.Core.FSharpValueOption`1[T]: Boolean get_IsValueNone() -Microsoft.FSharp.Core.FSharpValueOption`1[T]: Boolean get_IsValueSome() Microsoft.FSharp.Core.FSharpValueOption`1[T]: Microsoft.FSharp.Core.FSharpValueOption`1[T] NewValueSome(T) +Microsoft.FSharp.Core.FSharpValueOption`1[T]: Microsoft.FSharp.Core.FSharpValueOption`1[T] ValueNone Microsoft.FSharp.Core.FSharpValueOption`1[T]: Microsoft.FSharp.Core.FSharpValueOption`1[T] get_ValueNone() Microsoft.FSharp.Core.FSharpValueOption`1[T]: System.String ToString() Microsoft.FSharp.Core.FSharpValueOption`1[T]: System.Type GetType() @@ -2189,6 +2271,13 @@ Microsoft.FSharp.Core.FSharpValueOption`1[T]: T Item Microsoft.FSharp.Core.FSharpValueOption`1[T]: T Value Microsoft.FSharp.Core.FSharpValueOption`1[T]: T get_Item() Microsoft.FSharp.Core.FSharpValueOption`1[T]: T get_Value() +Microsoft.FSharp.Core.FSharpValueOption`1[T]: Boolean IsNone +Microsoft.FSharp.Core.FSharpValueOption`1[T]: Boolean IsSome +Microsoft.FSharp.Core.FSharpValueOption`1[T]: Boolean get_IsNone() +Microsoft.FSharp.Core.FSharpValueOption`1[T]: Boolean get_IsSome() +Microsoft.FSharp.Core.FSharpValueOption`1[T]: Microsoft.FSharp.Core.FSharpValueOption`1[T] None +Microsoft.FSharp.Core.FSharpValueOption`1[T]: Microsoft.FSharp.Core.FSharpValueOption`1[T] Some(T) +Microsoft.FSharp.Core.FSharpValueOption`1[T]: Microsoft.FSharp.Core.FSharpValueOption`1[T] get_None() Microsoft.FSharp.Core.FSharpTypeFunc: Boolean Equals(System.Object) Microsoft.FSharp.Core.FSharpTypeFunc: Int32 GetHashCode() Microsoft.FSharp.Core.FSharpTypeFunc: System.Object Specialize[T]() @@ -2196,35 +2285,41 @@ Microsoft.FSharp.Core.FSharpTypeFunc: System.String ToString() Microsoft.FSharp.Core.FSharpTypeFunc: System.Type GetType() Microsoft.FSharp.Core.FSharpTypeFunc: Void .ctor() Microsoft.FSharp.Core.FuncConvert: Boolean Equals(System.Object) +Microsoft.FSharp.Core.FuncConvert: Int32 GetHashCode() Microsoft.FSharp.Core.FuncConvert: Microsoft.FSharp.Core.FSharpFunc`2[Microsoft.FSharp.Core.Unit,Microsoft.FSharp.Core.Unit] FromAction(System.Action) -Microsoft.FSharp.Core.FuncConvert: Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.Unit] FromAction[T](System.Action`1[T]) -Microsoft.FSharp.Core.FuncConvert: Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,Microsoft.FSharp.Core.Unit]] FromAction[T1,T2](System.Action`2[T1,T2]) -Microsoft.FSharp.Core.FuncConvert: Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,Microsoft.FSharp.Core.FSharpFunc`2[T3,Microsoft.FSharp.Core.Unit]]] FromAction[T1,T2,T3](System.Action`3[T1,T2,T3]) -Microsoft.FSharp.Core.FuncConvert: Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,Microsoft.FSharp.Core.FSharpFunc`2[T3,Microsoft.FSharp.Core.FSharpFunc`2[T4,Microsoft.FSharp.Core.Unit]]]] FromAction[T1,T2,T3,T4](System.Action`4[T1,T2,T3,T4]) -Microsoft.FSharp.Core.FuncConvert: Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,Microsoft.FSharp.Core.FSharpFunc`2[T3,Microsoft.FSharp.Core.FSharpFunc`2[T4,Microsoft.FSharp.Core.FSharpFunc`2[T5,Microsoft.FSharp.Core.Unit]]]]] FromAction[T1,T2,T3,T4,T5](System.Action`5[T1,T2,T3,T4,T5]) Microsoft.FSharp.Core.FuncConvert: Microsoft.FSharp.Core.FSharpFunc`2[Microsoft.FSharp.Core.Unit,T] FromFunc[T](System.Func`1[T]) +Microsoft.FSharp.Core.FuncConvert: Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.Unit] FromAction[T](System.Action`1[T]) +Microsoft.FSharp.Core.FuncConvert: Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.Unit] ToFSharpFunc[T](System.Action`1[T]) Microsoft.FSharp.Core.FuncConvert: Microsoft.FSharp.Core.FSharpFunc`2[T,TResult] FromFunc[T,TResult](System.Func`2[T,TResult]) -Microsoft.FSharp.Core.FuncConvert: Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,TResult]] FromFunc[T1,T2,TResult](System.Func`3[T1,T2,TResult]) -Microsoft.FSharp.Core.FuncConvert: Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,Microsoft.FSharp.Core.FSharpFunc`2[T3,TResult]]] FromFunc[T1,T2,T3,TResult](System.Func`4[T1,T2,T3,TResult]) -Microsoft.FSharp.Core.FuncConvert: Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,Microsoft.FSharp.Core.FSharpFunc`2[T3,Microsoft.FSharp.Core.FSharpFunc`2[T4,TResult]]]] FromFunc[T1,T2,T3,T4,TResult](System.Func`5[T1,T2,T3,T4,TResult]) +Microsoft.FSharp.Core.FuncConvert: Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,Microsoft.FSharp.Core.FSharpFunc`2[T3,Microsoft.FSharp.Core.FSharpFunc`2[T4,Microsoft.FSharp.Core.FSharpFunc`2[T5,Microsoft.FSharp.Core.Unit]]]]] FromAction[T1,T2,T3,T4,T5](System.Action`5[T1,T2,T3,T4,T5]) Microsoft.FSharp.Core.FuncConvert: Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,Microsoft.FSharp.Core.FSharpFunc`2[T3,Microsoft.FSharp.Core.FSharpFunc`2[T4,Microsoft.FSharp.Core.FSharpFunc`2[T5,TResult]]]]] FromFunc[T1,T2,T3,T4,T5,TResult](System.Func`6[T1,T2,T3,T4,T5,TResult]) -Microsoft.FSharp.Core.FuncConvert: Int32 GetHashCode() -Microsoft.FSharp.Core.FuncConvert: Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.Unit] ToFSharpFunc[T](System.Action`1[T]) Microsoft.FSharp.Core.FuncConvert: Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,Microsoft.FSharp.Core.FSharpFunc`2[T3,Microsoft.FSharp.Core.FSharpFunc`2[T4,Microsoft.FSharp.Core.FSharpFunc`2[T5,TResult]]]]] FuncFromTupled[T1,T2,T3,T4,T5,TResult](Microsoft.FSharp.Core.FSharpFunc`2[System.Tuple`5[T1,T2,T3,T4,T5],TResult]) +Microsoft.FSharp.Core.FuncConvert: Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,Microsoft.FSharp.Core.FSharpFunc`2[T3,Microsoft.FSharp.Core.FSharpFunc`2[T4,Microsoft.FSharp.Core.Unit]]]] FromAction[T1,T2,T3,T4](System.Action`4[T1,T2,T3,T4]) +Microsoft.FSharp.Core.FuncConvert: Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,Microsoft.FSharp.Core.FSharpFunc`2[T3,Microsoft.FSharp.Core.FSharpFunc`2[T4,TResult]]]] FromFunc[T1,T2,T3,T4,TResult](System.Func`5[T1,T2,T3,T4,TResult]) Microsoft.FSharp.Core.FuncConvert: Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,Microsoft.FSharp.Core.FSharpFunc`2[T3,Microsoft.FSharp.Core.FSharpFunc`2[T4,TResult]]]] FuncFromTupled[T1,T2,T3,T4,TResult](Microsoft.FSharp.Core.FSharpFunc`2[System.Tuple`4[T1,T2,T3,T4],TResult]) +Microsoft.FSharp.Core.FuncConvert: Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,Microsoft.FSharp.Core.FSharpFunc`2[T3,Microsoft.FSharp.Core.Unit]]] FromAction[T1,T2,T3](System.Action`3[T1,T2,T3]) +Microsoft.FSharp.Core.FuncConvert: Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,Microsoft.FSharp.Core.FSharpFunc`2[T3,TResult]]] FromFunc[T1,T2,T3,TResult](System.Func`4[T1,T2,T3,TResult]) Microsoft.FSharp.Core.FuncConvert: Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,Microsoft.FSharp.Core.FSharpFunc`2[T3,TResult]]] FuncFromTupled[T1,T2,T3,TResult](Microsoft.FSharp.Core.FSharpFunc`2[System.Tuple`3[T1,T2,T3],TResult]) +Microsoft.FSharp.Core.FuncConvert: Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,Microsoft.FSharp.Core.Unit]] FromAction[T1,T2](System.Action`2[T1,T2]) +Microsoft.FSharp.Core.FuncConvert: Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,TResult]] FromFunc[T1,T2,TResult](System.Func`3[T1,T2,TResult]) Microsoft.FSharp.Core.FuncConvert: Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,TResult]] FuncFromTupled[T1,T2,TResult](Microsoft.FSharp.Core.FSharpFunc`2[System.Tuple`2[T1,T2],TResult]) Microsoft.FSharp.Core.FuncConvert: System.String ToString() Microsoft.FSharp.Core.FuncConvert: System.Type GetType() Microsoft.FSharp.Core.GeneralizableValueAttribute: Boolean Equals(System.Object) +Microsoft.FSharp.Core.GeneralizableValueAttribute: Boolean IsDefaultAttribute() Microsoft.FSharp.Core.GeneralizableValueAttribute: Boolean Match(System.Object) Microsoft.FSharp.Core.GeneralizableValueAttribute: Int32 GetHashCode() +Microsoft.FSharp.Core.GeneralizableValueAttribute: System.Object TypeId +Microsoft.FSharp.Core.GeneralizableValueAttribute: System.Object get_TypeId() Microsoft.FSharp.Core.GeneralizableValueAttribute: System.String ToString() Microsoft.FSharp.Core.GeneralizableValueAttribute: System.Type GetType() Microsoft.FSharp.Core.GeneralizableValueAttribute: Void .ctor() Microsoft.FSharp.Core.InterfaceAttribute: Boolean Equals(System.Object) +Microsoft.FSharp.Core.InterfaceAttribute: Boolean IsDefaultAttribute() Microsoft.FSharp.Core.InterfaceAttribute: Boolean Match(System.Object) Microsoft.FSharp.Core.InterfaceAttribute: Int32 GetHashCode() +Microsoft.FSharp.Core.InterfaceAttribute: System.Object TypeId +Microsoft.FSharp.Core.InterfaceAttribute: System.Object get_TypeId() Microsoft.FSharp.Core.InterfaceAttribute: System.String ToString() Microsoft.FSharp.Core.InterfaceAttribute: System.Type GetType() Microsoft.FSharp.Core.InterfaceAttribute: Void .ctor() @@ -2364,8 +2459,11 @@ Microsoft.FSharp.Core.LanguagePrimitives: TResult MultiplyDynamic[T1,T2,TResult] Microsoft.FSharp.Core.LanguagePrimitives: UInt32 ParseUInt32(System.String) Microsoft.FSharp.Core.LanguagePrimitives: UInt64 ParseUInt64(System.String) Microsoft.FSharp.Core.LiteralAttribute: Boolean Equals(System.Object) +Microsoft.FSharp.Core.LiteralAttribute: Boolean IsDefaultAttribute() Microsoft.FSharp.Core.LiteralAttribute: Boolean Match(System.Object) Microsoft.FSharp.Core.LiteralAttribute: Int32 GetHashCode() +Microsoft.FSharp.Core.LiteralAttribute: System.Object TypeId +Microsoft.FSharp.Core.LiteralAttribute: System.Object get_TypeId() Microsoft.FSharp.Core.LiteralAttribute: System.String ToString() Microsoft.FSharp.Core.LiteralAttribute: System.Type GetType() Microsoft.FSharp.Core.LiteralAttribute: Void .ctor() @@ -2384,6 +2482,8 @@ Microsoft.FSharp.Core.MatchFailureException: System.Collections.IDictionary get_ Microsoft.FSharp.Core.MatchFailureException: System.Exception GetBaseException() Microsoft.FSharp.Core.MatchFailureException: System.Exception InnerException Microsoft.FSharp.Core.MatchFailureException: System.Exception get_InnerException() +Microsoft.FSharp.Core.MatchFailureException: System.Reflection.MethodBase TargetSite +Microsoft.FSharp.Core.MatchFailureException: System.Reflection.MethodBase get_TargetSite() Microsoft.FSharp.Core.MatchFailureException: System.String Data0 Microsoft.FSharp.Core.MatchFailureException: System.String HelpLink Microsoft.FSharp.Core.MatchFailureException: System.String Message @@ -2396,38 +2496,53 @@ Microsoft.FSharp.Core.MatchFailureException: System.String get_Message() Microsoft.FSharp.Core.MatchFailureException: System.String get_Source() Microsoft.FSharp.Core.MatchFailureException: System.String get_StackTrace() Microsoft.FSharp.Core.MatchFailureException: System.Type GetType() -Microsoft.FSharp.Core.MatchFailureException: System.Type GetType() Microsoft.FSharp.Core.MatchFailureException: Void .ctor() Microsoft.FSharp.Core.MatchFailureException: Void .ctor(System.String, Int32, Int32) +Microsoft.FSharp.Core.MatchFailureException: Void GetObjectData(System.Runtime.Serialization.SerializationInfo, System.Runtime.Serialization.StreamingContext) Microsoft.FSharp.Core.MatchFailureException: Void set_HelpLink(System.String) Microsoft.FSharp.Core.MatchFailureException: Void set_Source(System.String) Microsoft.FSharp.Core.MeasureAnnotatedAbbreviationAttribute: Boolean Equals(System.Object) +Microsoft.FSharp.Core.MeasureAnnotatedAbbreviationAttribute: Boolean IsDefaultAttribute() Microsoft.FSharp.Core.MeasureAnnotatedAbbreviationAttribute: Boolean Match(System.Object) Microsoft.FSharp.Core.MeasureAnnotatedAbbreviationAttribute: Int32 GetHashCode() +Microsoft.FSharp.Core.MeasureAnnotatedAbbreviationAttribute: System.Object TypeId +Microsoft.FSharp.Core.MeasureAnnotatedAbbreviationAttribute: System.Object get_TypeId() Microsoft.FSharp.Core.MeasureAnnotatedAbbreviationAttribute: System.String ToString() Microsoft.FSharp.Core.MeasureAnnotatedAbbreviationAttribute: System.Type GetType() Microsoft.FSharp.Core.MeasureAnnotatedAbbreviationAttribute: Void .ctor() Microsoft.FSharp.Core.MeasureAttribute: Boolean Equals(System.Object) +Microsoft.FSharp.Core.MeasureAttribute: Boolean IsDefaultAttribute() Microsoft.FSharp.Core.MeasureAttribute: Boolean Match(System.Object) Microsoft.FSharp.Core.MeasureAttribute: Int32 GetHashCode() +Microsoft.FSharp.Core.MeasureAttribute: System.Object TypeId +Microsoft.FSharp.Core.MeasureAttribute: System.Object get_TypeId() Microsoft.FSharp.Core.MeasureAttribute: System.String ToString() Microsoft.FSharp.Core.MeasureAttribute: System.Type GetType() Microsoft.FSharp.Core.MeasureAttribute: Void .ctor() Microsoft.FSharp.Core.NoComparisonAttribute: Boolean Equals(System.Object) +Microsoft.FSharp.Core.NoComparisonAttribute: Boolean IsDefaultAttribute() Microsoft.FSharp.Core.NoComparisonAttribute: Boolean Match(System.Object) Microsoft.FSharp.Core.NoComparisonAttribute: Int32 GetHashCode() +Microsoft.FSharp.Core.NoComparisonAttribute: System.Object TypeId +Microsoft.FSharp.Core.NoComparisonAttribute: System.Object get_TypeId() Microsoft.FSharp.Core.NoComparisonAttribute: System.String ToString() Microsoft.FSharp.Core.NoComparisonAttribute: System.Type GetType() Microsoft.FSharp.Core.NoComparisonAttribute: Void .ctor() Microsoft.FSharp.Core.NoDynamicInvocationAttribute: Boolean Equals(System.Object) +Microsoft.FSharp.Core.NoDynamicInvocationAttribute: Boolean IsDefaultAttribute() Microsoft.FSharp.Core.NoDynamicInvocationAttribute: Boolean Match(System.Object) Microsoft.FSharp.Core.NoDynamicInvocationAttribute: Int32 GetHashCode() +Microsoft.FSharp.Core.NoDynamicInvocationAttribute: System.Object TypeId +Microsoft.FSharp.Core.NoDynamicInvocationAttribute: System.Object get_TypeId() Microsoft.FSharp.Core.NoDynamicInvocationAttribute: System.String ToString() Microsoft.FSharp.Core.NoDynamicInvocationAttribute: System.Type GetType() Microsoft.FSharp.Core.NoDynamicInvocationAttribute: Void .ctor() Microsoft.FSharp.Core.NoEqualityAttribute: Boolean Equals(System.Object) +Microsoft.FSharp.Core.NoEqualityAttribute: Boolean IsDefaultAttribute() Microsoft.FSharp.Core.NoEqualityAttribute: Boolean Match(System.Object) Microsoft.FSharp.Core.NoEqualityAttribute: Int32 GetHashCode() +Microsoft.FSharp.Core.NoEqualityAttribute: System.Object TypeId +Microsoft.FSharp.Core.NoEqualityAttribute: System.Object get_TypeId() Microsoft.FSharp.Core.NoEqualityAttribute: System.String ToString() Microsoft.FSharp.Core.NoEqualityAttribute: System.Type GetType() Microsoft.FSharp.Core.NoEqualityAttribute: Void .ctor() @@ -2605,8 +2720,8 @@ Microsoft.FSharp.Core.Operators: System.Collections.Generic.IEnumerable`1[T] op_ Microsoft.FSharp.Core.Operators: System.Collections.Generic.IEnumerable`1[T] op_Range[T](T, T) Microsoft.FSharp.Core.Operators: System.Decimal ToDecimal[T](T) Microsoft.FSharp.Core.Operators: System.Exception Failure(System.String) -Microsoft.FSharp.Core.Operators: System.IO.TextWriter ConsoleError[T]() Microsoft.FSharp.Core.Operators: System.IO.TextReader ConsoleIn[T]() +Microsoft.FSharp.Core.Operators: System.IO.TextWriter ConsoleError[T]() Microsoft.FSharp.Core.Operators: System.IO.TextWriter ConsoleOut[T]() Microsoft.FSharp.Core.Operators: System.Object Box[T](T)" + #if DEBUG @@ -2759,9 +2874,42 @@ Microsoft.FSharp.Core.OptionModule: TState FoldBack[T,TState](Microsoft.FSharp.C Microsoft.FSharp.Core.OptionModule: TState Fold[T,TState](Microsoft.FSharp.Core.FSharpFunc`2[TState,Microsoft.FSharp.Core.FSharpFunc`2[T,TState]], TState, Microsoft.FSharp.Core.FSharpOption`1[T]) Microsoft.FSharp.Core.OptionModule: T[] ToArray[T](Microsoft.FSharp.Core.FSharpOption`1[T]) Microsoft.FSharp.Core.OptionModule: Void Iterate[T](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.Unit], Microsoft.FSharp.Core.FSharpOption`1[T]) +Microsoft.FSharp.Core.ValueOption: Boolean Contains[T](T, Microsoft.FSharp.Core.FSharpValueOption`1[T]) +Microsoft.FSharp.Core.ValueOption: Boolean Equals(System.Object) +Microsoft.FSharp.Core.ValueOption: Boolean Exists[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean], Microsoft.FSharp.Core.FSharpValueOption`1[T]) +Microsoft.FSharp.Core.ValueOption: Boolean ForAll[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean], Microsoft.FSharp.Core.FSharpValueOption`1[T]) +Microsoft.FSharp.Core.ValueOption: Boolean IsNone[T](Microsoft.FSharp.Core.FSharpValueOption`1[T]) +Microsoft.FSharp.Core.ValueOption: Boolean IsSome[T](Microsoft.FSharp.Core.FSharpValueOption`1[T]) +Microsoft.FSharp.Core.ValueOption: Int32 Count[T](Microsoft.FSharp.Core.FSharpValueOption`1[T]) +Microsoft.FSharp.Core.ValueOption: Int32 GetHashCode() +Microsoft.FSharp.Core.ValueOption: Microsoft.FSharp.Collections.FSharpList`1[T] ToList[T](Microsoft.FSharp.Core.FSharpValueOption`1[T]) +Microsoft.FSharp.Core.ValueOption: Microsoft.FSharp.Core.FSharpValueOption`1[TResult] Bind[T,TResult](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpValueOption`1[TResult]], Microsoft.FSharp.Core.FSharpValueOption`1[T]) +Microsoft.FSharp.Core.ValueOption: Microsoft.FSharp.Core.FSharpValueOption`1[TResult] Map2[T1,T2,TResult](Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,TResult]], Microsoft.FSharp.Core.FSharpValueOption`1[T1], Microsoft.FSharp.Core.FSharpValueOption`1[T2]) +Microsoft.FSharp.Core.ValueOption: Microsoft.FSharp.Core.FSharpValueOption`1[TResult] Map3[T1,T2,T3,TResult](Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,Microsoft.FSharp.Core.FSharpFunc`2[T3,TResult]]], Microsoft.FSharp.Core.FSharpValueOption`1[T1], Microsoft.FSharp.Core.FSharpValueOption`1[T2], Microsoft.FSharp.Core.FSharpValueOption`1[T3]) +Microsoft.FSharp.Core.ValueOption: Microsoft.FSharp.Core.FSharpValueOption`1[TResult] Map[T,TResult](Microsoft.FSharp.Core.FSharpFunc`2[T,TResult], Microsoft.FSharp.Core.FSharpValueOption`1[T]) +Microsoft.FSharp.Core.ValueOption: Microsoft.FSharp.Core.FSharpValueOption`1[T] Filter[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean], Microsoft.FSharp.Core.FSharpValueOption`1[T]) +Microsoft.FSharp.Core.ValueOption: Microsoft.FSharp.Core.FSharpValueOption`1[T] Flatten[T](Microsoft.FSharp.Core.FSharpValueOption`1[Microsoft.FSharp.Core.FSharpValueOption`1[T]]) +Microsoft.FSharp.Core.ValueOption: Microsoft.FSharp.Core.FSharpValueOption`1[T] OfNullable[T](System.Nullable`1[T]) +Microsoft.FSharp.Core.ValueOption: Microsoft.FSharp.Core.FSharpValueOption`1[T] OfObj[T](T) +Microsoft.FSharp.Core.ValueOption: Microsoft.FSharp.Core.FSharpValueOption`1[T] OrElseWith[T](Microsoft.FSharp.Core.FSharpFunc`2[Microsoft.FSharp.Core.Unit,Microsoft.FSharp.Core.FSharpValueOption`1[T]], Microsoft.FSharp.Core.FSharpValueOption`1[T]) +Microsoft.FSharp.Core.ValueOption: Microsoft.FSharp.Core.FSharpValueOption`1[T] OrElse[T](Microsoft.FSharp.Core.FSharpValueOption`1[T], Microsoft.FSharp.Core.FSharpValueOption`1[T]) +Microsoft.FSharp.Core.ValueOption: System.Nullable`1[T] ToNullable[T](Microsoft.FSharp.Core.FSharpValueOption`1[T]) +Microsoft.FSharp.Core.ValueOption: System.String ToString() +Microsoft.FSharp.Core.ValueOption: System.Type GetType() +Microsoft.FSharp.Core.ValueOption: T DefaultValue[T](T, Microsoft.FSharp.Core.FSharpValueOption`1[T]) +Microsoft.FSharp.Core.ValueOption: T DefaultWith[T](Microsoft.FSharp.Core.FSharpFunc`2[Microsoft.FSharp.Core.Unit,T], Microsoft.FSharp.Core.FSharpValueOption`1[T]) +Microsoft.FSharp.Core.ValueOption: T GetValue[T](Microsoft.FSharp.Core.FSharpValueOption`1[T]) +Microsoft.FSharp.Core.ValueOption: T ToObj[T](Microsoft.FSharp.Core.FSharpValueOption`1[T]) +Microsoft.FSharp.Core.ValueOption: TState FoldBack[T,TState](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpFunc`2[TState,TState]], Microsoft.FSharp.Core.FSharpValueOption`1[T], TState) +Microsoft.FSharp.Core.ValueOption: TState Fold[T,TState](Microsoft.FSharp.Core.FSharpFunc`2[TState,Microsoft.FSharp.Core.FSharpFunc`2[T,TState]], TState, Microsoft.FSharp.Core.FSharpValueOption`1[T]) +Microsoft.FSharp.Core.ValueOption: T[] ToArray[T](Microsoft.FSharp.Core.FSharpValueOption`1[T]) +Microsoft.FSharp.Core.ValueOption: Void Iterate[T](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.Unit], Microsoft.FSharp.Core.FSharpValueOption`1[T]) Microsoft.FSharp.Core.OptionalArgumentAttribute: Boolean Equals(System.Object) +Microsoft.FSharp.Core.OptionalArgumentAttribute: Boolean IsDefaultAttribute() Microsoft.FSharp.Core.OptionalArgumentAttribute: Boolean Match(System.Object) Microsoft.FSharp.Core.OptionalArgumentAttribute: Int32 GetHashCode() +Microsoft.FSharp.Core.OptionalArgumentAttribute: System.Object TypeId +Microsoft.FSharp.Core.OptionalArgumentAttribute: System.Object get_TypeId() Microsoft.FSharp.Core.OptionalArgumentAttribute: System.String ToString() Microsoft.FSharp.Core.OptionalArgumentAttribute: System.Type GetType() Microsoft.FSharp.Core.OptionalArgumentAttribute: Void .ctor() @@ -2783,10 +2931,9 @@ Microsoft.FSharp.Core.PrintfModule: Boolean Equals(System.Object) Microsoft.FSharp.Core.PrintfModule: Int32 GetHashCode() Microsoft.FSharp.Core.PrintfModule: System.String ToString() Microsoft.FSharp.Core.PrintfModule: System.Type GetType() -Microsoft.FSharp.Core.PrintfModule: T PrintFormat[T](Microsoft.FSharp.Core.PrintfFormat`4[T,System.IO.TextWriter,Microsoft.FSharp.Core.Unit,Microsoft.FSharp.Core.Unit]) -Microsoft.FSharp.Core.PrintfModule: T PrintFormatLine[T](Microsoft.FSharp.Core.PrintfFormat`4[T,System.IO.TextWriter,Microsoft.FSharp.Core.Unit,Microsoft.FSharp.Core.Unit]) Microsoft.FSharp.Core.PrintfModule: T PrintFormatLineToError[T](Microsoft.FSharp.Core.PrintfFormat`4[T,System.IO.TextWriter,Microsoft.FSharp.Core.Unit,Microsoft.FSharp.Core.Unit]) Microsoft.FSharp.Core.PrintfModule: T PrintFormatLineToTextWriter[T](System.IO.TextWriter, Microsoft.FSharp.Core.PrintfFormat`4[T,System.IO.TextWriter,Microsoft.FSharp.Core.Unit,Microsoft.FSharp.Core.Unit]) +Microsoft.FSharp.Core.PrintfModule: T PrintFormatLine[T](Microsoft.FSharp.Core.PrintfFormat`4[T,System.IO.TextWriter,Microsoft.FSharp.Core.Unit,Microsoft.FSharp.Core.Unit]) Microsoft.FSharp.Core.PrintfModule: T PrintFormatThen[TResult,T](Microsoft.FSharp.Core.FSharpFunc`2[System.String,TResult], Microsoft.FSharp.Core.PrintfFormat`4[T,Microsoft.FSharp.Core.Unit,System.String,TResult]) Microsoft.FSharp.Core.PrintfModule: T PrintFormatToError[T](Microsoft.FSharp.Core.PrintfFormat`4[T,System.IO.TextWriter,Microsoft.FSharp.Core.Unit,Microsoft.FSharp.Core.Unit]) Microsoft.FSharp.Core.PrintfModule: T PrintFormatToStringBuilderThen[TResult,T](Microsoft.FSharp.Core.FSharpFunc`2[Microsoft.FSharp.Core.Unit,TResult], System.Text.StringBuilder, Microsoft.FSharp.Core.PrintfFormat`4[T,System.Text.StringBuilder,Microsoft.FSharp.Core.Unit,TResult]) @@ -2796,36 +2943,52 @@ Microsoft.FSharp.Core.PrintfModule: T PrintFormatToStringThen[TResult,T](Microso Microsoft.FSharp.Core.PrintfModule: T PrintFormatToStringThen[T](Microsoft.FSharp.Core.PrintfFormat`4[T,Microsoft.FSharp.Core.Unit,System.String,System.String]) Microsoft.FSharp.Core.PrintfModule: T PrintFormatToTextWriterThen[TResult,T](Microsoft.FSharp.Core.FSharpFunc`2[Microsoft.FSharp.Core.Unit,TResult], System.IO.TextWriter, Microsoft.FSharp.Core.PrintfFormat`4[T,System.IO.TextWriter,Microsoft.FSharp.Core.Unit,TResult]) Microsoft.FSharp.Core.PrintfModule: T PrintFormatToTextWriter[T](System.IO.TextWriter, Microsoft.FSharp.Core.PrintfFormat`4[T,System.IO.TextWriter,Microsoft.FSharp.Core.Unit,Microsoft.FSharp.Core.Unit]) +Microsoft.FSharp.Core.PrintfModule: T PrintFormat[T](Microsoft.FSharp.Core.PrintfFormat`4[T,System.IO.TextWriter,Microsoft.FSharp.Core.Unit,Microsoft.FSharp.Core.Unit]) Microsoft.FSharp.Core.ProjectionParameterAttribute: Boolean Equals(System.Object) +Microsoft.FSharp.Core.ProjectionParameterAttribute: Boolean IsDefaultAttribute() Microsoft.FSharp.Core.ProjectionParameterAttribute: Boolean Match(System.Object) Microsoft.FSharp.Core.ProjectionParameterAttribute: Int32 GetHashCode() +Microsoft.FSharp.Core.ProjectionParameterAttribute: System.Object TypeId +Microsoft.FSharp.Core.ProjectionParameterAttribute: System.Object get_TypeId() Microsoft.FSharp.Core.ProjectionParameterAttribute: System.String ToString() Microsoft.FSharp.Core.ProjectionParameterAttribute: System.Type GetType() Microsoft.FSharp.Core.ProjectionParameterAttribute: Void .ctor() Microsoft.FSharp.Core.ReferenceEqualityAttribute: Boolean Equals(System.Object) +Microsoft.FSharp.Core.ReferenceEqualityAttribute: Boolean IsDefaultAttribute() Microsoft.FSharp.Core.ReferenceEqualityAttribute: Boolean Match(System.Object) Microsoft.FSharp.Core.ReferenceEqualityAttribute: Int32 GetHashCode() +Microsoft.FSharp.Core.ReferenceEqualityAttribute: System.Object TypeId +Microsoft.FSharp.Core.ReferenceEqualityAttribute: System.Object get_TypeId() Microsoft.FSharp.Core.ReferenceEqualityAttribute: System.String ToString() Microsoft.FSharp.Core.ReferenceEqualityAttribute: System.Type GetType() Microsoft.FSharp.Core.ReferenceEqualityAttribute: Void .ctor() Microsoft.FSharp.Core.ReflectedDefinitionAttribute: Boolean Equals(System.Object) Microsoft.FSharp.Core.ReflectedDefinitionAttribute: Boolean IncludeValue +Microsoft.FSharp.Core.ReflectedDefinitionAttribute: Boolean IsDefaultAttribute() Microsoft.FSharp.Core.ReflectedDefinitionAttribute: Boolean Match(System.Object) Microsoft.FSharp.Core.ReflectedDefinitionAttribute: Boolean get_IncludeValue() Microsoft.FSharp.Core.ReflectedDefinitionAttribute: Int32 GetHashCode() +Microsoft.FSharp.Core.ReflectedDefinitionAttribute: System.Object TypeId +Microsoft.FSharp.Core.ReflectedDefinitionAttribute: System.Object get_TypeId() Microsoft.FSharp.Core.ReflectedDefinitionAttribute: System.String ToString() Microsoft.FSharp.Core.ReflectedDefinitionAttribute: System.Type GetType() Microsoft.FSharp.Core.ReflectedDefinitionAttribute: Void .ctor() Microsoft.FSharp.Core.ReflectedDefinitionAttribute: Void .ctor(Boolean) Microsoft.FSharp.Core.RequireQualifiedAccessAttribute: Boolean Equals(System.Object) +Microsoft.FSharp.Core.RequireQualifiedAccessAttribute: Boolean IsDefaultAttribute() Microsoft.FSharp.Core.RequireQualifiedAccessAttribute: Boolean Match(System.Object) Microsoft.FSharp.Core.RequireQualifiedAccessAttribute: Int32 GetHashCode() +Microsoft.FSharp.Core.RequireQualifiedAccessAttribute: System.Object TypeId +Microsoft.FSharp.Core.RequireQualifiedAccessAttribute: System.Object get_TypeId() Microsoft.FSharp.Core.RequireQualifiedAccessAttribute: System.String ToString() Microsoft.FSharp.Core.RequireQualifiedAccessAttribute: System.Type GetType() Microsoft.FSharp.Core.RequireQualifiedAccessAttribute: Void .ctor() Microsoft.FSharp.Core.RequiresExplicitTypeArgumentsAttribute: Boolean Equals(System.Object) +Microsoft.FSharp.Core.RequiresExplicitTypeArgumentsAttribute: Boolean IsDefaultAttribute() Microsoft.FSharp.Core.RequiresExplicitTypeArgumentsAttribute: Boolean Match(System.Object) Microsoft.FSharp.Core.RequiresExplicitTypeArgumentsAttribute: Int32 GetHashCode() +Microsoft.FSharp.Core.RequiresExplicitTypeArgumentsAttribute: System.Object TypeId +Microsoft.FSharp.Core.RequiresExplicitTypeArgumentsAttribute: System.Object get_TypeId() Microsoft.FSharp.Core.RequiresExplicitTypeArgumentsAttribute: System.String ToString() Microsoft.FSharp.Core.RequiresExplicitTypeArgumentsAttribute: System.Type GetType() Microsoft.FSharp.Core.RequiresExplicitTypeArgumentsAttribute: Void .ctor() @@ -2837,10 +3000,13 @@ Microsoft.FSharp.Core.ResultModule: Microsoft.FSharp.Core.FSharpResult`2[TResult Microsoft.FSharp.Core.ResultModule: System.String ToString() Microsoft.FSharp.Core.ResultModule: System.Type GetType() Microsoft.FSharp.Core.SealedAttribute: Boolean Equals(System.Object) +Microsoft.FSharp.Core.SealedAttribute: Boolean IsDefaultAttribute() Microsoft.FSharp.Core.SealedAttribute: Boolean Match(System.Object) Microsoft.FSharp.Core.SealedAttribute: Boolean Value Microsoft.FSharp.Core.SealedAttribute: Boolean get_Value() Microsoft.FSharp.Core.SealedAttribute: Int32 GetHashCode() +Microsoft.FSharp.Core.SealedAttribute: System.Object TypeId +Microsoft.FSharp.Core.SealedAttribute: System.Object get_TypeId() Microsoft.FSharp.Core.SealedAttribute: System.String ToString() Microsoft.FSharp.Core.SealedAttribute: System.Type GetType() Microsoft.FSharp.Core.SealedAttribute: Void .ctor() @@ -2885,26 +3051,38 @@ Microsoft.FSharp.Core.StringModule: System.Type GetType() Microsoft.FSharp.Core.StringModule: Void Iterate(Microsoft.FSharp.Core.FSharpFunc`2[System.Char,Microsoft.FSharp.Core.Unit], System.String) Microsoft.FSharp.Core.StringModule: Void IterateIndexed(Microsoft.FSharp.Core.FSharpFunc`2[System.Int32,Microsoft.FSharp.Core.FSharpFunc`2[System.Char,Microsoft.FSharp.Core.Unit]], System.String) Microsoft.FSharp.Core.StructAttribute: Boolean Equals(System.Object) +Microsoft.FSharp.Core.StructAttribute: Boolean IsDefaultAttribute() Microsoft.FSharp.Core.StructAttribute: Boolean Match(System.Object) Microsoft.FSharp.Core.StructAttribute: Int32 GetHashCode() +Microsoft.FSharp.Core.StructAttribute: System.Object TypeId +Microsoft.FSharp.Core.StructAttribute: System.Object get_TypeId() Microsoft.FSharp.Core.StructAttribute: System.String ToString() Microsoft.FSharp.Core.StructAttribute: System.Type GetType() Microsoft.FSharp.Core.StructAttribute: Void .ctor() Microsoft.FSharp.Core.StructuralComparisonAttribute: Boolean Equals(System.Object) +Microsoft.FSharp.Core.StructuralComparisonAttribute: Boolean IsDefaultAttribute() Microsoft.FSharp.Core.StructuralComparisonAttribute: Boolean Match(System.Object) Microsoft.FSharp.Core.StructuralComparisonAttribute: Int32 GetHashCode() +Microsoft.FSharp.Core.StructuralComparisonAttribute: System.Object TypeId +Microsoft.FSharp.Core.StructuralComparisonAttribute: System.Object get_TypeId() Microsoft.FSharp.Core.StructuralComparisonAttribute: System.String ToString() Microsoft.FSharp.Core.StructuralComparisonAttribute: System.Type GetType() Microsoft.FSharp.Core.StructuralComparisonAttribute: Void .ctor() Microsoft.FSharp.Core.StructuralEqualityAttribute: Boolean Equals(System.Object) +Microsoft.FSharp.Core.StructuralEqualityAttribute: Boolean IsDefaultAttribute() Microsoft.FSharp.Core.StructuralEqualityAttribute: Boolean Match(System.Object) Microsoft.FSharp.Core.StructuralEqualityAttribute: Int32 GetHashCode() +Microsoft.FSharp.Core.StructuralEqualityAttribute: System.Object TypeId +Microsoft.FSharp.Core.StructuralEqualityAttribute: System.Object get_TypeId() Microsoft.FSharp.Core.StructuralEqualityAttribute: System.String ToString() Microsoft.FSharp.Core.StructuralEqualityAttribute: System.Type GetType() Microsoft.FSharp.Core.StructuralEqualityAttribute: Void .ctor() Microsoft.FSharp.Core.StructuredFormatDisplayAttribute: Boolean Equals(System.Object) +Microsoft.FSharp.Core.StructuredFormatDisplayAttribute: Boolean IsDefaultAttribute() Microsoft.FSharp.Core.StructuredFormatDisplayAttribute: Boolean Match(System.Object) Microsoft.FSharp.Core.StructuredFormatDisplayAttribute: Int32 GetHashCode() +Microsoft.FSharp.Core.StructuredFormatDisplayAttribute: System.Object TypeId +Microsoft.FSharp.Core.StructuredFormatDisplayAttribute: System.Object get_TypeId() Microsoft.FSharp.Core.StructuredFormatDisplayAttribute: System.String ToString() Microsoft.FSharp.Core.StructuredFormatDisplayAttribute: System.String Value Microsoft.FSharp.Core.StructuredFormatDisplayAttribute: System.String get_Value() @@ -2915,14 +3093,20 @@ Microsoft.FSharp.Core.Unit: Int32 GetHashCode() Microsoft.FSharp.Core.Unit: System.String ToString() Microsoft.FSharp.Core.Unit: System.Type GetType() Microsoft.FSharp.Core.UnverifiableAttribute: Boolean Equals(System.Object) +Microsoft.FSharp.Core.UnverifiableAttribute: Boolean IsDefaultAttribute() Microsoft.FSharp.Core.UnverifiableAttribute: Boolean Match(System.Object) Microsoft.FSharp.Core.UnverifiableAttribute: Int32 GetHashCode() +Microsoft.FSharp.Core.UnverifiableAttribute: System.Object TypeId +Microsoft.FSharp.Core.UnverifiableAttribute: System.Object get_TypeId() Microsoft.FSharp.Core.UnverifiableAttribute: System.String ToString() Microsoft.FSharp.Core.UnverifiableAttribute: System.Type GetType() Microsoft.FSharp.Core.UnverifiableAttribute: Void .ctor() Microsoft.FSharp.Core.VolatileFieldAttribute: Boolean Equals(System.Object) +Microsoft.FSharp.Core.VolatileFieldAttribute: Boolean IsDefaultAttribute() Microsoft.FSharp.Core.VolatileFieldAttribute: Boolean Match(System.Object) Microsoft.FSharp.Core.VolatileFieldAttribute: Int32 GetHashCode() +Microsoft.FSharp.Core.VolatileFieldAttribute: System.Object TypeId +Microsoft.FSharp.Core.VolatileFieldAttribute: System.Object get_TypeId() Microsoft.FSharp.Core.VolatileFieldAttribute: System.String ToString() Microsoft.FSharp.Core.VolatileFieldAttribute: System.Type GetType() Microsoft.FSharp.Core.VolatileFieldAttribute: Void .ctor() @@ -3214,20 +3398,20 @@ Microsoft.FSharp.Linq.RuntimeHelpers.LeafExpressionConverter: System.String ToSt Microsoft.FSharp.Linq.RuntimeHelpers.LeafExpressionConverter: System.Type GetType() Microsoft.FSharp.Linq.RuntimeHelpers.LeafExpressionConverter: T MemberInitializationHelper[T](T) Microsoft.FSharp.Linq.RuntimeHelpers.LeafExpressionConverter: T NewAnonymousObjectHelper[T](T) -Microsoft.FSharp.NativeInterop.NativePtrModule: T& ToByRefInlined[T](IntPtr) Microsoft.FSharp.NativeInterop.NativePtrModule: Boolean Equals(System.Object) Microsoft.FSharp.NativeInterop.NativePtrModule: Int32 GetHashCode() Microsoft.FSharp.NativeInterop.NativePtrModule: IntPtr AddPointerInlined[T](IntPtr, Int32) Microsoft.FSharp.NativeInterop.NativePtrModule: IntPtr OfNativeIntInlined[T](IntPtr) +Microsoft.FSharp.NativeInterop.NativePtrModule: IntPtr OfVoidPtrInlined[T](Void*) Microsoft.FSharp.NativeInterop.NativePtrModule: IntPtr StackAllocate[T](Int32) Microsoft.FSharp.NativeInterop.NativePtrModule: IntPtr ToNativeIntInlined[T](IntPtr) Microsoft.FSharp.NativeInterop.NativePtrModule: System.String ToString() Microsoft.FSharp.NativeInterop.NativePtrModule: System.Type GetType() Microsoft.FSharp.NativeInterop.NativePtrModule: T GetPointerInlined[T](IntPtr, Int32) Microsoft.FSharp.NativeInterop.NativePtrModule: T ReadPointerInlined[T](IntPtr) +Microsoft.FSharp.NativeInterop.NativePtrModule: T& ToByRefInlined[T](IntPtr) Microsoft.FSharp.NativeInterop.NativePtrModule: Void SetPointerInlined[T](IntPtr, Int32, T) Microsoft.FSharp.NativeInterop.NativePtrModule: Void WritePointerInlined[T](IntPtr, T) -Microsoft.FSharp.NativeInterop.NativePtrModule: IntPtr OfVoidPtrInlined[T](Void*) Microsoft.FSharp.NativeInterop.NativePtrModule: Void* ToVoidPtrInlined[T](IntPtr) Microsoft.FSharp.Quotations.DerivedPatternsModule: Boolean Equals(System.Object) Microsoft.FSharp.Quotations.DerivedPatternsModule: Int32 GetHashCode() diff --git a/tests/FSharp.Core.UnitTests/SurfaceArea.net40.fs b/tests/FSharp.Core.UnitTests/SurfaceArea.net40.fs index fb3d061f045..16035e67c02 100644 --- a/tests/FSharp.Core.UnitTests/SurfaceArea.net40.fs +++ b/tests/FSharp.Core.UnitTests/SurfaceArea.net40.fs @@ -114,6 +114,7 @@ Microsoft.FSharp.Collections.ArrayModule: System.Tuple`3[T1[],T2[],T3[]] Unzip3[ Microsoft.FSharp.Collections.ArrayModule: System.Type GetType() Microsoft.FSharp.Collections.ArrayModule: T Average[T](T[]) Microsoft.FSharp.Collections.ArrayModule: T ExactlyOne[T](T[]) +Microsoft.FSharp.Collections.ArrayModule: Microsoft.FSharp.Core.FSharpOption`1[T] TryExactlyOne[T](T[]) Microsoft.FSharp.Collections.ArrayModule: T FindBack[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean], T[]) Microsoft.FSharp.Collections.ArrayModule: T Find[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean], T[]) Microsoft.FSharp.Collections.ArrayModule: T Get[T](T[], Int32) @@ -360,6 +361,7 @@ Microsoft.FSharp.Collections.ListModule: System.Tuple`3[Microsoft.FSharp.Collect Microsoft.FSharp.Collections.ListModule: System.Type GetType() Microsoft.FSharp.Collections.ListModule: T Average[T](Microsoft.FSharp.Collections.FSharpList`1[T]) Microsoft.FSharp.Collections.ListModule: T ExactlyOne[T](Microsoft.FSharp.Collections.FSharpList`1[T]) +Microsoft.FSharp.Collections.ListModule: Microsoft.FSharp.Core.FSharpOption`1[T] TryExactlyOne[T](Microsoft.FSharp.Collections.FSharpList`1[T]) Microsoft.FSharp.Collections.ListModule: T FindBack[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean], Microsoft.FSharp.Collections.FSharpList`1[T]) Microsoft.FSharp.Collections.ListModule: T Find[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean], Microsoft.FSharp.Collections.FSharpList`1[T]) Microsoft.FSharp.Collections.ListModule: T Get[T](Microsoft.FSharp.Collections.FSharpList`1[T], Int32) @@ -494,6 +496,7 @@ Microsoft.FSharp.Collections.SeqModule: System.Tuple`2[System.Collections.Generi Microsoft.FSharp.Collections.SeqModule: System.Type GetType() Microsoft.FSharp.Collections.SeqModule: T Average[T](System.Collections.Generic.IEnumerable`1[T]) Microsoft.FSharp.Collections.SeqModule: T ExactlyOne[T](System.Collections.Generic.IEnumerable`1[T]) +Microsoft.FSharp.Collections.SeqModule: Microsoft.FSharp.Core.FSharpOption`1[T] TryExactlyOne[T](System.Collections.Generic.IEnumerable`1[T]) Microsoft.FSharp.Collections.SeqModule: T FindBack[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean], System.Collections.Generic.IEnumerable`1[T]) Microsoft.FSharp.Collections.SeqModule: T Find[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean], System.Collections.Generic.IEnumerable`1[T]) Microsoft.FSharp.Collections.SeqModule: T Get[T](Int32, System.Collections.Generic.IEnumerable`1[T]) @@ -2269,6 +2272,13 @@ Microsoft.FSharp.Core.FSharpValueOption`1[T]: T Item Microsoft.FSharp.Core.FSharpValueOption`1[T]: T Value Microsoft.FSharp.Core.FSharpValueOption`1[T]: T get_Item() Microsoft.FSharp.Core.FSharpValueOption`1[T]: T get_Value() +Microsoft.FSharp.Core.FSharpValueOption`1[T]: Boolean IsNone +Microsoft.FSharp.Core.FSharpValueOption`1[T]: Boolean IsSome +Microsoft.FSharp.Core.FSharpValueOption`1[T]: Boolean get_IsNone() +Microsoft.FSharp.Core.FSharpValueOption`1[T]: Boolean get_IsSome() +Microsoft.FSharp.Core.FSharpValueOption`1[T]: Microsoft.FSharp.Core.FSharpValueOption`1[T] None +Microsoft.FSharp.Core.FSharpValueOption`1[T]: Microsoft.FSharp.Core.FSharpValueOption`1[T] Some(T) +Microsoft.FSharp.Core.FSharpValueOption`1[T]: Microsoft.FSharp.Core.FSharpValueOption`1[T] get_None() Microsoft.FSharp.Core.FSharpTypeFunc: Boolean Equals(System.Object) Microsoft.FSharp.Core.FSharpTypeFunc: Int32 GetHashCode() Microsoft.FSharp.Core.FSharpTypeFunc: System.Object Specialize[T]() @@ -2867,6 +2877,36 @@ Microsoft.FSharp.Core.OptionModule: TState FoldBack[T,TState](Microsoft.FSharp.C Microsoft.FSharp.Core.OptionModule: TState Fold[T,TState](Microsoft.FSharp.Core.FSharpFunc`2[TState,Microsoft.FSharp.Core.FSharpFunc`2[T,TState]], TState, Microsoft.FSharp.Core.FSharpOption`1[T]) Microsoft.FSharp.Core.OptionModule: T[] ToArray[T](Microsoft.FSharp.Core.FSharpOption`1[T]) Microsoft.FSharp.Core.OptionModule: Void Iterate[T](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.Unit], Microsoft.FSharp.Core.FSharpOption`1[T]) +Microsoft.FSharp.Core.ValueOption: Boolean Contains[T](T, Microsoft.FSharp.Core.FSharpValueOption`1[T]) +Microsoft.FSharp.Core.ValueOption: Boolean Equals(System.Object) +Microsoft.FSharp.Core.ValueOption: Boolean Exists[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean], Microsoft.FSharp.Core.FSharpValueOption`1[T]) +Microsoft.FSharp.Core.ValueOption: Boolean ForAll[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean], Microsoft.FSharp.Core.FSharpValueOption`1[T]) +Microsoft.FSharp.Core.ValueOption: Boolean IsNone[T](Microsoft.FSharp.Core.FSharpValueOption`1[T]) +Microsoft.FSharp.Core.ValueOption: Boolean IsSome[T](Microsoft.FSharp.Core.FSharpValueOption`1[T]) +Microsoft.FSharp.Core.ValueOption: Int32 Count[T](Microsoft.FSharp.Core.FSharpValueOption`1[T]) +Microsoft.FSharp.Core.ValueOption: Int32 GetHashCode() +Microsoft.FSharp.Core.ValueOption: Microsoft.FSharp.Collections.FSharpList`1[T] ToList[T](Microsoft.FSharp.Core.FSharpValueOption`1[T]) +Microsoft.FSharp.Core.ValueOption: Microsoft.FSharp.Core.FSharpValueOption`1[TResult] Bind[T,TResult](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpValueOption`1[TResult]], Microsoft.FSharp.Core.FSharpValueOption`1[T]) +Microsoft.FSharp.Core.ValueOption: Microsoft.FSharp.Core.FSharpValueOption`1[TResult] Map2[T1,T2,TResult](Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,TResult]], Microsoft.FSharp.Core.FSharpValueOption`1[T1], Microsoft.FSharp.Core.FSharpValueOption`1[T2]) +Microsoft.FSharp.Core.ValueOption: Microsoft.FSharp.Core.FSharpValueOption`1[TResult] Map3[T1,T2,T3,TResult](Microsoft.FSharp.Core.FSharpFunc`2[T1,Microsoft.FSharp.Core.FSharpFunc`2[T2,Microsoft.FSharp.Core.FSharpFunc`2[T3,TResult]]], Microsoft.FSharp.Core.FSharpValueOption`1[T1], Microsoft.FSharp.Core.FSharpValueOption`1[T2], Microsoft.FSharp.Core.FSharpValueOption`1[T3]) +Microsoft.FSharp.Core.ValueOption: Microsoft.FSharp.Core.FSharpValueOption`1[TResult] Map[T,TResult](Microsoft.FSharp.Core.FSharpFunc`2[T,TResult], Microsoft.FSharp.Core.FSharpValueOption`1[T]) +Microsoft.FSharp.Core.ValueOption: Microsoft.FSharp.Core.FSharpValueOption`1[T] Filter[T](Microsoft.FSharp.Core.FSharpFunc`2[T,System.Boolean], Microsoft.FSharp.Core.FSharpValueOption`1[T]) +Microsoft.FSharp.Core.ValueOption: Microsoft.FSharp.Core.FSharpValueOption`1[T] Flatten[T](Microsoft.FSharp.Core.FSharpValueOption`1[Microsoft.FSharp.Core.FSharpValueOption`1[T]]) +Microsoft.FSharp.Core.ValueOption: Microsoft.FSharp.Core.FSharpValueOption`1[T] OfNullable[T](System.Nullable`1[T]) +Microsoft.FSharp.Core.ValueOption: Microsoft.FSharp.Core.FSharpValueOption`1[T] OfObj[T](T) +Microsoft.FSharp.Core.ValueOption: Microsoft.FSharp.Core.FSharpValueOption`1[T] OrElseWith[T](Microsoft.FSharp.Core.FSharpFunc`2[Microsoft.FSharp.Core.Unit,Microsoft.FSharp.Core.FSharpValueOption`1[T]], Microsoft.FSharp.Core.FSharpValueOption`1[T]) +Microsoft.FSharp.Core.ValueOption: Microsoft.FSharp.Core.FSharpValueOption`1[T] OrElse[T](Microsoft.FSharp.Core.FSharpValueOption`1[T], Microsoft.FSharp.Core.FSharpValueOption`1[T]) +Microsoft.FSharp.Core.ValueOption: System.Nullable`1[T] ToNullable[T](Microsoft.FSharp.Core.FSharpValueOption`1[T]) +Microsoft.FSharp.Core.ValueOption: System.String ToString() +Microsoft.FSharp.Core.ValueOption: System.Type GetType() +Microsoft.FSharp.Core.ValueOption: T DefaultValue[T](T, Microsoft.FSharp.Core.FSharpValueOption`1[T]) +Microsoft.FSharp.Core.ValueOption: T DefaultWith[T](Microsoft.FSharp.Core.FSharpFunc`2[Microsoft.FSharp.Core.Unit,T], Microsoft.FSharp.Core.FSharpValueOption`1[T]) +Microsoft.FSharp.Core.ValueOption: T GetValue[T](Microsoft.FSharp.Core.FSharpValueOption`1[T]) +Microsoft.FSharp.Core.ValueOption: T ToObj[T](Microsoft.FSharp.Core.FSharpValueOption`1[T]) +Microsoft.FSharp.Core.ValueOption: TState FoldBack[T,TState](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.FSharpFunc`2[TState,TState]], Microsoft.FSharp.Core.FSharpValueOption`1[T], TState) +Microsoft.FSharp.Core.ValueOption: TState Fold[T,TState](Microsoft.FSharp.Core.FSharpFunc`2[TState,Microsoft.FSharp.Core.FSharpFunc`2[T,TState]], TState, Microsoft.FSharp.Core.FSharpValueOption`1[T]) +Microsoft.FSharp.Core.ValueOption: T[] ToArray[T](Microsoft.FSharp.Core.FSharpValueOption`1[T]) +Microsoft.FSharp.Core.ValueOption: Void Iterate[T](Microsoft.FSharp.Core.FSharpFunc`2[T,Microsoft.FSharp.Core.Unit], Microsoft.FSharp.Core.FSharpValueOption`1[T]) Microsoft.FSharp.Core.OptionalArgumentAttribute: Boolean Equals(System.Object) Microsoft.FSharp.Core.OptionalArgumentAttribute: Boolean IsDefaultAttribute() Microsoft.FSharp.Core.OptionalArgumentAttribute: Boolean Match(System.Object) diff --git a/tests/FSharp.Core.UnitTests/TypeForwarding.fs b/tests/FSharp.Core.UnitTests/TypeForwarding.fs index b0ca6fa9044..28d53156a60 100644 --- a/tests/FSharp.Core.UnitTests/TypeForwarding.fs +++ b/tests/FSharp.Core.UnitTests/TypeForwarding.fs @@ -8,9 +8,7 @@ open System open FSharp.Core.UnitTests.LibraryTestFx open NUnit.Framework -#if NETSTANDARD1_6 -// TODO named #define ? -#else +#if NET46 [] type TypeForwardingModule() = [] @@ -30,5 +28,7 @@ type TypeForwardingModule() = | ("v4.0.30319", "v4.0.30319") -> Assert.AreEqual(tupleAssemblyName, mscorlib4AssemblyName) | _ -> failwith "Unknown scenario." - () + () +#else +// TODO named #define ? #endif \ No newline at end of file diff --git a/tests/FSharp.Core.UnitTests/project.json b/tests/FSharp.Core.UnitTests/project.json deleted file mode 100644 index 901129da26d..00000000000 --- a/tests/FSharp.Core.UnitTests/project.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "version": "1.0.0-*", - "name": "FSharp.Core.UnitTests", - "buildOptions": { - "debugType": "portable", - "emitEntryPoint": true - }, - "dependencies": { - "nunit": "3.5.0", - "nunitlite": "3.5.0", - "System.ValueTuple": "4.3.0", - "FsCheck": "3.0.0-alpha3", - "Testing.FSharp.Core": "4.2.4", - "Microsoft.FSharp.TupleSample": "1.0.0-alpha-161112" - }, - "runtimes": { - "win7-x86": {}, - "win7-x64": {}, - "osx.10.11-x64": {}, - "ubuntu.14.04-x64": {} - }, - "frameworks": { - "netcoreapp1.0": { - "dependencies": { - "Microsoft.NETCore.App": { - "type": "platform", - "version": "1.0.1" - } - }, - "imports": [ "netstandard1.1", "netstandard1.6", "portable-net45+win8+wp8+wpa81" ] - } - }, -} diff --git a/tests/FSharp.Directory.Build.props b/tests/FSharp.Directory.Build.props new file mode 100644 index 00000000000..bb8eac309b1 --- /dev/null +++ b/tests/FSharp.Directory.Build.props @@ -0,0 +1,3 @@ + + + diff --git a/tests/FSharp.Directory.Build.targets b/tests/FSharp.Directory.Build.targets new file mode 100644 index 00000000000..590214e9b00 --- /dev/null +++ b/tests/FSharp.Directory.Build.targets @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/tests/fsharp/Directory.Build.props b/tests/fsharp/Directory.Build.props new file mode 100644 index 00000000000..bb8eac309b1 --- /dev/null +++ b/tests/fsharp/Directory.Build.props @@ -0,0 +1,3 @@ + + + diff --git a/tests/fsharp/Directory.Build.targets b/tests/fsharp/Directory.Build.targets new file mode 100644 index 00000000000..ccd47cc0a9a --- /dev/null +++ b/tests/fsharp/Directory.Build.targets @@ -0,0 +1,3 @@ + + + diff --git a/tests/fsharp/FSharp.Tests.FSharpSuite.DrivingCoreCLR/DeployCompiler/fsc/NuGet.Config b/tests/fsharp/FSharp.Tests.FSharpSuite.DrivingCoreCLR/DeployCompiler/fsc/NuGet.Config deleted file mode 100644 index e64f65a1761..00000000000 --- a/tests/fsharp/FSharp.Tests.FSharpSuite.DrivingCoreCLR/DeployCompiler/fsc/NuGet.Config +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/tests/fsharp/FSharp.Tests.FSharpSuite.DrivingCoreCLR/DeployCompiler/fsc/project.json b/tests/fsharp/FSharp.Tests.FSharpSuite.DrivingCoreCLR/DeployCompiler/fsc/project.json deleted file mode 100644 index 1ef5b17e135..00000000000 --- a/tests/fsharp/FSharp.Tests.FSharpSuite.DrivingCoreCLR/DeployCompiler/fsc/project.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "version": "1.0.0-*", - "name": "fsc", - "buildOptions": { - "debugType": "portable", - "emitEntryPoint": true - }, - "dependencies": { - "Testing.FSharp.Compiler": "4.2.0-*" - }, - "runtimes": { - "win7-x86": { }, - "win7-x64": { }, - "osx.10.10-x64": { }, - "ubuntu.14.04-x64": { } - }, - "frameworks": { - "netcoreapp1.0": { - "dependencies": { - "Microsoft.NETCore.App": { - "type": "platform", - "version": "1.0.1" - } - }, - } - }, - "scripts": { - "postpublish": [ "cmd /c copy %publish:OutputPath%\\runtimes\\any\\native\\* %publish:OutputPath%" ] - } -} \ No newline at end of file diff --git a/tests/fsharp/FSharp.Tests.FSharpSuite.DrivingCoreCLR/DeployCompiler/fsi/NuGet.Config b/tests/fsharp/FSharp.Tests.FSharpSuite.DrivingCoreCLR/DeployCompiler/fsi/NuGet.Config deleted file mode 100644 index e64f65a1761..00000000000 --- a/tests/fsharp/FSharp.Tests.FSharpSuite.DrivingCoreCLR/DeployCompiler/fsi/NuGet.Config +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/tests/fsharp/FSharp.Tests.FSharpSuite.DrivingCoreCLR/DeployCompiler/fsi/project.json b/tests/fsharp/FSharp.Tests.FSharpSuite.DrivingCoreCLR/DeployCompiler/fsi/project.json deleted file mode 100644 index 8d7efcca46e..00000000000 --- a/tests/fsharp/FSharp.Tests.FSharpSuite.DrivingCoreCLR/DeployCompiler/fsi/project.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "version": "1.0.0-*", - "name": "fsi", - "buildOptions": { - "debugType": "portable", - "emitEntryPoint": true - }, - "dependencies": { - "Testing.FSharp.Compiler": "4.2.0-*" - }, - "runtimes": { - "win7-x86": { }, - "win7-x64": { }, - "osx.10.10-x64": { }, - "ubuntu.14.04-x64": { } - }, - "frameworks": { - "netcoreapp1.0": { - "dependencies": { - "Microsoft.NETCore.App": { - "type": "platform", - "version": "1.0.1" - } - }, - } - }, - "scripts": { - "postpublish": [ "cmd /c copy %publish:OutputPath%\\runtimes\\any\\native\\* %publish:OutputPath%" ] - } -} \ No newline at end of file diff --git a/tests/fsharp/FSharp.Tests.FSharpSuite.DrivingCoreCLR/FSharp.Tests.FSharpSuite.DrivingCoreCLR.fsproj b/tests/fsharp/FSharp.Tests.FSharpSuite.DrivingCoreCLR/FSharp.Tests.FSharpSuite.DrivingCoreCLR.fsproj deleted file mode 100644 index b236d1d93cb..00000000000 --- a/tests/fsharp/FSharp.Tests.FSharpSuite.DrivingCoreCLR/FSharp.Tests.FSharpSuite.DrivingCoreCLR.fsproj +++ /dev/null @@ -1,59 +0,0 @@ - - - - $(MSBuildProjectDirectory)\..\..\..\src - {bda4d411-6ad9-4b3e-a3b3-07bad6bef1ed} - true - true - - - - Debug - AnyCPU - 2.0 - true - true - Library - true - $(DefineConstants);FSHARP_SUITE_DRIVES_CORECLR_TESTS - FSharp.Tests.FSharpSuite.DrivingCoreCLR - FSharp.Tests.FSharpSuite.DrivingCoreCLR - - false - false - $(OtherFlags) --warnon:1182 - - - - - scriptlib.fsx - - - - NunitHelpers.fs - - - - - - - - - - - - ..\..\packages\NUnit.3.5.0\lib\net45\nunit.framework.dll - True - - - {2E4D67B4-522D-4CF7-97E4-BA940F0B18F3} - FSharp.Compiler.Private - - - - - {DED3BBD7-53F4-428A-8C9F-27968E768605} - FSharp.Core - - - \ No newline at end of file diff --git a/tests/fsharp/FSharp.Tests.FSharpSuite.DrivingCoreCLR/FSharp.Tests.FSharpSuite.DrivingCoreCLR.sln b/tests/fsharp/FSharp.Tests.FSharpSuite.DrivingCoreCLR/FSharp.Tests.FSharpSuite.DrivingCoreCLR.sln deleted file mode 100644 index 69d9198aba2..00000000000 --- a/tests/fsharp/FSharp.Tests.FSharpSuite.DrivingCoreCLR/FSharp.Tests.FSharpSuite.DrivingCoreCLR.sln +++ /dev/null @@ -1,25 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.25928.0 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FSharp.Tests.FSharpSuite.DrivingCoreCLR", "FSharp.Tests.FSharpSuite.DrivingCoreCLR.fsproj", "{BDA4D411-6AD9-4B3E-A3B3-07BAD6BEF1ED}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Proto|Any CPU = Proto|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {BDA4D411-6AD9-4B3E-A3B3-07BAD6BEF1ED}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {BDA4D411-6AD9-4B3E-A3B3-07BAD6BEF1ED}.Debug|Any CPU.Build.0 = Debug|Any CPU - {BDA4D411-6AD9-4B3E-A3B3-07BAD6BEF1ED}.Proto|Any CPU.ActiveCfg = Proto|Any CPU - {BDA4D411-6AD9-4B3E-A3B3-07BAD6BEF1ED}.Proto|Any CPU.Build.0 = Proto|Any CPU - {BDA4D411-6AD9-4B3E-A3B3-07BAD6BEF1ED}.Release|Any CPU.ActiveCfg = Release|Any CPU - {BDA4D411-6AD9-4B3E-A3B3-07BAD6BEF1ED}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/tests/fsharp/FSharp.Tests.FSharpSuite.DrivingCoreCLR/Program.cs b/tests/fsharp/FSharp.Tests.FSharpSuite.DrivingCoreCLR/Program.cs deleted file mode 100644 index 5183e98a293..00000000000 --- a/tests/fsharp/FSharp.Tests.FSharpSuite.DrivingCoreCLR/Program.cs +++ /dev/null @@ -1 +0,0 @@ -// This file is only required for dotnet publish ... and it's not even really used by that. diff --git a/tests/fsharp/FSharp.Tests.FSharpSuite.DrivingCoreCLR/Program.fs b/tests/fsharp/FSharp.Tests.FSharpSuite.DrivingCoreCLR/Program.fs deleted file mode 100644 index 28ff2aa8434..00000000000 --- a/tests/fsharp/FSharp.Tests.FSharpSuite.DrivingCoreCLR/Program.fs +++ /dev/null @@ -1,12 +0,0 @@ -module Program - -open System -open System.Reflection -open NUnitLite -open NUnit.Common - -type HelperType() = inherit System.Object() - -[] -let main argv = - AutoRun(typeof.GetTypeInfo().Assembly).Execute(argv, new ExtendedTextWrapper(Console.Out), Console.In) diff --git a/tests/fsharp/FSharp.Tests.FSharpSuite.DrivingCoreCLR/project.json b/tests/fsharp/FSharp.Tests.FSharpSuite.DrivingCoreCLR/project.json deleted file mode 100644 index 89c511665ae..00000000000 --- a/tests/fsharp/FSharp.Tests.FSharpSuite.DrivingCoreCLR/project.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "version": "1.0.0-*", - "name": "FSharp.Tests.FSharpSuite.DrivingCoreCLR", - "buildOptions": { - "debugType": "portable", - "emitEntryPoint": true - }, - "dependencies": { - "NETStandard.Library": "1.6.1", - "Testing.FSharp.Core": "4.2.*", - "nunit": "3.5.0", - "nunitlite": "3.5.0" - }, - "runtimes": { - "win7-x86": {}, - "win7-x64": {}, - "osx.10.11-x64": {}, - "ubuntu.14.04-x64": {} - }, - "frameworks": { - "netcoreapp1.0": { - "dependencies": { - "Microsoft.NETCore.App": { - "type": "platform", - "version": "1.0.1" - }, - "System.Reflection.Emit.Lightweight": "4.3.0" - }, - "imports": [ "netstandard1.6", "portable-net45+win8+wp8+wpa81" ] - } - }, - "scripts": { - "postpublish": [ "cmd /c copy %publish:OutputPath%\\runtimes\\any\\native\\* %publish:OutputPath%" ] - } -} diff --git a/tests/fsharp/FSharp.Tests.FSharpSuite.fsproj b/tests/fsharp/FSharp.Tests.FSharpSuite.fsproj index 2ec2840bc85..97aa63d88fb 100644 --- a/tests/fsharp/FSharp.Tests.FSharpSuite.fsproj +++ b/tests/fsharp/FSharp.Tests.FSharpSuite.fsproj @@ -1,30 +1,23 @@  - - - $(MSBuildProjectDirectory)\..\..\src - {C163E892-5BF7-4B59-AA99-B0E8079C67C4} - - + + - Debug - AnyCPU - 2.0 - true + net46;netcoreapp2.0 + win-x86;win-x64 + $(AssetTargetFallback);portable-net45+win8+wp8+wpa81 true Library - true - FSharp.Tests.FSharpSuite - FSharp.Tests.FSharpSuite - + true false false $(OtherFlags) --warnon:1182 + nunit - - - + + + $(DefineConstants);FSHARP_SUITE_DRIVES_CORECLR_TESTS - + scriptlib.fsx @@ -34,37 +27,28 @@ NunitHelpers.fs - + + + + + + + + + - - - - - - $(FSharpSourcesRoot)\..\packages\System.Collections.Immutable.$(SystemCollectionsImmutablePackageVersion)\lib\portable-net45+win8+wp8+wpa81\System.Collections.Immutable.dll - True - - - $(FSharpSourcesRoot)\..\packages\System.Reflection.Metadata.$(SystemReflectionMetadataPackageVersion)\lib\portable-net45+win8\System.Reflection.Metadata.dll - True - - - ..\..\packages\NUnit.3.5.0\lib\net45\nunit.framework.dll - True - - - {2E4D67B4-522D-4CF7-97E4-BA940F0B18F3} - FSharp.Compiler.Private - - - {DED3BBD7-53F4-428A-8C9F-27968E768605} - FSharp.Core - + + + + + + - \ No newline at end of file + + diff --git a/tests/fsharp/SDKTests/AllSdkTargetsTests.proj b/tests/fsharp/SDKTests/AllSdkTargetsTests.proj index 8aecfd0263e..9da3a21fea1 100644 --- a/tests/fsharp/SDKTests/AllSdkTargetsTests.proj +++ b/tests/fsharp/SDKTests/AllSdkTargetsTests.proj @@ -1,7 +1,7 @@ - release + Release @@ -14,5 +14,6 @@ + diff --git a/tests/fsharp/SDKTests/Directory.Build.props b/tests/fsharp/SDKTests/Directory.Build.props new file mode 100644 index 00000000000..bb5b23d29d0 --- /dev/null +++ b/tests/fsharp/SDKTests/Directory.Build.props @@ -0,0 +1,3 @@ + + + diff --git a/tests/fsharp/SDKTests/Directory.Build.targets b/tests/fsharp/SDKTests/Directory.Build.targets new file mode 100644 index 00000000000..bb5b23d29d0 --- /dev/null +++ b/tests/fsharp/SDKTests/Directory.Build.targets @@ -0,0 +1,3 @@ + + + diff --git a/tests/fsharp/SDKTests/tests/Test.props b/tests/fsharp/SDKTests/tests/Test.props index fdfc314758e..b4665ec5749 100644 --- a/tests/fsharp/SDKTests/tests/Test.props +++ b/tests/fsharp/SDKTests/tests/Test.props @@ -6,14 +6,14 @@ <_TargetFrameworkVersionWithoutV Condition="'$(_TargetFrameworkVersionWithoutV)' == ''">4.6 .NETFramework - release - $(MSBuildThisFileDirectory)..\..\..\..\$(Configuration)\net40\bin + Release + $(MSBuildThisFileDirectory)..\..\..\..\artifacts\bin\FSharp.Build\$(Configuration)\net46 AnyCPU $(MSBuildThisFileDirectory) - + diff --git a/tests/fsharp/SDKTests/tests/Test.targets b/tests/fsharp/SDKTests/tests/Test.targets index 668f100f9e4..6f1638051d8 100644 --- a/tests/fsharp/SDKTests/tests/Test.targets +++ b/tests/fsharp/SDKTests/tests/Test.targets @@ -1,6 +1,6 @@ - + @@ -27,7 +27,6 @@ - diff --git a/tests/fsharp/TypeProviderTests.fs b/tests/fsharp/TypeProviderTests.fs index 08a39395ef9..f5d9f909450 100644 --- a/tests/fsharp/TypeProviderTests.fs +++ b/tests/fsharp/TypeProviderTests.fs @@ -27,7 +27,6 @@ let FSIANYCPU_BASIC = FSI_CORECLR #else let FSC_BASIC = FSC_OPT_PLUS_DEBUG let FSI_BASIC = FSI_FILE -let FSIANYCPU_BASIC = FSIANYCPU_FILE #endif (* @@ -272,7 +271,9 @@ let splitAssembly subdir project = SingleTest.singleTestBuildAndRunAux cfg FSI_BASIC +#if !FSHARP_SUITE_DRIVES_CORECLR_TESTS SingleTest.singleTestBuildAndRunAux cfg FSIANYCPU_BASIC +#endif // Do the same thing with different load locations for the type provider design-time component diff --git a/tests/fsharp/core/anon/lib.fs b/tests/fsharp/core/anon/lib.fs new file mode 100644 index 00000000000..abeb7711ab9 --- /dev/null +++ b/tests/fsharp/core/anon/lib.fs @@ -0,0 +1,249 @@ + +module AnonLib + + +let failures = ref [] + +let report_failure (s : string) = + stderr.Write" NO: " + stderr.WriteLine s + failures := !failures @ [s] + +let test (s : string) b = + stderr.Write(s) + if b then stderr.WriteLine " OK" + else report_failure (s) + +let check (s:string) x1 x2 = + stderr.Write(s) + if (x1 = x2) then stderr.WriteLine " OK" + else (stderr.WriteLine (sprintf "fail, expected %A, got %A" x2 x1); report_failure (s)) + +let inline getX (x: ^TX) : ^X = + (^TX : (member get_X : unit -> ^X) (x)) + + +let inline Y (x: ^TX) : ^X = + (^TX : (member get_Y : unit -> ^X) (x)) + + +module KindB1 = + + let data1 = {| X = 1 |} + + // Types can be written with the same syntax + let data2 : {| X : int |} = data1 + + // Access is as expected + let f1 (v : {| X : int |}) = v.X + + // Access can be nested + let f2 (v : {| X: {| X : int |} |}) = v.X.X + + // Access can be nested + let f3 (v : {| Y: {| X : int |} |}) = v.Y.X + + // Access can be nested + let f4 (v : {| Y: {| X : 'T |} |}) = v.Y.X + + check "coijoiwcnkc42c2" {| Y = 1; X = "1" |} {| X = "1"; Y = 1 |} + check "coijoiwcnkc42c3" {| Y = 1; X = "1"; Z = 2 |} {| Z = 2; X = "1"; Y = 1 |} + + check "coijoiwcnkwle1" {| a = 1 |} {| a = 1 |} + check "coijoiwcnkwle2" {| a = 2 |} {| a = 2 |} + + check "coijoiwcnkwle3" (sprintf "%A" {| X = 10 |}) "{X = 10;}" + check "coijoiwcnkwle4" (sprintf "%A" {| X = 10; Y = 1 |} |> fun s -> s.Replace("\n","").Replace("\r","")) ("{X = 10; Y = 1;}".Replace("\n","").Replace("\r","")) + check "clekoiew09" (f2 {| X = {| X = 10 |} |}) 10 + check "cewkew0oijew" (f2 {| X = {| X = 20 |} |}) 20 + + check "ceoijew90ewcw1" (FSharp.Reflection.FSharpType.IsRecord(typeof<{| X : int; Y: string |}>)) true + check "ceoijew90ewcw2" (FSharp.Reflection.FSharpType.GetRecordFields(typeof<{| X : int; Y: string |}>).Length) 2 + check "ceoijew90ewcw3" (FSharp.Reflection.FSharpValue.GetRecordFields({| X = 1; Y = "a" |}).Length) 2 + check "ceoijew90ewcw4" (FSharp.Reflection.FSharpType.IsRecord(typeof<{| X : int |}>)) true + check "ceoijew90ewcw5" (FSharp.Reflection.FSharpType.GetRecordFields(typeof<{| X : int |}>).Length) 1 + check "ceoijew90ewcw6" (FSharp.Reflection.FSharpValue.GetRecordFields({| X = 1 |}).Length) 1 + check "ceoijew90ewcw7" (FSharp.Reflection.FSharpValue.GetRecordFields({| X = 1 |}).[0]) (box 1) + + // Equality is possible + check "ceijoewwekcj" {| a = 1-1 |} {| a = Unchecked.defaultof<_> |} + + // Comparison is possible if structural elements are comparable + check "ceijowere9er" ({| a = 1+1 |} > {| a = 0 |}) true + + // Check we can alias these types + type recd1 = {| a : int |} + + // test a generic function + let test7<'T>(x:'T) = {| a = x |} + + // test a generic function + let test8<'T>(x:'T) = {| a = x; b = x |} + + // Properties may satisfy member constraints + // Access code may not be generic except through existing member constraints + + + // To speciy a struct representation use this: + let data3 = struct {| X = 1 |} + + // Types can be written with the same syntax + let data4 : struct {| X : int |} = data3 + + let testConstrainedAccess = getX {| X = 0 |}, getX data1, getX {| X = 2; Y = "2" |} + + check "testConstrainedAccess1" (sprintf "%A" testConstrainedAccess) "(0, 1, 2)" + + let testConstrainedAccess2 = getX (struct {| X = 0 |}), getX data3, getX (struct {| X = 2; Y = "2" |}) + + check "testConstrainedAccess2" (sprintf "%A" testConstrainedAccess2) "(0, 1, 2)" + +module TestInAttributes = + type FooAttribute(ty: System.Type) = + inherit System.Attribute() + member x.Type = ty + + [)>] + type C() = + member x.P = 1 + check "clkwweclk" ((typeof.GetCustomAttributes(typeof,true).[0] :?> FooAttribute).Type) (typeof<{| Field1: int; Field2 : string |}>) + +module KindB2 = + + // Gives object that has full C#-compatibe anonymous metadata. Compiles to an instantiation of a generic type in the declaring assembly with appropriate .NET + // metadata (property names). The types are CLIMutable to be C#-compatible. The identity of the types are implicitly assembly-qualified. + let data1 = {| X = 1 |} + + let data1b = {| Y = 1 |} + + let data1c = {| X = 1; Y = 2 |} + + let data1d = {| X = 1; Y = 3 |} + + // Types can be written with the same syntax + let data2 : {| X : int |} = data1 + + // Struct representations may be specified, though C# doesn't allow them + let data3 = struct {| X = 1; Y = 2 |} + + // Types can be written with the same syntax + let data4 : struct {| X : int; Y : int |} = data3 + + let testAccess = (data4.X, data4.Y, data1.X, data2.X, data3.X, data3.Y) + + printfn "{| X = 10 |} = %A" ({| X = 10 |} ) + printfn "{| X = 10 ; Y = \"abc\" |} = %A" ({| X = 10 ; Y = "abc"|} ) + + let testConstrainedAccess = getX ({| X = 0 |}), getX data1, getX ({| X = 2; Y = "2" |}) + + check "cew9cwoi" testConstrainedAccess (0, 1, 2) + + let testConstrainedAccess2 = getX (struct {| X = 0 |}), getX data3, getX (struct {| X = 2; Y = "2" |}) + + check "cew9cwo3" testConstrainedAccess2 (0, 1, 2) + +module CopyAndUpdateOfAnonRecord = + let data = {| X = 1 |} + let data2 = {| data with Y = "1" |} + let data3 = {| data with X = "3" |} + let data4 = {| data2 with X = "3" |} + check "fewjkvwno31" data.X 1 + check "fewjkvwno32" data2.X 1 + check "fewjkvwno33" data2.Y "1" + check "fewjkvwno34" data3.X "3" + check "fewjkvwno3443" data4.X "3" + check "fewjkvwno3443" data4.Y "1" + +module CopyAndUpdateOfAnonRecordStruct = + let data = struct {| X = 1 |} + let data2 = struct {| data with Y = "1" |} + let data3 = struct {| data with X = "3" |} + let data4 = struct {| data2 with X = "3" |} + check "fewjkvwno311" data.X 1 + check "fewjkvwno322" data2.X 1 + check "fewjkvwno333" data2.Y "1" + check "fewjkvwno344" data3.X "3" + check "fewjkvwno3444" data4.X "3" + check "fewjkvwno3442" data4.Y "1" + +module CopyAndUpdateOfAnonRecordFromRecord = + type Base = { X : int } + let data = { X = 1 } + let data2 = {| data with Y = "1" |} + let data3 = {| data with X = "3" |} + let data4 = {| data2 with X = "3" |} + check "fewjkvwno315" data.X 1 + check "fewjkvwno326" data2.X 1 + check "fewjkvwno337" data2.Y "1" + check "fewjkvwno348" data3.X "3" + check "fewjkvwno344y" data4.X "3" + check "fewjkvwno344b" data4.Y "1" + +module CopyAndUpdateOfAnonRecordFromStructRecord = + [] + type Base = { X : int } + let data = { X = 1 } + let data2 = {| data with Y = "1" |} + let data3 = {| data with X = "3" |} + check "fewjkvwno31q" data.X 1 + check "fewjkvwno32w" data2.X 1 + check "fewjkvwno33ej" data2.Y "1" + check "fewjkvwno34rs" data3.X "3" + +module QuotesNewRecord = + + open FSharp.Quotations + open FSharp.Quotations.Patterns + let ty, args = match <@ {| X = 1; Y = "two" |} @> with NewRecord(a,b) -> a,b + + check "gceoijew90ewcw1" (FSharp.Reflection.FSharpType.IsRecord(ty)) true + check "gceoijew90ewcw2" (FSharp.Reflection.FSharpType.GetRecordFields(ty).Length) 2 + check "gceoijew90ewcw2" ([ for p in FSharp.Reflection.FSharpType.GetRecordFields(ty) -> p.Name ]) [ "X"; "Y" ] + check "gceoijew90ewcw3" args [ <@@ 1 @@>; <@@ "two" @@> ] + +module QuotesNewRecord2 = + + open FSharp.Quotations + open FSharp.Quotations.Patterns + let ty, args = match <@ {| Y = "two"; X = 1 |} @> with NewRecord(a,b) -> a,b + + check "qgceoijew90ewcw1" (FSharp.Reflection.FSharpType.IsRecord(ty)) true + check "qgceoijew90ewcw2" (FSharp.Reflection.FSharpType.GetRecordFields(ty).Length) 2 + // Fields are sorted + check "qgceoijew90ewcw2" ([ for p in FSharp.Reflection.FSharpType.GetRecordFields(ty) -> p.Name ]) [ "X"; "Y" ] + check "qgceoijew90ewcw3" args [ <@@ 1 @@>; <@@ "two" @@> ] + +module QuotesPropertyGet = + + open FSharp.Quotations + open FSharp.Quotations.Patterns + let obj, prop = match <@ {| X = 1; Y = "two" |}.X @> with Patterns.PropertyGet(a,b,[]) -> a,b + + check "wgceoijew90ewcw1" prop.Name "X" + + +module SampleAPI = + + let SampleFunction (arg : {| A: int; B: string |}) = arg.A + arg.B.Length + let SampleFunctionAcceptingList (args : {| A: int; B: string |} list) = args |> List.map (fun arg -> arg.A + arg.B.Length) + let SampleFunctionReturningAnonRecd () = {| A=1; B = "abc" |} + +module SampleAPIStruct = + let SampleFunction (arg : (struct {| A: int; B: string |})) = arg.A + arg.B.Length + let SampleFunctionAcceptingList (args : (struct {| A: int; B: string |}) list) = args |> List.map (fun arg -> arg.A + arg.B.Length) + let SampleFunctionReturningAnonRecd () = struct {| A=1; B = "abc" |} + +module SampleAPITupleStruct = + let SampleFunction ((a,b) : (struct (int * string))) = a + b.Length + let SampleFunctionAcceptingList (args : (struct (int * string)) list) = args |> List.map (fun (struct (a,b)) -> a + b.Length) + let SampleFunctionReturningStructTuple () = struct (1, "abc") + +module SyntaxCornerCaseTests = + + let _ = id<{| X: int |}> {| X = 3 |} + // Check use as type argument + let _ = id<{| X: int |}> {| X = 3 |} + let _ = id<{| X: int; Y: int |}> {| X = 3; Y = 4 |} + let _ = id<{| X: int; Y: int |}> ({| X = 3; Y = 4 |}) + let _ = id (struct {| X = 3; Y = 44 |}) + let _ = id (struct {| X = 3; Y = 4 |}) \ No newline at end of file diff --git a/tests/fsharp/core/anon/test.fsx b/tests/fsharp/core/anon/test.fsx new file mode 100644 index 00000000000..331d522f071 --- /dev/null +++ b/tests/fsharp/core/anon/test.fsx @@ -0,0 +1,83 @@ +// #Regression #Conformance #Accessibility #SignatureFiles #Regression #Records +#if TESTS_AS_APP +module Core_anon +#endif + +open AnonLib +let failures = ref [] + +let report_failure (s : string) = + stderr.Write" NO: " + stderr.WriteLine s + failures := !failures @ [s] + +let test (s : string) b = + stderr.Write(s) + if b then stderr.WriteLine " OK" + else report_failure (s) + +let check (s:string) x1 x2 = + stderr.Write(s) + if (x1 = x2) then stderr.WriteLine " OK" + else (stderr.WriteLine (sprintf "fail, expected %A, got %A" x2 x1); report_failure (s)) + +module Test = + + let testAccess = (KindB1.data1.X, KindB1.data3.X) + + check "coijoiwcnkwle2" (sprintf "%A" KindB1.data1) "{X = 1;}" + +module Tests2 = + + let testAccess = (KindB2.data1.X, KindB2.data3.X, KindB2.data3.Y) + + check "coijoiwcnkwle3" (sprintf "%A" KindB2.data1) "{X = 1;}" + + let _ = (KindB2.data1 = KindB2.data1) + +module MoreTests = + + let testUseInFunctionSignatureOnly (x: {| X1 : int |}) = () + let testUseInReturnSignatureOnly () : {| X2 : int |} = Unchecked.defaultof<_> + let testUseInTypeOfOnly () = typeof<{| X3 : int |}> + + let (x : struct (int * int)) = (3, 4) + let () = match (struct (3,4)) with (a,b) -> () + +module CrossAssemblyTest = + let tests() = + check "vrknvio1" (SampleAPI.SampleFunction {| A=1; B = "abc" |}) 4 // note, this is creating an instance of an anonymous record from another assembly. + check "vrknvio2" (SampleAPI.SampleFunctionAcceptingList [ {| A=1; B = "abc" |}; {| A=2; B = "def" |} ]) [4; 5] // note, this is creating an instance of an anonymous record from another assembly. + check "vrknvio3" (let d = SampleAPI.SampleFunctionReturningAnonRecd() in d.A + d.B.Length) 4 + check "vrknvio4" (let d = SampleAPIStruct.SampleFunctionReturningAnonRecd() in d.ToString().Replace("\n","").Replace("\r","")) """{A = 1; B = "abc";}""" + tests() + +module CrossAssemblyTestStruct = + let tests() = + check "svrknvio1" (SampleAPIStruct.SampleFunction {| A=1; B = "abc" |}) 4 // note, this is creating an instance of an anonymous record from another assembly. The structness is inferred in this case. + check "svrknvio2" (SampleAPIStruct.SampleFunctionAcceptingList [ {| A=1; B = "abc" |}; {| A=2; B = "def" |} ]) [4; 5] // note, this is creating an instance of an anonymous record from another assembly. The structness is inferred in this case. + check "svrknvio3" (let d = SampleAPIStruct.SampleFunctionReturningAnonRecd() in d.A + d.B.Length) 4 + tests() + +module CrossAssemblyTestTupleStruct = + let tests() = + check "svrknvio1" (SampleAPITupleStruct.SampleFunction (1, "abc")) 4 // note, this is creating an instance of an anonymous record from another assembly. The structness is inferred in this case. + check "svrknvio2" (SampleAPITupleStruct.SampleFunctionAcceptingList [ (1, "abc"); (2, "def") ]) [4; 5] // note, this is creating an instance of an anonymous record from another assembly. The structness is inferred in this case. + check "svrknvio3" (match SampleAPITupleStruct.SampleFunctionReturningStructTuple() with (x,y) -> x + y.Length) 4 + check "svrknvio4" (let res = SampleAPITupleStruct.SampleFunctionReturningStructTuple() in match res with (x,y) -> x + y.Length) 4 + tests() + +#if TESTS_AS_APP +let RUN() = !failures +#else +let aa = + match !failures with + | [] -> + stdout.WriteLine "Test Passed" + System.IO.File.WriteAllText("test.ok","ok") + exit 0 + | _ -> + stdout.WriteLine "Test Failed" + exit 1 +#endif + diff --git a/tests/fsharp/core/array/test.fsx b/tests/fsharp/core/array/test.fsx index 0e25ee5e966..ee3c5407823 100644 --- a/tests/fsharp/core/array/test.fsx +++ b/tests/fsharp/core/array/test.fsx @@ -1407,7 +1407,7 @@ module bug872632 = module CheckUnionTypesAreSealed = open System -#if NETCOREAPP1_0 +#if NETCOREAPP open System.Reflection type System.Type with member this.IsSealed @@ -1469,7 +1469,7 @@ module manyIndexes = 0 -#if !NETCOREAPP1_0 +#if !NETCOREAPP module bug6447 = let a = System.Array.CreateInstance(typeof, [|1|], [|1|]) let a1 = System.Array.CreateInstance(typeof, [|1|], [|3|]) diff --git a/tests/fsharp/core/attributes/test.fsx b/tests/fsharp/core/attributes/test.fsx index 66d6a183934..f8f60ee019c 100644 --- a/tests/fsharp/core/attributes/test.fsx +++ b/tests/fsharp/core/attributes/test.fsx @@ -7,11 +7,11 @@ module Core_attributes #endif #light -#if !TESTS_AS_APP && !NETCOREAPP1_0 +#if !TESTS_AS_APP && !NETCOREAPP #load "testlib.fsi" "testlib.fs" // a warning is expected here #endif -#if !TESTS_AS_APP && !NETCOREAPP1_0 +#if !TESTS_AS_APP && !NETCOREAPP #r "cslib.dll" #endif @@ -38,7 +38,7 @@ open System.Diagnostics (* ATTRIBUTES *) -#if !TESTS_AS_APP && !NETCOREAPP1_0 +#if !TESTS_AS_APP && !NETCOREAPP [] #endif @@ -58,7 +58,7 @@ let fx3 (x:x2) = fx2 x (* attribute on a method *) let [] myLoggingMethod x = stderr.WriteLine(x:string) -#if !NETCOREAPP1_0 +#if !NETCOREAPP let [] myLoggingMethod2 x = stderr.WriteLine(x:string) #endif @@ -206,12 +206,15 @@ end do () type dummy = Dummy -let ass = typeof.Assembly +let assembly = typeof.Assembly // Assembly attributes are currently ignored by F# Interactive, so this test // fails. We ignore the failure. #if COMPILED -let ca = ass.GetCustomAttributes(typeof,false) +let ca = assembly.GetCustomAttributes(typeof,false) + +for item in ca do + printfn "%A" ((item :?> System.Reflection.AssemblyTitleAttribute).Title) do if Array.length ca <> 1 then failwith "could not find CA on assembly" #endif @@ -228,7 +231,7 @@ let ca4 = typeof.GetCustomAttributes(typeof,false) do if Array.length ca4 <> 1 then failwith "could not find CA on type" -#if !NETCOREAPP1_0 +#if !NETCOREAPP open System.Runtime.InteropServices [] @@ -325,7 +328,7 @@ let ca7d = ty.Assembly.GetCustomAttributes(typeof,false) do if Array.length ca7d <> 1 then report_failure (sprintf "could not get parameterized CA on assembly, num CAs = %d" (Array.length ca7d)) -#if !NETCOREAPP1_0 +#if !NETCOREAPP #if COMPILED [<``module``: DontPressThisButton3(1, "", -2)>] do() @@ -376,7 +379,7 @@ module CheckGenericParameterAttibutesAndNames = if typeof.GetMethod("M2").GetGenericArguments().[1].Name <> "V" then report_failure "wrong name on generic parameter (C)" if typeof.GetMethod("M3").GetGenericArguments().[0].Name <> "a" then report_failure "unexpected inferred name on generic parameter (D)" -#if !TESTS_AS_APP && !NETCOREAPP1_0 +#if !TESTS_AS_APP && !NETCOREAPP module CheckAttributesOnElementsWithSignatures = let checkOneAttribute msg (cas: _ []) = @@ -432,7 +435,7 @@ end // -#if !NETCOREAPP1_0 +#if !NETCOREAPP #r "System.Security.dll";; #r "System.Configuration.dll";; @@ -511,7 +514,7 @@ module ThreadStaticTest = begin static val mutable private results : int list static member Results with get() = C.results and set v = C.results <- v -#if !MONO && !NETCOREAPP1_0 +#if !MONO && !NETCOREAPP let N = 1000 let main() = let t1 = @@ -561,7 +564,7 @@ end (*------------------------------------------------------------------------- !* System.Runtime.InteropServices.In/OUT attributes *------------------------------------------------------------------------- *) -#if !NETCOREAPP1_0 +#if !NETCOREAPP open System let g ( [] x : int byref) = 0 let g2 (( [] x : int byref), ([] y : int byref)) = 0 @@ -611,7 +614,7 @@ type C = end -#if !NETCOREAPP1_0 +#if !NETCOREAPP let test2179 = let ty = typeof in @@ -809,12 +812,12 @@ module Bug1437_PS_FSharp1_0_AttributesWithArrayArguments = begin [] do () - let ass = typeof.Assembly + let assembly = typeof.Assembly // Assembly attributes are currently ignored by F# Interactive, so this test // fails. We ignore the failure. #if COMPILED - let ca = ass.GetCustomAttributes(typeof,false) + let ca = assembly.GetCustomAttributes(typeof,false) let _ = check "ce99pj32cweq" (Array.length ca) 1 #endif end @@ -884,7 +887,7 @@ module Bug6161_PS_FSharp1_0_MoreAttributesWithArrayArguments = begin check "ce99pj32cweqT" (ca.[0].GetType()) (typeof) check "ce99pj32cweqY" (ca.[0] :?> AnyAttribute).Value (box [| 42 |]) -#if !TESTS_AS_APP && !NETCOREAPP1_0 +#if !TESTS_AS_APP && !NETCOREAPP let _ = let ty = typeof let ca = ty.GetCustomAttributes(typeof,false) @@ -1090,7 +1093,7 @@ module NullsInAttributes = test "TestProperty5" (null, null, null, Some null, Some null, Some null) test "TestProperty6" (box "1", "2", typeof, Some (box "3"), Some "4", Some typeof) -#if !NETCOREAPP1_0 +#if !NETCOREAPP module Bug5762 = open System open System.IO @@ -1333,7 +1336,7 @@ module BugWithOverloadedAttributes = [] type Bar = class end -#if !TESTS_AS_APP && !NETCOREAPP1_0 +#if !TESTS_AS_APP && !NETCOREAPP module Bug719b = open TestLibModule.Bug719 diff --git a/tests/fsharp/core/attributes/testlib.fs b/tests/fsharp/core/attributes/testlib.fs index f83ed790953..3691bd8751e 100644 --- a/tests/fsharp/core/attributes/testlib.fs +++ b/tests/fsharp/core/attributes/testlib.fs @@ -118,7 +118,7 @@ module TypeParamAttributesDifferent = type ThisLibAssembly = X | Y -#if !NETCOREAPP1_0 +#if !NETCOREAPP module Bug719 = open System.Runtime.InteropServices diff --git a/tests/fsharp/core/attributes/testlib.fsi b/tests/fsharp/core/attributes/testlib.fsi index e83aa9e4f11..785ee261f62 100644 --- a/tests/fsharp/core/attributes/testlib.fsi +++ b/tests/fsharp/core/attributes/testlib.fsi @@ -103,7 +103,7 @@ type ThisLibAssembly -#if !NETCOREAPP1_0 +#if !NETSTANDARD module Bug719 = open System.Runtime.InteropServices diff --git a/tests/fsharp/core/byrefs/.gitignore b/tests/fsharp/core/byrefs/.gitignore new file mode 100644 index 00000000000..6a7461313bb --- /dev/null +++ b/tests/fsharp/core/byrefs/.gitignore @@ -0,0 +1 @@ +*.dll diff --git a/tests/fsharp/core/byrefs/cslib3.cs b/tests/fsharp/core/byrefs/cslib3.cs new file mode 100644 index 00000000000..727f71411df --- /dev/null +++ b/tests/fsharp/core/byrefs/cslib3.cs @@ -0,0 +1,17 @@ +using System; + +namespace CSharpLib3 +{ + public static class Extensions + { + public static void Test(this in DateTime dt) + { + + } + + public static ref readonly DateTime Test2(this ref DateTime dt) + { + return ref dt; + } + } +} \ No newline at end of file diff --git a/tests/fsharp/core/byrefs/test.bsl b/tests/fsharp/core/byrefs/test.bsl index c24101f3a4a..71542c8be42 100644 --- a/tests/fsharp/core/byrefs/test.bsl +++ b/tests/fsharp/core/byrefs/test.bsl @@ -43,13 +43,29 @@ test.fsx(66,34,66,47): typecheck error FS1204: This construct is for use in the test.fsx(66,34,66,47): typecheck error FS1204: This construct is for use in the FSharp.Core library and should not be used directly -test.fsx(71,21,71,23): typecheck error FS3237: Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. +test.fsx(71,21,71,23): typecheck error FS3236: Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. -test.fsx(72,21,72,23): typecheck error FS3237: Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. +test.fsx(72,21,72,23): typecheck error FS3236: Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. -test.fsx(78,21,78,37): typecheck error FS3237: Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. +test.fsx(78,21,78,37): typecheck error FS3236: Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. test.fsx(85,22,85,23): typecheck error FS0001: This expression was expected to have type 'inref' but here has type 'System.DateTime' + +test.fsx(88,10,88,15): typecheck error FS3238: Byref types are not allowed to have optional type extensions. + +test.fsx(92,10,92,15): typecheck error FS3238: Byref types are not allowed to have optional type extensions. + +test.fsx(96,10,96,16): typecheck error FS3238: Byref types are not allowed to have optional type extensions. + +test.fsx(114,21,114,36): typecheck error FS3236: Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. + +test.fsx(114,21,114,36): typecheck error FS0001: Type mismatch. Expecting a + 'byref' +but given a + 'inref' +The type 'ByRefKinds.InOut' does not match the type 'ByRefKinds.In' + +test.fsx(119,21,119,29): typecheck error FS3236: Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. diff --git a/tests/fsharp/core/byrefs/test.fsx b/tests/fsharp/core/byrefs/test.fsx index e2a85f718f4..0eba848ec2f 100644 --- a/tests/fsharp/core/byrefs/test.fsx +++ b/tests/fsharp/core/byrefs/test.fsx @@ -85,6 +85,39 @@ module ByrefNegativeTests = let v = C.M(w) // not allowed check "cweweoiwe51btw" v w + type byref<'T> with + + member this.Test() = 1 + + type inref<'T> with + + member this.Test() = 1 + + type outref<'T> with + + member this.Test() = 1 + + module CantTakeAddressOfExpressionReturningReferenceType = + open System.Collections.Concurrent + open System.Collections.Generic + + let test1 () = + let aggregator = + new ConcurrentDictionary< + string, ConcurrentDictionary> + >() + + for kvp in aggregator do + for kvpInner in kvp.Value do + kvp.Value.TryRemove( + kvpInner.Key, + &kvpInner.Value) + |> ignore + + let test2 () = + let x = KeyValuePair(1, [||]) + let y = &x.Value + () #endif // Test a simple ref argument @@ -1158,119 +1191,119 @@ module ByrefReturnMemberTests = member __.P = f (0, &x) // check recursive functions - module BeefModuleGeneric = + module TestNameModuleGeneric = - let rec beef (unused: 'T) id (data: byref) : unit = + let rec testValue (unused: 'T) id (data: byref) : unit = if id = 10 then data <- 3uy else - beef unused (id + 1) &data + testValue unused (id + 1) &data let Test() = let mutable x = 0uy - beef "unused" 0 &x + testValue "unused" 0 &x check "vruoer" x 3uy Test() - module BeefModuleNonGeneric = + module TestNameModuleNonGeneric = - let rec beef id (data: byref) : unit = + let rec testValue id (data: byref) : unit = if id = 10 then data <- 3uy else - beef (id + 1) &data + testValue (id + 1) &data let Test() = let mutable x = 0uy - beef 0 &x + testValue 0 &x check "vruoer3r" x 3uy Test() - module BeefModuleNonGenericSubsume = + module TestNameModuleNonGenericSubsume = - let rec beef id (data: byref) (y: System.IComparable) : unit = + let rec testValue id (data: byref) (y: System.IComparable) : unit = if id = 10 then data <- 3uy else - beef (id + 1) &data y + testValue (id + 1) &data y let Test() = let mutable x = 0uy - beef 0 &x Unchecked.defaultof + testValue 0 &x Unchecked.defaultof check "vruoer3r" x 3uy Test() - type GenericBeefRecursive() = + type GenericTestNameRecursive() = - let rec beef unused id (data: byref) : unit = - if id = 10 then data <- 3uy else beef unused (id + 1) &data + let rec testValue unused id (data: byref) : unit = + if id = 10 then data <- 3uy else testValue unused (id + 1) &data - static do GenericBeefRecursive().Test() + static do GenericTestNameRecursive().Test() member __.Test() = let mutable x = 0uy - beef "unused" 0 &x + testValue "unused" 0 &x check "vruoer3rv" x 3uy let mutable z = 0uy - beef 6L 0 &z + testValue 6L 0 &z check "vruoer3rvwqf" z 3uy - type NonGenericBeefRecursiveInClass() = + type NonGenericTestNameRecursiveInClass() = - let rec beef id (data: byref) : unit = + let rec testValue id (data: byref) : unit = if id = 10 then data <- 3uy else - beef (id + 1) &data + testValue (id + 1) &data - static do NonGenericBeefRecursiveInClass().Test() + static do NonGenericTestNameRecursiveInClass().Test() member __.Test() = let mutable x = 0uy - beef 0 &x + testValue 0 &x check "vruoer3rvvremtys" x 3uy - type NonGenericBeefRecursiveInClassSubsume() = + type NonGenericTestNameRecursiveInClassSubsume() = - let rec beef id (data: byref) (y:System.IComparable) : unit = + let rec testValue id (data: byref) (y:System.IComparable) : unit = if id = 10 then data <- 3uy else - beef (id + 1) &data y + testValue (id + 1) &data y - static do NonGenericBeefRecursiveInClassSubsume().Test() + static do NonGenericTestNameRecursiveInClassSubsume().Test() member __.Test() = let mutable x = 0uy - beef 0 &x Unchecked.defaultof + testValue 0 &x Unchecked.defaultof check "vruoer3rvvremtys" x 3uy - type StaticGenericBeefRecursiveInClass() = + type StaticGenericTestNameRecursiveInClass() = - static let rec beef unused id (data: byref) : unit = - if id = 10 then data <- 3uy else beef unused (id + 1) &data + static let rec testValue unused id (data: byref) : unit = + if id = 10 then data <- 3uy else testValue unused (id + 1) &data - static do StaticGenericBeefRecursiveInClass.Test() + static do StaticGenericTestNameRecursiveInClass.Test() static member Test() = let mutable x = 0uy - beef "unused" 0 &x + testValue "unused" 0 &x check "vruoer3rv" x 3uy let mutable z = 0uy - beef 6L 0 &z + testValue 6L 0 &z check "vruoer3rvwqfgw" z 3uy - type StaticNonGenericBeefRecursiveInClass() = + type StaticNonGenericTestNameRecursiveInClass() = - static let rec beef id (data: byref) : unit = - if id = 10 then data <- 3uy else beef (id + 1) &data + static let rec testValue id (data: byref) : unit = + if id = 10 then data <- 3uy else testValue (id + 1) &data - static do StaticNonGenericBeefRecursiveInClass.Test() + static do StaticNonGenericTestNameRecursiveInClass.Test() static member Test() = let mutable x = 0uy - beef 0 &x + testValue 0 &x check "vruoer3rvvrebae" x 3uy module TestInRefMutation = diff --git a/tests/fsharp/core/byrefs/test2.bsl b/tests/fsharp/core/byrefs/test2.bsl index 5cdb952a471..c6af427d7ce 100644 --- a/tests/fsharp/core/byrefs/test2.bsl +++ b/tests/fsharp/core/byrefs/test2.bsl @@ -1,4 +1,10 @@ +test2.fsx(181,9,181,22): typecheck warning FS0193: This expression is a function value, i.e. is missing arguments. Its type is byref -> unit. + +test2.fsx(199,9,199,20): typecheck warning FS0193: This expression is a function value, i.e. is missing arguments. Its type is int -> byref -> unit. + +test2.fsx(214,9,214,24): typecheck warning FS0193: This expression is a function value, i.e. is missing arguments. Its type is inref * int -> unit. + test2.fsx(29,18,29,19): typecheck error FS3209: The address of the variable 'y' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. test2.fsx(36,18,36,19): typecheck error FS3209: The address of the variable 'z' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. @@ -19,6 +25,10 @@ test2.fsx(79,14,79,29): typecheck error FS3228: The address of a value returned test2.fsx(87,14,87,29): typecheck error FS3228: The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. +test2.fsx(93,13,93,14): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. + +test2.fsx(93,17,93,29): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. + test2.fsx(93,28,93,29): typecheck error FS0421: The address of the variable 'x' cannot be used at this point test2.fsx(93,17,93,29): typecheck error FS0425: The type of a first-class function cannot contain byrefs @@ -27,4 +37,94 @@ test2.fsx(93,17,93,29): typecheck error FS0425: The type of a first-class functi test2.fsx(112,53,112,54): typecheck error FS3209: The address of the variable 'x' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. -test2.fsx(124,33,124,34): typecheck error FS3209: The address of the variable 'x' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. +test2.fsx(124,41,124,42): typecheck error FS3209: The address of the variable 'x' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + +test2.fsx(133,23,133,33): typecheck error FS0438: Duplicate method. The method 'TestMethod' has the same name and signature as another method in type 'NegativeTests.TestNegativeOverloading'. + +test2.fsx(131,23,131,33): typecheck error FS0438: Duplicate method. The method 'TestMethod' has the same name and signature as another method in type 'NegativeTests.TestNegativeOverloading'. + +test2.fsx(129,23,129,33): typecheck error FS0438: Duplicate method. The method 'TestMethod' has the same name and signature as another method in type 'NegativeTests.TestNegativeOverloading'. + +test2.fsx(137,18,137,22): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. + +test2.fsx(137,18,137,22): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. + +test2.fsx(139,18,139,23): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. + +test2.fsx(141,9,141,14): typecheck error FS3301: The function or method has an invalid return type '(byref * int)'. This is not permitted by the rules of Common IL. + +test2.fsx(141,34,141,39): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. + +test2.fsx(141,35,141,36): typecheck error FS0418: The byref typed value 'x' cannot be used at this point + +test2.fsx(143,9,143,14): typecheck error FS3301: The function or method has an invalid return type '(byref -> unit)'. This is not permitted by the rules of Common IL. + +test2.fsx(145,14,145,15): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. + +test2.fsx(147,17,147,18): typecheck error FS3300: The parameter 'x' has an invalid type '((byref -> unit) * int)'. This is not permitted by the rules of Common IL. + +test2.fsx(149,17,149,18): typecheck error FS3300: The parameter 'x' has an invalid type '(byref -> unit)'. This is not permitted by the rules of Common IL. + +test2.fsx(149,41,149,42): typecheck error FS3300: The parameter 'y' has an invalid type '(byref * int)'. This is not permitted by the rules of Common IL. + +test2.fsx(155,36,155,39): typecheck error FS3300: The parameter 'tup' has an invalid type '(inref * int)'. This is not permitted by the rules of Common IL. + +test2.fsx(156,13,156,33): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. + +test2.fsx(158,37,158,38): typecheck error FS3300: The parameter 'x' has an invalid type '(byref -> unit)'. This is not permitted by the rules of Common IL. + +test2.fsx(160,37,160,38): typecheck error FS3300: The parameter 'x' has an invalid type 'byref option'. This is not permitted by the rules of Common IL. + +test2.fsx(162,17,162,18): typecheck error FS3300: The parameter 'x' has an invalid type 'byref option'. This is not permitted by the rules of Common IL. + +test2.fsx(167,13,167,14): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. + +test2.fsx(167,17,167,30): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. + +test2.fsx(170,9,170,15): typecheck error FS3301: The function or method has an invalid return type '(byref -> unit)'. This is not permitted by the rules of Common IL. + +test2.fsx(171,9,171,22): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. + +test2.fsx(174,13,174,14): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. + +test2.fsx(176,13,176,26): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. + +test2.fsx(181,9,181,22): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. + +test2.fsx(185,13,185,14): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. + +test2.fsx(185,17,185,28): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. + +test2.fsx(188,9,188,15): typecheck error FS3301: The function or method has an invalid return type '(int -> byref -> unit)'. This is not permitted by the rules of Common IL. + +test2.fsx(189,9,189,20): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. + +test2.fsx(192,13,192,14): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. + +test2.fsx(194,13,194,24): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. + +test2.fsx(199,9,199,20): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. + +test2.fsx(203,13,203,14): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. + +test2.fsx(203,17,203,32): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. + +test2.fsx(203,17,203,32): typecheck error FS0425: The type of a first-class function cannot contain byrefs + +test2.fsx(207,13,207,14): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. + +test2.fsx(209,13,209,28): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. + +test2.fsx(214,9,214,24): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. + +test2.fsx(217,9,217,15): typecheck error FS3301: The function or method has an invalid return type '(byref * int)'. This is not permitted by the rules of Common IL. + +test2.fsx(219,10,219,15): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. + +test2.fsx(219,11,219,12): typecheck error FS0421: The address of the variable 'x' cannot be used at this point + +test2.fsx(222,9,222,18): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. + +test2.fsx(226,13,226,14): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. + +test2.fsx(226,17,226,26): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. diff --git a/tests/fsharp/core/byrefs/test2.fsx b/tests/fsharp/core/byrefs/test2.fsx index a65471c145e..ab7ec8cd730 100644 --- a/tests/fsharp/core/byrefs/test2.fsx +++ b/tests/fsharp/core/byrefs/test2.fsx @@ -100,7 +100,7 @@ module NegativeTests = type Test() = - member __.Beef() = + member __.TestMethod() = let mutable a = Unchecked.defaultof let obj = { new ByRefInterface with @@ -118,11 +118,114 @@ module NegativeTests = obj.Test(&x, &y) |> ignore a - type Beef = delegate of unit-> byref - let testBeef () = + type TestDelegate = delegate of unit-> byref + let testFunction () = let mutable x = 1 - let f = Beef(fun () -> &x) // is not allowed + let f = TestDelegate(fun () -> &x) // is not allowed () + + type TestNegativeOverloading() = + + static member TestMethod(dt: byref) = () + + static member TestMethod(dt: inref) = () + + static member TestMethod(dt: outref) = () + + type NegativeInterface = + + abstract Test : (byref * byref) -> byref + + abstract Test2 : (byref -> unit) -> unit + + let test8 (x: byref) = (&x, 1) + + let test9 (x: byref) = + printfn "test9" + fun (y: byref) -> () + + let test10 (x: (byref -> unit) * int) = () + + let test11 (x: byref -> unit) (y: byref * int) = () + + type StaticTest private () = + + static member Test (x: inref, y: int) = () + + static member NegativeTest(tup) = + StaticTest.Test(tup) + + static member NegativeTest2(x: byref -> unit) = () + + static member NegativeTest3(x: byref option) = () + + let test12 (x: byref option) = () + + let testHelper1 (x: int) (y: byref) = () + + let test13 () = + let x = testHelper1 1 + () + + let test14 () = + testHelper1 1 + + let test15 () = + let x = + printfn "test" + testHelper1 1 + () + + let test16 () = + let x = 1 + testHelper1 1 + () + + let test17 () = + let x = testHelper1 + () + + let test18 () = + testHelper1 + + let test19 () = + let x = + printfn "test" + testHelper1 + () + + let test20 () = + let x = 1 + testHelper1 + () + + let test21 () = + let x = StaticTest.Test + () + + let test22 () = + let x = + printfn "test" + StaticTest.Test + () + + let test23 () = + let x = 1 + StaticTest.Test + () + + let test24 () : byref * int = + let mutable x = 1 + (&x, 1) + + let test25 () = + test24 () + () + + let test26 () = + let x = test24 () + () + #endif module Tests = @@ -138,6 +241,37 @@ module Tests = () () + type TestPositiveOverloading() = + + static member TestMethod(dt: byref) = () + + static member TestMethod(dt: inref) = () + + static member TestMethod(dt: outref) = () + + type PositiveInterface = + + abstract Test : byref * byref -> byref + + // This looks like it should fail, but its sig is 'val test2 : x: byref -> y: byref -> unit' + // unless a signature tells it otherwise, e.g. 'val test2 : (byref -> byref) -> unit' + let test2 (x: byref) = + fun (y: byref) -> () + + type StaticTest private () = + + static member Test (x: byref, y: int) = () + + static member Test2 (x: inref, y: int) = () + + // This passes because tup becomes 'int ref * int', which is valid and produces valid code. + // We include this to test current behavior with inference and byrefs. + static member PositiveTest(tup) = + StaticTest.Test(tup) + + let test3 () = + StaticTest.Test2 // is passing, but probably shouldn't be + let aa = if !failures then (stdout.WriteLine "Test Failed"; exit 1) else (stdout.WriteLine "Test Passed"; diff --git a/tests/fsharp/core/byrefs/test3.bsl b/tests/fsharp/core/byrefs/test3.bsl new file mode 100644 index 00000000000..6fe9b7ec397 --- /dev/null +++ b/tests/fsharp/core/byrefs/test3.bsl @@ -0,0 +1,22 @@ + +test3.fsx(39,18,39,28): typecheck error FS3237: Cannot call the byref extension method 'Test2. The first parameter requires the value to be mutable or a non-readonly byref type. + +test3.fsx(40,9,40,11): typecheck error FS0001: Type mismatch. Expecting a + 'byref' +but given a + 'inref' +The type 'ByRefKinds.InOut' does not match the type 'ByRefKinds.In' + +test3.fsx(44,9,44,20): typecheck error FS3237: Cannot call the byref extension method 'Change. The first parameter requires the value to be mutable or a non-readonly byref type. + +test3.fsx(49,19,49,30): typecheck error FS3237: Cannot call the byref extension method 'Test2. The first parameter requires the value to be mutable or a non-readonly byref type. + +test3.fsx(55,9,55,21): typecheck error FS3237: Cannot call the byref extension method 'Change. The first parameter requires the value to be mutable or a non-readonly byref type. + +test3.fsx(59,17,59,29): typecheck error FS3239: Cannot partially apply the extension method 'NotChange' because the first parameter is a byref type. + +test3.fsx(60,17,60,24): typecheck error FS3239: Cannot partially apply the extension method 'Test' because the first parameter is a byref type. + +test3.fsx(61,17,61,26): typecheck error FS3239: Cannot partially apply the extension method 'Change' because the first parameter is a byref type. + +test3.fsx(62,17,62,25): typecheck error FS3239: Cannot partially apply the extension method 'Test2' because the first parameter is a byref type. diff --git a/tests/fsharp/core/byrefs/test3.fsx b/tests/fsharp/core/byrefs/test3.fsx new file mode 100644 index 00000000000..5cc0f379da8 --- /dev/null +++ b/tests/fsharp/core/byrefs/test3.fsx @@ -0,0 +1,101 @@ +#if TESTS_AS_APP +module Core_byrefs +#endif + +open System +open System.Runtime.CompilerServices +open CSharpLib3 + +let failures = ref false +let report_failure (s) = + stderr.WriteLine ("NO: " + s); failures := true +let test s b = if b then () else report_failure(s) + +(* TEST SUITE FOR Int32 *) + +let out r (s:string) = r := !r @ [s] + +let check s actual expected = + if actual = expected then printfn "%s: OK" s + else report_failure (sprintf "%s: FAILED, expected %A, got %A" s expected actual) + +let check2 s expected actual = check s actual expected + +// Test extension members for byrefs + +[] +type Ext() = + [] + static member inline Change(dt: byref) = () + + [] + static member inline NotChange(dt: inref) = () + +#if NEGATIVE +module Negatives = + + let test1 () : byref = + let dt = DateTime.Now + let x = &dt.Test2() // should fail + &x // should fail + + let test2 () = + let dt = DateTime.Now + dt.Change() // should fail + + let test3 () = + let dt = DateTime.Now + let dtr = &dt + let _x = &dtr.Test2() // should fail + () + + let test4 () = + let dt = DateTime.Now + let dtr = &dt + dtr.Change() // should fail + + let test5 () = + let dt = DateTime.Now + let x = dt.NotChange // should fail + let y = dt.Test // should fail + let z = dt.Change // should fail + let w = dt.Test2 // should fail + () + +#endif + +module Positives = + + let test1 () = + let dt = DateTime.Now + let _x = dt.Test() + let dtr = &dt + dtr.Test() + + let test2 () = + let dt = DateTime.Now + dt.NotChange() + let dtr = &dt + dtr.NotChange() + + let test3 () = + let mutable dt = DateTime.Now + let _x = dt.Test2() + dt.Test() + let dtr = &dt + let _x = dtr.Test2() + dtr.Test() + + let test4 () = + let mutable dt = DateTime.Now + dt.Change() + dt.NotChange() + let dtr = &dt + dtr.Change() + dtr.NotChange() + +let aa = + if !failures then (stdout.WriteLine "Test Failed"; exit 1) + else (stdout.WriteLine "Test Passed"; + System.IO.File.WriteAllText("test3.ok","ok"); + exit 0) \ No newline at end of file diff --git a/tests/fsharp/core/comprehensions-hw/test.fsx b/tests/fsharp/core/comprehensions-hw/test.fsx index 19535574cd1..54ccfa1f167 100644 --- a/tests/fsharp/core/comprehensions-hw/test.fsx +++ b/tests/fsharp/core/comprehensions-hw/test.fsx @@ -447,7 +447,7 @@ test "coic23" -#if !NETCOREAPP1_0 +#if !NETCOREAPP let pickering() = let files = Directory.GetFiles(@"C:\Program Files\Microsoft Enterprise Library January 2006\", "*.csproj", SearchOption.AllDirectories) for file in files do @@ -557,7 +557,7 @@ module RandomSmallIfThenElseTest = do () return a } -#if !NETCOREAPP1_0 +#if !NETCOREAPP module MoreExtensions = open Microsoft.FSharp.Control diff --git a/tests/fsharp/core/comprehensions/test.fsx b/tests/fsharp/core/comprehensions/test.fsx index 3bf078fcc8d..5ab55a9a2ae 100644 --- a/tests/fsharp/core/comprehensions/test.fsx +++ b/tests/fsharp/core/comprehensions/test.fsx @@ -518,7 +518,7 @@ module MaxIntMinIntBOundaryCases = begin end -#if !NETCOREAPP1_0 +#if !NETCOREAPP open System.IO open System.Xml diff --git a/tests/fsharp/core/control/test.fsx b/tests/fsharp/core/control/test.fsx index ea2aafcd663..5b3ae01492b 100644 --- a/tests/fsharp/core/control/test.fsx +++ b/tests/fsharp/core/control/test.fsx @@ -4,7 +4,7 @@ module Core_control #endif #light -#if NETCOREAPP1_0 +#if NETCOREAPP open System.Threading.Tasks #endif @@ -32,7 +32,7 @@ let report_failure s = log (sprintf "FAILURE: %s failed" s) ) -#if !NETCOREAPP1_0 +#if !NETCOREAPP System.AppDomain.CurrentDomain.UnhandledException.AddHandler( fun _ (args:System.UnhandledExceptionEventArgs) -> lock syncObj (fun () -> @@ -355,7 +355,7 @@ module SpawnTests = do result <- 1 }); while result = 0 do printf "." -#if NETCOREAPP1_0 +#if NETCOREAPP Task.Delay(10).Wait() #else System.Threading.Thread.Sleep(10) @@ -363,7 +363,7 @@ module SpawnTests = result) 1 -#if !NETCOREAPP1_0 +#if !NETCOREAPP module FromBeginEndTests = // FromBeginEnd let FromBeginEndTest() = @@ -395,7 +395,7 @@ module FromBeginEndTests = if (!savedCallback).IsNone then failwith "expected a callback (loc cwowen903)" (!savedCallback).Value.Invoke iar else -#if NETCOREAPP1_0 +#if NETCOREAPP Task.Run(fun _ -> Task.Delay(sleep).Wait() #else @@ -465,7 +465,7 @@ module Bug6078 = "foo" Test() -#if !MONO && !NETCOREAPP1_0 +#if !MONO && !NETCOREAPP module AwaitEventTests = let AwaitEventTest() = // AwaitEvent @@ -486,7 +486,7 @@ module AwaitEventTests = if completeSynchronously then ev.Trigger(r) else -#if NETCOREAPP1_0 +#if NETCOREAPP Task.Run(fun _ -> Task.Delay(sleep).Wait() #else @@ -773,7 +773,7 @@ module OnCancelTests = return () }, asyncGroup.Token); while count = 0 do do printfn "waiting to enter cancellation section" -#if NETCOREAPP1_0 +#if NETCOREAPP Task.Delay(10).Wait() #else System.Threading.Thread.Sleep(10) @@ -782,7 +782,7 @@ module OnCancelTests = res) 0 -#if !TESTS_AS_APP && !NETCOREAPP1_0 +#if !TESTS_AS_APP && !NETCOREAPP module SyncContextReturnTests = let p() = printfn "running on %A" System.Threading.SynchronizationContext.Current @@ -1082,7 +1082,7 @@ module ParallelTests = member x.Dispose() = // This gets run when the cancel happens // Sleep a bit to check we wait for the sleep after the cancel -#if NETCOREAPP1_0 +#if NETCOREAPP Task.Delay(10).Wait() #else System.Threading.Thread.Sleep(10) @@ -1134,7 +1134,7 @@ module ParallelTests = [| 0..n-1 |] -#if !NETCOREAPP1_0 +#if !NETCOREAPP module AsyncWaitOneTest1 = let Run() = @@ -1259,7 +1259,7 @@ Async.RunSynchronously (async { let! n = s.AsyncRead(buffer,0,9) in return n }) *) #endif -#if !NETCOREAPP1_0 +#if !NETCOREAPP module AsyncGenerateTests = let Run() = for length in 1 .. 10 do @@ -1315,7 +1315,7 @@ module AsyncGenerateTests = [| 0 .. length-1|];; #endif -#if !NETCOREAPP1_0 +#if !NETCOREAPP (* #This part of control suite disabled under bug#1809 module ThreadAbortTests = @@ -1401,7 +1401,7 @@ let catch a = let to_be_cancelled n flag1 flag2 = async { use! holder = Async.OnCancel(fun _ -> incr flag1) -#if NETCOREAPP1_0 +#if NETCOREAPP do Task.Delay(n/8).Wait() #else do System.Threading.Thread.Sleep (n / 8) @@ -1422,7 +1422,7 @@ let test2 () = test "test2 - OnCancel" (!flag1 >= 0 && !flag1 < n && !flag2 >= 0 && !flag2 < n) -#if !NETCOREAPP1_0 +#if !NETCOREAPP // SwitchToNewThread let test3 () = let ids = ref [] @@ -1484,7 +1484,7 @@ let test8() = let syncRoot = System.Object() let k = ref 0 let comp _ = async { return lock syncRoot (fun () -> incr k -#if NETCOREAPP1_0 +#if NETCOREAPP Task.Delay(1).Wait() #else System.Threading.Thread.Sleep(1) @@ -1628,7 +1628,7 @@ let test15() = Async.Parallel2(a, cancel) |> Async.RunSynchronously |> ignore with _ -> () -#if NETCOREAPP1_0 +#if NETCOREAPP Task.Delay(300).Wait() #else System.Threading.Thread.Sleep(300) @@ -1651,7 +1651,7 @@ let test15b() = let a = Async.TryCancelled(a, (fun _ -> p.Check -1)) a |> Async.RunSynchronously |> ignore with _ -> () -#if NETCOREAPP1_0 +#if NETCOREAPP Task.Delay(100).Wait() #else System.Threading.Thread.Sleep(100) @@ -1659,7 +1659,7 @@ let test15b() = test1() test2() -#if !NETCOREAPP1_0 +#if !NETCOREAPP test3() #endif test8() @@ -1685,7 +1685,7 @@ let test22() = let p = Path "test22" let a = async { do p.Check 1 -#if NETCOREAPP1_0 +#if NETCOREAPP do Task.Delay(200).Wait() #else do System.Threading.Thread.Sleep(200) @@ -1703,14 +1703,14 @@ let test22() = let run = Async.TryCancelled(run, fun _ -> p.Check 4) let group = new System.Threading.CancellationTokenSource() Async.Start(run,group.Token) -#if NETCOREAPP1_0 +#if NETCOREAPP Task.Delay(100).Wait() #else System.Threading.Thread.Sleep(100) #endif p.Check 2 group.Cancel() -#if NETCOREAPP1_0 +#if NETCOREAPP Task.Delay(200).Wait() #else System.Threading.Thread.Sleep(200) @@ -1748,7 +1748,7 @@ module ParallelTest = member x.Dispose() = // This gets run when the cancel happens if i=n-1 then // last guy waits a long time to ensure client is blocked -#if NETCOREAPP1_0 +#if NETCOREAPP Task.Delay(200).Wait() #else System.Threading.Thread.Sleep(2000) @@ -1780,7 +1780,7 @@ module ParallelTest = Test() -#if !TESTS_AS_APP && !NETCOREAPP1_0 +#if !TESTS_AS_APP && !NETCOREAPP // See bug 5570, check we do not switch threads module CheckNoPumpingOrThreadSwitchingBecauseWeTrampolineSynchronousCode = let checkOnThread msg expectedThreadId = @@ -2053,7 +2053,7 @@ module Bug391710 = Async.Start(a1, cancellationToken = cts.Token) Async.Start(a2) -#if NETCOREAPP1_0 +#if NETCOREAPP Task.Delay(500).Wait(); #else System.Threading.Thread.Sleep(500) @@ -2062,7 +2062,7 @@ module Bug391710 = try Bug391710() -#if NETCOREAPP1_0 +#if NETCOREAPP Task.Delay(500).Wait(); #else System.Threading.Thread.Sleep(2000) @@ -2079,13 +2079,13 @@ let RunAll() = StartChildOutsideOfAsync.Run() SpawnTests.Run() AsBeginEndTests.AsBeginEndTest() -#if !MONO && !NETCOREAPP1_0 +#if !MONO && !NETCOREAPP AwaitEventTests.AwaitEventTest() #endif OnCancelTests.Run() GenerateTests.Run() ParallelTests.Run() -#if !NETCOREAPP1_0 +#if !NETCOREAPP AsyncWaitOneTest1.Run() AsyncGenerateTests.Run() #endif diff --git a/tests/fsharp/core/controlChamenos/test.fsx b/tests/fsharp/core/controlChamenos/test.fsx index c4bc30f97a9..b95bfff4c80 100644 --- a/tests/fsharp/core/controlChamenos/test.fsx +++ b/tests/fsharp/core/controlChamenos/test.fsx @@ -27,7 +27,7 @@ let report_failure s = log (sprintf "FAILURE: %s failed" s) ) -#if !NETCOREAPP1_0 +#if !NETCOREAPP System.AppDomain.CurrentDomain.UnhandledException.AddHandler( fun _ (args:System.UnhandledExceptionEventArgs) -> lock syncObj (fun () -> diff --git a/tests/fsharp/core/controlMailbox/test.fsx b/tests/fsharp/core/controlMailbox/test.fsx index 61345f46db9..fc8a1cc7aea 100644 --- a/tests/fsharp/core/controlMailbox/test.fsx +++ b/tests/fsharp/core/controlMailbox/test.fsx @@ -6,7 +6,7 @@ module Core_controlMailBox #nowarn "40" // recursive references -#if NETCOREAPP1_0 +#if NETCOREAPP open System.Threading.Tasks #endif @@ -31,7 +31,7 @@ let report_failure s = log (sprintf "FAILURE: %s failed" s) ) -#if !NETCOREAPP1_0 +#if !NETCOREAPP System.AppDomain.CurrentDomain.UnhandledException.AddHandler( fun _ (args:System.UnhandledExceptionEventArgs) -> lock syncObj (fun () -> @@ -210,7 +210,7 @@ module MailboxProcessorBasicTests = while !received < n do if !received % 100 = 0 then printfn "received = %d" !received -#if NETCOREAPP1_0 +#if NETCOREAPP Task.Delay(1).Wait() #else System.Threading.Thread.Sleep(1) @@ -233,7 +233,7 @@ module MailboxProcessorBasicTests = | Some _ -> do incr received }) mb1.Start(); for i in 0 .. n-1 do -#if NETCOREAPP1_0 +#if NETCOREAPP Task.Delay(1).Wait(); #else System.Threading.Thread.Sleep(1) @@ -242,7 +242,7 @@ module MailboxProcessorBasicTests = while !received < n do if !received % 100 = 0 then printfn "main thread: received = %d" !received -#if NETCOREAPP1_0 +#if NETCOREAPP Task.Delay(1).Wait(); #else System.Threading.Thread.Sleep(1) @@ -275,7 +275,7 @@ module MailboxProcessorBasicTests = w.Start() while w.ElapsedMilliseconds < 1000L && (!timedOut).IsNone do mb.Post(-1) -#if NETCOREAPP1_0 +#if NETCOREAPP Task.Delay(1).Wait(); #else System.Threading.Thread.Sleep(1) @@ -298,7 +298,7 @@ module MailboxProcessorBasicTests = w.Start() while w.ElapsedMilliseconds < 100L do mb.Post(false) -#if NETCOREAPP1_0 +#if NETCOREAPP Task.Delay(0).Wait(); #else System.Threading.Thread.Sleep(0) @@ -318,7 +318,7 @@ module MailboxProcessorErrorEventTests = let res = ref 100 mb1.Error.Add(fun _ -> res := 0) mb1.Start(); -#if NETCOREAPP1_0 +#if NETCOREAPP Task.Delay(200).Wait(); #else System.Threading.Thread.Sleep(200) @@ -333,7 +333,7 @@ module MailboxProcessorErrorEventTests = let res = ref 0 mb1.Error.Add(fun _ -> res := 100) mb1.Start(); -#if NETCOREAPP1_0 +#if NETCOREAPP Task.Delay(200).Wait(); #else System.Threading.Thread.Sleep(200) @@ -351,7 +351,7 @@ module MailboxProcessorErrorEventTests = mb1.Error.Add(function Err n -> res := n | _ -> check "rwe90r - unexpected error" 0 1) mb1.Start(); mb1.Post 100 -#if NETCOREAPP1_0 +#if NETCOREAPP Task.Delay(200).Wait(); #else System.Threading.Thread.Sleep(200) @@ -473,7 +473,7 @@ let test7() = let timeoutboxes str = new MailboxProcessor<'b>(fun inbox -> async { for i in 1 .. 10 do -#if NETCOREAPP1_0 +#if NETCOREAPP Task.Delay(200).Wait() #else do System.Threading.Thread.Sleep 200 @@ -586,7 +586,7 @@ module LotsOfMessages = check "celrv09ervkn" (queueLength >= logger.CurrentQueueLength) true queueLength <- logger.CurrentQueueLength -#if NETCOREAPP1_0 +#if NETCOREAPP Task.Delay(10).Wait() #else System.Threading.Thread.Sleep(10) diff --git a/tests/fsharp/core/controlStackOverflow/test.fsx b/tests/fsharp/core/controlStackOverflow/test.fsx index 6bc557ef28d..735b09173c9 100644 --- a/tests/fsharp/core/controlStackOverflow/test.fsx +++ b/tests/fsharp/core/controlStackOverflow/test.fsx @@ -8,7 +8,7 @@ module Core_controlStackOverflow #nowarn "40" // recursive references -#if NETCOREAPP1_0 +#if NETCOREAPP open System.Threading.Tasks #endif @@ -36,7 +36,7 @@ let report_failure s = log (sprintf "FAILURE: %s failed" s) ) -#if !NETCOREAPP1_0 +#if !NETCOREAPP System.AppDomain.CurrentDomain.UnhandledException.AddHandler( fun _ (args:System.UnhandledExceptionEventArgs) -> lock syncObj (fun () -> @@ -231,7 +231,7 @@ module StackDiveTests = let quwiAsync x = Async.FromContinuations(fun (c,_,_) -> -#if NETCOREAPP1_0 +#if NETCOREAPP Task.Run( fun _ -> async { diff --git a/tests/fsharp/core/forexpression/test.fsx b/tests/fsharp/core/forexpression/test.fsx index 671d67f820d..6384d113693 100644 --- a/tests/fsharp/core/forexpression/test.fsx +++ b/tests/fsharp/core/forexpression/test.fsx @@ -109,7 +109,7 @@ let sumOverRange () = let sumOverString () = let mutable sum = 0 for i in testString do -#if NETCOREAPP1_0 +#if NETCOREAPP sum <- sum + ((int (i :?> char)) - (int '0')) #else sum <- sum + ((int i) - (int '0')) diff --git a/tests/fsharp/core/fsfromfsviacs/test.fsx b/tests/fsharp/core/fsfromfsviacs/test.fsx index 137b4df15af..76ec203112f 100644 --- a/tests/fsharp/core/fsfromfsviacs/test.fsx +++ b/tests/fsharp/core/fsfromfsviacs/test.fsx @@ -166,12 +166,10 @@ module TestExtensions = check "dfeweeon1" (System.DateTime.Now.ExtendCSharpTypeWithInRefReturnExtension()).Date x.Date check "dfeweeon2" (x.ExtendCSharpTypeWithInRefReturnExtension()).Date x.Date - check "dfeweeon3" (x.ExtendCSharpTypeWithRefReturnExtension()).Date x.Date - let mutable mx = x check "dfeweeon4" (mx.ExtendCSharpTypeWithOutRefExtension(); mx) x.Date - check "dfeweeon5" (x.ExtendCSharpTypeWithInRefExtension()) x.Year + check "dfeweeon5" (mx.ExtendCSharpTypeWithInRefExtension()) x.Year let ToFSharpFunc() = diff --git a/tests/fsharp/core/fsi-load/test.fsx b/tests/fsharp/core/fsi-load/test.fsx index ad2ef3bef5c..f81654365e7 100644 --- a/tests/fsharp/core/fsi-load/test.fsx +++ b/tests/fsharp/core/fsi-load/test.fsx @@ -11,6 +11,9 @@ module OtherModule = let foo () = [ for (k: KeyValuePair) in [] -> () ] + let testAnonRecordInFsi1 (x : {| X : int |}) = () + + let testAnonRecordInFsi2 () : {| X : int |} = failwith "ok" let _ = stdout.WriteLine "Test Passed" diff --git a/tests/fsharp/core/lazy/test.fsx b/tests/fsharp/core/lazy/test.fsx index d16340be2a0..7b2424252df 100644 --- a/tests/fsharp/core/lazy/test.fsx +++ b/tests/fsharp/core/lazy/test.fsx @@ -43,7 +43,7 @@ do test "fedeoin" (let x = 3 in Lazy.force (Lazy.force (lazy (lazy (x+x)))) = 6) do test "fedeoin" (let x = ref 3 in let y = lazy (x := !x + 1; 6) in ignore (Lazy.force y); ignore (Lazy.force y); !x = 4) do test "fedeoin" (let x = ref 3 in let y = lazy (x := !x + 1; "abc") in ignore (Lazy.force y); ignore (Lazy.force y); !x = 4) -#if !NETCOREAPP1_0 +#if !NETCOREAPP module Bug5770 = open System.Threading do diff --git a/tests/fsharp/core/letrec/test.fsx b/tests/fsharp/core/letrec/test.fsx index 2c07ef1edee..4c746116db1 100644 --- a/tests/fsharp/core/letrec/test.fsx +++ b/tests/fsharp/core/letrec/test.fsx @@ -127,7 +127,7 @@ let WouldFailAtRuntimeTest2 () = and a3 = (fun x -> a2 + 2) 1 in a2 + a3 -#if !TESTS_AS_APP && !NETCOREAPP1_0 +#if !TESTS_AS_APP && !NETCOREAPP open System open System.Windows.Forms @@ -303,7 +303,7 @@ module RecursiveInterfaceObjectExpressions = begin end -#if !TESTS_AS_APP && !NETCOREAPP1_0 +#if !TESTS_AS_APP && !NETCOREAPP module RecursiveInnerConstrainedGenerics = begin open System.Windows.Forms diff --git a/tests/fsharp/core/libtest/test.fsx b/tests/fsharp/core/libtest/test.fsx index f6c432f55dd..f76c479de5e 100644 --- a/tests/fsharp/core/libtest/test.fsx +++ b/tests/fsharp/core/libtest/test.fsx @@ -2227,7 +2227,7 @@ do check "generic format m" "-1y" (sprintf "%A" (-1y)) do check "generic format n" "-1s" (sprintf "%A" (-1s)) do check "generic format o" "-1" (sprintf "%A" (-1)) do check "generic format p" "-1L" (sprintf "%A" (-1L)) -#if !NETCOREAPP1_0 +#if !NETCOREAPP // See FSHARP1.0:4797 // On NetFx4.0 and above we do not emit the 'I' suffix let bigintsuffix = if (System.Environment.Version.Major, System.Environment.Version.Minor) > (2,0) then "" else "I" @@ -2716,7 +2716,7 @@ module SeqTestsOnEnumerableEnforcingDisposalAtEnd = begin do check "" numActiveEnumerators 0 do check "Seq.max" (Seq.max (countEnumeratorsAndCheckedDisposedAtMostOnce [1; 4; 2; 5; 8; 4; 0; 3])) 8 do check "" numActiveEnumerators 0 -#if !NETCOREAPP1_0 +#if !NETCOREAPP // strings don't have enumerators in portable do check "Seq.minBy" (Seq.minBy int (countEnumeratorsAndCheckedDisposedAtMostOnce "this is a test")) ' ' do check "" numActiveEnumerators 0 @@ -3694,7 +3694,7 @@ module MiscIEnumerableTests = begin open System.Net open System.IO -#if !NETCOREAPP1_0 +#if !NETCOREAPP /// generate the sequence of lines read off an internet connection let httpSeq (nm:string) = Seq.generate @@ -3866,7 +3866,7 @@ module FloatParseTests = begin do check "FloatParse.A" (to_bits (of_string "Infinity")) 0x7ff0000000000000L // 9218868437227405312L do check "FloatParse.B" (to_bits (of_string "-Infinity")) 0xfff0000000000000L // (-4503599627370496L) do check "FloatParse.C" (to_bits (of_string "NaN")) 0xfff8000000000000L // (-2251799813685248L) -#if !NETCOREAPP1_0 +#if !NETCOREAPP do check "FloatParse.D" (to_bits (of_string "-NaN")) ( // http://en.wikipedia.org/wiki/NaN let bit64 = System.IntPtr.Size = 8 in if bit64 && System.Environment.Version.Major < 4 then @@ -4078,9 +4078,6 @@ module SetTests = begin let unionTest n (nx,ny) = let check (xs:'a Set) = -#if DEBUG - test "vwnwer" (xs.CheckBalanceInvariant); -#endif xs in let xs = randomInts nx |> check in let ys = randomInts ny |> check in @@ -4271,7 +4268,7 @@ do check "clwnwe91" 10m 10m do check "clwnwe92" 10m 10.000m do check "clwnwe93" 1000000000m 1000000000m do check "clwnwe94" (4294967296000000000m.ToString()) "4294967296000000000" -#if !NETCOREAPP1_0 +#if !NETCOREAPP do check "clwnwe95" (10.000m.ToString(System.Globalization.CultureInfo.GetCultureInfo(1033).NumberFormat)) "10.000" // The actual output of a vanilla .ToString() depends on current culture UI. For this reason I am specifying the en-us culture. #endif do check "clwnwe96" (10m.ToString()) "10" @@ -4322,7 +4319,7 @@ do check "lkvcnwd09g" 2.0M (20.0M % 6.00M) do check "lkvcnwd09h" 20.0M (floor 20.300M) do check "lkvcnwd09j" 20.0 (floor 20.300) do check "lkvcnwd09k" 20.0f (floor 20.300f) -#if !NETCOREAPP1_0 +#if !NETCOREAPP do check "lkvcnwd09l" 20.0M (round 20.300M) do check "lkvcnwd09z" 20.0M (round 20.500M) do check "lkvcnwd09x" 22.0M (round 21.500M) @@ -5564,7 +5561,7 @@ module bug122495 = let c = C( P = a.[0..1]) -#if !NETCOREAPP1_0 +#if !NETCOREAPP (*--------------------------------------------------------------------------- !* Bug 33760: wrong codegen for params[] Action overload *--------------------------------------------------------------------------- *) diff --git a/tests/fsharp/core/longnames/test.fsx b/tests/fsharp/core/longnames/test.fsx index aa1579ef2b8..577dc547a6d 100644 --- a/tests/fsharp/core/longnames/test.fsx +++ b/tests/fsharp/core/longnames/test.fsx @@ -112,7 +112,7 @@ let v12 = let v13 = Microsoft.FSharp.Core.Some(1) -#if !NETCOREAPP1_0 +#if !NETCOREAPP (* check lid setting bug *) open System.Diagnostics @@ -615,6 +615,79 @@ module rec Ok15 = test "lkneecec09iew15" (not (typeof.FullName.Contains("AModule") )) +module rec Ok16 = + + type A<'a> = A of 'a + + module A = + type Dummy = A | B + + test "lkneecec09iew16" (not (typeof.FullName.Contains("AModule") )) + +module rec Ok17 = + + type A<'a> = A of 'a + type A = A of int + + module A = + type Dummy = A | B + + test "lkneecec09iew17" (typeof.FullName.Contains("AModule") ) + +module rec Ok18 = + + type A<[]'u> = A of int<'u> + + module A = + type Dummy = A | B + + test "lkneecec09iew18" (typeof.FullName.Contains("AModule") ) + +module rec Ok19 = + + type A<[]'u, 'a> = | A of int<'u> | B of 'a + + module A = + type Dummy = A | B + + test "lkneecec09iew19" (not (typeof.FullName.Contains("AModule") )) + +module rec Ok20 = + + type A<'a, []'u> = A of int<'u> | B of 'a + + module A = + type Dummy = A | B + + test "lkneecec09iew20" (not (typeof.FullName.Contains("AModule") )) + +module rec Ok21 = + + type A<'a, 'b> = A of 'a | B of 'b + + module A = + type Dummy = A | B + + test "lkneecec09iew21" (not (typeof.FullName.Contains("AModule") )) + +module rec Ok22 = + + module A = + type Dummy = A | B + + type A<'a> = A of 'a + + test "lkneecec09iew22" (not (typeof.FullName.Contains("AModule") )) + +module rec Ok23 = + + module A = + type Dummy = A | B + + type A = A of int + + test "lkneecec09iew23" (typeof.FullName.Contains("AModule") ) + #if TESTS_AS_APP let RUN() = !failures #else @@ -628,4 +701,3 @@ let aa = stdout.WriteLine "Test Failed" exit 1 #endif - diff --git a/tests/fsharp/core/math/numbers/test.fsx b/tests/fsharp/core/math/numbers/test.fsx index 3a198932cf3..dfdc2b005a3 100644 --- a/tests/fsharp/core/math/numbers/test.fsx +++ b/tests/fsharp/core/math/numbers/test.fsx @@ -3,7 +3,7 @@ module Core_math_numbers #endif -#if NETCOREAPP1_0 +#if NETCOREAPP open CoreClrUtilities #endif diff --git a/tests/fsharp/core/math/numbersVS2008/test.fsx b/tests/fsharp/core/math/numbersVS2008/test.fsx index b7e288616d2..ec3adaf70c8 100644 --- a/tests/fsharp/core/math/numbersVS2008/test.fsx +++ b/tests/fsharp/core/math/numbersVS2008/test.fsx @@ -248,7 +248,7 @@ let negative64s = (-4611686018427387905L , -4611686018427387904L , -4611686018427387903L); (999L , -9223372036854775808L , -9223372036854775807L); (* MinValue is -2^63 *) (999L , 999L , 999L)] -#if !NETCOREAPP1_0 +#if !NETCOREAPP // Regression 3481: ToInt32 let triple k n project = let x = k * BigInteger.Pow(2I,n) in project (x - 1I),project x,project (x + 1I) diff --git a/tests/fsharp/core/measures/test.fsx b/tests/fsharp/core/measures/test.fsx index 9425bb52cdc..f1dec887c09 100644 --- a/tests/fsharp/core/measures/test.fsx +++ b/tests/fsharp/core/measures/test.fsx @@ -123,7 +123,7 @@ module FLOAT = let x23p = sinh (4.4<_>) let x23r = tan (4.4<_>) let x23s = tanh (4.4<_>) -#if !NETCOREAPP1_0 +#if !NETCOREAPP let x23t = truncate (4.5<_>) #endif // check the types and values! @@ -313,7 +313,7 @@ module DECIMAL = let x1d : decimal = ceil 4.4M let x1h : decimal = floor 4.4M let x1l : decimal = pown 4.4M 3 -#if !NETCOREAPP1_0 +#if !NETCOREAPP let x1m : decimal = round 4.4M #endif let x1n : int = sign 4.4M @@ -516,7 +516,7 @@ module MembersTest = let f1 = (f :> System.IFormattable) let f2 = (f :> System.IComparable) let f3 = (f :> System.IEquatable>) -#if !NETCOREAPP1_0 +#if !NETCOREAPP let f4 = (f :> System.IConvertible) #endif @@ -549,7 +549,7 @@ module WrappedFloatTypeTest = static member Sin (c1:C<1>) = C<1>(sin c1.V) static member Sinh (c1:C<1>) = C<1>(sinh c1.V) static member Tanh (c1:C<1>) = C<1>(tan c1.V) -#if !NETCOREAPP1_0 +#if !NETCOREAPP static member Truncate (c1:C<1>) = C<1>(truncate c1.V) #endif static member Pow (c1:C<1>,c2:C<1>) = C<1>( c1.V ** c2.V) @@ -597,7 +597,7 @@ module WrappedFloatTypeTest = let c26 = sin (C<1>(0.5)) let c27 = sinh (C<1>(0.5)) let c28 = tanh (C<1>(0.5)) -#if !NETCOREAPP1_0 +#if !NETCOREAPP let c29 = truncate (C<1>(0.5)) #endif let c30 = C<1>(0.5) ** C<1>(2.0) diff --git a/tests/fsharp/core/members/absil.fsi b/tests/fsharp/core/members/absil.fsi index 02c730d0d86..40fb9a9cfbc 100644 --- a/tests/fsharp/core/members/absil.fsi +++ b/tests/fsharp/core/members/absil.fsi @@ -1271,7 +1271,7 @@ type modul = val manifest_of_mainmod: modul -> manifest val module_is_mainmod: modul -> bool -val assname_of_mainmod: modul -> AssemblyName +val assemblyName_of_mainmod: modul -> AssemblyName (* ==================================================================== * PART 2 @@ -1285,14 +1285,14 @@ val assname_of_mainmod: modul -> AssemblyName * Generate references to existing assemblies and modules * -------------------------------------------------------------------- *) -val mk_simple_assref: AssemblyName -> AssemblyRef +val mk_simple_assemblyRef: AssemblyName -> AssemblyRef val mk_simple_modref: ModuleName -> ModuleRef -val mk_simple_scoref_from_assname: AssemblyName -> ScopeRef -val mk_simple_scoref_from_assref: AssemblyRef -> ScopeRef +val mk_simple_scoref_from_assemblyName: AssemblyName -> ScopeRef +val mk_simple_scoref_from_assemblyRef: AssemblyRef -> ScopeRef -val assref_for_manifest: manifest -> AssemblyRef -val assref_for_mainmod: modul -> AssemblyRef +val assemblyRef_for_manifest: manifest -> AssemblyRef +val assemblyRef_for_mainmod: modul -> AssemblyRef (* -------------------------------------------------------------------- * Take apart MethodSpecs diff --git a/tests/fsharp/core/members/basics-hw-mutrec/test.fs b/tests/fsharp/core/members/basics-hw-mutrec/test.fs index c3421cee247..2faf94b7ba4 100644 --- a/tests/fsharp/core/members/basics-hw-mutrec/test.fs +++ b/tests/fsharp/core/members/basics-hw-mutrec/test.fs @@ -1,4 +1,4 @@ -// #Regression #Conformance #SignatureFiles #Classes #ObjectConstructors #ObjectOrientedTypes #Fields #MemberDefinitions #MethodsAndProperties #Unions #InterfacesAndImplementations #Events #Overloading #Recursion #Regression + // #Regression #Conformance #SignatureFiles #Classes #ObjectConstructors #ObjectOrientedTypes #Fields #MemberDefinitions #MethodsAndProperties #Unions #InterfacesAndImplementations #Events #Overloading #Recursion #Regression diff --git a/tests/fsharp/core/members/basics-hw/test.fsx b/tests/fsharp/core/members/basics-hw/test.fsx index 3bb6859f0d1..58420e78210 100644 --- a/tests/fsharp/core/members/basics-hw/test.fsx +++ b/tests/fsharp/core/members/basics-hw/test.fsx @@ -58,7 +58,7 @@ test "fweoew093" ((f(1)).b = 2) open System open System.Collections -#if !NETCOREAPP1_0 +#if !NETCOREAPP open System.Windows.Forms #endif @@ -66,7 +66,7 @@ open System.Windows.Forms // Some simple object-expression tests let x0 = { new System.Object() with member __.GetHashCode() = 3 } -#if !NETCOREAPP1_0 +#if !NETCOREAPP let x1 = { new System.Windows.Forms.Form() with member __.GetHashCode() = 3 } #endif @@ -981,7 +981,7 @@ let [] button () = 1 // Test we can use base calls -#if !NETCOREAPP1_0 +#if !NETCOREAPP open System.Windows.Forms type MyCanvas2 = @@ -1781,14 +1781,14 @@ module DefaultConstructorConstraints = begin let x1 = (f1() : obj) let x2 = (f1() : int) let x3 = (f1() : DateTime) -#if !NETCOREAPP1_0 +#if !NETCOREAPP let x4 = (f1() : System.Windows.Forms.Form) #endif let f2 () = f1() let y1 = (f2() : obj) let y2 = (f2() : int) let y3 = (f2() : DateTime) -#if !NETCOREAPP1_0 +#if !NETCOREAPP let y4 = (f2() : System.Windows.Forms.Form) #endif @@ -2031,7 +2031,7 @@ module T1 = Vector2D(1.0,1.0) = Vector2D(1.0,1.0) -#if !NETCOREAPP1_0 +#if !NETCOREAPP module Ex5 = open System.Drawing type Label(?text,?font) = diff --git a/tests/fsharp/core/members/incremental-hw/test.fsx b/tests/fsharp/core/members/incremental-hw/test.fsx index 8454fd186a7..5090b112779 100644 --- a/tests/fsharp/core/members/incremental-hw/test.fsx +++ b/tests/fsharp/core/members/incremental-hw/test.fsx @@ -227,7 +227,7 @@ module WireVariations = //! Area variations -#if !NETCOREAPP1_0 +#if !NETCOREAPP module AreaVariations = (* Accepted *) open System.Drawing @@ -404,7 +404,7 @@ module ScalaPersonExample = //! Forms -#if !NETCOREAPP1_0 +#if !NETCOREAPP module Forms1 = open System.Drawing open System.Windows.Forms diff --git a/tests/fsharp/core/members/incremental/test.fsx b/tests/fsharp/core/members/incremental/test.fsx index 03076c34232..473b485ce2d 100644 --- a/tests/fsharp/core/members/incremental/test.fsx +++ b/tests/fsharp/core/members/incremental/test.fsx @@ -225,7 +225,7 @@ end //! Area variations -#if !MONO && !NETCOREAPP1_0 +#if !MONO && !NETCOREAPP module AreaVariations = begin (* Accepted *) open System.Drawing @@ -402,7 +402,7 @@ end //! Forms -#if !MONO && !NETCOREAPP1_0 +#if !MONO && !NETCOREAPP module Forms1 = begin open System.Drawing open System.Windows.Forms diff --git a/tests/fsharp/core/patterns/test.fsx b/tests/fsharp/core/patterns/test.fsx index 4b72133ee02..ba88f07d7b2 100644 --- a/tests/fsharp/core/patterns/test.fsx +++ b/tests/fsharp/core/patterns/test.fsx @@ -685,7 +685,7 @@ module Combinator_Examples = begin end -#if !NETCOREAPP1_0 +#if !NETCOREAPP module XmlPattern_Examples = begin @@ -813,7 +813,7 @@ module RandomTEst = type IEvenCooler = inherit ICool -#if !NETCOREAPP1_0 +#if !NETCOREAPP module RandomCodeFragment = open System diff --git a/tests/fsharp/core/printing/testLoadFile2.fsx b/tests/fsharp/core/printing/testLoadFile2.fsx index f4b3ba260f4..ab00483c814 100644 --- a/tests/fsharp/core/printing/testLoadFile2.fsx +++ b/tests/fsharp/core/printing/testLoadFile2.fsx @@ -1,4 +1,4 @@ -#if NETCOREAPP1_0 +#if NETCOREAPP open CoreClrUtilities #endif diff --git a/tests/fsharp/core/queriesLeafExpressionConvert/test.fsx b/tests/fsharp/core/queriesLeafExpressionConvert/test.fsx index 166d5255db3..4e4d1b9f6e3 100644 --- a/tests/fsharp/core/queriesLeafExpressionConvert/test.fsx +++ b/tests/fsharp/core/queriesLeafExpressionConvert/test.fsx @@ -565,7 +565,7 @@ module LeafExpressionEvaluationTests = checkEval "vrewoinrv09c" (<@ ceil 2.0 @>) (ceil 2.0) checkEval "vrewoinrv09v" (<@ sqrt 2.0 @>) (sqrt 2.0) checkEval "vrewoinrv09b" (<@ sign 2.0 @>) (sign 2.0) -#if !NETCOREAPP1_0 +#if !NETCOREAPP checkEval "vrewoinrv09n" (<@ truncate 2.3 @>) (truncate 2.3) #endif checkEval "vrewoinrv09m" (<@ floor 2.3 @>) (floor 2.3) @@ -585,7 +585,7 @@ module LeafExpressionEvaluationTests = checkEval "vrewoinrv09D" (<@ ceil 2.0f @>) (ceil 2.0f) checkEval "vrewoinrv09F" (<@ sqrt 2.0f @>) (sqrt 2.0f) checkEval "vrewoinrv09G" (<@ sign 2.0f @>) (sign 2.0f) -#if !NETCOREAPP1_0 +#if !NETCOREAPP checkEval "vrewoinrv09H" (<@ truncate 2.3f @>) (truncate 2.3f) #endif checkEval "vrewoinrv09J" (<@ floor 2.3f @>) (floor 2.3f) @@ -597,7 +597,7 @@ module LeafExpressionEvaluationTests = checkEval "vrewoinrv09V" (<@ ceil 2.0M @>) (ceil 2.0M) checkEval "vrewoinrv09B" (<@ sign 2.0M @>) (sign 2.0M) -#if !NETCOREAPP1_0 +#if !NETCOREAPP checkEval "vrewoinrv09N" (<@ truncate 2.3M @>) (truncate 2.3M) #endif checkEval "vrewoinrv09M" (<@ floor 2.3M @>) (floor 2.3M) @@ -617,7 +617,7 @@ module LeafExpressionEvaluationTests = checkEval "vrewoinrv09SS" (<@ [ 0UL .. 10UL ] @>) [ 0UL .. 10UL ] //Comment this testcase under portable due to bug 500323:[FSharp] portable library can't run "round" function -#if !NETCOREAPP1_0 +#if !NETCOREAPP // Round dynamic dispatch on Decimal checkEval "vrewoinrv09FF" (<@ round 2.3M @>) (round 2.3M) #endif diff --git a/tests/fsharp/core/queriesOverIQueryable/test.fsx b/tests/fsharp/core/queriesOverIQueryable/test.fsx index 245c32bb463..472dac742f6 100644 --- a/tests/fsharp/core/queriesOverIQueryable/test.fsx +++ b/tests/fsharp/core/queriesOverIQueryable/test.fsx @@ -142,19 +142,29 @@ module QueryExecutionOverIQueryable = (query { let q = query { for i in db -> i.Name } in for v in q do yield v } ) "db.Select(_arg1 => _arg1.Name).Select(_arg2 => _arg2)" + open FSharp.Reflection + + let t = typeof< {| Name1: string; Name2: string |} > + check "wkcwe09" (FSharpType.IsRecord t) true + check "wkcwe09" (FSharpType.GetRecordFields t |> Array.forall (fun f -> f.CanWrite)) false + +// checkLinqQueryText "ltcjhnwec6" +// (query { for i in db -> {| Name1 = i.Name; Name2 = i.Name |} } ) +// "db.Select(_arg1 => _arg1.Name).Select(_arg2 => _arg2)" +// "System.Linq.Enumerable+WhereSelectEnumerableIterator`2[Microsoft.FSharp.Linq.RuntimeHelpers.AnonymousObject`2[System.String,System.String],<>f__AnonymousType3691853213`2'[System.String,System.String]].Select(_arg2 => _arg2)" + checkCommuteSeq "cnewnc03nested" (query { let q = query { for i in db -> i.Name } in for v in q do yield v } ) (seq { for i in db -> i.Name }) - //type R = { A : int; B : int } - //let db2 = [ { A = 1; B = 2 } ] - //let results = query { for (i: MutTup) in db2 -> (i,i) } - - //System.Linq.Queryable.GroupBy( checkCommuteSeq "cnewnc06y" (query { for i in db do for j in db do yield (i.Name,j.Name) }) (seq { for i in db do for j in db do yield (i.Name,j.Name) }) + checkCommuteSeq "cnewnc06y" + (query { for i in db do for j in db do yield {| Name1 = i.Name; Name2 = j.Name |} }) + (seq { for i in db do for j in db do yield {| Name1 = i.Name; Name2 = j.Name |} }) + checkCommuteSeq "cnewnc06ynested" (query { let q = query { for i in db do for j in db do yield (i.Name,j.Name) } in for v in q do yield v }) (seq { for i in db do for j in db do yield (i.Name,j.Name) }) @@ -286,44 +296,10 @@ module QueryExecutionOverIQueryable = take 2 }) ["Don"; "Peter"] - (* - checkCommuteSeq "cnewnc06ya3b" - (query { for i in db do - yield i.Name - distinct } |> Seq.toList) - ["Don"; "Peter"; "Freddy"; "Freddi"] - *) - -#if ZIP - checkCommuteSeq "cnewnc06ya3c" - (query { for i in [1;2;3;4] do - zip [4;3;2;1] into j - yield (i,j) } |> Seq.toList) - [(1, 4); (2, 3); (3, 2); (4, 1)] - - checkCommuteSeq "cnewnc06y43" - (query { for i in [1;2;3;4] do - zip [4;3;2;1;0] into j - yield (i,j) } |> Seq.toList) - [(1, 4); (2, 3); (3, 2); (4, 1)] - - checkCommuteSeq "cnewnc06y43b" - (query { for i in [1;2;3;4] do - zip [4;3;2] into j - yield (i,j) } |> Seq.toList) - [(1, 4); (2, 3); (3, 2)] - - checkCommuteSeq "cnewnc06y43c" - (query { for i in db do - zip db into j - yield (i.Name,j.Name.Length) } |> Seq.toList) - [("Don", 3); ("Peter", 5); ("Freddy", 6); ("Freddi", 6); ("Don", 3)] - -#endif - checkLinqQueryText "ltcjhnwecd" (query { for i in db do where true; take 3 }) "db.Where(i => True).Take(3)" + checkCommuteSeq "cnewnc06yb" (query { for i in db do groupBy i.Name } |> Seq.map (fun g -> (g.Key,Seq.toList g)) |> System.Linq.Queryable.AsQueryable) (seq { for i in db do yield i } |> Seq.groupBy (fun i -> i.Name) |> Seq.map (fun (key,g) -> (key, Seq.toList g))) @@ -894,8 +870,6 @@ module QueryExecutionOverIQueryable = (query { for i in db do groupValBy i i.Name }) "db.GroupBy(i => i.Name, i => i)" - - checkLinqQueryText "ltcnewnc06yb2x" (query { for i in db do for j in db do groupValBy j i.Name }) "db.SelectMany(_arg1 => db, (_arg1, _arg2) => new AnonymousObject`2(Item1 = _arg1, Item2 = _arg2)).GroupBy(tupledArg => tupledArg.Item1.Name, tupledArg => tupledArg.Item2)" @@ -980,9 +954,6 @@ module QueryExecutionOverIQueryable = yield (i.Cost + j.Cost) }) "db.Join(db, i => i.Quantity, j => j.Quantity, (i, j) => new AnonymousObject`2(Item1 = i, Item2 = j)).Select(_arg1 => (_arg1.Item1.Cost + _arg1.Item2.Cost))" - - - checkLinqQueryText "ltcnewnc06yh9Q5" (query { for i in db do groupJoin j in db on (i.Name = j.Name) into group @@ -996,8 +967,6 @@ module QueryExecutionOverIQueryable = yield group } ) "db.Select(_arg1 => new AnonymousObject`2(Item1 = _arg1, Item2 = _arg1.Name)).GroupJoin(db, tupledArg => tupledArg.Item2, j => j.Name, (tupledArg, group) => new AnonymousObject`3(Item1 = tupledArg.Item1, Item2 = tupledArg.Item2, Item3 = group)).Select(_arg2 => _arg2.Item3)" - - checkLinqQueryText "ltcnewnc06yh9Q6" (query { for i in db do groupJoin j in db on (i.Quantity ?= j.Quantity.GetValueOrDefault()) into group @@ -1027,8 +996,6 @@ module QueryExecutionOverIQueryable = yield group } ) "db.Select(_arg1 => new AnonymousObject`2(Item1 = _arg1, Item2 = _arg1.Name)).GroupJoin(db, tupledArg => tupledArg.Item2, j => j.Name, (tupledArg, group) => new AnonymousObject`3(Item1 = tupledArg.Item1, Item2 = tupledArg.Item2, Item3 = group.DefaultIfEmpty())).Select(_arg2 => _arg2.Item3)" - - check "cnewnc06yh9Q5" (query { for i in db do groupJoin j in db on (i.Name = j.Name) into group @@ -1052,10 +1019,6 @@ module QueryExecutionOverIQueryable = (query { for i in db do groupJoin j in db on (i.Quantity ?=? j.Quantity) into group; yield group |> Seq.map (fun x -> x.Name) |> Seq.toList } |> Seq.toList) [[]; ["Peter"]; []; ["Freddi"]; []] - - - - check "cnewnc06yh9Q5left1" (query { for i in db do leftOuterJoin j in db on (i.Name = j.Name) into group @@ -1068,9 +1031,6 @@ module QueryExecutionOverIQueryable = yield (i, group |> Seq.toList) } |> Seq.toList) [("1", ["1";"12"]); ("2", [null]) ] - - - // Smoke test for returning a tuple checkCommuteSeq "smcnewnc01a" (query { yield (1,1) } ) @@ -1162,8 +1122,6 @@ module QueryExecutionOverIQueryable = (query { for x in db do yield (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16) }) (seq { for x in db do yield (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16) }) - - // Smoke test for returning a tuple, nested for loops checkCommuteSeq "smcnewnc01xx" (query { for x in db do for y in db do yield (1,1) }) @@ -1194,12 +1152,10 @@ module QueryExecutionOverIQueryable = (query { for x in db do for y in db do yield (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16) }) (seq { for x in db do for y in db do yield (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16) }) - type R1 = { V1 : int } type R7 = { V1 : int; V2 : int; V3 : int; V4 : int; V5 : int; V6 : int; V7 : int } type R8 = { V1 : int; V2 : int; V3 : int; V4 : int; V5 : int; V6 : int; V7 : int; V8 : int } - // Smoke test for returning an immutable record object, size = 1 checkCommuteSeq "rsmcnewnc01" (query { yield { R1.V1=1 } } |> Seq.map (fun r -> r.V1) |> System.Linq.Queryable.AsQueryable) @@ -1262,7 +1218,6 @@ module QueryExecutionOverIQueryable = (query { yield { MR8.V1=1; MR8.V2=2; MR8.V3=3; MR8.V4=4; MR8.V5=5; MR8.V6=6; MR8.V7=7; MR8.V8=8 } } |> qmap (fun r -> r.V1, r.V2)) [1,2;] - // Smoke test for returning a mutable record object, size = 1 checkCommuteSeq "mrsmcnewnc01x" (query { for x in db do yield { MR1.V1=1 } } |> qmap (fun r -> r.V1)) @@ -1289,6 +1244,37 @@ module QueryExecutionOverIQueryable = (seq { for x in db do yield { MR8.V1=1; MR8.V2=2; MR8.V3=3; MR8.V4=4; MR8.V5=5; MR8.V6=6; MR8.V7=7; MR8.V8=8 } } |> Seq.map (fun r -> r.V1, r.V2)) + // Smoke test for returning an immutable anonymous record object, size = 1 + checkCommuteSeq "rsmcnewnc01" + (query { yield {| V1=1 |} } |> Seq.map (fun r -> r.V1) |> System.Linq.Queryable.AsQueryable) + [1;] + + // Smoke test for returning an immutable anonymous record object, size = 7 + checkCommuteSeq "rsmcnewnc07" + (query { yield {| V1=1; V2=2; V3=3; V4=4; V5=5; V6=6; V7=7 |} } |> qmap (fun r -> r.V1, r.V2) |> System.Linq.Queryable.AsQueryable) + [1,2;] + + // Smoke test for returning an immutable anonymous record object, size = 8 + checkCommuteSeq "rsmcnewnc08" + (query { yield {| V1=1; V2=2; V3=3; V4=4; V5=5; V6=6; V7=7; V8=8 |} } |> qmap (fun r -> r.V1, r.V2) |> System.Linq.Queryable.AsQueryable) + [1,2;] + + + // Smoke test for returning an immutable anonymous record object, size = 1 + checkCommuteSeq "rsmcnewnc01x" + (query { for x in db do yield {| V1=1 |} } |> qmap (fun r -> r.V1)) + (seq { for x in db do yield {| V1=1 |} } |> Seq.map (fun r -> r.V1)) + + // Smoke test for returning an immutable anonymous record object, size = 7 + checkCommuteSeq "rsmcnewnc07x" + (query { for x in db do yield {| V1=1; V2=2; V3=3; V4=4; V5=5; V6=6; V7=7 |} } |> qmap (fun r -> r.V1, r.V2) |> System.Linq.Queryable.AsQueryable) + (seq { for x in db do yield {| V1=1; V2=2; V3=3; V4=4; V5=5; V6=6; V7=7 |} } |> Seq.map (fun r -> r.V1, r.V2)) + + // Smoke test for returning an immutable anonymous record object, size = 8 + checkCommuteSeq "rsmcnewnc08x" + (query { for x in db do yield {| V1=1; V2=2; V3=3; V4=4; V5=5; V6=6; V7=7; V8=8 |} } |> qmap (fun r -> r.V1, r.V2)) + (seq { for x in db do yield {| V1=1; V2=2; V3=3; V4=4; V5=5; V6=6; V7=7; V8=8 |} } |> Seq.map (fun r -> r.V1, r.V2)) + // Smoke test for returning an object using property-set notation for member init, size = 8 type C1() = let mutable v1 = 0 @@ -1302,8 +1288,6 @@ module QueryExecutionOverIQueryable = (query { for x in db do yield C1(V1=1) } |> qmap (fun r -> r.V1)) (seq { for x in db do yield C1(V1=1) } |> Seq.map (fun r -> r.V1)) - //<@ C1(V1=1) @> - // Smoke test for returning an object using property-set notation for member init type C2() = let mutable v1 = 0 @@ -1351,8 +1335,6 @@ module QueryExecutionOverIQueryable = (query { for i in db -> (i, i) }) (seq { for i in db -> (i,i) }) - - checkCommuteSeq "smcnewnc022df1" (query { for p in db do groupBy p.Name into g @@ -1367,9 +1349,6 @@ module QueryExecutionOverIQueryable = select (g.Key, s) }) [("Don", 0s); ("Peter", 10s); ("Freddy", 0s); ("Freddi", 32s)] - - - module QueryExecutionOverIQueryableWhereDataIsRecord = open System open Microsoft.FSharp.Linq @@ -1390,7 +1369,6 @@ module QueryExecutionOverIQueryableWhereDataIsRecord = let dbEmpty = System.Linq.Queryable.AsQueryable([] |> List.toSeq) let dbOne = System.Linq.Queryable.AsQueryable([1] |> List.toSeq) - checkCommuteSeq "rrcnewnc01" (query { yield! db }) db diff --git a/tests/fsharp/core/quotes/test.fsx b/tests/fsharp/core/quotes/test.fsx index 52ef066ea7e..289988569de 100644 --- a/tests/fsharp/core/quotes/test.fsx +++ b/tests/fsharp/core/quotes/test.fsx @@ -4,7 +4,7 @@ module Core_quotes #endif #light -#if !TESTS_AS_APP && !NETCOREAPP1_0 +#if !TESTS_AS_APP && !NETCOREAPP #r "cslib.dll" #endif @@ -352,7 +352,7 @@ module TypedTest = begin test "check PropertyGet (static)" ((<@ System.DateTime.Now @> |> (function PropertyGet(None,_,[]) -> true | _ -> false))) test "check PropertyGet (instance)" ((<@ ("1").Length @> |> (function PropertyGet(Some(String("1")),_,[]) -> true | _ -> false))) -#if !NETCOREAPP1_0 +#if !NETCOREAPP test "check PropertySet (static)" ((<@ System.Environment.ExitCode <- 1 @> |> (function PropertySet(None,_,[],Int32(1)) -> true | _ -> false))) #endif test "check PropertySet (instance)" ((<@ ("1").Length @> |> (function PropertyGet(Some(String("1")),_,[]) -> true | _ -> false))) @@ -543,7 +543,7 @@ module TypedTest = begin | _ -> false end -#if !FSHARP_CORE_31 && !TESTS_AS_APP && !NETCOREAPP1_0 +#if !FSHARP_CORE_31 && !TESTS_AS_APP && !NETCOREAPP test "check accesses to readonly fields in ReflectedDefinitions" begin let c1 = Class1("a") @@ -1681,7 +1681,7 @@ module QuotationConstructionTests = check "vcknwwe066" (try let _ = Expr.PropertyGet(getof <@@ System.DateTime.Now @@>,[ <@@ 1 @@> ]) in false with :? ArgumentException -> true) true check "vcknwwe077" (Expr.PropertyGet(<@@ "3" @@>, getof <@@ "1".Length @@>)) <@@ "3".Length @@> check "vcknwwe088" (Expr.PropertyGet(<@@ "3" @@>, getof <@@ "1".Length @@>,[ ])) <@@ "3".Length @@> -#if !TESTS_AS_APP && !NETCOREAPP1_0 +#if !TESTS_AS_APP && !NETCOREAPP check "vcknwwe099" (Expr.PropertySet(<@@ (new System.Windows.Forms.Form()) @@>, setof <@@ (new System.Windows.Forms.Form()).Text <- "2" @@>, <@@ "3" @@> )) <@@ (new System.Windows.Forms.Form()).Text <- "3" @@> #endif check "vcknwwe099" (Expr.PropertySet(<@@ (new Foo()) @@>, setof <@@ (new Foo()).[3] <- 1 @@>, <@@ 2 @@> , [ <@@ 3 @@> ] )) <@@ (new Foo()).[3] <- 2 @@> @@ -2303,7 +2303,7 @@ module ReflectedDefinitionOnTypesWithImplicitCodeGen = module M = // This type has an implicit IComparable implementation, it is not accessible as a reflected definition type R = { x:int; y:string; z:System.DateTime } -#if NETCOREAPP1_0 +#if NETCOREAPP for m in typeof.GetMethods() do #else for m in typeof.GetMethods(System.Reflection.BindingFlags.DeclaredOnly) do @@ -2337,7 +2337,7 @@ module ReflectedDefinitionOnTypesWithImplicitCodeGen = #endif check "celnwer35" (Quotations.Expr.TryGetReflectedDefinition(m).IsNone) true -#if !NETCOREAPP1_0 +#if !NETCOREAPP module BasicUsingTEsts = let q1() = let a = ResizeArray<_>() diff --git a/tests/fsharp/core/reflect/test2.fs b/tests/fsharp/core/reflect/test2.fs index 9faf3bf07ca..5b4a58e5b8e 100644 --- a/tests/fsharp/core/reflect/test2.fs +++ b/tests/fsharp/core/reflect/test2.fs @@ -30,7 +30,7 @@ module NewTests = let (|String|_|) (v:obj) = match v with :? string as s -> Some(s) | _ -> None let (|Int|_|) (v:obj) = match v with :? int as s -> Some(s) | _ -> None let showAll = -#if NETCOREAPP1_0 +#if NETCOREAPP true #else System.Reflection.BindingFlags.Public ||| System.Reflection.BindingFlags.NonPublic diff --git a/tests/fsharp/core/resources/test.fs b/tests/fsharp/core/resources/test.fs index b41d71d67db..cb0991b961e 100644 --- a/tests/fsharp/core/resources/test.fs +++ b/tests/fsharp/core/resources/test.fs @@ -13,8 +13,8 @@ let foreachE (e : System.Collections.IEnumerator) (f : 'a -> unit) = let main() = - let ass = (typeof).Assembly in - Printf.printf "ass = %s\n" (ass.ToString()); + let assembly = (typeof).Assembly in + Printf.printf "assembly = %s\n" (assembly.ToString()); let args = System.Environment.GetCommandLineArgs() in let rname = if Array.length args > 1 then args.[1] else "Resources" in let resourceMan = new System.Resources.ResourceManager(rname, (typeof).Assembly) in diff --git a/tests/fsharp/core/span/.gitignore b/tests/fsharp/core/span/.gitignore new file mode 100644 index 00000000000..c7256c83585 --- /dev/null +++ b/tests/fsharp/core/span/.gitignore @@ -0,0 +1 @@ +*.generated.fsx diff --git a/tests/fsharp/core/span/common-pre.fsx b/tests/fsharp/core/span/common-pre.fsx new file mode 100644 index 00000000000..50c063af871 --- /dev/null +++ b/tests/fsharp/core/span/common-pre.fsx @@ -0,0 +1,4 @@ +open System +open System.IO + +File.WriteAllText("refs.generated.fsx", sprintf @"#r @""%s\.nuget\packages\System.Memory\4.5.0\lib\netstandard2.0\System.Memory.dll""" (Environment.GetEnvironmentVariable("USERPROFILE"))) diff --git a/tests/fsharp/core/span/test-pre.fsx b/tests/fsharp/core/span/test-pre.fsx new file mode 100644 index 00000000000..9db0f8cc9a7 --- /dev/null +++ b/tests/fsharp/core/span/test-pre.fsx @@ -0,0 +1 @@ +#load "common-pre.fsx" diff --git a/tests/fsharp/core/span/test.bsl b/tests/fsharp/core/span/test.bsl index 6b25d0d6af0..e57ec0e3662 100644 --- a/tests/fsharp/core/span/test.bsl +++ b/tests/fsharp/core/span/test.bsl @@ -1,16 +1,16 @@ -test.fsx(303,46,303,86): typecheck error FS3234: The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. +test.fsx(302,46,302,86): typecheck error FS3233: The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. -test.fsx(306,13,306,86): typecheck error FS3230: This value can't be assigned because the target 'param1' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. +test.fsx(305,13,305,86): typecheck error FS3229: This value can't be assigned because the target 'param1' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. -test.fsx(309,13,309,62): typecheck error FS3230: This value can't be assigned because the target 'param1' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. +test.fsx(308,13,308,62): typecheck error FS3229: This value can't be assigned because the target 'param1' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. -test.fsx(348,13,348,57): typecheck error FS3230: This value can't be assigned because the target 'addr' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. +test.fsx(347,13,347,57): typecheck error FS3229: This value can't be assigned because the target 'addr' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. -test.fsx(351,13,351,38): typecheck error FS3230: This value can't be assigned because the target 'param1' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. +test.fsx(350,13,350,38): typecheck error FS3229: This value can't be assigned because the target 'param1' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. -test.fsx(354,14,354,29): typecheck error FS3209: The address of the variable 'stackReferring3' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. +test.fsx(353,14,353,29): typecheck error FS3209: The address of the variable 'stackReferring3' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. -test.fsx(376,18,376,19): typecheck error FS3209: The address of the variable 'x' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. +test.fsx(375,18,375,19): typecheck error FS3209: The address of the variable 'x' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. -test.fsx(380,18,380,33): typecheck error FS3228: The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. +test.fsx(379,18,379,33): typecheck error FS3228: The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. diff --git a/tests/fsharp/core/span/test.fsx b/tests/fsharp/core/span/test.fsx index 81ac6b3c7a3..34d0da9775a 100644 --- a/tests/fsharp/core/span/test.fsx +++ b/tests/fsharp/core/span/test.fsx @@ -1,5 +1,4 @@ -#r @"..\..\..\..\packages\System.Memory.4.5.0-rc1\lib\netstandard2.0\System.Memory.dll" -#r @"..\..\..\..\packages\NETStandard.Library.NETFramework.2.0.0-preview2-25405-01\build\net461\ref\netstandard.dll" +#load "refs.generated.fsx" #nowarn "9" #nowarn "51" diff --git a/tests/fsharp/core/span/test2-pre.fsx b/tests/fsharp/core/span/test2-pre.fsx new file mode 100644 index 00000000000..9db0f8cc9a7 --- /dev/null +++ b/tests/fsharp/core/span/test2-pre.fsx @@ -0,0 +1 @@ +#load "common-pre.fsx" diff --git a/tests/fsharp/core/span/test2.bsl b/tests/fsharp/core/span/test2.bsl index 49551f4fd39..314062df20f 100644 --- a/tests/fsharp/core/span/test2.bsl +++ b/tests/fsharp/core/span/test2.bsl @@ -1,78 +1,88 @@ -test2.fsx(79,21,79,35): typecheck error FS0406: The byref-typed variable 'test' is used in an invalid way. Byrefs cannot be captured by closures or passed to inner functions. +test2.fsx(78,17,78,18): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. -test2.fsx(79,21,79,35): typecheck error FS0406: The byref-typed variable 'test' is used in an invalid way. Byrefs cannot be captured by closures or passed to inner functions. +test2.fsx(78,21,78,35): typecheck error FS0406: The byref-typed variable 'test' is used in an invalid way. Byrefs cannot be captured by closures or passed to inner functions. -test2.fsx(79,31,79,35): typecheck error FS0418: The byref typed value 'test' cannot be used at this point +test2.fsx(78,21,78,35): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. -test2.fsx(79,21,79,35): typecheck error FS0425: The type of a first-class function cannot contain byrefs +test2.fsx(78,21,78,35): typecheck error FS0406: The byref-typed variable 'test' is used in an invalid way. Byrefs cannot be captured by closures or passed to inner functions. -test2.fsx(79,21,79,35): typecheck error FS0425: The type of a first-class function cannot contain byrefs +test2.fsx(78,31,78,35): typecheck error FS0418: The byref typed value 'test' cannot be used at this point -test2.fsx(84,14,84,15): typecheck error FS3209: The address of the variable 'x' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. +test2.fsx(78,21,78,35): typecheck error FS0425: The type of a first-class function cannot contain byrefs -test2.fsx(91,14,91,15): typecheck error FS3209: The address of the variable 'y' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. +test2.fsx(78,21,78,35): typecheck error FS0425: The type of a first-class function cannot contain byrefs -test2.fsx(100,14,100,15): typecheck error FS3209: The address of the variable 'y' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. +test2.fsx(83,14,83,15): typecheck error FS3209: The address of the variable 'x' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. -test2.fsx(106,14,106,15): typecheck error FS3209: The address of the variable 'y' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. +test2.fsx(90,14,90,15): typecheck error FS3209: The address of the variable 'y' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. -test2.fsx(111,14,111,15): typecheck error FS3209: The address of the variable 'y' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. +test2.fsx(99,14,99,15): typecheck error FS3209: The address of the variable 'y' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. -test2.fsx(115,14,115,30): typecheck error FS3228: The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. +test2.fsx(105,14,105,15): typecheck error FS3209: The address of the variable 'y' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. -test2.fsx(119,14,119,37): typecheck error FS3228: The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. +test2.fsx(110,14,110,15): typecheck error FS3209: The address of the variable 'y' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. -test2.fsx(124,14,124,15): typecheck error FS3209: The address of the variable 'y' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. +test2.fsx(114,14,114,30): typecheck error FS3228: The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. -test2.fsx(128,13,128,42): typecheck error FS3236: A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. +test2.fsx(118,14,118,37): typecheck error FS3228: The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. -test2.fsx(132,14,132,41): typecheck error FS3228: The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. +test2.fsx(123,14,123,15): typecheck error FS3209: The address of the variable 'y' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. -test2.fsx(136,14,136,71): typecheck error FS3228: The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. +test2.fsx(127,13,127,42): typecheck error FS3235: A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. -test2.fsx(140,13,140,52): typecheck error FS3236: A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. +test2.fsx(131,14,131,41): typecheck error FS3228: The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. -test2.fsx(144,13,144,14): typecheck error FS3235: The Span or IsByRefLike variable 's' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. +test2.fsx(135,14,135,71): typecheck error FS3228: The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. -test2.fsx(149,13,149,52): typecheck error FS3236: A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. +test2.fsx(139,13,139,52): typecheck error FS3235: A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. -test2.fsx(153,21,153,84): typecheck error FS3234: The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. +test2.fsx(143,13,143,14): typecheck error FS3234: The Span or IsByRefLike variable 's' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. -test2.fsx(154,13,154,14): typecheck error FS3235: The Span or IsByRefLike variable 'y' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. +test2.fsx(148,13,148,52): typecheck error FS3235: A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. -test2.fsx(158,13,158,83): typecheck error FS3236: A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. +test2.fsx(152,21,152,84): typecheck error FS3233: The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. -test2.fsx(163,13,163,14): typecheck error FS3235: The Span or IsByRefLike variable 'y' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. +test2.fsx(153,13,153,14): typecheck error FS3234: The Span or IsByRefLike variable 'y' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. -test2.fsx(167,14,167,71): typecheck error FS3228: The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. +test2.fsx(157,13,157,83): typecheck error FS3235: A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. -test2.fsx(191,43,191,44): typecheck error FS3209: The address of the variable 'x' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. +test2.fsx(162,13,162,14): typecheck error FS3234: The Span or IsByRefLike variable 'y' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. -test2.fsx(195,14,195,15): typecheck error FS3209: The address of the variable 'y' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. +test2.fsx(166,14,166,71): typecheck error FS3228: The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. -test2.fsx(199,13,199,19): typecheck error FS3230: This value can't be assigned because the target 'x' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. +test2.fsx(190,43,190,44): typecheck error FS3209: The address of the variable 'x' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. -test2.fsx(204,26,204,27): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. +test2.fsx(194,14,194,15): typecheck error FS3209: The address of the variable 'y' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. -test2.fsx(204,26,204,27): typecheck error FS0406: The byref-typed variable 'inputSequence' is used in an invalid way. Byrefs cannot be captured by closures or passed to inner functions. +test2.fsx(198,13,198,19): typecheck error FS3229: This value can't be assigned because the target 'x' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. -test2.fsx(204,26,204,27): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. +test2.fsx(203,26,203,27): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. -test2.fsx(204,26,204,27): typecheck error FS0425: The type of a first-class function cannot contain byrefs +test2.fsx(203,26,203,27): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. -test2.fsx(204,26,204,27): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. +test2.fsx(203,26,203,27): typecheck error FS0406: The byref-typed variable 'inputSequence' is used in an invalid way. Byrefs cannot be captured by closures or passed to inner functions. -test2.fsx(204,26,204,27): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. +test2.fsx(203,26,203,27): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. -test2.fsx(209,13,209,18): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. +test2.fsx(203,26,203,27): typecheck error FS0425: The type of a first-class function cannot contain byrefs -test2.fsx(208,14,208,18): typecheck error FS0437: A type would store a byref typed value. This is not permitted by Common IL. +test2.fsx(203,26,203,27): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. -test2.fsx(214,13,214,18): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. +test2.fsx(203,26,203,27): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. -test2.fsx(213,14,213,19): typecheck error FS0437: A type would store a byref typed value. This is not permitted by Common IL. +test2.fsx(203,26,203,27): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. -test2.fsx(222,18,222,23): typecheck error FS3228: The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. +test2.fsx(203,26,203,27): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. -test2.fsx(231,17,231,18): typecheck error FS3235: The Span or IsByRefLike variable 's' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. +test2.fsx(208,13,208,18): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. + +test2.fsx(207,14,207,18): typecheck error FS0437: A type would store a byref typed value. This is not permitted by Common IL. + +test2.fsx(213,13,213,18): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. + +test2.fsx(212,14,212,19): typecheck error FS0437: A type would store a byref typed value. This is not permitted by Common IL. + +test2.fsx(221,18,221,23): typecheck error FS3228: The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + +test2.fsx(230,17,230,18): typecheck error FS3234: The Span or IsByRefLike variable 's' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. diff --git a/tests/fsharp/core/span/test2.fsx b/tests/fsharp/core/span/test2.fsx index e3be6f78871..fc31f9511b7 100644 --- a/tests/fsharp/core/span/test2.fsx +++ b/tests/fsharp/core/span/test2.fsx @@ -1,5 +1,4 @@ -#r @"..\..\..\..\packages\System.Memory.4.5.0-rc1\lib\netstandard2.0\System.Memory.dll" -#r @"..\..\..\..\packages\NETStandard.Library.NETFramework.2.0.0-preview2-25405-01\build\net461\ref\netstandard.dll" +#load "refs.generated.fsx" #nowarn "9" #nowarn "51" diff --git a/tests/fsharp/core/span/test3-pre.fsx b/tests/fsharp/core/span/test3-pre.fsx new file mode 100644 index 00000000000..9db0f8cc9a7 --- /dev/null +++ b/tests/fsharp/core/span/test3-pre.fsx @@ -0,0 +1 @@ +#load "common-pre.fsx" diff --git a/tests/fsharp/core/span/test3.bsl b/tests/fsharp/core/span/test3.bsl index da0e0fa6f8a..cb284695276 100644 --- a/tests/fsharp/core/span/test3.bsl +++ b/tests/fsharp/core/span/test3.bsl @@ -1,13 +1,13 @@ -test3.fsx(31,17,31,23): typecheck error FS0027: This value is not mutable. Consider using the mutable keyword, e.g. 'let mutable x = expression'. +test3.fsx(30,17,30,23): typecheck error FS0027: This value is not mutable. Consider using the mutable keyword, e.g. 'let mutable x = expression'. -test3.fsx(39,21,39,27): typecheck error FS0027: This value is not mutable. Consider using the mutable keyword, e.g. 'let mutable x = expression'. +test3.fsx(38,21,38,27): typecheck error FS0027: This value is not mutable. Consider using the mutable keyword, e.g. 'let mutable x = expression'. -test3.fsx(47,26,47,27): typecheck error FS0001: The type 'Span' is not compatible with the type 'seq<'a>' +test3.fsx(46,26,46,27): typecheck error FS0001: The type 'Span' is not compatible with the type 'seq<'a>' -test3.fsx(48,21,48,27): typecheck error FS0027: This value is not mutable. Consider using the mutable keyword, e.g. 'let mutable x = expression'. +test3.fsx(47,21,47,27): typecheck error FS0027: This value is not mutable. Consider using the mutable keyword, e.g. 'let mutable x = expression'. -test3.fsx(47,26,47,27): typecheck error FS0193: Type constraint mismatch. The type +test3.fsx(46,26,46,27): typecheck error FS0193: Type constraint mismatch. The type 'Span' is not compatible with type 'seq<'a>' diff --git a/tests/fsharp/core/span/test3.fsx b/tests/fsharp/core/span/test3.fsx index dc9ff0b2993..641aab5609d 100644 --- a/tests/fsharp/core/span/test3.fsx +++ b/tests/fsharp/core/span/test3.fsx @@ -1,5 +1,4 @@ -#r @"..\..\..\..\packages\System.Memory.4.5.0-rc1\lib\netstandard2.0\System.Memory.dll" -#r @"..\..\..\..\packages\NETStandard.Library.NETFramework.2.0.0-preview2-25405-01\build\net461\ref\netstandard.dll" +#load "refs.generated.fsx" #nowarn "9" #nowarn "51" diff --git a/tests/fsharp/core/subtype/test.fsx b/tests/fsharp/core/subtype/test.fsx index b33a35e5f8a..d40791e305b 100644 --- a/tests/fsharp/core/subtype/test.fsx +++ b/tests/fsharp/core/subtype/test.fsx @@ -31,7 +31,7 @@ open System.Collections.Generic let f1 (x: 'a[]) = (x :> ICollection<'a>) do let x = f1 [| 3;4; |] in test "test239809" (x.Contains(3)) -#if !NETCOREAPP1_0 +#if !NETCOREAPP (* 'a[] :> IReadOnlyCollection<'a> *) let f1ReadOnly (x: 'a[]) = (x :> IReadOnlyCollection<'a>) do let x = f1ReadOnly [| 3;4; |] in test "test239809ReadOnly" (x.Count = 2) @@ -41,7 +41,7 @@ do let x = f1ReadOnly [| 3;4; |] in test "test239809ReadOnly" (x.Count = 2) let f2 (x: 'a[]) = (x :> IList<'a>) do let x = f2 [| 3;4; |] in test "test239810" (x.Item(1) = 4) -#if !NETCOREAPP1_0 +#if !NETCOREAPP (* 'a[] :> IReadOnlyList<'a> *) let f2ReadOnly (x: 'a[]) = (x :> IReadOnlyList<'a>) do let x = f2ReadOnly [| 3;4; |] in test "test239810ReadOnly" (x.Item(1) = 4) @@ -55,7 +55,7 @@ do let x = f3 [| 3;4; |] in for x in x do (Printf.printf "val %d\n" x) done let f4 (x: 'a[]) = (x :> IList<'a>) do let x = f4 [| 31;42; |] in for x in x do (Printf.printf "val %d\n" x) done -#if !NETCOREAPP1_0 +#if !NETCOREAPP (* Call 'foreachG' using an IReadOnlyList (solved to IEnumerable) *) let f4ReadOnly (x: 'a[]) = (x :> IReadOnlyList<'a>) do let x = f4ReadOnly [| 31;42; |] in for x in x do (Printf.printf "val %d\n" x) done @@ -65,7 +65,7 @@ do let x = f4ReadOnly [| 31;42; |] in for x in x do (Printf.printf "val %d\n" x) let f5 (x: 'a[]) = (x :> ICollection<'a>) do let x = f5 [| 31;42; |] in for x in x do (Printf.printf "val %d\n" x) done -#if !NETCOREAPP1_0 +#if !NETCOREAPP (* Call 'foreachG' using an IReadOnlyCollection (solved to IEnumerable) *) let f5ReadOnly (x: 'a[]) = (x :> IReadOnlyCollection<'a>) do let x = f5ReadOnly [| 31;42; |] in for x in x do (Printf.printf "val %d\n" x) done @@ -106,7 +106,7 @@ let testUpcastToEnum1 (x: System.AttributeTargets) = (x :> System.Enum) let testUpcastToEnum6 (x: System.Enum) = (x :> System.Enum) // these delegates don't exist in portable -#if !UNIX && !NETCOREAPP1_0 +#if !UNIX && !NETCOREAPP let testUpcastToDelegate1 (x: System.Threading.ThreadStart) = (x :> System.Delegate) let testUpcastToMulticastDelegate1 (x: System.Threading.ThreadStart) = (x :> System.MulticastDelegate) @@ -244,7 +244,7 @@ module SomeRandomOperatorConstraints = begin let sum64 seq : int64 = Seq.reduce (+) seq let sum32 seq : int64 = Seq.reduce (+) seq -#if !NETCOREAPP1_0 +#if !NETCOREAPP let sumBigInt seq : BigInteger = Seq.reduce (+) seq #endif let sumDateTime (dt : DateTime) (seq : #seq) : DateTime = Seq.fold (+) dt seq @@ -1904,8 +1904,7 @@ module TestInheritFunc3 = check "cnwcki4" ((Foo() |> box |> unbox int -> int -> int> ) 5 6 7) 19 -#if !NETCOREAPP1_0 - +#if !NETCOREAPP module TestConverter = open System diff --git a/tests/fsharp/core/syntax/test.fsx b/tests/fsharp/core/syntax/test.fsx index cc3123be09c..e26783d7f31 100644 --- a/tests/fsharp/core/syntax/test.fsx +++ b/tests/fsharp/core/syntax/test.fsx @@ -837,7 +837,7 @@ let testTryFinallySyntaxOnOneLine () = try () finally () -#if !TESTS_AS_APP && !NETCOREAPP1_0 +#if !TESTS_AS_APP && !NETCOREAPP type SampleForm = class inherit System.Windows.Forms.Form @@ -1035,7 +1035,7 @@ do test "vliwe94" (f -2L = - 2L) do test "vliwe95" (f -2n = - 2n) do test "vliwe96" (f -2.0 = - 2.0) do test "vliwe97" (f -2.0f = - 2.0f) -#if !NETCOREAPP1_0 +#if !NETCOREAPP do test "vliwe99" (f -2I = - 2I) #endif diff --git a/tests/fsharp/core/unicode/kanji-unicode-utf16.fs b/tests/fsharp/core/unicode/kanji-unicode-utf16.fs index 4319c31f981..5e0256ad2e5 100644 Binary files a/tests/fsharp/core/unicode/kanji-unicode-utf16.fs and b/tests/fsharp/core/unicode/kanji-unicode-utf16.fs differ diff --git a/tests/fsharp/core/unicode/test.fsx b/tests/fsharp/core/unicode/test.fsx index 11add13debc..9b7303c0d32 100644 --- a/tests/fsharp/core/unicode/test.fsx +++ b/tests/fsharp/core/unicode/test.fsx @@ -19,7 +19,7 @@ let test (s : string) b = (* TEST SUITE FOR UNICODE CHARS *) -#if !TESTS_AS_APP && !NETCOREAPP1_0 +#if !TESTS_AS_APP && !NETCOREAPP let input_byte (x : System.IO.FileStream) = let b = x.ReadByte() if b = -1 then raise (System.IO.EndOfStreamException()) else b diff --git a/tests/fsharp/packages.config b/tests/fsharp/packages.config deleted file mode 100644 index cf755012d51..00000000000 --- a/tests/fsharp/packages.config +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/tests/fsharp/regression/5531/compilation.output.test.bsl b/tests/fsharp/regression/5531/compilation.output.test.bsl new file mode 100644 index 00000000000..4154944d97d --- /dev/null +++ b/tests/fsharp/regression/5531/compilation.output.test.bsl @@ -0,0 +1,2 @@ + +test.fs(7,17): warning FS0864: This new member hides the abstract member 'abstract member Base.Foo : unit -> unit'. Rename the member or use 'override' instead. \ No newline at end of file diff --git a/tests/fsharp/regression/5531/compilation.output.test.txt b/tests/fsharp/regression/5531/compilation.output.test.txt new file mode 100644 index 00000000000..7c43a910eee --- /dev/null +++ b/tests/fsharp/regression/5531/compilation.output.test.txt @@ -0,0 +1,2 @@ + +test.fs(7,17): warning FS0864: This new member hides the abstract member 'abstract member Base.Foo : unit -> unit'. Rename the member or use 'override' instead. diff --git a/tests/fsharp/regression/5531/output.test.bsl b/tests/fsharp/regression/5531/output.test.bsl new file mode 100644 index 00000000000..ff9df4c542e --- /dev/null +++ b/tests/fsharp/regression/5531/output.test.bsl @@ -0,0 +1,7 @@ +Base +Base +Derived +Base +Base +Base +Derived \ No newline at end of file diff --git a/tests/fsharp/regression/5531/output.test.txt b/tests/fsharp/regression/5531/output.test.txt new file mode 100644 index 00000000000..d8b84b0deeb --- /dev/null +++ b/tests/fsharp/regression/5531/output.test.txt @@ -0,0 +1,7 @@ +Base +Base +Derived +Base +Base +Base +Derived diff --git a/tests/fsharp/regression/5531/test.fs b/tests/fsharp/regression/5531/test.fs new file mode 100644 index 00000000000..4059b772bfd --- /dev/null +++ b/tests/fsharp/regression/5531/test.fs @@ -0,0 +1,23 @@ +type Base() = + abstract member Foo : unit -> unit + default this.Foo() = printfn "Base" + +type Derived() = + inherit Base() + member this.Foo() = printfn "Derived" + +let inline callFoo< ^T when ^T : (member Foo: unit -> unit) > (t: ^T) = + (^T : (member Foo: unit -> unit) (t)) + +let b = Base() +let d = Derived() +let bd = d :> Base + +b.Foo() +bd.Foo() +d.Foo() + +callFoo b +callFoo bd +callFoo d +callFoo d \ No newline at end of file diff --git a/tests/fsharp/single-test.fs b/tests/fsharp/single-test.fs index 1b1fad560ef..14a79c360d2 100644 --- a/tests/fsharp/single-test.fs +++ b/tests/fsharp/single-test.fs @@ -12,7 +12,6 @@ type Permutation = | FSI_CORECLR #if !FSHARP_SUITE_DRIVES_CORECLR_TESTS | FSI_FILE - | FSIANYCPU_FILE | FSI_STDIN | GENERATED_SIGNATURE | FSC_OPT_MINUS_DEBUG @@ -29,83 +28,228 @@ let cleanUpFSharpCore cfg = removeFSharpCore () { new System.IDisposable with member x.Dispose() = removeFSharpCore () } -let singleTestBuildAndRunCore cfg (copyFiles:string) p = - - let sources = - ["testlib.fsi";"testlib.fs";"test.mli";"test.ml";"test.fsi";"test.fs";"test2.fsi";"test2.fs";"test.fsx";"test2.fsx"] - |> List.filter (fileExists cfg) - - match p with - | FSC_CORECLR -> - use cleanup = (cleanUpFSharpCore cfg) - use testOkFile = new FileGuard (getfullpath cfg "test.ok") - - let testName = getBasename cfg.Directory - let extraSource = (__SOURCE_DIRECTORY__ ++ "coreclr_utilities.fs") - let outDir = (__SOURCE_DIRECTORY__ ++ sprintf @"../testbin/%s/coreclr/fsharp/core/%s" cfg.BUILD_CONFIG testName) - let outFile = (__SOURCE_DIRECTORY__ ++ sprintf @"../testbin/%s/coreclr/fsharp/core/%s/test.exe" cfg.BUILD_CONFIG testName) - - makeDirectory (getDirectoryName outFile) - let fscArgs = - sprintf """--debug:portable --debug+ --out:%s --target:exe -g --define:FX_RESHAPED_REFLECTION --define:NETCOREAPP1_0 "%s" %s """ - outFile - extraSource - (String.concat " " sources) - - let fsccArgs = sprintf """--OutputDir:%s --CopyDlls:%s %s""" outDir copyFiles fscArgs - - fsi_script cfg "--exec %s %s %s" - cfg.fsi_flags - (__SOURCE_DIRECTORY__ ++ @"../scripts/fscc.fsx") - fsccArgs - [] - - exec cfg cfg.DotNetExe outFile - - testOkFile.CheckExists() - - | FSI_CORECLR -> - use cleanup = (cleanUpFSharpCore cfg) - use testOkFile = new FileGuard (getfullpath cfg "test.ok") - - let testName = getBasename cfg.Directory - let extraSource = (__SOURCE_DIRECTORY__ ++ "coreclr_utilities.fs") - let outDir = (__SOURCE_DIRECTORY__ ++ sprintf @"../testbin/%s/coreclr/fsharp/core/%s" cfg.BUILD_CONFIG testName) - let fsiArgs = - sprintf """ --define:NETCOREAPP1_0 --define:FX_RESHAPED_REFLECTION "%s" %s """ - extraSource - (String.concat " " sources) - - let fsciArgs = sprintf """--verbose:repro --OutputDir:%s --CopyDlls:%s %s""" outDir copyFiles fsiArgs - - fsi_script cfg "--exec %s %s %s" - cfg.fsi_flags - (__SOURCE_DIRECTORY__ ++ @"../scripts/fsci.fsx") - fsciArgs - [] - - testOkFile.CheckExists() +// Generate a project files +let emitFile filename (body:string) = + try + // Create a file to write to + use sw = File.CreateText(filename) + sw.WriteLine(body) + with | _ -> () + +let copyFilesToDest sourceDir destDir = + let filenames = Directory.GetFiles(sourceDir, "*", SearchOption.TopDirectoryOnly) + for file in filenames do + let dest = Path.Combine(destDir, Path.GetFileName(file)) + File.Copy(file, dest) + +type CompileItem = Reference | Compile | UseSource | LoadSource + +type OutputType = Library | Exe | Script + +type ProjectConfiguration = { + OutputType:OutputType + Framework:string + SourceDirectory:string + SourceItems:string list + ExtraSourceItems:string list + UtilitySourceItems:string list + ReferenceItems:string list + LoadSources:string list + UseSources:string list + Optimize:bool +} + + +let replaceTokens tag (replacement:string) (template:string) = template.Replace(tag, replacement) + +let generateProps testCompilerVersion = + let template = @" + + Release + $(TESTCOMPILERVERSION) + + +" + template + |> replaceTokens "$(PROJECTDIRECTORY)" (Path.GetFullPath(__SOURCE_DIRECTORY__)) + |> replaceTokens "$(TESTCOMPILERVERSION)" testCompilerVersion + +let generateTargets = + let template = @" + + +" + template + |> replaceTokens "$(PROJECTDIRECTORY)" (Path.GetFullPath(__SOURCE_DIRECTORY__)) + +let generateOverrides = + let template = @" + + +" + template + +let generateProjectArtifacts (pc:ProjectConfiguration) targetFramework = + let computeSourceItems addDirectory addCondition (compileItem:CompileItem) sources = + let computeInclude src = + let fileName = if addDirectory then Path.Combine(pc.SourceDirectory, src) else src + let condition = if addCondition then " Condition=\"Exists('" + fileName + "')\"" else "" + match compileItem with + | CompileItem.Compile -> + "\n " + | CompileItem.Reference -> + "\n " + | CompileItem.UseSource -> + "\n " + | CompileItem.LoadSource -> + "\n " + + sources + |> List.map(fun src -> computeInclude src) + |> List.fold (fun acc s -> acc + s) "" + + let replace tag items addDirectory addCondition compileItem (template:string) = template.Replace(tag, computeSourceItems addDirectory addCondition compileItem items) + + let outputType = + match pc.OutputType with + | OutputType.Script -> "Script" + | _ -> "Exe" + let optimize = if pc.Optimize then "True" else "False" + let debug = if pc.Optimize then "True" else "False" + let generateProjBody = + let template = @" + + + $(OUTPUTTYPE) + $(TARGETFRAMEWORK) + false + $(DEBUG) + portable + $(OPTIMIZE) + false + FX_RESHAPED_REFLECTION + NETCOREAPP + false + + + + $(UTILITYSOURCEITEMS) + + + + $(SOURCEITEMS) + + + + $(EXTRASOURCEITEMS) + + + + $(REFERENCEITEMS) + + + + + + + + + + + +" + template + |> replace "$(UTILITYSOURCEITEMS)" pc.UtilitySourceItems false false CompileItem.Compile + |> replace "$(SOURCEITEMS)" pc.SourceItems true false CompileItem.Compile + |> replace "$(EXTRASOURCEITEMS)" pc.ExtraSourceItems true true CompileItem.Compile + |> replace "$(REFERENCEITEMS)" pc.ReferenceItems true true CompileItem.Reference + |> replace "$(LOADSOURCEITEMS)" pc.LoadSources true true CompileItem.LoadSource + |> replace "$(USESOURCEITEMS)" pc.UseSources true true CompileItem.UseSource + |> replaceTokens "$(DIRECTORYBUILDLOCATION)" (Path.GetFullPath(__SOURCE_DIRECTORY__)) + |> replaceTokens "$(OUTPUTTYPE)" outputType + |> replaceTokens "$(OPTIMIZE)" optimize + |> replaceTokens "$(DEBUG)" debug + |> replaceTokens "$(TARGETFRAMEWORK)" targetFramework + generateProjBody + +let singleTestBuildAndRunCore cfg copyFiles p = + let sources = [] + let loadSources = [] + let useSources = [] + let extraSources = ["testlib.fsi";"testlib.fs";"test.mli";"test.ml";"test.fsi";"test.fs";"test2.fsi";"test2.fs";"test.fsx";"test2.fsx"] + let utilitySources = [__SOURCE_DIRECTORY__ ++ "coreclr_utilities.fs"] + let referenceItems = if String.IsNullOrEmpty(copyFiles) then [] else [copyFiles] + let framework = "netcoreapp2.0" + + let executeSingleTestBuildAndRun outputType compilerType targetFramework optimize = + let mutable result = false + let directory = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName() ) + let pc = { + OutputType = outputType + Framework = framework + SourceDirectory = cfg.Directory + SourceItems = sources + ExtraSourceItems = extraSources + UtilitySourceItems = utilitySources + ReferenceItems = referenceItems + LoadSources = loadSources + UseSources = useSources + Optimize = optimize + } + + let targetsBody = generateTargets + let overridesBody = generateOverrides + let targetsFileName = Path.Combine(directory, "Directory.Build.targets") + let propsFileName = Path.Combine(directory, "Directory.Build.props") + let overridesFileName = Path.Combine(directory, "Directory.Overrides.targets") + let projectFileName = Path.Combine(directory, Path.GetRandomFileName() + ".fsproj") + try + Directory.CreateDirectory(directory) |> ignore + copyFilesToDest cfg.Directory directory + emitFile targetsFileName targetsBody + emitFile overridesFileName overridesBody + if outputType = OutputType.Exe then + let executeFsc testCompilerVersion targetFramework = + let propsBody = generateProps testCompilerVersion + emitFile propsFileName propsBody + let projectBody = generateProjectArtifacts pc targetFramework + emitFile projectFileName projectBody + use testOkFile = new FileGuard(Path.Combine(directory, "test.ok")) + exec { cfg with Directory = directory } cfg.DotNetExe (sprintf "run -f %s" targetFramework) + testOkFile.CheckExists() + executeFsc compilerType targetFramework + else + let executeFsi testCompilerVersion targetFramework = + let propsBody = generateProps testCompilerVersion + emitFile propsFileName propsBody + let projectBody = generateProjectArtifacts pc targetFramework + emitFile projectFileName projectBody + use testOkFile = new FileGuard(Path.Combine(directory, "test.ok")) + exec { cfg with Directory = directory } cfg.DotNetExe "build /t:RunFSharpScript" + testOkFile.CheckExists() + executeFsi compilerType targetFramework + result <- true + finally + if result <> false then + Directory.Delete(directory, true) + else + printfn "Configuration: %s" cfg.Directory + printfn "Directory: %s" directory + printfn "Filename: %s" projectFileName + + match p with + | FSC_CORECLR -> executeSingleTestBuildAndRun OutputType.Exe "coreclr" "netcoreapp2.0" true + | FSI_CORECLR -> executeSingleTestBuildAndRun OutputType.Script "coreclr" "netcoreapp2.0" true #if !FSHARP_SUITE_DRIVES_CORECLR_TESTS - | FSI_FILE -> - use cleanup = (cleanUpFSharpCore cfg) - use testOkFile = new FileGuard (getfullpath cfg "test.ok") - - fsi cfg "%s" cfg.fsi_flags sources - - testOkFile.CheckExists() - - | FSIANYCPU_FILE -> - use cleanup = (cleanUpFSharpCore cfg) - use testOkFile = new FileGuard (getfullpath cfg "test.ok") - - fsiAnyCpu cfg "%s" cfg.fsi_flags sources - - testOkFile.CheckExists() + | FSC_OPT_PLUS_DEBUG -> executeSingleTestBuildAndRun OutputType.Exe "net40" "net472" true + | FSC_OPT_MINUS_DEBUG -> executeSingleTestBuildAndRun OutputType.Exe "net40" "net472" false + | FSI_FILE -> executeSingleTestBuildAndRun OutputType.Script "net40" "net472" true | FSI_STDIN -> use cleanup = (cleanUpFSharpCore cfg) use testOkFile = new FileGuard (getfullpath cfg "test.ok") + let sources = extraSources |> List.filter (fileExists cfg) fsiStdin cfg (sources |> List.rev |> List.head) "" [] //use last file, because `cmd < a.txt b.txt` redirect b.txt only @@ -122,42 +266,24 @@ let singleTestBuildAndRunCore cfg (copyFiles:string) p = source1 |> Option.iter (fun from -> copy_y cfg from "tmptest.fs") log "Generated signature file..." - fsc cfg "%s --sig:tmptest.fsi --define:TESTS_AS_APP" cfg.fsc_flags ["tmptest.fs"] + fsc cfg "%s --sig:tmptest.fsi" cfg.fsc_flags ["tmptest.fs"] (if File.Exists("FSharp.Core.dll") then log "found fsharp.core.dll after build" else log "found fsharp.core.dll after build") |> ignore log "Compiling against generated signature file..." - fsc cfg "%s -o:tmptest1.exe --define:TESTS_AS_APP" cfg.fsc_flags ["tmptest.fsi";"tmptest.fs"] + fsc cfg "%s -o:tmptest1.exe" cfg.fsc_flags ["tmptest.fsi";"tmptest.fs"] (if File.Exists("FSharp.Core.dll") then log "found fsharp.core.dll after build" else log "found fsharp.core.dll after build") |> ignore log "Verifying built .exe..." peverify cfg "tmptest1.exe" - | FSC_OPT_MINUS_DEBUG -> - use cleanup = (cleanUpFSharpCore cfg) - use testOkFile = new FileGuard (getfullpath cfg "test.ok") - - fsc cfg "%s --optimize- --debug -o:test--optminus--debug.exe -g" cfg.fsc_flags sources - peverify cfg "test--optminus--debug.exe" - exec cfg ("." ++ "test--optminus--debug.exe") "" - - testOkFile.CheckExists() - - | FSC_OPT_PLUS_DEBUG -> - use cleanup = (cleanUpFSharpCore cfg) - use testOkFile = new FileGuard (getfullpath cfg "test.ok") - - fsc cfg "%s --optimize+ --debug -o:test--optplus--debug.exe -g" cfg.fsc_flags sources - peverify cfg "test--optplus--debug.exe" - exec cfg ("." ++ "test--optplus--debug.exe") "" - - testOkFile.CheckExists() - | AS_DLL -> // Compile as a DLL to exercise pickling of interface data, then recompile the original source file referencing this DLL // THe second compilation will not utilize the information from the first in any meaningful way, but the // compiler will unpickle the interface and optimization data, so we test unpickling as well. use cleanup = (cleanUpFSharpCore cfg) use testOkFile = new FileGuard (getfullpath cfg "test.ok") + + let sources = extraSources |> List.filter (fileExists cfg) fsc cfg "%s --optimize -a -o:test--optimize-lib.dll -g" cfg.fsc_flags sources fsc cfg "%s --optimize -r:test--optimize-lib.dll -o:test--optimize-client-of-lib.exe -g" cfg.fsc_flags sources @@ -210,13 +336,24 @@ let singleNegTest (cfg: TestConfig) testname = then fsc cfg "%s -a -o:%s-pre.dll" cfg.fsc_flags testname [testname + "-pre.fs"] else () + if fileExists cfg (testname + "-pre.fsx") then + fsi_script cfg "--exec %s %s %s" + cfg.fsi_flags + (cfg.Directory ++ (testname + "-pre.fsx")) + "" + [] + log "Negative typechecker testing: %s" testname - fscAppendErrExpectFail cfg (sprintf "%s.err" testname) """%s --vserrors --warnaserror --nologo --maxerrors:10000 -a -o:%s.dll""" cfg.fsc_flags testname sources + let warnaserror = + if cfg.fsc_flags.Contains("--warnaserror-") then String.Empty + else "--warnaserror" + + fscAppendErrExpectFail cfg (sprintf "%s.err" testname) """%s --vserrors %s --nologo --maxerrors:10000 -a -o:%s.dll""" cfg.fsc_flags warnaserror testname sources let diff = fsdiff cfg (sprintf "%s.err" testname) (sprintf "%s.bsl" testname) - fscAppendErrExpectFail cfg (sprintf "%s.vserr" testname) "%s --test:ContinueAfterParseFailure --vserrors --warnaserror --nologo --maxerrors:10000 -a -o:%s.dll" cfg.fsc_flags testname sources + fscAppendErrExpectFail cfg (sprintf "%s.vserr" testname) "%s --test:ContinueAfterParseFailure --vserrors %s --nologo --maxerrors:10000 -a -o:%s.dll" cfg.fsc_flags warnaserror testname sources let vbslDiff = fsdiff cfg (sprintf "%s.vserr" testname) VSBSLFILE diff --git a/tests/fsharp/test-framework.fs b/tests/fsharp/test-framework.fs index aeb90af5ae8..85d462ffe47 100644 --- a/tests/fsharp/test-framework.fs +++ b/tests/fsharp/test-framework.fs @@ -11,7 +11,7 @@ open NUnit.Framework [] module Commands = - let getfullpath workDir path = + let getfullpath workDir (path:string) = let rooted = if Path.IsPathRooted(path) then path else Path.Combine(workDir, path) @@ -122,11 +122,14 @@ type TestConfig = BUILD_CONFIG : string FSC : string fsc_flags : string - FSCBinPath : string FSCOREDLLPATH : string FSI : string +#if !FSHARP_SUITE_DRIVES_CORECLR_TESTS FSIANYCPU : string +#endif FSI_FOR_SCRIPTS : string + FSharpBuild : string + FSharpCompilerInteractiveSettings : string fsi_flags : string ILDASM : string PEVERIFY : string @@ -152,43 +155,45 @@ let requireFile nm = let config configurationName envVars = let SCRIPT_ROOT = __SOURCE_DIRECTORY__ - let packagesDir = SCRIPT_ROOT ++ ".." ++ ".." ++ "packages" - let FSCBinPath = SCRIPT_ROOT ++ ".." ++ ".." ++ configurationName ++ "net40" ++ "bin" + let packagesDir = Environment.GetEnvironmentVariable("USERPROFILE") ++ ".nuget" ++ "packages" +#if NET46 + let fscArchitecture = "net46" + let fsiArchitecture = "net46" + let fsharpCoreArchitecture = "net45" + let fsharpBuildArchitecture = "net46" + let fsharpCompilerInteractiveSettingsArchitecture = "net46" +#else + let fscArchitecture = "netcoreapp2.1" + let fsiArchitecture = "netcoreapp2.1" + let fsharpCoreArchitecture = "netstandard1.6" + let fsharpBuildArchitecture = "netstandard2.0" + let fsharpCompilerInteractiveSettingsArchitecture = "netstandard1.6" +#endif + let repoRoot = SCRIPT_ROOT ++ ".." ++ ".." + let artifactsPath = repoRoot ++ "artifacts" + let artifactsBinPath = artifactsPath ++ "bin" let csc_flags = "/nologo" let fsc_flags = "-r:System.Core.dll --nowarn:20 --define:COMPILED" let fsi_flags = "-r:System.Core.dll --nowarn:20 --define:INTERACTIVE --maxerrors:1 --abortonerror" let Is64BitOperatingSystem = WindowsPlatform.Is64BitOperatingSystem envVars let architectureMoniker = if Is64BitOperatingSystem then "x64" else "x86" - let CSC = requireFile (packagesDir ++ "Microsoft.Net.Compilers.2.7.0" ++ "tools" ++ "csc.exe") - let ILDASM = requireFile (packagesDir ++ ("runtime.win-" + architectureMoniker + ".Microsoft.NETCore.ILDAsm.2.0.3") ++ "runtimes" ++ ("win-" + architectureMoniker) ++ "native" ++ "ildasm.exe") - let coreclrdll = requireFile (packagesDir ++ ("runtime.win-" + architectureMoniker + ".Microsoft.NETCore.Runtime.CoreCLR.2.0.3") ++ "runtimes" ++ ("win-" + architectureMoniker) ++ "native" ++ "coreclr.dll") - let PEVERIFY = requireFile (SCRIPT_ROOT ++ ".." ++ "fsharpqa" ++ "testenv" ++ "src" ++ "PEVerify" ++ "bin" ++ configurationName ++ "net46" ++ "PEVerify.exe") - let FSI_FOR_SCRIPTS = - match envVars |> Map.tryFind "_fsiexe" with - | Some fsiexe when (not (String.IsNullOrWhiteSpace fsiexe)) -> requireFile (SCRIPT_ROOT ++ ".." ++ ".." ++ (fsiexe.Trim([| '\"' |]))) - | _ -> - // build.cmd sets that var, if it is not set, we are probably called directly from visual studio or the nunit console runner. - let fsharpCompilerTools = Directory.GetDirectories(packagesDir, "FSharp.Compiler.Tools.*") - match fsharpCompilerTools with - | [||] -> failwithf "Could not find any 'FSharp.Compiler.Tools' inside '%s'" packagesDir - | [| dir |] -> Path.Combine(dir, "tools", "fsi.exe") - | _ -> failwithf "Found more than one 'FSharp.Compiler.Tools' inside '%s', please clean up." packagesDir - let toolsDir = SCRIPT_ROOT ++ ".." ++ ".." ++ "Tools" - let dotNetExe = toolsDir ++ "dotnetcli" ++ "dotnet.exe" + let CSC = requireFile (packagesDir ++ "Microsoft.Net.Compilers" ++ "2.7.0" ++ "tools" ++ "csc.exe") + let ILDASM = requireFile (packagesDir ++ ("runtime.win-" + architectureMoniker + ".Microsoft.NETCore.ILDAsm") ++ "2.0.3" ++ "runtimes" ++ ("win-" + architectureMoniker) ++ "native" ++ "ildasm.exe") + let coreclrdll = requireFile (packagesDir ++ ("runtime.win-" + architectureMoniker + ".Microsoft.NETCore.Runtime.CoreCLR") ++ "2.0.3" ++ "runtimes" ++ ("win-" + architectureMoniker) ++ "native" ++ "coreclr.dll") + let PEVERIFY = requireFile (artifactsBinPath ++ "PEVerify" ++ configurationName ++ "net46" ++ "PEVerify.exe") + let FSI_FOR_SCRIPTS = artifactsBinPath ++ "fsi" ++ configurationName ++ fsiArchitecture ++ "fsi.exe" + let FSharpBuild = requireFile (artifactsBinPath ++ "FSharp.Build" ++ configurationName ++ fsharpBuildArchitecture ++ "FSharp.Build.dll") + let FSharpCompilerInteractiveSettings = requireFile (artifactsBinPath ++ "FSharp.Compiler.Interactive.Settings" ++ configurationName ++ fsharpCompilerInteractiveSettingsArchitecture ++ "FSharp.Compiler.Interactive.Settings.dll") + let dotNetExe = artifactsPath ++ "toolset" ++ "dotnet" ++ "dotnet.exe" // ildasm requires coreclr.dll to run which has already been restored to the packages directory File.Copy(coreclrdll, Path.GetDirectoryName(ILDASM) ++ "coreclr.dll", overwrite=true) + let FSI = requireFile (FSI_FOR_SCRIPTS) #if !FSHARP_SUITE_DRIVES_CORECLR_TESTS - let FSI = requireFile (FSCBinPath ++ "fsi.exe") - let FSIANYCPU = requireFile (FSCBinPath ++ "fsiAnyCpu.exe") - let FSC = requireFile (FSCBinPath ++ "fsc.exe") - let FSCOREDLLPATH = requireFile (FSCBinPath ++ "FSharp.Core.dll") -#else - let FSI = SCRIPT_ROOT ++ ".." ++ ".." ++ "tests" ++ "testbin" ++ configurationName ++ "coreclr" ++ "FSC" ++ "fsi.exe" - let FSIANYCPU = SCRIPT_ROOT ++ ".." ++ ".." ++ "tests" ++ "testbin" ++ configurationName ++ "coreclr" ++ "FSC" ++ "fsiAnyCpu.exe" - let FSC = SCRIPT_ROOT ++ ".." ++ ".." ++ "tests" ++ "testbin" ++ configurationName ++ "coreclr" ++ "FSC" ++ "fsc.exe" - let FSCOREDLLPATH = "" + let FSIANYCPU = requireFile (artifactsBinPath ++ "fsiAnyCpu" ++ configurationName ++ "net46" ++ "fsiAnyCpu.exe") #endif + let FSC = requireFile (artifactsBinPath ++ "fsc" ++ configurationName ++ fscArchitecture ++ "fsc.exe") + let FSCOREDLLPATH = requireFile (artifactsBinPath ++ "FSharp.Core" ++ configurationName ++ fsharpCoreArchitecture ++ "FSharp.Core.dll") let defaultPlatform = match Is64BitOperatingSystem with @@ -198,7 +203,6 @@ let config configurationName envVars = | false -> "win7-x86" { EnvironmentVariables = envVars - FSCBinPath = FSCBinPath |> Commands.pathAddBackslash FSCOREDLLPATH = FSCOREDLLPATH ILDASM = ILDASM PEVERIFY = PEVERIFY @@ -206,8 +210,12 @@ let config configurationName envVars = BUILD_CONFIG = configurationName FSC = FSC FSI = FSI +#if !FSHARP_SUITE_DRIVES_CORECLR_TESTS FSIANYCPU = FSIANYCPU +#endif FSI_FOR_SCRIPTS = FSI_FOR_SCRIPTS + FSharpBuild = FSharpBuild + FSharpCompilerInteractiveSettings = FSharpCompilerInteractiveSettings csc_flags = csc_flags fsc_flags = fsc_flags fsi_flags = fsi_flags @@ -224,10 +232,11 @@ let logConfig (cfg: TestConfig) = log "csc_flags =%s" cfg.csc_flags log "FSC =%s" cfg.FSC log "fsc_flags =%s" cfg.fsc_flags - log "FSCBINPATH =%s" cfg.FSCBinPath log "FSCOREDLLPATH =%s" cfg.FSCOREDLLPATH log "FSI =%s" cfg.FSI - log "FSIANYCPU =%s" cfg.FSIANYCPU +#if !FSHARP_SUITE_DRIVES_CORECLR_TESTS + log "FSIANYCPU =%s" cfg.FSIANYCPU +#endif log "fsi_flags =%s" cfg.fsi_flags log "ILDASM =%s" cfg.ILDASM log "PEVERIFY =%s" cfg.PEVERIFY @@ -437,7 +446,9 @@ let ildasm cfg arg = Printf.ksprintf (Commands.ildasm (exec cfg) cfg.ILDASM) arg let peverify cfg = Commands.peverify (exec cfg) cfg.PEVERIFY "/nologo" let peverifyWithArgs cfg args = Commands.peverify (exec cfg) cfg.PEVERIFY args let fsi cfg = Printf.ksprintf (Commands.fsi (exec cfg) cfg.FSI) +#if !FSHARP_SUITE_DRIVES_CORECLR_TESTS let fsiAnyCpu cfg = Printf.ksprintf (Commands.fsi (exec cfg) cfg.FSIANYCPU) +#endif let fsi_script cfg = Printf.ksprintf (Commands.fsi (exec cfg) cfg.FSI_FOR_SCRIPTS) let fsiExpectFail cfg = Printf.ksprintf (Commands.fsi (execExpectFail cfg) cfg.FSI) let fsiAppendIgnoreExitCode cfg stdoutPath stderrPath = Printf.ksprintf (Commands.fsi (execAppendIgnoreExitCode cfg stdoutPath stderrPath) cfg.FSI) @@ -450,6 +461,7 @@ let rm cfg x = Commands.rm cfg.Directory x let rmdir cfg x = Commands.rmdir cfg.Directory x let mkdir cfg = Commands.mkdir_p cfg.Directory let copy_y cfg f = Commands.copy_y cfg.Directory f >> checkResult +let copySystemValueTuple cfg = copy_y cfg (getDirectoryName(cfg.FSC) ++ "System.ValueTuple.dll") ("." ++ "System.ValueTuple.dll") let diff normalize path1 path2 = let result = System.Text.StringBuilder() diff --git a/tests/fsharp/tests.fs b/tests/fsharp/tests.fs index 72e48f87e90..7f5804ea1f2 100644 --- a/tests/fsharp/tests.fs +++ b/tests/fsharp/tests.fs @@ -1,4 +1,4 @@ -// vvvvvvvvvvvvv To run these tests in F# Interactive , 'build net40', then send this chunk, then evaluate body of a test vvvvvvvvvvvvvvvv +// To run these tests in F# Interactive , 'build net40', then send this chunk, then evaluate body of a test vvvvvvvvvvvvvvvv #if INTERACTIVE #r @"../../packages/NUnit.3.5.0/lib/net45/nunit.framework.dll" #load "../../src/scripts/scriptlib.fsx" @@ -31,7 +31,7 @@ module CoreTests = // These tests are enabled for .NET Framework and .NET Core [] let ``access-FSC_BASIC``() = singleTestBuildAndRun "core/access" FSC_BASIC -// All tests below here are known to pass for .NET Core but not yet enabled due to CI problems + [] let ``access-FSI_BASIC``() = singleTestBuildAndRun "core/access" FSI_BASIC @@ -190,29 +190,27 @@ module CoreTests = end begin - use testOkFile = fileguard cfg "test.ok" - fsi cfg "" ["test.fsx"] - - testOkFile.CheckExists() - end + use testOkFile = fileguard cfg "test2.ok" - begin + fsc cfg "%s -o:test2.exe -g" cfg.fsc_flags ["test2.fsx"] - use testOkFile = fileguard cfg "test.ok" + singleNegTest { cfg with fsc_flags = sprintf "%s --warnaserror-" cfg.fsc_flags } "test2" - fsiAnyCpu cfg "" ["test.fsx"] + exec cfg ("." ++ "test2.exe") "" testOkFile.CheckExists() end begin - use testOkFile = fileguard cfg "test2.ok" + csc cfg """/langversion:7.2 /nologo /target:library /out:cslib3.dll""" ["cslib3.cs"] - fsc cfg "%s -o:test2.exe -g" cfg.fsc_flags ["test2.fsx"] + use testOkFile = fileguard cfg "test3.ok" - singleNegTest cfg "test2" + fsc cfg "%s -r:cslib3.dll -o:test3.exe -g" cfg.fsc_flags ["test3.fsx"] - exec cfg ("." ++ "test2.exe") "" + singleNegTest { cfg with fsc_flags = sprintf "%s -r:cslib3.dll" cfg.fsc_flags } "test3" + + exec cfg ("." ++ "test3.exe") "" testOkFile.CheckExists() end @@ -227,10 +225,10 @@ module CoreTests = begin use testOkFile = fileguard cfg "test.ok" - fsc cfg "%s -o:test.exe -g" cfg.fsc_flags ["test.fsx"] - singleNegTest cfg "test" + fsc cfg "%s -o:test.exe -g" cfg.fsc_flags ["test.fsx"] + // Execution is disabled until we can be sure .NET 4.7.2 is on the machine //exec cfg ("." ++ "test.exe") "" @@ -240,10 +238,10 @@ module CoreTests = begin use testOkFile = fileguard cfg "test2.ok" - fsc cfg "%s -o:test2.exe -g" cfg.fsc_flags ["test2.fsx"] - singleNegTest cfg "test2" + fsc cfg "%s -o:test2.exe -g" cfg.fsc_flags ["test2.fsx"] + // Execution is disabled until we can be sure .NET 4.7.2 is on the machine //exec cfg ("." ++ "test.exe") "" @@ -253,10 +251,10 @@ module CoreTests = begin use testOkFile = fileguard cfg "test3.ok" - fsc cfg "%s -o:test3.exe -g" cfg.fsc_flags ["test3.fsx"] - singleNegTest cfg "test3" + fsc cfg "%s -o:test3.exe -g" cfg.fsc_flags ["test3.fsx"] + // Execution is disabled until we can be sure .NET 4.7.2 is on the machine //exec cfg ("." ++ "test.exe") "" @@ -316,11 +314,40 @@ module CoreTests = [] let fscenum () = singleTestBuildAndRun "core/enum" FSC_BASIC +// [] +// let fsienum () = singleTestBuildAndRun "core/enum" FSI_BASIC + +#if !FSHARP_SUITE_DRIVES_CORECLR_TESTS + + // These tests are enabled for .NET Framework and .NET Core [] - let fsienum () = singleTestBuildAndRun "core/enum" FSI_BASIC + let ``anon-FSC_BASIC``() = + let cfg = testConfig "core/anon" + fsc cfg "%s -a -o:lib.dll" cfg.fsc_flags ["lib.fs"] -#if !FSHARP_SUITE_DRIVES_CORECLR_TESTS + copySystemValueTuple cfg + peverify cfg "lib.dll" + + fsc cfg "%s -r:lib.dll" cfg.fsc_flags ["test.fsx"] + + peverify cfg "test.exe" + + begin + use testOkFile = fileguard cfg "test.ok" + + exec cfg ("." ++ "test.exe") "" + + testOkFile.CheckExists() + end + + begin + use testOkFile = fileguard cfg "test.ok" + + fsi cfg "-r:lib.dll" ["test.fsx"] + + testOkFile.CheckExists() + end [] let events () = @@ -452,7 +479,7 @@ module CoreTests = fsc cfg "%s -a -o:lib.dll -g" cfg.fsc_flags ["lib.fs"] - copy_y cfg (cfg.FSCBinPath ++ "System.ValueTuple.dll") ("." ++ "System.ValueTuple.dll") + copySystemValueTuple cfg peverify cfg "lib.dll" @@ -762,7 +789,7 @@ module CoreTests = fsc cfg "%s -o:test.exe -r cslib.dll -g" cfg.fsc_flags ["test.fsx"] - copy_y cfg (cfg.FSCBinPath ++ "System.ValueTuple.dll") ("." ++ "System.ValueTuple.dll") + copySystemValueTuple cfg peverify cfg "test.exe" @@ -938,7 +965,7 @@ module CoreTests = let ``letrec (mutrec variations part two) FSI_BASIC`` () = singleTestBuildAndRun "core/letrec-mutrec2" FSI_BASIC [] - let recordResolution () = singleTestBuildAndRun "core/recordResolution" FSC_OPT_PLUS_DEBUG + let recordResolution () = singleTestBuildAndRun "core/recordResolution" FSC_BASIC [] let ``no-warn-2003-tests`` () = @@ -1045,7 +1072,7 @@ module CoreTests = echo "Test 6=================================================" - fscAppend cfg stdoutPath stderrPath "--nologo -r FSharp.Compiler.Interactive.Settings" ["usesfsi.fsx"] + fscAppend cfg stdoutPath stderrPath "--nologo -r \"%s\"" cfg.FSharpCompilerInteractiveSettings ["usesfsi.fsx"] echo "Test 7=================================================" @@ -1605,13 +1632,13 @@ module CoreTests = let verify () = let cfg = testConfig "core/verify" - peverifyWithArgs cfg "/nologo" (cfg.FSCBinPath ++ "FSharp.Build.dll") + peverifyWithArgs cfg "/nologo" (cfg.FSharpBuild) - // peverifyWithArgs cfg "/nologo /MD" (cfg.FSCBinPath ++ "FSharp.Compiler.dll") + // peverifyWithArgs cfg "/nologo /MD" (getDirectoryName(cfg.FSC) ++ "FSharp.Compiler.dll") - peverifyWithArgs cfg "/nologo" (cfg.FSCBinPath ++ "fsi.exe") + peverifyWithArgs cfg "/nologo" (cfg.FSI) - peverifyWithArgs cfg "/nologo" (cfg.FSCBinPath ++ "FSharp.Compiler.Interactive.Settings.dll") + peverifyWithArgs cfg "/nologo" (cfg.FSharpCompilerInteractiveSettings) fsc cfg "%s -o:xmlverify.exe -g" cfg.fsc_flags ["xmlverify.fs"] @@ -1648,7 +1675,6 @@ module ToolsTests = let eval () = singleTestBuildAndRun "tools/eval" FSC_BASIC #endif - module RegressionTests = [] @@ -1669,6 +1695,35 @@ module RegressionTests = [] let ``tuple-bug-1-FSC_BASIC`` () = singleTestBuildAndRun "regression/tuple-bug-1" FSC_BASIC +#if !FSHARP_SUITE_DRIVES_CORECLR_TESTS + [] + let ``SRTP doesn't handle calling member hiding hinherited members`` () = + let cfg = testConfig "regression/5531" + + let outFile = "compilation.output.test.txt" + let expectedFile = "compilation.output.test.bsl" + + fscBothToOut cfg outFile "%s --nologo -O" cfg.fsc_flags ["test.fs"] + + let diff = fsdiff cfg outFile expectedFile + + match diff with + | "" -> () + | _ -> + Assert.Fail (sprintf "'%s' and '%s' differ; %A" (getfullpath cfg outFile) (getfullpath cfg expectedFile) diff) + + let outFile2 = "output.test.txt" + let expectedFile2 = "output.test.bsl" + + execBothToOut cfg (cfg.Directory) outFile2 (cfg.Directory ++ "test.exe") "" + + let diff2 = fsdiff cfg outFile2 expectedFile2 + match diff2 with + | "" -> () + | _ -> + Assert.Fail (sprintf "'%s' and '%s' differ; %A" (getfullpath cfg outFile2) (getfullpath cfg expectedFile2) diff2) +#endif + [] let ``26`` () = singleTestBuildAndRun "regression/26" FSC_BASIC @@ -1709,7 +1764,7 @@ module RegressionTests = // Requires WinForms [] let ``83`` () = singleTestBuildAndRun "regression/83" FSC_BASIC -#endif + [] let ``84`` () = singleTestBuildAndRun "regression/84" FSC_BASIC @@ -1720,6 +1775,7 @@ module RegressionTests = fsc cfg "%s -r:Category.dll -a -o:petshop.dll" cfg.fsc_flags ["Category.ml"] peverify cfg "petshop.dll" +#endif [] let ``86`` () = singleTestBuildAndRun "regression/86" FSC_BASIC @@ -1846,7 +1902,7 @@ module OptimizationTests = |> Seq.filter (fun line -> line.Contains(".locals init")) |> Seq.length - log "Ran ok - optimizations removed %d textual occurrences of optimizable identifiers from target IL" numElim + log "Ran ok - optimizations removed %d textual occurrences of optimizable identifiers from target IL" numElim [] let stats () = @@ -1901,7 +1957,7 @@ module TypecheckTests = let ``sigs pos27`` () = let cfg = testConfig "typecheck/sigs" fsc cfg "%s --target:exe -o:pos27.exe" cfg.fsc_flags ["pos27.fs"] - copy_y cfg (cfg.FSCBinPath ++ "System.ValueTuple.dll") ("." ++ "System.ValueTuple.dll") + copySystemValueTuple cfg peverify cfg "pos27.exe" [] @@ -2389,6 +2445,12 @@ module TypecheckTests = [] let ``type check neg102`` () = singleNegTest (testConfig "typecheck/sigs") "neg102" + [] + let ``type check neg103`` () = singleNegTest (testConfig "typecheck/sigs") "neg103" + + [] + let ``type check neg104`` () = singleNegTest (testConfig "typecheck/sigs") "neg104" + [] let ``type check neg106`` () = singleNegTest (testConfig "typecheck/sigs") "neg106" @@ -2401,11 +2463,20 @@ module TypecheckTests = [] let ``type check neg109`` () = singleNegTest (testConfig "typecheck/sigs") "neg109" - [] - let ``type check neg103`` () = singleNegTest (testConfig "typecheck/sigs") "neg103" + [] + let ``type check neg110`` () = singleNegTest (testConfig "typecheck/sigs") "neg110" - [] - let ``type check neg104`` () = singleNegTest (testConfig "typecheck/sigs") "neg104" + [] + let ``type check neg113`` () = singleNegTest (testConfig "typecheck/sigs") "neg113" + + [] + let ``type check neg114`` () = singleNegTest (testConfig "typecheck/sigs") "neg114" + + [] + let ``type check neg_anon_1`` () = singleNegTest (testConfig "typecheck/sigs") "neg_anon_1" + + [] + let ``type check neg_anon_2`` () = singleNegTest (testConfig "typecheck/sigs") "neg_anon_2" [] let ``type check neg_issue_3752`` () = singleNegTest (testConfig "typecheck/sigs") "neg_issue_3752" @@ -2545,7 +2616,7 @@ open System.Runtime.InteropServices fv.LegalTrademarks |> Assert.areEqual "CST \u2122" #endif -#if !NETSTANDARD1_6 +#if NET46 module ProductVersionTest = let informationalVersionAttrName = typeof.FullName diff --git a/tests/fsharp/tools/eval/test.fsx b/tests/fsharp/tools/eval/test.fsx index 535a54799a4..b2cfedc68fa 100644 --- a/tests/fsharp/tools/eval/test.fsx +++ b/tests/fsharp/tools/eval/test.fsx @@ -1,6 +1,6 @@ #light -#if !NETCOREAPP1_0 +#if !NETSTANDARD #r @"System.Core.dll" #r @"System.Data.Linq.dll" #endif diff --git a/tests/fsharp/typecheck/sigs/.gitignore b/tests/fsharp/typecheck/sigs/.gitignore new file mode 100644 index 00000000000..c7256c83585 --- /dev/null +++ b/tests/fsharp/typecheck/sigs/.gitignore @@ -0,0 +1 @@ +*.generated.fsx diff --git a/tests/fsharp/typecheck/sigs/neg102.fs b/tests/fsharp/typecheck/sigs/neg102.fs index 5eb13cdc79f..972967ae8eb 100644 --- a/tests/fsharp/typecheck/sigs/neg102.fs +++ b/tests/fsharp/typecheck/sigs/neg102.fs @@ -44,4 +44,4 @@ module FS0104 = let f3 = function | System.DateTimeKind.Unspecified -> "Unspecified" | System.DateTimeKind.Utc -> "Utc" - | System.DateTimeKind.Local -> "Local" \ No newline at end of file + | System.DateTimeKind.Local -> "Local" diff --git a/tests/fsharp/typecheck/sigs/neg102.vsbsl b/tests/fsharp/typecheck/sigs/neg102.vsbsl new file mode 100644 index 00000000000..333f0e34d17 --- /dev/null +++ b/tests/fsharp/typecheck/sigs/neg102.vsbsl @@ -0,0 +1,18 @@ + +neg102.fs(9,14,9,22): typecheck error FS0025: Incomplete pattern matches on this expression. For example, the value 'B' may indicate a case not covered by the pattern(s). + +neg102.fs(12,14,12,22): typecheck error FS0025: Incomplete pattern matches on this expression. For example, the value '0' may indicate a case not covered by the pattern(s). + +neg102.fs(15,14,15,22): typecheck error FS0025: Incomplete pattern matches on this expression. For example, the value 'EnumABC.B' may indicate a case not covered by the pattern(s). + +neg102.fs(18,14,18,22): typecheck error FS0025: Incomplete pattern matches on this expression. For example, the value 'EnumABC.C' may indicate a case not covered by the pattern(s). + +neg102.fs(22,14,22,22): typecheck error FS0025: Incomplete pattern matches on this expression. For example, the value 'Some (EnumABC.C)' may indicate a case not covered by the pattern(s). + +neg102.fs(27,14,27,22): typecheck error FS0025: Incomplete pattern matches on this expression. For example, the value 'System.DateTimeKind.Utc' may indicate a case not covered by the pattern(s). + +neg102.fs(32,14,32,22): typecheck error FS0104: Enums may take values outside known cases. For example, the value 'enum (2)' may indicate a case not covered by the pattern(s). + +neg102.fs(37,14,37,22): typecheck error FS0104: Enums may take values outside known cases. For example, the value 'Some (enum (2))' may indicate a case not covered by the pattern(s). + +neg102.fs(44,14,44,22): typecheck error FS0104: Enums may take values outside known cases. For example, the value 'enum (3)' may indicate a case not covered by the pattern(s). diff --git a/tests/fsharp/typecheck/sigs/neg103.vsbsl b/tests/fsharp/typecheck/sigs/neg103.vsbsl new file mode 100644 index 00000000000..422a9e3bf81 --- /dev/null +++ b/tests/fsharp/typecheck/sigs/neg103.vsbsl @@ -0,0 +1,25 @@ + +neg103.fs(7,12,7,22): typecheck error FS0001: This expression was expected to have type + 'Async<'a>' +but here has type + 'string' + +neg103.fs(12,7,12,15): typecheck error FS0001: This expression was expected to have type + 'int' +but here has type + 'MyUnion' + +neg103.fs(17,7,17,15): typecheck error FS0001: This expression was expected to have type + 'int' +but here has type + 'MyUnion' + +neg103.fs(21,7,21,9): typecheck error FS0001: This expression was expected to have type + 'Async' +but here has type + 'int' + +neg103.fs(25,11,25,19): typecheck error FS0001: This expression was expected to have type + 'int' +but here has type + 'MyUnion' diff --git a/tests/fsharp/typecheck/sigs/neg104.bsl b/tests/fsharp/typecheck/sigs/neg104.bsl index aa804860dfc..022a8e3e4b2 100644 --- a/tests/fsharp/typecheck/sigs/neg104.bsl +++ b/tests/fsharp/typecheck/sigs/neg104.bsl @@ -17,4 +17,4 @@ neg104.fs(32,27,32,28): parse error FS0604: Unmatched '{' neg104.fs(35,19,35,20): parse error FS0010: Unexpected symbol '}' in definition. Expected incomplete structured construct at or before this point or other token. -neg104.fs(35,1,35,20): parse error FS0010: Incomplete structured construct at or before this point in implementation file +neg104.fs(36,1,36,1): parse error FS0010: Incomplete structured construct at or before this point in implementation file diff --git a/tests/fsharp/typecheck/sigs/neg104.fs b/tests/fsharp/typecheck/sigs/neg104.fs index ee35527a251..98c09fb1056 100644 --- a/tests/fsharp/typecheck/sigs/neg104.fs +++ b/tests/fsharp/typecheck/sigs/neg104.fs @@ -32,4 +32,4 @@ module C = let a (x: AT) = async { let! match! = x let! x = match! - return () } \ No newline at end of file + return () } diff --git a/tests/fsharp/typecheck/sigs/neg104.vsbsl b/tests/fsharp/typecheck/sigs/neg104.vsbsl index 1fe8b3683ef..e4e6e79397a 100644 --- a/tests/fsharp/typecheck/sigs/neg104.vsbsl +++ b/tests/fsharp/typecheck/sigs/neg104.vsbsl @@ -17,7 +17,7 @@ neg104.fs(32,27,32,28): parse error FS0604: Unmatched '{' neg104.fs(35,19,35,20): parse error FS0010: Unexpected symbol '}' in definition. Expected incomplete structured construct at or before this point or other token. -neg104.fs(35,1,35,20): parse error FS0010: Incomplete structured construct at or before this point in implementation file +neg104.fs(36,1,36,1): parse error FS0010: Incomplete structured construct at or before this point in implementation file neg104.fs(8,9,8,30): typecheck error FS0750: This construct may only be used within computation expressions diff --git a/tests/fsharp/typecheck/sigs/neg106.bsl b/tests/fsharp/typecheck/sigs/neg106.bsl index a2109823a23..e07dd731fbb 100644 --- a/tests/fsharp/typecheck/sigs/neg106.bsl +++ b/tests/fsharp/typecheck/sigs/neg106.bsl @@ -1,5 +1,5 @@ -neg106.fs(8,59,8,61): typecheck error FS3231: A value defined in a module must be mutable in order to take its address, e.g. 'let mutable x = ...' +neg106.fs(8,59,8,61): typecheck error FS3230: A value defined in a module must be mutable in order to take its address, e.g. 'let mutable x = ...' neg106.fs(13,18,13,72): typecheck error FS0041: No overloads match for method 'CompareExchange'. The available overloads are shown below. neg106.fs(13,18,13,72): typecheck error FS0041: Possible overload: 'System.Threading.Interlocked.CompareExchange(location1: byref, value: int, comparand: int) : int'. Type constraint mismatch. The type @@ -38,7 +38,7 @@ is not compatible with type 'byref<'a>' . -neg106.fs(17,59,17,61): typecheck error FS3237: Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. +neg106.fs(17,59,17,61): typecheck error FS3236: Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. neg106.fs(17,14,17,68): typecheck error FS0041: No overloads match for method 'CompareExchange'. The available overloads are shown below. neg106.fs(17,14,17,68): typecheck error FS0041: Possible overload: 'System.Threading.Interlocked.CompareExchange(location1: byref, value: int, comparand: int) : int'. Type constraint mismatch. The type @@ -149,6 +149,8 @@ The type 'ByRefKinds.Out' does not match the type 'ByRefKinds.In' neg106.fs(102,37,102,40): typecheck error FS0072: Lookup on object of indeterminate type based on information prior to this program point. A type annotation may be needed prior to this program point to constrain the type of the object. This may allow the lookup to be resolved. +neg106.fs(102,36,102,40): typecheck error FS3236: Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. + neg106.fs(102,36,102,40): typecheck error FS0001: Type mismatch. Expecting a 'outref<'a>' but given a @@ -163,6 +165,8 @@ The type 'ByRefKinds.InOut' does not match the type 'ByRefKinds.In' neg106.fs(112,39,112,42): typecheck error FS0072: Lookup on object of indeterminate type based on information prior to this program point. A type annotation may be needed prior to this program point to constrain the type of the object. This may allow the lookup to be resolved. +neg106.fs(112,38,112,42): typecheck error FS3236: Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. + neg106.fs(112,38,112,42): typecheck error FS0001: Type mismatch. Expecting a 'byref<'a>' but given a @@ -177,6 +181,8 @@ The type 'ByRefKinds.Out' does not match the type 'ByRefKinds.In' neg106.fs(122,39,122,42): typecheck error FS0072: Lookup on object of indeterminate type based on information prior to this program point. A type annotation may be needed prior to this program point to constrain the type of the object. This may allow the lookup to be resolved. +neg106.fs(122,38,122,42): typecheck error FS3236: Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. + neg106.fs(122,38,122,42): typecheck error FS0001: Type mismatch. Expecting a 'outref<'a>' but given a @@ -191,6 +197,8 @@ The type 'ByRefKinds.InOut' does not match the type 'ByRefKinds.In' neg106.fs(132,39,132,42): typecheck error FS0072: Lookup on object of indeterminate type based on information prior to this program point. A type annotation may be needed prior to this program point to constrain the type of the object. This may allow the lookup to be resolved. +neg106.fs(132,38,132,42): typecheck error FS3236: Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. + neg106.fs(132,38,132,42): typecheck error FS0001: Type mismatch. Expecting a 'byref<'a>' but given a @@ -205,6 +213,8 @@ The type 'ByRefKinds.Out' does not match the type 'ByRefKinds.In' neg106.fs(142,39,142,42): typecheck error FS0072: Lookup on object of indeterminate type based on information prior to this program point. A type annotation may be needed prior to this program point to constrain the type of the object. This may allow the lookup to be resolved. +neg106.fs(142,38,142,42): typecheck error FS3236: Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. + neg106.fs(142,38,142,42): typecheck error FS0001: Type mismatch. Expecting a 'outref<'a>' but given a diff --git a/tests/fsharp/typecheck/sigs/neg106.vsbsl b/tests/fsharp/typecheck/sigs/neg106.vsbsl index a2109823a23..e07dd731fbb 100644 --- a/tests/fsharp/typecheck/sigs/neg106.vsbsl +++ b/tests/fsharp/typecheck/sigs/neg106.vsbsl @@ -1,5 +1,5 @@ -neg106.fs(8,59,8,61): typecheck error FS3231: A value defined in a module must be mutable in order to take its address, e.g. 'let mutable x = ...' +neg106.fs(8,59,8,61): typecheck error FS3230: A value defined in a module must be mutable in order to take its address, e.g. 'let mutable x = ...' neg106.fs(13,18,13,72): typecheck error FS0041: No overloads match for method 'CompareExchange'. The available overloads are shown below. neg106.fs(13,18,13,72): typecheck error FS0041: Possible overload: 'System.Threading.Interlocked.CompareExchange(location1: byref, value: int, comparand: int) : int'. Type constraint mismatch. The type @@ -38,7 +38,7 @@ is not compatible with type 'byref<'a>' . -neg106.fs(17,59,17,61): typecheck error FS3237: Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. +neg106.fs(17,59,17,61): typecheck error FS3236: Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. neg106.fs(17,14,17,68): typecheck error FS0041: No overloads match for method 'CompareExchange'. The available overloads are shown below. neg106.fs(17,14,17,68): typecheck error FS0041: Possible overload: 'System.Threading.Interlocked.CompareExchange(location1: byref, value: int, comparand: int) : int'. Type constraint mismatch. The type @@ -149,6 +149,8 @@ The type 'ByRefKinds.Out' does not match the type 'ByRefKinds.In' neg106.fs(102,37,102,40): typecheck error FS0072: Lookup on object of indeterminate type based on information prior to this program point. A type annotation may be needed prior to this program point to constrain the type of the object. This may allow the lookup to be resolved. +neg106.fs(102,36,102,40): typecheck error FS3236: Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. + neg106.fs(102,36,102,40): typecheck error FS0001: Type mismatch. Expecting a 'outref<'a>' but given a @@ -163,6 +165,8 @@ The type 'ByRefKinds.InOut' does not match the type 'ByRefKinds.In' neg106.fs(112,39,112,42): typecheck error FS0072: Lookup on object of indeterminate type based on information prior to this program point. A type annotation may be needed prior to this program point to constrain the type of the object. This may allow the lookup to be resolved. +neg106.fs(112,38,112,42): typecheck error FS3236: Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. + neg106.fs(112,38,112,42): typecheck error FS0001: Type mismatch. Expecting a 'byref<'a>' but given a @@ -177,6 +181,8 @@ The type 'ByRefKinds.Out' does not match the type 'ByRefKinds.In' neg106.fs(122,39,122,42): typecheck error FS0072: Lookup on object of indeterminate type based on information prior to this program point. A type annotation may be needed prior to this program point to constrain the type of the object. This may allow the lookup to be resolved. +neg106.fs(122,38,122,42): typecheck error FS3236: Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. + neg106.fs(122,38,122,42): typecheck error FS0001: Type mismatch. Expecting a 'outref<'a>' but given a @@ -191,6 +197,8 @@ The type 'ByRefKinds.InOut' does not match the type 'ByRefKinds.In' neg106.fs(132,39,132,42): typecheck error FS0072: Lookup on object of indeterminate type based on information prior to this program point. A type annotation may be needed prior to this program point to constrain the type of the object. This may allow the lookup to be resolved. +neg106.fs(132,38,132,42): typecheck error FS3236: Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. + neg106.fs(132,38,132,42): typecheck error FS0001: Type mismatch. Expecting a 'byref<'a>' but given a @@ -205,6 +213,8 @@ The type 'ByRefKinds.Out' does not match the type 'ByRefKinds.In' neg106.fs(142,39,142,42): typecheck error FS0072: Lookup on object of indeterminate type based on information prior to this program point. A type annotation may be needed prior to this program point to constrain the type of the object. This may allow the lookup to be resolved. +neg106.fs(142,38,142,42): typecheck error FS3236: Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. + neg106.fs(142,38,142,42): typecheck error FS0001: Type mismatch. Expecting a 'outref<'a>' but given a diff --git a/tests/fsharp/typecheck/sigs/neg107-pre.fsx b/tests/fsharp/typecheck/sigs/neg107-pre.fsx new file mode 100644 index 00000000000..e64b1cb84da --- /dev/null +++ b/tests/fsharp/typecheck/sigs/neg107-pre.fsx @@ -0,0 +1,4 @@ +open System +open System.IO + +File.WriteAllText("neg107.generated.fsx", sprintf @"#r @""%s\.nuget\packages\System.Memory\4.5.0\lib\netstandard2.0\System.Memory.dll""" (Environment.GetEnvironmentVariable("USERPROFILE"))) diff --git a/tests/fsharp/typecheck/sigs/neg107.bsl b/tests/fsharp/typecheck/sigs/neg107.bsl index a999fa3c5c3..2fe7ea8251d 100644 --- a/tests/fsharp/typecheck/sigs/neg107.bsl +++ b/tests/fsharp/typecheck/sigs/neg107.bsl @@ -1,76 +1,108 @@ -neg107.fsx(26,48,26,59): typecheck error FS0406: The byref-typed variable 'a' is used in an invalid way. Byrefs cannot be captured by closures or passed to inner functions. +neg107.fsx(25,48,25,59): typecheck error FS0406: The byref-typed variable 'a' is used in an invalid way. Byrefs cannot be captured by closures or passed to inner functions. -neg107.fsx(27,69,27,80): typecheck error FS0406: The byref-typed variable 'a' is used in an invalid way. Byrefs cannot be captured by closures or passed to inner functions. +neg107.fsx(26,69,26,80): typecheck error FS0406: The byref-typed variable 'a' is used in an invalid way. Byrefs cannot be captured by closures or passed to inner functions. -neg107.fsx(28,43,28,59): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. +neg107.fsx(27,13,27,25): typecheck error FS3301: The function or method has an invalid return type '(unit -> Span)'. This is not permitted by the rules of Common IL. -neg107.fsx(28,47,28,58): typecheck error FS0406: The byref-typed variable 'a' is used in an invalid way. Byrefs cannot be captured by closures or passed to inner functions. +neg107.fsx(27,43,27,59): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. -neg107.fsx(28,57,28,58): typecheck error FS0418: The byref typed value 'a' cannot be used at this point +neg107.fsx(27,43,27,59): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. -neg107.fsx(28,47,28,58): typecheck error FS0425: The type of a first-class function cannot contain byrefs +neg107.fsx(27,47,27,58): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. -neg107.fsx(29,51,29,67): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. +neg107.fsx(27,47,27,58): typecheck error FS0406: The byref-typed variable 'a' is used in an invalid way. Byrefs cannot be captured by closures or passed to inner functions. -neg107.fsx(29,55,29,66): typecheck error FS0406: The byref-typed variable 'a' is used in an invalid way. Byrefs cannot be captured by closures or passed to inner functions. +neg107.fsx(27,57,27,58): typecheck error FS0418: The byref typed value 'a' cannot be used at this point -neg107.fsx(29,65,29,66): typecheck error FS0418: The byref typed value 'a' cannot be used at this point +neg107.fsx(27,47,27,58): typecheck error FS0425: The type of a first-class function cannot contain byrefs -neg107.fsx(29,55,29,66): typecheck error FS0425: The type of a first-class function cannot contain byrefs +neg107.fsx(28,13,28,25): typecheck error FS3301: The function or method has an invalid return type '(unit -> ReadOnlySpan)'. This is not permitted by the rules of Common IL. -neg107.fsx(31,49,31,54): typecheck error FS0406: The byref-typed variable 'a' is used in an invalid way. Byrefs cannot be captured by closures or passed to inner functions. +neg107.fsx(28,51,28,67): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. -neg107.fsx(31,57,31,65): typecheck error FS0406: The byref-typed variable 'a' is used in an invalid way. Byrefs cannot be captured by closures or passed to inner functions. +neg107.fsx(28,51,28,67): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. -neg107.fsx(32,70,32,75): typecheck error FS0406: The byref-typed variable 'a' is used in an invalid way. Byrefs cannot be captured by closures or passed to inner functions. +neg107.fsx(28,55,28,66): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. -neg107.fsx(32,78,32,86): typecheck error FS0406: The byref-typed variable 'a' is used in an invalid way. Byrefs cannot be captured by closures or passed to inner functions. +neg107.fsx(28,55,28,66): typecheck error FS0406: The byref-typed variable 'a' is used in an invalid way. Byrefs cannot be captured by closures or passed to inner functions. -neg107.fsx(33,48,33,53): typecheck error FS0406: The byref-typed variable 'a' is used in an invalid way. Byrefs cannot be captured by closures or passed to inner functions. +neg107.fsx(28,65,28,66): typecheck error FS0418: The byref typed value 'a' cannot be used at this point -neg107.fsx(33,48,33,53): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. +neg107.fsx(28,55,28,66): typecheck error FS0425: The type of a first-class function cannot contain byrefs -neg107.fsx(33,56,33,64): typecheck error FS0406: The byref-typed variable 'a' is used in an invalid way. Byrefs cannot be captured by closures or passed to inner functions. +neg107.fsx(30,49,30,54): typecheck error FS0406: The byref-typed variable 'a' is used in an invalid way. Byrefs cannot be captured by closures or passed to inner functions. -neg107.fsx(33,56,33,64): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. +neg107.fsx(30,57,30,65): typecheck error FS0406: The byref-typed variable 'a' is used in an invalid way. Byrefs cannot be captured by closures or passed to inner functions. -neg107.fsx(33,56,33,64): typecheck error FS0425: The type of a first-class function cannot contain byrefs +neg107.fsx(31,70,31,75): typecheck error FS0406: The byref-typed variable 'a' is used in an invalid way. Byrefs cannot be captured by closures or passed to inner functions. -neg107.fsx(33,48,33,53): typecheck error FS0425: The type of a first-class function cannot contain byrefs +neg107.fsx(31,78,31,86): typecheck error FS0406: The byref-typed variable 'a' is used in an invalid way. Byrefs cannot be captured by closures or passed to inner functions. -neg107.fsx(34,56,34,61): typecheck error FS0406: The byref-typed variable 'a' is used in an invalid way. Byrefs cannot be captured by closures or passed to inner functions. +neg107.fsx(32,13,32,30): typecheck error FS3301: The function or method has an invalid return type 'Async>'. This is not permitted by the rules of Common IL. -neg107.fsx(34,56,34,61): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. +neg107.fsx(32,48,32,53): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. -neg107.fsx(34,64,34,72): typecheck error FS0406: The byref-typed variable 'a' is used in an invalid way. Byrefs cannot be captured by closures or passed to inner functions. +neg107.fsx(32,48,32,53): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. -neg107.fsx(34,64,34,72): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. +neg107.fsx(32,48,32,53): typecheck error FS0406: The byref-typed variable 'a' is used in an invalid way. Byrefs cannot be captured by closures or passed to inner functions. -neg107.fsx(34,64,34,72): typecheck error FS0425: The type of a first-class function cannot contain byrefs +neg107.fsx(32,48,32,53): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. -neg107.fsx(34,56,34,61): typecheck error FS0425: The type of a first-class function cannot contain byrefs +neg107.fsx(32,56,32,64): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. -neg107.fsx(37,33,37,34): typecheck error FS0425: The type of a first-class function cannot contain byrefs +neg107.fsx(32,56,32,64): typecheck error FS0406: The byref-typed variable 'a' is used in an invalid way. Byrefs cannot be captured by closures or passed to inner functions. -neg107.fsx(37,33,37,34): typecheck error FS0425: The type of a first-class function cannot contain byrefs +neg107.fsx(32,56,32,64): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. -neg107.fsx(45,34,45,40): typecheck error FS3233: Struct members cannot return the address of fields of the struct by reference +neg107.fsx(32,56,32,64): typecheck error FS0425: The type of a first-class function cannot contain byrefs -neg107.fsx(45,34,45,38): typecheck error FS3233: Struct members cannot return the address of fields of the struct by reference +neg107.fsx(32,48,32,53): typecheck error FS0425: The type of a first-class function cannot contain byrefs -neg107.fsx(53,34,53,38): typecheck error FS3233: Struct members cannot return the address of fields of the struct by reference +neg107.fsx(33,13,33,30): typecheck error FS3301: The function or method has an invalid return type 'Async>'. This is not permitted by the rules of Common IL. -neg107.fsx(67,34,67,40): typecheck error FS3233: Struct members cannot return the address of fields of the struct by reference +neg107.fsx(33,56,33,61): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. -neg107.fsx(67,34,67,38): typecheck error FS3233: Struct members cannot return the address of fields of the struct by reference +neg107.fsx(33,56,33,61): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. -neg107.fsx(71,19,71,20): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. +neg107.fsx(33,56,33,61): typecheck error FS0406: The byref-typed variable 'a' is used in an invalid way. Byrefs cannot be captured by closures or passed to inner functions. -neg107.fsx(71,14,71,18): typecheck error FS0437: A type would store a byref typed value. This is not permitted by Common IL. +neg107.fsx(33,56,33,61): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. -neg107.fsx(71,19,71,20): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. +neg107.fsx(33,64,33,72): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. -neg107.fsx(71,19,71,20): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. +neg107.fsx(33,64,33,72): typecheck error FS0406: The byref-typed variable 'a' is used in an invalid way. Byrefs cannot be captured by closures or passed to inner functions. -neg107.fsx(71,19,71,20): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. +neg107.fsx(33,64,33,72): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. + +neg107.fsx(33,64,33,72): typecheck error FS0425: The type of a first-class function cannot contain byrefs + +neg107.fsx(33,56,33,61): typecheck error FS0425: The type of a first-class function cannot contain byrefs + +neg107.fsx(36,33,36,34): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. + +neg107.fsx(36,33,36,34): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. + +neg107.fsx(36,33,36,34): typecheck error FS0425: The type of a first-class function cannot contain byrefs + +neg107.fsx(36,33,36,34): typecheck error FS0425: The type of a first-class function cannot contain byrefs + +neg107.fsx(44,34,44,40): typecheck error FS3232: Struct members cannot return the address of fields of the struct by reference + +neg107.fsx(44,34,44,38): typecheck error FS3232: Struct members cannot return the address of fields of the struct by reference + +neg107.fsx(52,34,52,38): typecheck error FS3232: Struct members cannot return the address of fields of the struct by reference + +neg107.fsx(66,34,66,40): typecheck error FS3232: Struct members cannot return the address of fields of the struct by reference + +neg107.fsx(66,34,66,38): typecheck error FS3232: Struct members cannot return the address of fields of the struct by reference + +neg107.fsx(70,19,70,20): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. + +neg107.fsx(70,14,70,18): typecheck error FS0437: A type would store a byref typed value. This is not permitted by Common IL. + +neg107.fsx(70,19,70,20): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. + +neg107.fsx(70,19,70,20): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. + +neg107.fsx(70,19,70,20): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. diff --git a/tests/fsharp/typecheck/sigs/neg107.fsx b/tests/fsharp/typecheck/sigs/neg107.fsx index 1df5dec5fd4..ac27e3b62c4 100644 --- a/tests/fsharp/typecheck/sigs/neg107.fsx +++ b/tests/fsharp/typecheck/sigs/neg107.fsx @@ -1,5 +1,4 @@ -#r @"..\..\..\..\packages\System.Memory.4.5.0-rc1\lib\netstandard2.0\System.Memory.dll" -#r @"..\..\..\..\packages\NETStandard.Library.NETFramework.2.0.0-preview2-25405-01\build\net461\ref\netstandard.dll" +#load "neg107.generated.fsx" namespace System.Runtime.CompilerServices diff --git a/tests/fsharp/typecheck/sigs/neg107.vsbsl b/tests/fsharp/typecheck/sigs/neg107.vsbsl index a999fa3c5c3..2fe7ea8251d 100644 --- a/tests/fsharp/typecheck/sigs/neg107.vsbsl +++ b/tests/fsharp/typecheck/sigs/neg107.vsbsl @@ -1,76 +1,108 @@ -neg107.fsx(26,48,26,59): typecheck error FS0406: The byref-typed variable 'a' is used in an invalid way. Byrefs cannot be captured by closures or passed to inner functions. +neg107.fsx(25,48,25,59): typecheck error FS0406: The byref-typed variable 'a' is used in an invalid way. Byrefs cannot be captured by closures or passed to inner functions. -neg107.fsx(27,69,27,80): typecheck error FS0406: The byref-typed variable 'a' is used in an invalid way. Byrefs cannot be captured by closures or passed to inner functions. +neg107.fsx(26,69,26,80): typecheck error FS0406: The byref-typed variable 'a' is used in an invalid way. Byrefs cannot be captured by closures or passed to inner functions. -neg107.fsx(28,43,28,59): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. +neg107.fsx(27,13,27,25): typecheck error FS3301: The function or method has an invalid return type '(unit -> Span)'. This is not permitted by the rules of Common IL. -neg107.fsx(28,47,28,58): typecheck error FS0406: The byref-typed variable 'a' is used in an invalid way. Byrefs cannot be captured by closures or passed to inner functions. +neg107.fsx(27,43,27,59): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. -neg107.fsx(28,57,28,58): typecheck error FS0418: The byref typed value 'a' cannot be used at this point +neg107.fsx(27,43,27,59): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. -neg107.fsx(28,47,28,58): typecheck error FS0425: The type of a first-class function cannot contain byrefs +neg107.fsx(27,47,27,58): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. -neg107.fsx(29,51,29,67): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. +neg107.fsx(27,47,27,58): typecheck error FS0406: The byref-typed variable 'a' is used in an invalid way. Byrefs cannot be captured by closures or passed to inner functions. -neg107.fsx(29,55,29,66): typecheck error FS0406: The byref-typed variable 'a' is used in an invalid way. Byrefs cannot be captured by closures or passed to inner functions. +neg107.fsx(27,57,27,58): typecheck error FS0418: The byref typed value 'a' cannot be used at this point -neg107.fsx(29,65,29,66): typecheck error FS0418: The byref typed value 'a' cannot be used at this point +neg107.fsx(27,47,27,58): typecheck error FS0425: The type of a first-class function cannot contain byrefs -neg107.fsx(29,55,29,66): typecheck error FS0425: The type of a first-class function cannot contain byrefs +neg107.fsx(28,13,28,25): typecheck error FS3301: The function or method has an invalid return type '(unit -> ReadOnlySpan)'. This is not permitted by the rules of Common IL. -neg107.fsx(31,49,31,54): typecheck error FS0406: The byref-typed variable 'a' is used in an invalid way. Byrefs cannot be captured by closures or passed to inner functions. +neg107.fsx(28,51,28,67): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. -neg107.fsx(31,57,31,65): typecheck error FS0406: The byref-typed variable 'a' is used in an invalid way. Byrefs cannot be captured by closures or passed to inner functions. +neg107.fsx(28,51,28,67): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. -neg107.fsx(32,70,32,75): typecheck error FS0406: The byref-typed variable 'a' is used in an invalid way. Byrefs cannot be captured by closures or passed to inner functions. +neg107.fsx(28,55,28,66): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. -neg107.fsx(32,78,32,86): typecheck error FS0406: The byref-typed variable 'a' is used in an invalid way. Byrefs cannot be captured by closures or passed to inner functions. +neg107.fsx(28,55,28,66): typecheck error FS0406: The byref-typed variable 'a' is used in an invalid way. Byrefs cannot be captured by closures or passed to inner functions. -neg107.fsx(33,48,33,53): typecheck error FS0406: The byref-typed variable 'a' is used in an invalid way. Byrefs cannot be captured by closures or passed to inner functions. +neg107.fsx(28,65,28,66): typecheck error FS0418: The byref typed value 'a' cannot be used at this point -neg107.fsx(33,48,33,53): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. +neg107.fsx(28,55,28,66): typecheck error FS0425: The type of a first-class function cannot contain byrefs -neg107.fsx(33,56,33,64): typecheck error FS0406: The byref-typed variable 'a' is used in an invalid way. Byrefs cannot be captured by closures or passed to inner functions. +neg107.fsx(30,49,30,54): typecheck error FS0406: The byref-typed variable 'a' is used in an invalid way. Byrefs cannot be captured by closures or passed to inner functions. -neg107.fsx(33,56,33,64): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. +neg107.fsx(30,57,30,65): typecheck error FS0406: The byref-typed variable 'a' is used in an invalid way. Byrefs cannot be captured by closures or passed to inner functions. -neg107.fsx(33,56,33,64): typecheck error FS0425: The type of a first-class function cannot contain byrefs +neg107.fsx(31,70,31,75): typecheck error FS0406: The byref-typed variable 'a' is used in an invalid way. Byrefs cannot be captured by closures or passed to inner functions. -neg107.fsx(33,48,33,53): typecheck error FS0425: The type of a first-class function cannot contain byrefs +neg107.fsx(31,78,31,86): typecheck error FS0406: The byref-typed variable 'a' is used in an invalid way. Byrefs cannot be captured by closures or passed to inner functions. -neg107.fsx(34,56,34,61): typecheck error FS0406: The byref-typed variable 'a' is used in an invalid way. Byrefs cannot be captured by closures or passed to inner functions. +neg107.fsx(32,13,32,30): typecheck error FS3301: The function or method has an invalid return type 'Async>'. This is not permitted by the rules of Common IL. -neg107.fsx(34,56,34,61): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. +neg107.fsx(32,48,32,53): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. -neg107.fsx(34,64,34,72): typecheck error FS0406: The byref-typed variable 'a' is used in an invalid way. Byrefs cannot be captured by closures or passed to inner functions. +neg107.fsx(32,48,32,53): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. -neg107.fsx(34,64,34,72): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. +neg107.fsx(32,48,32,53): typecheck error FS0406: The byref-typed variable 'a' is used in an invalid way. Byrefs cannot be captured by closures or passed to inner functions. -neg107.fsx(34,64,34,72): typecheck error FS0425: The type of a first-class function cannot contain byrefs +neg107.fsx(32,48,32,53): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. -neg107.fsx(34,56,34,61): typecheck error FS0425: The type of a first-class function cannot contain byrefs +neg107.fsx(32,56,32,64): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. -neg107.fsx(37,33,37,34): typecheck error FS0425: The type of a first-class function cannot contain byrefs +neg107.fsx(32,56,32,64): typecheck error FS0406: The byref-typed variable 'a' is used in an invalid way. Byrefs cannot be captured by closures or passed to inner functions. -neg107.fsx(37,33,37,34): typecheck error FS0425: The type of a first-class function cannot contain byrefs +neg107.fsx(32,56,32,64): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. -neg107.fsx(45,34,45,40): typecheck error FS3233: Struct members cannot return the address of fields of the struct by reference +neg107.fsx(32,56,32,64): typecheck error FS0425: The type of a first-class function cannot contain byrefs -neg107.fsx(45,34,45,38): typecheck error FS3233: Struct members cannot return the address of fields of the struct by reference +neg107.fsx(32,48,32,53): typecheck error FS0425: The type of a first-class function cannot contain byrefs -neg107.fsx(53,34,53,38): typecheck error FS3233: Struct members cannot return the address of fields of the struct by reference +neg107.fsx(33,13,33,30): typecheck error FS3301: The function or method has an invalid return type 'Async>'. This is not permitted by the rules of Common IL. -neg107.fsx(67,34,67,40): typecheck error FS3233: Struct members cannot return the address of fields of the struct by reference +neg107.fsx(33,56,33,61): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. -neg107.fsx(67,34,67,38): typecheck error FS3233: Struct members cannot return the address of fields of the struct by reference +neg107.fsx(33,56,33,61): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. -neg107.fsx(71,19,71,20): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. +neg107.fsx(33,56,33,61): typecheck error FS0406: The byref-typed variable 'a' is used in an invalid way. Byrefs cannot be captured by closures or passed to inner functions. -neg107.fsx(71,14,71,18): typecheck error FS0437: A type would store a byref typed value. This is not permitted by Common IL. +neg107.fsx(33,56,33,61): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. -neg107.fsx(71,19,71,20): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. +neg107.fsx(33,64,33,72): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. -neg107.fsx(71,19,71,20): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. +neg107.fsx(33,64,33,72): typecheck error FS0406: The byref-typed variable 'a' is used in an invalid way. Byrefs cannot be captured by closures or passed to inner functions. -neg107.fsx(71,19,71,20): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. +neg107.fsx(33,64,33,72): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. + +neg107.fsx(33,64,33,72): typecheck error FS0425: The type of a first-class function cannot contain byrefs + +neg107.fsx(33,56,33,61): typecheck error FS0425: The type of a first-class function cannot contain byrefs + +neg107.fsx(36,33,36,34): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. + +neg107.fsx(36,33,36,34): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. + +neg107.fsx(36,33,36,34): typecheck error FS0425: The type of a first-class function cannot contain byrefs + +neg107.fsx(36,33,36,34): typecheck error FS0425: The type of a first-class function cannot contain byrefs + +neg107.fsx(44,34,44,40): typecheck error FS3232: Struct members cannot return the address of fields of the struct by reference + +neg107.fsx(44,34,44,38): typecheck error FS3232: Struct members cannot return the address of fields of the struct by reference + +neg107.fsx(52,34,52,38): typecheck error FS3232: Struct members cannot return the address of fields of the struct by reference + +neg107.fsx(66,34,66,40): typecheck error FS3232: Struct members cannot return the address of fields of the struct by reference + +neg107.fsx(66,34,66,38): typecheck error FS3232: Struct members cannot return the address of fields of the struct by reference + +neg107.fsx(70,19,70,20): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. + +neg107.fsx(70,14,70,18): typecheck error FS0437: A type would store a byref typed value. This is not permitted by Common IL. + +neg107.fsx(70,19,70,20): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. + +neg107.fsx(70,19,70,20): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. + +neg107.fsx(70,19,70,20): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. diff --git a/tests/fsharp/typecheck/sigs/neg108.bsl b/tests/fsharp/typecheck/sigs/neg108.bsl index 77e4943fa7c..d29ee5e1a75 100644 --- a/tests/fsharp/typecheck/sigs/neg108.bsl +++ b/tests/fsharp/typecheck/sigs/neg108.bsl @@ -1,2 +1,5 @@ -neg108.fs(5,3,5,15): typecheck error FS3242: This type does not inherit Attribute, it will not work correctly with other .NET languages. +neg108.fs(4,19,4,23): typecheck error FS0001: This expression was expected to have type + 'Test' +but here has type + 'Unit -> Test' diff --git a/tests/fsharp/typecheck/sigs/neg108.fs b/tests/fsharp/typecheck/sigs/neg108.fs index 974a0ffa7e9..d356032b7d6 100644 --- a/tests/fsharp/typecheck/sigs/neg108.fs +++ b/tests/fsharp/typecheck/sigs/neg108.fs @@ -1,8 +1,7 @@ module Neg108 -// check that a decent error is given when a type that does not inherit from System.Attribute is used as attribute -type NotAttribute() = class end -[] -type T() = class end +type Test = Test of Unit +let test : Test = Test + + -// note this test shouldn't contain any other code diff --git a/tests/fsharp/typecheck/sigs/neg110.bsl b/tests/fsharp/typecheck/sigs/neg110.bsl new file mode 100644 index 00000000000..084a852ba7b --- /dev/null +++ b/tests/fsharp/typecheck/sigs/neg110.bsl @@ -0,0 +1,14 @@ + +neg110.fs(2,552,2,557): typecheck error FS0039: The type 'fail1' is not defined. + +neg110.fs(2,552,2,557): typecheck error FS0039: The type 'fail1' is not defined. + +neg110.fs(3,624,3,629): typecheck error FS0039: The value or constructor 'fail2' is not defined. Maybe you want one of the following: + + Failure + + failwith + + failwithf + +neg110.fs(5,538,5,540): typecheck error FS0003: This value is not a function and cannot be applied. diff --git a/tests/fsharp/typecheck/sigs/neg110.fs b/tests/fsharp/typecheck/sigs/neg110.fs new file mode 100644 index 00000000000..109f5de8402 --- /dev/null +++ b/tests/fsharp/typecheck/sigs/neg110.fs @@ -0,0 +1,5 @@ +module Neg110 +type TestDU = | A1 of string | A2 of string | A3 of string | A4 of string | A5 of string | A6 of string | A7 of string | A8 of string | A9 of string | A10 of string | A11 of string | A12 | A13 | A14 | A15 | A16 | A17 | A18 | A19 | A20 | A21 | A22 | A23 | A24 | A25 | A26 | A27 | A28 | A29 | A30 | A31 | A32 | A33 | A34 | A35 | A36 | A37 | A38 | A39 | A40 | A41 | A42 | A43 | A44 | A45 | A46 | A47 | A48 | A49 | A50 | A51 | A52 | A53 | A54 | A55 | A56 | A57 | A58 | A59 | A60 | A61 | A62 | A63 | A64 | A65 | A66 | A67AAAAAAAAAAAAAAAAAAAAAAAA of string fail1 +type TestRec = { Naaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaammmmmmmmmmmmeeeeeeeeeeee : string; Name2 : string } member x.P = fail2 +module SomeRidiculouslyLongNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaammmmmmmmmmmmeeeeeeeeeeee = + let testFunctionNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaammmmmmmmmmmmeeeeeeeeeeee () = () fail4 diff --git a/tests/fsharp/typecheck/sigs/neg113.bsl b/tests/fsharp/typecheck/sigs/neg113.bsl new file mode 100644 index 00000000000..211ba670f91 --- /dev/null +++ b/tests/fsharp/typecheck/sigs/neg113.bsl @@ -0,0 +1,24 @@ + +neg113.fs(5,50,5,61): typecheck error FS0001: Two anonymous record types have mismatched sets of field names '["a"; "b"]' and '["a"]' + +neg113.fs(7,41,7,52): typecheck error FS0001: Two anonymous record types have mismatched sets of field names '["b"]' and '["a"]' + +neg113.fs(10,27,10,55): typecheck error FS0059: The type '{|a : int|}' does not have any proper subtypes and need not be used as the target of a static coercion + +neg113.fs(10,27,10,55): typecheck error FS0193: Type constraint mismatch. The type + '{|b : int|}' +is not compatible with type + '{|a : int|}' + + +neg113.fs(13,27,13,62): typecheck error FS0059: The type '{|a : int|}' does not have any proper subtypes and need not be used as the target of a static coercion + +neg113.fs(13,27,13,62): typecheck error FS0193: Type constraint mismatch. The type + '{|a : int ; b : int|}' +is not compatible with type + '{|a : int|}' + + +neg113.fs(18,34,18,36): typecheck error FS0001: The type '('a -> 'a)' does not support the 'comparison' constraint. For example, it does not support the 'System.IComparable' interface + +neg113.fs(20,42,20,44): typecheck error FS0001: The type '('a -> 'a)' does not support the 'comparison' constraint. For example, it does not support the 'System.IComparable' interface diff --git a/tests/fsharp/typecheck/sigs/neg113.fs b/tests/fsharp/typecheck/sigs/neg113.fs new file mode 100644 index 00000000000..4979cea70bd --- /dev/null +++ b/tests/fsharp/typecheck/sigs/neg113.fs @@ -0,0 +1,20 @@ + +module M + + // Check we get compile-time errors + let negTypeTest1() = ({| a = 1+1; b = 2 |} = {| a = 2 |}) + + let negTypeTest2() = ({| b = 2 |} = {| a = 2 |} ) + + // no subsumption + let negTypeTest3() = ({| b = 2 |} :> {| a : int |} ) + + // no subsumption + let negTypeTest4() = ({| b = 2; a = 1 |} :> {| a : int |} ) + + let posgTypeTest5() = ({| b = 2; a = 1 |} = {| a = 1; b = 2 |} ) + + // Comparison is not possible if structural elements are comparable + let negTypeTest6() = ({| a = id |} > {| a = id |}) + + let negTypeTest7() = (compare {| a = id |} {| a = id |}) \ No newline at end of file diff --git a/tests/fsharp/typecheck/sigs/neg113.vsbsl b/tests/fsharp/typecheck/sigs/neg113.vsbsl new file mode 100644 index 00000000000..211ba670f91 --- /dev/null +++ b/tests/fsharp/typecheck/sigs/neg113.vsbsl @@ -0,0 +1,24 @@ + +neg113.fs(5,50,5,61): typecheck error FS0001: Two anonymous record types have mismatched sets of field names '["a"; "b"]' and '["a"]' + +neg113.fs(7,41,7,52): typecheck error FS0001: Two anonymous record types have mismatched sets of field names '["b"]' and '["a"]' + +neg113.fs(10,27,10,55): typecheck error FS0059: The type '{|a : int|}' does not have any proper subtypes and need not be used as the target of a static coercion + +neg113.fs(10,27,10,55): typecheck error FS0193: Type constraint mismatch. The type + '{|b : int|}' +is not compatible with type + '{|a : int|}' + + +neg113.fs(13,27,13,62): typecheck error FS0059: The type '{|a : int|}' does not have any proper subtypes and need not be used as the target of a static coercion + +neg113.fs(13,27,13,62): typecheck error FS0193: Type constraint mismatch. The type + '{|a : int ; b : int|}' +is not compatible with type + '{|a : int|}' + + +neg113.fs(18,34,18,36): typecheck error FS0001: The type '('a -> 'a)' does not support the 'comparison' constraint. For example, it does not support the 'System.IComparable' interface + +neg113.fs(20,42,20,44): typecheck error FS0001: The type '('a -> 'a)' does not support the 'comparison' constraint. For example, it does not support the 'System.IComparable' interface diff --git a/tests/fsharp/typecheck/sigs/neg114.bsl b/tests/fsharp/typecheck/sigs/neg114.bsl new file mode 100644 index 00000000000..f69db960676 --- /dev/null +++ b/tests/fsharp/typecheck/sigs/neg114.bsl @@ -0,0 +1,20 @@ + +neg114.fs(6,38,6,39): parse error FS0010: Unexpected symbol '}' in binding. Expected '|}' or other token. + +neg114.fs(6,29,6,31): parse error FS0605: Unmatched '{|' + +neg114.fs(8,5,8,8): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (6:29). Try indenting this token further or using standard formatting conventions. + +neg114.fs(10,5,10,9): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (8:5). Try indenting this token further or using standard formatting conventions. + +neg114.fs(10,5,10,9): parse error FS0010: Unexpected keyword 'type' in binding. Expected incomplete structured construct at or before this point or other token. + +neg114.fs(6,5,6,8): parse error FS3118: Incomplete value or function definition. If this is in an expression, the body of the expression must be indented to the same column as the 'let' keyword. + +neg114.fs(10,25,10,26): parse error FS0010: Unexpected symbol '}' in type definition. Expected '|}' or other token. + +neg114.fs(10,14,10,16): parse error FS0605: Unmatched '{|' + +neg114.fs(12,5,12,8): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (10:14). Try indenting this token further or using standard formatting conventions. + +neg114.fs(13,1,13,1): parse error FS0010: Incomplete structured construct at or before this point in implementation file diff --git a/tests/fsharp/typecheck/sigs/neg114.fs b/tests/fsharp/typecheck/sigs/neg114.fs new file mode 100644 index 00000000000..98c907e65d3 --- /dev/null +++ b/tests/fsharp/typecheck/sigs/neg114.fs @@ -0,0 +1,12 @@ + +module M + + + // Check we get parsing error and decent recovery + let negParsingTest2() = {| b = 2 } + + let normalCode1() = () + // Check we get parsing error and decent recovery + type X = {| A : int } + + let normalCode2() = () diff --git a/tests/fsharp/typecheck/sigs/neg114.vsbsl b/tests/fsharp/typecheck/sigs/neg114.vsbsl new file mode 100644 index 00000000000..1573127e3b5 --- /dev/null +++ b/tests/fsharp/typecheck/sigs/neg114.vsbsl @@ -0,0 +1,24 @@ + +neg114.fs(6,38,6,39): parse error FS0010: Unexpected symbol '}' in binding. Expected '|}' or other token. + +neg114.fs(6,29,6,31): parse error FS0605: Unmatched '{|' + +neg114.fs(8,5,8,8): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (6:29). Try indenting this token further or using standard formatting conventions. + +neg114.fs(10,5,10,9): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (8:5). Try indenting this token further or using standard formatting conventions. + +neg114.fs(10,5,10,9): parse error FS0010: Unexpected keyword 'type' in binding. Expected incomplete structured construct at or before this point or other token. + +neg114.fs(6,5,6,8): parse error FS3118: Incomplete value or function definition. If this is in an expression, the body of the expression must be indented to the same column as the 'let' keyword. + +neg114.fs(10,25,10,26): parse error FS0010: Unexpected symbol '}' in type definition. Expected '|}' or other token. + +neg114.fs(10,14,10,16): parse error FS0605: Unmatched '{|' + +neg114.fs(12,5,12,8): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (10:14). Try indenting this token further or using standard formatting conventions. + +neg114.fs(13,1,13,1): parse error FS0010: Incomplete structured construct at or before this point in implementation file + +neg114.fs(10,10,10,11): typecheck error FS0964: Type abbreviations cannot have augmentations + +neg114.fs(12,5,12,27): typecheck error FS0912: This declaration element is not permitted in an augmentation diff --git a/tests/fsharp/typecheck/sigs/neg63.bsl b/tests/fsharp/typecheck/sigs/neg63.bsl index 8898a017253..194fbe88771 100644 --- a/tests/fsharp/typecheck/sigs/neg63.bsl +++ b/tests/fsharp/typecheck/sigs/neg63.bsl @@ -1,6 +1,8 @@ neg63.fs(6,8,6,14): typecheck error FS3155: A quotation may not involve an assignment to or taking the address of a captured local variable +neg63.fs(9,5,9,13): typecheck error FS3301: The function or method has an invalid return type 'Quotations.Expr>'. This is not permitted by the rules of Common IL. + neg63.fs(11,9,11,10): typecheck error FS0421: The address of the variable 'x' cannot be used at this point neg63.fs(11,9,11,10): typecheck error FS3155: A quotation may not involve an assignment to or taking the address of a captured local variable @@ -12,3 +14,7 @@ neg63.fs(14,8,14,9): typecheck error FS3155: A quotation may not involve an assi neg63.fs(18,6,18,7): typecheck error FS3209: The address of the variable 'x' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. neg63.fs(26,6,26,10): typecheck error FS3209: The address of the variable 'addr' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. + +neg63.fs(30,24,30,25): typecheck error FS3232: Struct members cannot return the address of fields of the struct by reference + +neg63.fs(30,24,30,25): typecheck error FS3232: Struct members cannot return the address of fields of the struct by reference diff --git a/tests/fsharp/typecheck/sigs/neg63.fs b/tests/fsharp/typecheck/sigs/neg63.fs index bf8b25cac8e..8f22c5468e1 100644 --- a/tests/fsharp/typecheck/sigs/neg63.fs +++ b/tests/fsharp/typecheck/sigs/neg63.fs @@ -1,7 +1,7 @@ module Test -let negTest1() = +let negTest1() = let mutable x = 0 <@ x <- 1 @> @@ -25,14 +25,6 @@ let negTest5() = let addr = &x &addr -type Struct(initial:int) = - let mutable x = initial +[] +type Struct(x:int) = member __.AddrX = &x - member __.IncrX() = x <- x + 1 - -let posTest6(iterator: byref) = - iterator.AddrX - -let negTest7() = - let mutable iterator = Struct(0) - iterator.AddrX diff --git a/tests/fsharp/typecheck/sigs/neg_anon_1.bsl b/tests/fsharp/typecheck/sigs/neg_anon_1.bsl new file mode 100644 index 00000000000..d7aaaecd939 --- /dev/null +++ b/tests/fsharp/typecheck/sigs/neg_anon_1.bsl @@ -0,0 +1,24 @@ + +neg_anon_1.fs(5,50,5,61): typecheck error FS0001: Two anonymous record types have mismatched sets of field names '["a"; "b"]' and '["a"]' + +neg_anon_1.fs(7,41,7,52): typecheck error FS0001: Two anonymous record types have mismatched sets of field names '["b"]' and '["a"]' + +neg_anon_1.fs(10,27,10,55): typecheck error FS0059: The type '{|a : int|}' does not have any proper subtypes and need not be used as the target of a static coercion + +neg_anon_1.fs(10,27,10,55): typecheck error FS0193: Type constraint mismatch. The type + '{|b : int|}' +is not compatible with type + '{|a : int|}' + + +neg_anon_1.fs(13,27,13,62): typecheck error FS0059: The type '{|a : int|}' does not have any proper subtypes and need not be used as the target of a static coercion + +neg_anon_1.fs(13,27,13,62): typecheck error FS0193: Type constraint mismatch. The type + '{|a : int ; b : int|}' +is not compatible with type + '{|a : int|}' + + +neg_anon_1.fs(18,34,18,36): typecheck error FS0001: The type '('a -> 'a)' does not support the 'comparison' constraint. For example, it does not support the 'System.IComparable' interface + +neg_anon_1.fs(20,42,20,44): typecheck error FS0001: The type '('a -> 'a)' does not support the 'comparison' constraint. For example, it does not support the 'System.IComparable' interface diff --git a/tests/fsharp/typecheck/sigs/neg_anon_1.fs b/tests/fsharp/typecheck/sigs/neg_anon_1.fs new file mode 100644 index 00000000000..660788f83e2 --- /dev/null +++ b/tests/fsharp/typecheck/sigs/neg_anon_1.fs @@ -0,0 +1,20 @@ + +module M + + // Check we get compile-time errors + let negTypeTest1() = ({| a = 1+1; b = 2 |} = {| a = 2 |}) + + let negTypeTest2() = ({| b = 2 |} = {| a = 2 |} ) + + // no subsumption + let negTypeTest3() = ({| b = 2 |} :> {| a : int |} ) + + // no subsumption + let negTypeTest4() = ({| b = 2; a = 1 |} :> {| a : int |} ) + + let posgTypeTest5() = ({| b = 2; a = 1 |} = {| a = 1; b = 2 |} ) + + // Comparison is not possible if structural elements are comparable + let negTypeTest6() = ({| a = id |} > {| a = id |}) + + let negTypeTest7() = (compare {| a = id |} {| a = id |}) diff --git a/tests/fsharp/typecheck/sigs/neg_anon_2.bsl b/tests/fsharp/typecheck/sigs/neg_anon_2.bsl new file mode 100644 index 00000000000..2cd5b247a56 --- /dev/null +++ b/tests/fsharp/typecheck/sigs/neg_anon_2.bsl @@ -0,0 +1,20 @@ + +neg_anon_2.fs(6,38,6,39): parse error FS0010: Unexpected symbol '}' in binding. Expected '|}' or other token. + +neg_anon_2.fs(6,29,6,31): parse error FS0605: Unmatched '{|' + +neg_anon_2.fs(8,5,8,8): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (6:29). Try indenting this token further or using standard formatting conventions. + +neg_anon_2.fs(10,5,10,9): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (8:5). Try indenting this token further or using standard formatting conventions. + +neg_anon_2.fs(10,5,10,9): parse error FS0010: Unexpected keyword 'type' in binding. Expected incomplete structured construct at or before this point or other token. + +neg_anon_2.fs(6,5,6,8): parse error FS3118: Incomplete value or function definition. If this is in an expression, the body of the expression must be indented to the same column as the 'let' keyword. + +neg_anon_2.fs(10,25,10,26): parse error FS0010: Unexpected symbol '}' in type definition. Expected '|}' or other token. + +neg_anon_2.fs(10,14,10,16): parse error FS0605: Unmatched '{|' + +neg_anon_2.fs(12,5,12,8): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (10:14). Try indenting this token further or using standard formatting conventions. + +neg_anon_2.fs(14,1,14,1): parse error FS0010: Incomplete structured construct at or before this point in implementation file diff --git a/tests/fsharp/typecheck/sigs/neg_anon_2.fs b/tests/fsharp/typecheck/sigs/neg_anon_2.fs new file mode 100644 index 00000000000..adbdc0fa986 --- /dev/null +++ b/tests/fsharp/typecheck/sigs/neg_anon_2.fs @@ -0,0 +1,13 @@ + +module M + + + // Check we get parsing error and decent recovery + let negParsingTest2() = {| b = 2 } + + let normalCode1() = () + // Check we get parsing error and decent recovery + type X = {| A : int } + + let normalCode2() = () + diff --git a/tests/fsharp/typecheck/sigs/neg_anon_2.vsbsl b/tests/fsharp/typecheck/sigs/neg_anon_2.vsbsl new file mode 100644 index 00000000000..aa18d4d8d88 --- /dev/null +++ b/tests/fsharp/typecheck/sigs/neg_anon_2.vsbsl @@ -0,0 +1,24 @@ + +neg_anon_2.fs(6,38,6,39): parse error FS0010: Unexpected symbol '}' in binding. Expected '|}' or other token. + +neg_anon_2.fs(6,29,6,31): parse error FS0605: Unmatched '{|' + +neg_anon_2.fs(8,5,8,8): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (6:29). Try indenting this token further or using standard formatting conventions. + +neg_anon_2.fs(10,5,10,9): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (8:5). Try indenting this token further or using standard formatting conventions. + +neg_anon_2.fs(10,5,10,9): parse error FS0010: Unexpected keyword 'type' in binding. Expected incomplete structured construct at or before this point or other token. + +neg_anon_2.fs(6,5,6,8): parse error FS3118: Incomplete value or function definition. If this is in an expression, the body of the expression must be indented to the same column as the 'let' keyword. + +neg_anon_2.fs(10,25,10,26): parse error FS0010: Unexpected symbol '}' in type definition. Expected '|}' or other token. + +neg_anon_2.fs(10,14,10,16): parse error FS0605: Unmatched '{|' + +neg_anon_2.fs(12,5,12,8): parse error FS0058: Possible incorrect indentation: this token is offside of context started at position (10:14). Try indenting this token further or using standard formatting conventions. + +neg_anon_2.fs(14,1,14,1): parse error FS0010: Incomplete structured construct at or before this point in implementation file + +neg_anon_2.fs(10,10,10,11): typecheck error FS0964: Type abbreviations cannot have augmentations + +neg_anon_2.fs(12,5,12,27): typecheck error FS0912: This declaration element is not permitted in an augmentation diff --git a/tests/fsharp/typecheck/sigs/neg_byref_1.bsl b/tests/fsharp/typecheck/sigs/neg_byref_1.bsl index 3428aa81d88..ce415d11765 100644 --- a/tests/fsharp/typecheck/sigs/neg_byref_1.bsl +++ b/tests/fsharp/typecheck/sigs/neg_byref_1.bsl @@ -1,4 +1,6 @@ neg_byref_1.fs(2,5,2,8): typecheck error FS0431: A byref typed value would be stored here. Top-level let-bound byref values are not permitted. +neg_byref_1.fs(2,5,2,8): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. + neg_byref_1.fs(2,11,2,13): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. diff --git a/tests/fsharp/typecheck/sigs/neg_byref_16.bsl b/tests/fsharp/typecheck/sigs/neg_byref_16.bsl index 529156816da..d7964e54120 100644 --- a/tests/fsharp/typecheck/sigs/neg_byref_16.bsl +++ b/tests/fsharp/typecheck/sigs/neg_byref_16.bsl @@ -1,4 +1,8 @@ +neg_byref_16.fs(3,5,3,6): typecheck error FS3301: The function or method has an invalid return type '('a -> bool -> byref * 'a)'. This is not permitted by the rules of Common IL. + +neg_byref_16.fs(3,33,3,42): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. + neg_byref_16.fs(3,33,3,42): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. neg_byref_16.fs(3,40,3,41): typecheck error FS0421: The address of the variable 'a' cannot be used at this point diff --git a/tests/fsharp/typecheck/sigs/neg_byref_2.bsl b/tests/fsharp/typecheck/sigs/neg_byref_2.bsl index ce1fb78ab1b..a53bcefc4f3 100644 --- a/tests/fsharp/typecheck/sigs/neg_byref_2.bsl +++ b/tests/fsharp/typecheck/sigs/neg_byref_2.bsl @@ -1,4 +1,6 @@ neg_byref_2.fs(2,5,2,8): typecheck error FS0431: A byref typed value would be stored here. Top-level let-bound byref values are not permitted. +neg_byref_2.fs(2,5,2,8): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. + neg_byref_2.fs(2,11,2,15): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. diff --git a/tests/fsharp/typecheck/sigs/neg_byref_20.bsl b/tests/fsharp/typecheck/sigs/neg_byref_20.bsl index eecb7fcc8f5..408b36c3df4 100644 --- a/tests/fsharp/typecheck/sigs/neg_byref_20.bsl +++ b/tests/fsharp/typecheck/sigs/neg_byref_20.bsl @@ -1,2 +1,4 @@ neg_byref_20.fs(2,2,2,21): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. + +neg_byref_20.fs(2,2,2,21): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. diff --git a/tests/fsharp/typecheck/sigs/neg_byref_23.bsl b/tests/fsharp/typecheck/sigs/neg_byref_23.bsl index ca76f5bcc5e..a21c9e02d5e 100644 --- a/tests/fsharp/typecheck/sigs/neg_byref_23.bsl +++ b/tests/fsharp/typecheck/sigs/neg_byref_23.bsl @@ -1,2 +1,6 @@ neg_byref_23.fs(4,5,4,6): typecheck error FS0431: A byref typed value would be stored here. Top-level let-bound byref values are not permitted. + +neg_byref_23.fs(4,5,4,6): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. + +neg_byref_23.fs(4,9,4,10): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. diff --git a/tests/fsharp/typecheck/sigs/neg_byref_3.bsl b/tests/fsharp/typecheck/sigs/neg_byref_3.bsl index fb8ccdd71f9..48fb07c7f7e 100644 --- a/tests/fsharp/typecheck/sigs/neg_byref_3.bsl +++ b/tests/fsharp/typecheck/sigs/neg_byref_3.bsl @@ -1,6 +1,14 @@ neg_byref_3.fs(2,5,2,8): typecheck error FS0431: A byref typed value would be stored here. Top-level let-bound byref values are not permitted. +neg_byref_3.fs(2,5,2,8): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. + +neg_byref_3.fs(2,11,2,22): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. + neg_byref_3.fs(2,11,2,22): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. +neg_byref_3.fs(3,5,3,6): typecheck error FS3301: The function or method has an invalid return type '(byref list -> int)'. This is not permitted by the rules of Common IL. + +neg_byref_3.fs(3,11,3,22): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. + neg_byref_3.fs(3,11,3,22): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. diff --git a/tests/fsharp/typecheck/sigs/neg_byref_5.bsl b/tests/fsharp/typecheck/sigs/neg_byref_5.bsl index d60bde983ab..9364c2b9b44 100644 --- a/tests/fsharp/typecheck/sigs/neg_byref_5.bsl +++ b/tests/fsharp/typecheck/sigs/neg_byref_5.bsl @@ -1,4 +1,6 @@ neg_byref_5.fs(2,5,2,9): typecheck error FS0431: A byref typed value would be stored here. Top-level let-bound byref values are not permitted. +neg_byref_5.fs(2,5,2,9): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. + neg_byref_5.fs(2,12,2,16): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. diff --git a/tests/fsharp/typecheck/sigs/neg_byref_6.bsl b/tests/fsharp/typecheck/sigs/neg_byref_6.bsl index 18c5efe534e..465bfaa5657 100644 --- a/tests/fsharp/typecheck/sigs/neg_byref_6.bsl +++ b/tests/fsharp/typecheck/sigs/neg_byref_6.bsl @@ -1,4 +1,6 @@ neg_byref_6.fs(2,5,2,9): typecheck error FS0431: A byref typed value would be stored here. Top-level let-bound byref values are not permitted. +neg_byref_6.fs(2,5,2,9): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. + neg_byref_6.fs(2,12,2,17): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. diff --git a/tests/fsharp/typecheck/sigs/neg_byref_7.bsl b/tests/fsharp/typecheck/sigs/neg_byref_7.bsl index 11f25ecb6d4..cbe7789b3a1 100644 --- a/tests/fsharp/typecheck/sigs/neg_byref_7.bsl +++ b/tests/fsharp/typecheck/sigs/neg_byref_7.bsl @@ -1,4 +1,8 @@ +neg_byref_7.fs(2,31,2,35): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. + +neg_byref_7.fs(2,31,2,35): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. + neg_byref_7.fs(2,38,2,43): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. neg_byref_7.fs(2,38,2,43): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. diff --git a/tests/fsharp/typecheck/sigs/neg_byref_8.bsl b/tests/fsharp/typecheck/sigs/neg_byref_8.bsl index d0665ef6b9a..d39ae5771d1 100644 --- a/tests/fsharp/typecheck/sigs/neg_byref_8.bsl +++ b/tests/fsharp/typecheck/sigs/neg_byref_8.bsl @@ -1,4 +1,8 @@ +neg_byref_8.fs(2,31,2,35): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. + +neg_byref_8.fs(2,31,2,35): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. + neg_byref_8.fs(2,38,2,43): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. neg_byref_8.fs(2,38,2,43): typecheck error FS0412: A type instantiation involves a byref type. This is not permitted by the rules of Common IL. diff --git a/tests/fsharpqa/Source/CodeGen/EmittedIL/CompareIL.cmd b/tests/fsharpqa/Source/CodeGen/EmittedIL/CompareIL.cmd index da8260013c7..1786d4bc552 100644 --- a/tests/fsharpqa/Source/CodeGen/EmittedIL/CompareIL.cmd +++ b/tests/fsharpqa/Source/CodeGen/EmittedIL/CompareIL.cmd @@ -3,7 +3,7 @@ REM == %1 --> assembly ildasm /TEXT /LINENUM /NOBAR "%~nx1" >"%~n1.il" IF NOT ERRORLEVEL 0 exit 1 -echo ..\..\..\..\testenv\bin\ILComparer.exe "%~n1.il.bsl" "%~n1.il" -..\..\..\..\testenv\bin\ILComparer.exe "%~n1.il.bsl" "%~n1.il" +echo %~dp0..\..\..\testenv\bin\ILComparer.exe "%~n1.il.bsl" "%~n1.il" + %~dp0..\..\..\testenv\bin\ILComparer.exe "%~n1.il.bsl" "%~n1.il" exit /b %ERRORLEVEL% diff --git a/tests/fsharpqa/Source/CodeGen/EmittedIL/Tuples/ValueTupleAliasConstructor.il.bsl.net47 b/tests/fsharpqa/Source/CodeGen/EmittedIL/Tuples/ValueTupleAliasConstructor.il.bsl.net47 new file mode 100644 index 00000000000..0c4121676d1 --- /dev/null +++ b/tests/fsharpqa/Source/CodeGen/EmittedIL/Tuples/ValueTupleAliasConstructor.il.bsl.net47 @@ -0,0 +1,83 @@ + +// Microsoft (R) .NET Framework IL Disassembler. Version 4.6.1055.0 +// Copyright (c) Microsoft Corporation. All rights reserved. + + + +// Metadata version: v4.0.30319 +.assembly extern mscorlib +{ + .publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) // .z\V.4.. + .ver 4:0:0:0 +} +.assembly extern FSharp.Core +{ + .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) // .?_....: + .ver 4:5:0:0 +} +.assembly ValueTupleAliasConstructor +{ + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.FSharpInterfaceDataVersionAttribute::.ctor(int32, + int32, + int32) = ( 01 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 ) + + // --- The following custom attribute is added automatically, do not uncomment ------- + // .custom instance void [mscorlib]System.Diagnostics.DebuggableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggableAttribute/DebuggingModes) = ( 01 00 01 00 00 00 00 00 ) + + .hash algorithm 0x00008004 + .ver 0:0:0:0 +} +.mresource public FSharpSignatureData.ValueTupleAliasConstructor +{ + // Offset: 0x00000000 Length: 0x000001EA +} +.mresource public FSharpOptimizationData.ValueTupleAliasConstructor +{ + // Offset: 0x000001F0 Length: 0x00000061 +} +.module ValueTupleAliasConstructor.exe +// MVID: {5C136441-E59F-7FAD-A745-03834164135C} +.imagebase 0x00400000 +.file alignment 0x00000200 +.stackreserve 0x00100000 +.subsystem 0x0003 // WINDOWS_CUI +.corflags 0x00000001 // ILONLY +// Image base: 0x01150000 + + +// =============== CLASS MEMBERS DECLARATION =================== + +.class public abstract auto ansi sealed ValueTupleAliasConstructor + extends [mscorlib]System.Object +{ + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 07 00 00 00 00 00 ) +} // end of class ValueTupleAliasConstructor + +.class private abstract auto ansi sealed ''.$ValueTupleAliasConstructor + extends [mscorlib]System.Object +{ + .field static assembly int32 init@ + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .method public static void main@() cil managed + { + .entrypoint + // Code size 9 (0x9) + .maxstack 8 + .language '{AB4F38C9-B6E6-43BA-BE3B-58080B2CCCE3}', '{994B45C4-E6E9-11D2-903F-00C04FA302A1}', '{5A869D0B-6611-11D3-BD2A-0000F80849BD}' + .line 3,3 : 9,22 'c:\\kevinransom\\visualfsharp\\tests\\fsharpqa\\Source\\CodeGen\\EmittedIL\\Tuples\\ValueTupleAliasConstructor.fs' + IL_0000: ldc.i4.2 + IL_0001: ldc.i4.2 + IL_0002: newobj instance void valuetype [mscorlib]System.ValueTuple`2::.ctor(!0, + !1) + IL_0007: pop + IL_0008: ret + } // end of method $ValueTupleAliasConstructor::main@ + +} // end of class ''.$ValueTupleAliasConstructor + + +// ============================================================= + +// *********** DISASSEMBLY COMPLETE *********************** diff --git a/tests/fsharpqa/Source/CompilerOptions/fsc/codepage/E_DefaultCodePage01.fsx b/tests/fsharpqa/Source/CompilerOptions/fsc/codepage/E_DefaultCodePage01.fsx deleted file mode 100644 index 1ed9611bb9d..00000000000 --- a/tests/fsharpqa/Source/CompilerOptions/fsc/codepage/E_DefaultCodePage01.fsx +++ /dev/null @@ -1,4 +0,0 @@ -// #Regression #NoMT #CompilerOptions -#load "FunctionalLibrary01.fs";; -#q;; -//Unexpected character '\?' in type name$ \ No newline at end of file diff --git a/tests/fsharpqa/Source/CompilerOptions/fsc/codepage/env.lst b/tests/fsharpqa/Source/CompilerOptions/fsc/codepage/env.lst index 1befab598a4..b80eac641bd 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsc/codepage/env.lst +++ b/tests/fsharpqa/Source/CompilerOptions/fsc/codepage/env.lst @@ -29,7 +29,6 @@ SOURCE=E_RequiresParameter01.fs TAILFLAGS="--codepage" # E_RequiresParameter01.fs SOURCE=E_RequiresParameter01.fs TAILFLAGS="--codepage" FSIMODE=EXEC # E_RequiresParameter01.fs-fsi - SOURCE=E_DefaultCodePage01.fsx COMPILE_ONLY=1 FSIMODE=EXEC # E_DefaultCodePage01.fsx SOURCE=E_DefaultCodePage02.fsx COMPILE_ONLY=1 # E_DefaultCodePage02.fsx SOURCE=MatchingCodePage01.fsx COMPILE_ONLY=1 SCFLAGS="--codepage:1250" FSIMODE=EXEC # MatchingCodePage01.fsx diff --git a/tests/fsharpqa/Source/CompilerOptions/fsc/determinism/env.lst b/tests/fsharpqa/Source/CompilerOptions/fsc/determinism/env.lst index 5767e939fda..870f3a95619 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsc/determinism/env.lst +++ b/tests/fsharpqa/Source/CompilerOptions/fsc/determinism/env.lst @@ -21,7 +21,7 @@ SOURCE=dummy.fs SCFLAGS="--debug:embedded" PRECMD="\$FSC_PIPE --debug:embedded dummy.fs && \$FSI_PIPE copyArtifacts.fsx" POSTCMD="\$FSI_PIPE --nologo --quiet --exec binaryCompare.fsx false" # Confirm in determinstic mode, the same file compiled twice leads to exactly the same exe & pdbs - SOURCE=dummy.fs SCFLAGS="--deterministic" PRECMD="\$FSC_PIPE --deterministic dummy.fs && \$FSI_PIPE copyArtifacts.fsx" POSTCMD="\$FSI_PIPE --nologo --quiet --exec binaryCompare.fsx true" + SOURCE=dummy.fs SCFLAGS="--deterministic" PRECMD="\$FSC_PIPE --deterministic dummy.fs && \$FSI_PIPE copyArtifacts.fsx" POSTCMD="\$FSI_PIPE --nologo --quiet --exec binaryCompare.fsx true" SOURCE=dummy.fs SCFLAGS="--deterministic --debug:portable" PRECMD="\$FSC_PIPE --deterministic --debug:portable dummy.fs && \$FSI_PIPE copyArtifacts.fsx" POSTCMD="\$FSI_PIPE --nologo --quiet --exec binaryCompare.fsx true" SOURCE=dummy.fs SCFLAGS="--deterministic --debug:embedded" PRECMD="\$FSC_PIPE --deterministic --debug:embedded dummy.fs && \$FSI_PIPE copyArtifacts.fsx" POSTCMD="\$FSI_PIPE --nologo --quiet --exec binaryCompare.fsx true" diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ExceptionDefinitions/E_ExnConstructorBadFieldName.fs b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ExceptionDefinitions/E_ExnConstructorBadFieldName.fs index 01e7c7fa611..640fc4a532b 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ExceptionDefinitions/E_ExnConstructorBadFieldName.fs +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ExceptionDefinitions/E_ExnConstructorBadFieldName.fs @@ -1,7 +1,7 @@ // #Conformance #TypesAndModules #Exceptions // Make sure we properly detect bogus named field in constructors -//Union case/exception 'AAA' does not have field named 'V3'\. -//Union case/exception 'AAA' does not have field named 'V3'\. +//The exception 'AAA' does not have a field named 'V3'\. +//The exception 'AAA' does not have a field named 'V3'\. exception AAA of V1 : int * V2 : string diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/env.lst b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/env.lst index f3d0617fa9c..f6ef11cb79c 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/env.lst +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/env.lst @@ -72,5 +72,6 @@ NoMT SOURCE=Overload_ToString.fs COMPILE_ONLY=1 SCFLAGS=--warnaserror+ FSIMOD SOURCE=E_RecordsNotNull02.fs # E_RecordsNotNull02.fs SOURCE=E_InheritRecord01.fs SCFLAGS="--test:ErrorRanges" # E_InheritRecord01.fs -ReqNOCov SOURCE=BigRecord01.fs # BigRecord01.fs +# Fails due to stack overflow. +#ReqNOCov SOURCE=BigRecord01.fs # BigRecord01.fs SOURCE=DuckTypingRecords01.fs # DuckTypingRecords01.fs \ No newline at end of file diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/E_UnionConstructorBadFieldName.fs b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/E_UnionConstructorBadFieldName.fs index fbf8b6d278a..f9ebb74b26f 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/E_UnionConstructorBadFieldName.fs +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/E_UnionConstructorBadFieldName.fs @@ -1,8 +1,8 @@ // #Conformance #TypesAndModules #Unions // Make sure we properly detect bogus named field in constructors -//Union case/exception 'Case1' does not have field named 'V3'\. -//Union case/exception 'Case1' does not have field named 'V3'\. -//Union case/exception 'Case1' does not have field named 'V4'\. +//The union case 'Case1' does not have a field named 'V3'\. +//The union case 'Case1' does not have a field named 'V3'\. +//The union case 'Case1' does not have a field named 'V4'\. type MyDU = | Case1 of V1 : int * V2 : string diff --git a/tests/fsharpqa/Source/Conformance/Expressions/ApplicationExpressions/BasicApplication/E_PostfixType01.fs b/tests/fsharpqa/Source/Conformance/Expressions/ApplicationExpressions/BasicApplication/E_PostfixType01.fs index 0d719d0fd45..3fe7bda3e32 100644 --- a/tests/fsharpqa/Source/Conformance/Expressions/ApplicationExpressions/BasicApplication/E_PostfixType01.fs +++ b/tests/fsharpqa/Source/Conformance/Expressions/ApplicationExpressions/BasicApplication/E_PostfixType01.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #ApplicationExpressions // Regression test for FSHARP1.0:5525 // Deprecate postfix type application in "new" and "inherit" constructs -//This construct is deprecated: The use of the type syntax 'int C' and 'C ' is not permitted here\. Consider adjusting this type to be written in the form 'C'$ +//Unexpected identifier in expression$ type T<'t> = System.Collections.Generic.List<'t> let o = new int T () diff --git a/tests/fsharpqa/Source/Conformance/Expressions/ApplicationExpressions/BasicApplication/E_PostfixType03.fs b/tests/fsharpqa/Source/Conformance/Expressions/ApplicationExpressions/BasicApplication/E_PostfixType03.fs index eed4e517a69..aedb265593a 100644 --- a/tests/fsharpqa/Source/Conformance/Expressions/ApplicationExpressions/BasicApplication/E_PostfixType03.fs +++ b/tests/fsharpqa/Source/Conformance/Expressions/ApplicationExpressions/BasicApplication/E_PostfixType03.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #ApplicationExpressions // Regression test for FSHARP1.0:5525 // Deprecate postfix type application in "new" and "inherit" constructs -//This construct is deprecated: The use of the type syntax 'int C' and 'C ' is not permitted here\. Consider adjusting this type to be written in the form 'C'$ +//Unexpected identifier in member definition$ #nowarn "0988" type T<'t> = System.Collections.Generic.List<'t> diff --git a/tests/fsharpqa/Source/Conformance/PatternMatching/Named/E_ActivePatternHasNoFields.fs b/tests/fsharpqa/Source/Conformance/PatternMatching/Named/E_ActivePatternHasNoFields.fs new file mode 100644 index 00000000000..09cf78bec16 --- /dev/null +++ b/tests/fsharpqa/Source/Conformance/PatternMatching/Named/E_ActivePatternHasNoFields.fs @@ -0,0 +1,13 @@ +// #Regression #Conformance #PatternMatching #ActivePatterns +// Regression test for https://github.com/Microsoft/visualfsharp/issues/5745 +//Active patterns do not have fields. This syntax is invalid\. +open System.Text.RegularExpressions + +let (|USZipPlus4Code|_|) s = + let m = Regex.Match(s, @"^(\d{5})\-(\d{4})$") + if m.Success then + USZipPlus4Code(x=m.Groups.[1].Value, + y=m.Groups.[2].Value) + |> Some + else + None diff --git a/tests/fsharpqa/Source/Conformance/PatternMatching/Named/env.lst b/tests/fsharpqa/Source/Conformance/PatternMatching/Named/env.lst index f71447b925f..63f5a897cb7 100644 --- a/tests/fsharpqa/Source/Conformance/PatternMatching/Named/env.lst +++ b/tests/fsharpqa/Source/Conformance/PatternMatching/Named/env.lst @@ -26,6 +26,7 @@ SOURCE=E_ActivePatterns01.fs # E_ActivePatterns01.fs SOURCE=E_ActivePatterns02.fs # E_ActivePatterns02.fs + SOURCE=E_ActivePatternHasNoFields.fs # E_ActivePatternHasNoFields.fs SOURCE=E_ParameterRestrictions01.fs # E_ParameterRestrictions01.fs SOURCE=MultiActivePatterns01.fs # MultiActivePatterns01.fs diff --git a/tests/fsharpqa/Source/Conformance/StructFieldEqualityComparison/comparebsl.cmd b/tests/fsharpqa/Source/Conformance/StructFieldEqualityComparison/comparebsl.cmd new file mode 100644 index 00000000000..b2b96bdc187 --- /dev/null +++ b/tests/fsharpqa/Source/Conformance/StructFieldEqualityComparison/comparebsl.cmd @@ -0,0 +1,8 @@ +REM == %1 --> assembly + +%1 > %1.out + +echo ..\..\..\testenv\bin\ILComparer.exe "%1.bsl" "%1.out" +..\..\..\testenv\bin\ILComparer.exe "%1.bsl" "%1.out" +exit /b %ERRORLEVEL% + diff --git a/tests/fsharpqa/Source/Conformance/StructFieldEqualityComparison/env.lst b/tests/fsharpqa/Source/Conformance/StructFieldEqualityComparison/env.lst new file mode 100644 index 00000000000..3be25082cca --- /dev/null +++ b/tests/fsharpqa/Source/Conformance/StructFieldEqualityComparison/env.lst @@ -0,0 +1 @@ + SOURCE=floatsanddoubles.fs SCFLAGS="-g --out:floatsanddoubles.exe" COMPILE_ONLY=1 POSTCMD="comparebsl.cmd floatsanddoubles.exe" # floatsanddoubles.fs diff --git a/tests/fsharpqa/Source/Conformance/StructFieldEqualityComparison/floatsanddoubles.exe.bsl b/tests/fsharpqa/Source/Conformance/StructFieldEqualityComparison/floatsanddoubles.exe.bsl new file mode 100644 index 00000000000..d8a704c0362 --- /dev/null +++ b/tests/fsharpqa/Source/Conformance/StructFieldEqualityComparison/floatsanddoubles.exe.bsl @@ -0,0 +1,112 @@ +Doubles: Epsilon = Epsilon is: true Values 0.000000 = 0.000000 +Doubles: Epsilon = MinValue is: false Values 0.000000 = -179769313486232000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.000000 +Doubles: Epsilon = MaxValue is: false Values 0.000000 = 179769313486232000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.000000 +Doubles: Epsilon = NegativeInfinity is: false Values 0.000000 = -Infinity +Doubles: Epsilon = PositiveInfinity is: false Values 0.000000 = Infinity +Doubles: Epsilon = NaN is: false Values 0.000000 = NaN +Doubles: Epsilon = Number is: false Values 0.000000 = 7.000000 + +Doubles: MinValue = Epsilon is: false Values -179769313486232000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.000000 = 0.000000 +Doubles: MinValue = MinValue is: true Values -179769313486232000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.000000 = -179769313486232000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.000000 +Doubles: MinValue = MaxValue is: false Values -179769313486232000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.000000 = 179769313486232000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.000000 +Doubles: MinValue = NegativeInfinity is: false Values -179769313486232000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.000000 = -Infinity +Doubles: MinValue = PositiveInfinity is: false Values -179769313486232000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.000000 = Infinity +Doubles: MinValue = NaN is: false Values -179769313486232000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.000000 = NaN +Doubles: MinValue = Number is: false Values -179769313486232000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.000000 = 7.000000 + +Doubles: MaxValue = Epsilon is: false Values 179769313486232000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.000000 = 0.000000 +Doubles: MaxValue = MinValue is: false Values 179769313486232000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.000000 = -179769313486232000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.000000 +Doubles: MaxValue = MaxValue is: true Values 179769313486232000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.000000 = 179769313486232000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.000000 +Doubles: MaxValue = NegativeInfinity is: false Values 179769313486232000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.000000 = -Infinity +Doubles: MaxValue = PositiveInfinity is: false Values 179769313486232000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.000000 = Infinity +Doubles: MaxValue = NaN is: false Values 179769313486232000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.000000 = NaN +Doubles: MaxValue = Number is: false Values 179769313486232000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.000000 = 7.000000 + +Doubles: NegativeInfinity = Epsilon is: false Values -Infinity = 0.000000 +Doubles: NegativeInfinity = MinValue is: false Values -Infinity = -179769313486232000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.000000 +Doubles: NegativeInfinity = MaxValue is: false Values -Infinity = 179769313486232000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.000000 +Doubles: NegativeInfinity = NegativeInfinity is: true Values -Infinity = -Infinity +Doubles: NegativeInfinity = PositiveInfinity is: false Values -Infinity = Infinity +Doubles: NegativeInfinity = NaN is: false Values -Infinity = NaN +Doubles: NegativeInfinity = Number is: false Values -Infinity = 7.000000 + +Doubles: PositiveInfinity = Epsilon is: false Values Infinity = 0.000000 +Doubles: PositiveInfinity = MinValue is: false Values Infinity = -179769313486232000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.000000 +Doubles: PositiveInfinity = MaxValue is: false Values Infinity = 179769313486232000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.000000 +Doubles: PositiveInfinity = NegativeInfinity is: false Values Infinity = -Infinity +Doubles: PositiveInfinity = PositiveInfinity is: true Values Infinity = Infinity +Doubles: PositiveInfinity = NaN is: false Values Infinity = NaN +Doubles: PositiveInfinity = Number is: false Values Infinity = 7.000000 + +Doubles: NaN = Epsilon is: false Values NaN = 0.000000 +Doubles: NaN = MinValue is: false Values NaN = -179769313486232000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.000000 +Doubles: NaN = MaxValue is: false Values NaN = 179769313486232000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.000000 +Doubles: NaN = NegativeInfinity is: false Values NaN = -Infinity +Doubles: NaN = PositiveInfinity is: false Values NaN = Infinity +Doubles: NaN = NaN is: true Values NaN = NaN +Doubles: NaN = Number is: false Values NaN = 7.000000 + +Doubles: Number = Epsilon is: false Values 7.000000 = 0.000000 +Doubles: Number = MinValue is: false Values 7.000000 = -179769313486232000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.000000 +Doubles: Number = MaxValue is: false Values 7.000000 = 179769313486232000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.000000 +Doubles: Number = NegativeInfinity is: false Values 7.000000 = -Infinity +Doubles: Number = PositiveInfinity is: false Values 7.000000 = Infinity +Doubles: Number = NaN is: false Values 7.000000 = NaN +Doubles: Number = Number is: true Values 7.000000 = 7.000000 + +Floats: Epsilon = Epsilon is: true Values 0.000000 = 0.000000 +Floats: Epsilon = MinValue is: false Values 0.000000 = -179769313486232000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.000000 +Floats: Epsilon = MaxValue is: false Values 0.000000 = 179769313486232000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.000000 +Floats: Epsilon = NegativeInfinity is: false Values 0.000000 = -Infinity +Floats: Epsilon = PositiveInfinity is: false Values 0.000000 = Infinity +Floats: Epsilon = NaN is: false Values 0.000000 = NaN +Floats: Epsilon = Number is: false Values 0.000000 = 7.000000 + +Floats: MinValue = Epsilon is: false Values -179769313486232000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.000000 = 0.000000 +Floats: MinValue = MinValue is: true Values -179769313486232000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.000000 = -179769313486232000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.000000 +Floats: MinValue = MaxValue is: false Values -179769313486232000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.000000 = 179769313486232000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.000000 +Floats: MinValue = NegativeInfinity is: false Values -179769313486232000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.000000 = -Infinity +Floats: MinValue = PositiveInfinity is: false Values -179769313486232000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.000000 = Infinity +Floats: MinValue = NaN is: false Values -179769313486232000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.000000 = NaN +Floats: MinValue = Number is: false Values -179769313486232000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.000000 = 7.000000 + +Floats: MaxValue = Epsilon is: false Values 179769313486232000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.000000 = 0.000000 +Floats: MaxValue = MinValue is: false Values 179769313486232000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.000000 = -179769313486232000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.000000 +Floats: MaxValue = MaxValue is: true Values 179769313486232000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.000000 = 179769313486232000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.000000 +Floats: MaxValue = NegativeInfinity is: false Values 179769313486232000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.000000 = -Infinity +Floats: MaxValue = PositiveInfinity is: false Values 179769313486232000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.000000 = Infinity +Floats: MaxValue = NaN is: false Values 179769313486232000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.000000 = NaN +Floats: MaxValue = Number is: false Values 179769313486232000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.000000 = 7.000000 + +Floats: NegativeInfinity = Epsilon is: false Values -Infinity = 0.000000 +Floats: NegativeInfinity = MinValue is: false Values -Infinity = -179769313486232000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.000000 +Floats: NegativeInfinity = MaxValue is: false Values -Infinity = 179769313486232000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.000000 +Floats: NegativeInfinity = NegativeInfinity is: true Values -Infinity = -Infinity +Floats: NegativeInfinity = PositiveInfinity is: false Values -Infinity = Infinity +Floats: NegativeInfinity = NaN is: false Values -Infinity = NaN +Floats: NegativeInfinity = Number is: false Values -Infinity = 7.000000 + +Floats: PositiveInfinity = Epsilon is: false Values Infinity = 0.000000 +Floats: PositiveInfinity = MinValue is: false Values Infinity = -179769313486232000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.000000 +Floats: PositiveInfinity = MaxValue is: false Values Infinity = 179769313486232000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.000000 +Floats: PositiveInfinity = NegativeInfinity is: false Values Infinity = -Infinity +Floats: PositiveInfinity = PositiveInfinity is: true Values Infinity = Infinity +Floats: PositiveInfinity = NaN is: false Values Infinity = NaN +Floats: PositiveInfinity = Number is: false Values Infinity = 7.000000 + +Floats: NaN = Epsilon is: false Values NaN = 0.000000 +Floats: NaN = MinValue is: false Values NaN = -179769313486232000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.000000 +Floats: NaN = MaxValue is: false Values NaN = 179769313486232000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.000000 +Floats: NaN = NegativeInfinity is: false Values NaN = -Infinity +Floats: NaN = PositiveInfinity is: false Values NaN = Infinity +Floats: NaN = NaN is: true Values NaN = NaN +Floats: NaN = Number is: false Values NaN = 7.000000 + +Floats: Number = Epsilon is: false Values 7.000000 = 0.000000 +Floats: Number = MinValue is: false Values 7.000000 = -179769313486232000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.000000 +Floats: Number = MaxValue is: false Values 7.000000 = 179769313486232000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.000000 +Floats: Number = NegativeInfinity is: false Values 7.000000 = -Infinity +Floats: Number = PositiveInfinity is: false Values 7.000000 = Infinity +Floats: Number = NaN is: false Values 7.000000 = NaN +Floats: Number = Number is: true Values 7.000000 = 7.000000 + diff --git a/tests/fsharpqa/Source/Conformance/StructFieldEqualityComparison/floatsanddoubles.fs b/tests/fsharpqa/Source/Conformance/StructFieldEqualityComparison/floatsanddoubles.fs new file mode 100644 index 00000000000..b0679dbba6f --- /dev/null +++ b/tests/fsharpqa/Source/Conformance/StructFieldEqualityComparison/floatsanddoubles.fs @@ -0,0 +1,39 @@ +// =========================================================================================================================== +// Test case for GenericEqualityERFast with floats/doubles +// Ensures that matrix of values evaluate to the same values as the shipping compiler +// =========================================================================================================================== +module floatsanddoubles + +open System +open System + +type Float = + struct + val F : float + new (f:float) = { F = f } + end + +type Double = + struct + val D : double + new (d:double) = { D = d } + end + +let floats = [| Float(Double.Epsilon); Float(Double.MinValue); Float(Double.MaxValue);Float(Double.NegativeInfinity);Float(Double.PositiveInfinity);Float(Double.NaN); Float(7.0)|] +let doubles = [| Double(Double.Epsilon); Double(Double.MinValue); Double(Double.MaxValue);Double(Double.NegativeInfinity);Double(Double.PositiveInfinity);Double(Double.NaN); Double(7.0)|] +let names = [| "Epsilon"; "MinValue"; "MaxValue";"NegativeInfinity";"PositiveInfinity";"NaN";"Number" |] + +[] +let main argv = + + for i in 0 .. doubles.Length - 1 do + for j in 0 .. doubles.Length - 1 do + printfn "Doubles: %-17s = %-17s is: %-5b Values %f = %f" (names.[i]) (names.[j]) (doubles.[i].Equals(doubles.[j])) (doubles.[i].D) (doubles.[j].D) + printfn "" + + for i in 0 .. floats.Length - 1 do + for j in 0 .. floats.Length - 1 do + printfn "Floats: %-17s = %-17s is: %-5b Values %f = %f" (names.[i]) (names.[j]) (floats.[i].Equals(floats.[j])) (floats.[i].F) (floats.[j].F) + printfn "" + + 0 // return an integer exit code diff --git a/tests/fsharpqa/Source/OCamlCompat/MultiArgumentGenericType.fs b/tests/fsharpqa/Source/OCamlCompat/MultiArgumentGenericType.fs index 54b26ccc63d..a632b981da4 100644 --- a/tests/fsharpqa/Source/OCamlCompat/MultiArgumentGenericType.fs +++ b/tests/fsharpqa/Source/OCamlCompat/MultiArgumentGenericType.fs @@ -2,7 +2,7 @@ // Regressin Test for FSharp1.0:2098 - OCaml-compat warning for generics written like this: (string, int)Dictionary -//This construct is deprecated: The use of the type syntax 'int C' and 'C ' is not permitted here\. Consider adjusting this type to be written in the form 'C'$ +//Unexpected identifier in expression$ open System.Collections.Generic diff --git a/tests/fsharpqa/Source/run.pl b/tests/fsharpqa/Source/run.pl index c999def6387..d9c3de8c3de 100644 --- a/tests/fsharpqa/Source/run.pl +++ b/tests/fsharpqa/Source/run.pl @@ -265,12 +265,12 @@ my $PEVERIFY = $ENV{PEVERIFY}; unless(defined($PEVERIFY)) { my $scriptPath = dirname(__FILE__); - $PEVERIFY = "$scriptPath\\..\\testenv\\src\\PEVerify\\bin\\Release\\net46\\PEVerify.exe"; + $PEVERIFY = "$scriptPath\\..\\..\\..\\artifacts\\bin\\PEVerify\\Release\\net46\\PEVerify.exe"; if (-e $PEVERIFY) { $ENV{PEVERIFY} = $PEVERIFY; } else { - $ENV{PEVERIFY} = "$scriptPath\\..\\testenv\\src\\PEVerify\\bin\\Debug\\net46\\PEVerify.exe"; + $ENV{PEVERIFY} = "$scriptPath\\..\\..\\..\\artifacts\\bin\\PEVerify\\Debug\\net46\\PEVerify.exe"; } } diff --git a/tests/fsharpqa/Source/test.lst b/tests/fsharpqa/Source/test.lst index 0f3200c9af1..67199ab1137 100644 --- a/tests/fsharpqa/Source/test.lst +++ b/tests/fsharpqa/Source/test.lst @@ -69,7 +69,6 @@ CompilerOptions01,NoMT CompilerOptions\fsi\times CompilerOptions02,NoMT CompilerOptions\fsi\exename CompilerOptions01,NoMT,Determinism CompilerOptions\fsc\determinism - Conformance01 Conformance\BasicGrammarElements\Constants Conformance01 Conformance\BasicGrammarElements\OperatorNames Conformance01 Conformance\BasicGrammarElements\PrecedenceAndOperators @@ -228,6 +227,7 @@ Conformance08 Conformance\Signatures\SignatureConformance Conformance08 Conformance\Signatures\SignatureTypes Conformance08 Conformance\SpecialAttributesAndTypes\Imported\System.ThreadStatic Conformance08 Conformance\SpecialAttributesAndTypes\Imported\CallerInfo +Conformance08 Conformance\StructFieldEqualityComparison Conformance08 Conformance\TypesAndTypeConstraints\CheckingSyntacticTypes Conformance08 Conformance\TypesAndTypeConstraints\LogicalPropertiesOfTypes Conformance08 Conformance\TypesAndTypeConstraints\TypeConstraints diff --git a/tests/fsharpqa/testenv/src/AssemblyVersionCheck/.gitignore b/tests/fsharpqa/testenv/src/AssemblyVersionCheck/.gitignore new file mode 100644 index 00000000000..c0e717b21de --- /dev/null +++ b/tests/fsharpqa/testenv/src/AssemblyVersionCheck/.gitignore @@ -0,0 +1,2 @@ +# this file has to be dynamically written at build time +assemblies.fsx diff --git a/tests/fsharpqa/testenv/src/AssemblyVersionCheck/AssemblyVersionCheck.fsx b/tests/fsharpqa/testenv/src/AssemblyVersionCheck/AssemblyVersionCheck.fsx index 8554c7b46d2..727916d4986 100644 --- a/tests/fsharpqa/testenv/src/AssemblyVersionCheck/AssemblyVersionCheck.fsx +++ b/tests/fsharpqa/testenv/src/AssemblyVersionCheck/AssemblyVersionCheck.fsx @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. -// this was restored by packages.config in the root -#r @"..\..\..\..\..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll" +// this points to assemblies that were restored by packages.config in the root +#load "assemblies.fsx" open System open System.Diagnostics diff --git a/tests/fsharpqa/testenv/src/Directory.Build.props b/tests/fsharpqa/testenv/src/Directory.Build.props new file mode 100644 index 00000000000..bb8eac309b1 --- /dev/null +++ b/tests/fsharpqa/testenv/src/Directory.Build.props @@ -0,0 +1,3 @@ + + + diff --git a/tests/fsharpqa/testenv/src/Directory.Build.targets b/tests/fsharpqa/testenv/src/Directory.Build.targets new file mode 100644 index 00000000000..ccd47cc0a9a --- /dev/null +++ b/tests/fsharpqa/testenv/src/Directory.Build.targets @@ -0,0 +1,3 @@ + + + diff --git a/tests/fsharpqa/testenv/src/HostedCompilerServer/HostedCompilerServer.fsproj b/tests/fsharpqa/testenv/src/HostedCompilerServer/HostedCompilerServer.fsproj index 1a79ff36d5b..994b9060c14 100644 --- a/tests/fsharpqa/testenv/src/HostedCompilerServer/HostedCompilerServer.fsproj +++ b/tests/fsharpqa/testenv/src/HostedCompilerServer/HostedCompilerServer.fsproj @@ -1,59 +1,27 @@  - - - $(MSBuildProjectDirectory)\..\..\..\..\..\src - - + + - Debug - AnyCPU - 2.0 - 4239efea-e746-446a-bf7a-51fcbab13946 + net46 Exe - HostedCompilerServer - HostedCompilerServer - v4.6 - true - ..\..\bin - true - HostedCompilerServer - 3 - AnyCPU - true - - - - false - false - DEBUG;TRACE - - - true - true - TRACE + true + true + false + $(RepoRoot)tests\fsharpqa\testenv\bin + + + + + + + - - - - - - {DED3BBD7-53F4-428A-8C9F-27968E768605} - FSharp.Core - - - {2E4D67B4-522D-4CF7-97E4-BA940F0B18F3} - FSharp.Compiler.Private - - - $(FSharpSourcesRoot)\..\packages\System.ValueTuple.$(SystemValueTuplePackageVersion)\lib\netstandard1.0\System.ValueTuple.dll - true - + - - \ No newline at end of file + diff --git a/tests/fsharpqa/testenv/src/ILComparer/ILComparer.fsproj b/tests/fsharpqa/testenv/src/ILComparer/ILComparer.fsproj index 968fc2e137f..c530b623a40 100644 --- a/tests/fsharpqa/testenv/src/ILComparer/ILComparer.fsproj +++ b/tests/fsharpqa/testenv/src/ILComparer/ILComparer.fsproj @@ -1,51 +1,22 @@  - + + - $(MSBuildProjectDirectory)\..\..\..\..\..\src - - - - Debug - AnyCPU - 2.0 - {2e60864a-e3ff-4bcc-810f-dc7c34e6b236} + net45 Exe - ILComparer - ILComparer - v4.5 - true - 4.4.1.0 - ILComparer - ..\..\bin\ - true - $(OutputPath)$(AssemblyName).xml - 3 - AnyCPU - true - - - false - false - DEBUG;TRACE - - - true - true - TRACE + true + true + false + $(RepoRoot)tests\fsharpqa\testenv\bin + + - - - - - - {DED3BBD7-53F4-428A-8C9F-27968E768605} - FSharp.Core - + - + \ No newline at end of file diff --git a/tests/fsharpqa/testenv/src/ILComparer/Program.fs b/tests/fsharpqa/testenv/src/ILComparer/Program.fs index 1b2d33b24c3..3673f6fd57c 100644 --- a/tests/fsharpqa/testenv/src/ILComparer/Program.fs +++ b/tests/fsharpqa/testenv/src/ILComparer/Program.fs @@ -3,9 +3,6 @@ open System.IO [] let main (argv : string array) = - let fn1 = argv.[0] - let fn2 = argv.[1] - // Read file into an array let File2List (filename:string) = use s = new StreamReader(filename) @@ -16,9 +13,6 @@ let main (argv : string array) = if not isblank_or_comment then l <- List.append l ( line :: []) l - let f1 = File2List fn1 - let f2 = File2List fn2 - let rec compareAux (f1:string list) (f2:string list) i = match f1, f2 with | a :: resta, b :: restb -> @@ -73,4 +67,22 @@ let main (argv : string array) = printfn "%s" (e.ToString()) false - exit (if compare f1 f2 then 0 else 1) + let fn1 = argv.[0] + let fn2 = argv.[1] + let fn3 = argv.[0] + ".net47" + + let f2 = File2List fn2 + + // Check to see if fn1+".net47" exists, if so check this baseline first if not equal then check fn1 baseline + // the fn1 + ".net47" baseline exists in the rare case where il produced has changed for example valuetuple moved form system.valuetuple.dll to mscorlib.dll, making baselines tricky + let result = + if File.Exists(fn3) then + let f3 = File2List fn3 + if compare f3 f2 then 0 else 1 + else + 1 + if result = 0 then + exit 0 + else + let f1 = File2List fn1 + exit (if compare f1 f2 then 0 else 1) diff --git a/tests/fsharpqa/testenv/src/PEVerify/PEVerify.csproj b/tests/fsharpqa/testenv/src/PEVerify/PEVerify.csproj index 3af2b4d23db..9b2a2104693 100644 --- a/tests/fsharpqa/testenv/src/PEVerify/PEVerify.csproj +++ b/tests/fsharpqa/testenv/src/PEVerify/PEVerify.csproj @@ -3,6 +3,7 @@ Exe net46 + $(NoWarn);1591 diff --git a/tests/fsharpqa/testenv/src/nunit/nunit-console-x86.exe.config b/tests/fsharpqa/testenv/src/nunit/nunit-console-x86.exe.config deleted file mode 100644 index 5120c0dc91d..00000000000 --- a/tests/fsharpqa/testenv/src/nunit/nunit-console-x86.exe.config +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/tests/fsharpqa/testenv/src/nunit/nunit-console.exe.config b/tests/fsharpqa/testenv/src/nunit/nunit-console.exe.config deleted file mode 100644 index 22ef7d3b63d..00000000000 --- a/tests/fsharpqa/testenv/src/nunit/nunit-console.exe.config +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/tests/projects/Directory.Build.props b/tests/projects/Directory.Build.props new file mode 100644 index 00000000000..bb5b23d29d0 --- /dev/null +++ b/tests/projects/Directory.Build.props @@ -0,0 +1,3 @@ + + + diff --git a/tests/projects/Directory.Build.targets b/tests/projects/Directory.Build.targets new file mode 100644 index 00000000000..bb5b23d29d0 --- /dev/null +++ b/tests/projects/Directory.Build.targets @@ -0,0 +1,3 @@ + + + diff --git a/tests/projects/Sample_NETCoreSDK_FSharp_Library_netstandard2_0/Directory.Build.props b/tests/projects/Sample_NETCoreSDK_FSharp_Library_netstandard2_0/Directory.Build.props new file mode 100644 index 00000000000..bb8eac309b1 --- /dev/null +++ b/tests/projects/Sample_NETCoreSDK_FSharp_Library_netstandard2_0/Directory.Build.props @@ -0,0 +1,3 @@ + + + diff --git a/tests/projects/Sample_NETCoreSDK_FSharp_Library_netstandard2_0/Directory.Build.targets b/tests/projects/Sample_NETCoreSDK_FSharp_Library_netstandard2_0/Directory.Build.targets new file mode 100644 index 00000000000..ccd47cc0a9a --- /dev/null +++ b/tests/projects/Sample_NETCoreSDK_FSharp_Library_netstandard2_0/Directory.Build.targets @@ -0,0 +1,3 @@ + + + diff --git a/tests/projects/misc/Directory.Build.props b/tests/projects/misc/Directory.Build.props new file mode 100644 index 00000000000..056d3552497 --- /dev/null +++ b/tests/projects/misc/Directory.Build.props @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/tests/projects/misc/Directory.Build.targets b/tests/projects/misc/Directory.Build.targets new file mode 100644 index 00000000000..056d3552497 --- /dev/null +++ b/tests/projects/misc/Directory.Build.targets @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/tests/projects/misc/ProjectWithBuildErrors/ProjectWithBuildErrors/ProjectWithBuildErrors.fsproj b/tests/projects/misc/ProjectWithBuildErrors/ProjectWithBuildErrors/ProjectWithBuildErrors.fsproj index 43aa06b77c7..b1a44ceda79 100644 --- a/tests/projects/misc/ProjectWithBuildErrors/ProjectWithBuildErrors/ProjectWithBuildErrors.fsproj +++ b/tests/projects/misc/ProjectWithBuildErrors/ProjectWithBuildErrors/ProjectWithBuildErrors.fsproj @@ -1,83 +1,15 @@  - - + + - Debug - AnyCPU - 2.0 - 9eda4075-e1e5-4f51-8908-5d608c092254 - Exe - ProjectWithBuildErrors - ProjectWithBuildErrors - v4.5.2 - true + net452 4.4.1.0 - ProjectWithBuildErrors - - true - full - false - false - bin\$(Configuration)\ - DEBUG;TRACE - 3 - AnyCPU - bin\$(Configuration)\$(AssemblyName).XML - true - - - pdbonly - true - true - bin\$(Configuration)\ - TRACE - 3 - AnyCPU - bin\$(Configuration)\$(AssemblyName).XML - true - - - 11 - - - - - $(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets - - - - - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets - - - - + - - - - - - FSharp.Core - FSharp.Core.dll - $(MSBuildProgramFiles32)\Reference Assemblies\Microsoft\FSharp\.NETFramework\v4.0\$(TargetFSharpCoreVersion)\FSharp.Core.dll - - - - - - ..\packages\System.ValueTuple.4.4.0\lib\netstandard1.0\System.ValueTuple.dll - - - \ No newline at end of file + + diff --git a/tests/projects/misc/ProjectWithBuildErrors/ProjectWithBuildErrors/packages.config b/tests/projects/misc/ProjectWithBuildErrors/ProjectWithBuildErrors/packages.config deleted file mode 100644 index 4db38eab9ce..00000000000 --- a/tests/projects/misc/ProjectWithBuildErrors/ProjectWithBuildErrors/packages.config +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/tests/projects/misc/SameFileBelongsToMultipleProjects/Library2/Library2.fsproj b/tests/projects/misc/SameFileBelongsToMultipleProjects/Library2/Library2.fsproj index 2bbd1c6f286..090a7331af6 100644 --- a/tests/projects/misc/SameFileBelongsToMultipleProjects/Library2/Library2.fsproj +++ b/tests/projects/misc/SameFileBelongsToMultipleProjects/Library2/Library2.fsproj @@ -1,81 +1,17 @@  - - + + - Debug - AnyCPU - 2.0 - e72ee9de-323e-4f99-8d7e-1a1ed8a3477c - Library - Library2 - Library2 - v4.5.2 + net452 4.4.1.0 - true - Library2 - - true - full - false - false - bin\$(Configuration)\ - DEBUG;TRACE - 3 - bin\$(Configuration)\$(AssemblyName).XML - - - pdbonly - true - true - bin\$(Configuration)\ - RELEASE;TRACE - 3 - bin\$(Configuration)\$(AssemblyName).XML - - - 11 - - - - - $(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets - - - - - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets - - - - + Class.fs - - - - - - FSharp.Core - FSharp.Core.dll - $(MSBuildProgramFiles32)\Reference Assemblies\Microsoft\FSharp\.NETFramework\v4.0\$(TargetFSharpCoreVersion)\FSharp.Core.dll - - - - - - ..\packages\System.ValueTuple.4.4.0\lib\netstandard1.0\System.ValueTuple.dll - - - \ No newline at end of file + + diff --git a/tests/projects/misc/SameFileBelongsToMultipleProjects/Library2/packages.config b/tests/projects/misc/SameFileBelongsToMultipleProjects/Library2/packages.config deleted file mode 100644 index 4db38eab9ce..00000000000 --- a/tests/projects/misc/SameFileBelongsToMultipleProjects/Library2/packages.config +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/tests/projects/misc/SameFileBelongsToMultipleProjects/SameFileBelongsToMultipleProjects/SameFileBelongsToMultipleProjects.fsproj b/tests/projects/misc/SameFileBelongsToMultipleProjects/SameFileBelongsToMultipleProjects/SameFileBelongsToMultipleProjects.fsproj index 5215c45575c..f8ab90c7837 100644 --- a/tests/projects/misc/SameFileBelongsToMultipleProjects/SameFileBelongsToMultipleProjects/SameFileBelongsToMultipleProjects.fsproj +++ b/tests/projects/misc/SameFileBelongsToMultipleProjects/SameFileBelongsToMultipleProjects/SameFileBelongsToMultipleProjects.fsproj @@ -1,90 +1,19 @@  - - + + - Debug - AnyCPU - 2.0 - df29450f-abd7-49fb-96c5-c9cae9a54f40 - Exe - ConsoleApplication1 - ConsoleApplication1 - v4.5.2 - true + net452> 4.4.1.0 - SameFileBelongsToMultipleProjects - - true - full - false - false - bin\$(Configuration)\ - DEBUG;TRACE - 3 - AnyCPU - bin\$(Configuration)\$(AssemblyName).XML - true - - - pdbonly - true - true - bin\$(Configuration)\ - TRACE - 3 - AnyCPU - bin\$(Configuration)\$(AssemblyName).XML - true - - - - - FSharp.Core - FSharp.Core.dll - $(MSBuildProgramFiles32)\Reference Assemblies\Microsoft\FSharp\.NETFramework\v4.0\$(TargetFSharpCoreVersion)\FSharp.Core.dll - - - ..\packages\System.ValueTuple.4.4.0\lib\netstandard1.0\System.ValueTuple.dll - True - - - - - + + - - Library2 - {e72ee9de-323e-4f99-8d7e-1a1ed8a3477c} - True - + - - 11 - - - - - $(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets - - - - - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets - - - - - - \ No newline at end of file + + diff --git a/tests/projects/misc/TestProjectChanges/Library1AlwaysInMatchingConfiguration/Library1AlwaysInMatchingConfiguration.fsproj b/tests/projects/misc/TestProjectChanges/Library1AlwaysInMatchingConfiguration/Library1AlwaysInMatchingConfiguration.fsproj index a69c8f4efe2..7b711f61660 100644 --- a/tests/projects/misc/TestProjectChanges/Library1AlwaysInMatchingConfiguration/Library1AlwaysInMatchingConfiguration.fsproj +++ b/tests/projects/misc/TestProjectChanges/Library1AlwaysInMatchingConfiguration/Library1AlwaysInMatchingConfiguration.fsproj @@ -1,77 +1,14 @@  - - + + - Debug - AnyCPU - 2.0 - 9f36577a-657b-4117-a118-f69ab182aa31 - Library - Library1AlwaysInMatchingConfiguration - Library1AlwaysInMatchingConfiguration - v4.5.2 + net452 4.4.1.0 - true - Library1AlwaysInMatchingConfiguration - - true - full - false - false - bin\$(Configuration)\ - DEBUG;TRACE - 3 - bin\$(Configuration)\$(AssemblyName).XML - - - pdbonly - true - true - bin\$(Configuration)\ - RELEASE;TRACE - 3 - bin\$(Configuration)\$(AssemblyName).XML - - - 11 - - - - - $(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets - - - - - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets - - - - + - - - - FSharp.Core - FSharp.Core.dll - $(MSBuildProgramFiles32)\Reference Assemblies\Microsoft\FSharp\.NETFramework\v4.0\$(TargetFSharpCoreVersion)\FSharp.Core.dll - - - - - - ..\packages\System.ValueTuple.4.4.0\lib\netstandard1.0\System.ValueTuple.dll - - - - \ No newline at end of file + + diff --git a/tests/projects/misc/TestProjectChanges/Library1AlwaysInMatchingConfiguration/fff.config b/tests/projects/misc/TestProjectChanges/Library1AlwaysInMatchingConfiguration/fff.config deleted file mode 100644 index 4db38eab9ce..00000000000 --- a/tests/projects/misc/TestProjectChanges/Library1AlwaysInMatchingConfiguration/fff.config +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/tests/projects/misc/TestProjectChanges/Library2AlwaysInDebugConfiguration/Library2AlwaysInDebugConfiguration.fsproj b/tests/projects/misc/TestProjectChanges/Library2AlwaysInDebugConfiguration/Library2AlwaysInDebugConfiguration.fsproj index a39259e1911..7b711f61660 100644 --- a/tests/projects/misc/TestProjectChanges/Library2AlwaysInDebugConfiguration/Library2AlwaysInDebugConfiguration.fsproj +++ b/tests/projects/misc/TestProjectChanges/Library2AlwaysInDebugConfiguration/Library2AlwaysInDebugConfiguration.fsproj @@ -1,78 +1,14 @@  - - + + - Debug - AnyCPU - 2.0 - e72ee9de-323e-4f99-8d7e-1a1ed8a3477c - Library - Library2AlwaysInDebugConfiguration - Library2AlwaysInDebugConfiguration - v4.5.2 + net452 4.4.1.0 - true - Library2AlwaysInDebugConfiguration - - true - full - false - false - bin\$(Configuration)\ - DEBUG;TRACE - 3 - bin\$(Configuration)\$(AssemblyName).XML - - - pdbonly - true - true - bin\$(Configuration)\ - RELEASE;TRACE - 3 - bin\$(Configuration)\$(AssemblyName).XML - - - 11 - - - - - $(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets - - - - - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets - - - - + - - - - - - FSharp.Core - FSharp.Core.dll - $(MSBuildProgramFiles32)\Reference Assemblies\Microsoft\FSharp\.NETFramework\v4.0\$(TargetFSharpCoreVersion)\FSharp.Core.dll - - - - - - ..\packages\System.ValueTuple.4.4.0\lib\netstandard1.0\System.ValueTuple.dll - - - \ No newline at end of file + + diff --git a/tests/projects/misc/TestProjectChanges/Library2AlwaysInDebugConfiguration/packages.config b/tests/projects/misc/TestProjectChanges/Library2AlwaysInDebugConfiguration/packages.config deleted file mode 100644 index 4db38eab9ce..00000000000 --- a/tests/projects/misc/TestProjectChanges/Library2AlwaysInDebugConfiguration/packages.config +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/tests/projects/misc/TestProjectChanges/TestProjectChanges/TestProjectChanges.fsproj b/tests/projects/misc/TestProjectChanges/TestProjectChanges/TestProjectChanges.fsproj index 1428be05684..3c5f9cd080f 100644 --- a/tests/projects/misc/TestProjectChanges/TestProjectChanges/TestProjectChanges.fsproj +++ b/tests/projects/misc/TestProjectChanges/TestProjectChanges/TestProjectChanges.fsproj @@ -1,96 +1,20 @@  - - + + - Debug - AnyCPU - 2.0 - df29450f-abd7-49fb-96c5-c9cae9a54f40 - Exe - ConsoleApplication1 - ConsoleApplication1 - v4.5.2 - true + net452 4.4.1.0 - TestProjectChanges - - - true - full - false - false - bin\$(Configuration)\ - DEBUG;TRACE - 3 - AnyCPU - bin\$(Configuration)\$(AssemblyName).XML - true - - - pdbonly - true - true - bin\$(Configuration)\ - TRACE - 3 - AnyCPU - bin\$(Configuration)\$(AssemblyName).XML - true - - - - FSharp.Core - FSharp.Core.dll - $(MSBuildProgramFiles32)\Reference Assemblies\Microsoft\FSharp\.NETFramework\v4.0\$(TargetFSharpCoreVersion)\FSharp.Core.dll - - - ..\packages\System.ValueTuple.4.4.0\lib\netstandard1.0\System.ValueTuple.dll - True - - - - - + + - - Library1AlwaysInMatchingConfiguration - {9f36577a-657b-4117-a118-f69ab182aa31} - True - - - Library2AlwaysInDebugConfiguration - {e72ee9de-323e-4f99-8d7e-1a1ed8a3477c} - True - + + - - 11 - - - - - $(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets - - - - - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets - - - - - - + diff --git a/tests/scripts/compiler-perf-results.txt b/tests/scripts/compiler-perf-results.txt index 65201821cef..c10207ef164 100644 --- a/tests/scripts/compiler-perf-results.txt +++ b/tests/scripts/compiler-perf-results.txt @@ -132,17 +132,31 @@ https://github.com/manofstick/visualfsharp.git all-your-collections-are-belong-t https://github.com/manofstick/visualfsharp.git all-your-collections-are-belong-to-us 87dafbc17b494c438b6db9e59e064736bd8a44e2 458e6c29d7e059a5a8a7b4cd7858c7d633fb5906 MSRC-DON-OFFICE 224.75 11.20 31.09 46.96 63.08 53.08 https://github.com/manofstick/visualfsharp.git all-your-collections-are-belong-to-us 87dafbc17b494c438b6db9e59e064736bd8a44e2 7e1fd6ac330f86597f3167e8067cfd805a89eec9 MSRC-DON-OFFICE 235.48 10.83 33.47 47.17 65.56 52.50 -https://github.com/dsyme/visualfsharp.git weak1 58bd2bec78f01e57fecff604146a3cc55eec4966 221224e6d20bd835c2b9e01e0a52bf45e740a8d0 MSRC-3617253 260.05 10.97 30.78 47.15 58.04 59.77 -https://github.com/dsyme/visualfsharp.git weak2 35b7e2caed9b81e2ceb9de9f325ddeb550bf97d6 4df997507226caa272f2c7d4fbdc52eb71c8ead2 MSRC-3617253 257.26 11.24 30.62 48.03 57.80 57.60 - +https://github.com/dsyme/visualfsharp.git range1 e49ac8a2f21223e60d0d9597e52ea9e5f8705963 ac9f2af4329d2ae1c4213bb1d22dc4450b319207 MSRC-3617253 259.69 11.98 32.23 47.16 56.83 58.14 +https://github.com/dsyme/visualfsharp.git range1 e49ac8a2f21223e60d0d9597e52ea9e5f8705963 ac9f2af4329d2ae1c4213bb1d22dc4450b319207 MSRC-3617253 250.75 11.73 30.77 46.66 57.97 59.44 +https://github.com/dsyme/visualfsharp.git range1 e49ac8a2f21223e60d0d9597e52ea9e5f8705963 ac9f2af4329d2ae1c4213bb1d22dc4450b319207 MSRC-3617253 252.83 11.66 31.05 47.17 58.80 58.59 https://github.com/dsyme/visualfsharp.git range1 e49ac8a2f21223e60d0d9597e52ea9e5f8705963 221224e6d20bd835c2b9e01e0a52bf45e740a8d0 MSRC-3617253 275.83 12.79 32.57 53.38 61.94 58.03 https://github.com/dsyme/visualfsharp.git range1 46be8bee06180324b63a3b808cf4a90492a5f095 ff078e94deff66e548efb668465fcdd601cc158d MSRC-3617253 265.13 10.57 35.61 48.73 59.07 59.03 +https://github.com/dsyme/visualfsharp.git range1 46be8bee06180324b63a3b808cf4a90492a5f095 284cb2ff115adb8ff5b1febe1c305a10c933172e MSRC-3617253 262.84 10.55 35.17 48.54 59.51 59.15 + +https://github.com/Microsoft/visualfsharp master ac9f2af4329d2ae1c4213bb1d22dc4450b319207 ac9f2af4329d2ae1c4213bb1d22dc4450b319207 MSRC-3617253 250.78 11.70 30.18 46.84 57.18 58.49 +https://github.com/Microsoft/visualfsharp master ac9f2af4329d2ae1c4213bb1d22dc4450b319207 ac9f2af4329d2ae1c4213bb1d22dc4450b319207 MSRC-3617253 251.89 11.89 30.30 46.67 58.00 59.09 +https://github.com/Microsoft/visualfsharp master ac9f2af4329d2ae1c4213bb1d22dc4450b319207 ac9f2af4329d2ae1c4213bb1d22dc4450b319207 MSRC-3617253 250.48 11.44 30.93 46.09 57.41 58.86 +https://github.com/Microsoft/visualfsharp master 221224e6d20bd835c2b9e01e0a52bf45e740a8d0 221224e6d20bd835c2b9e01e0a52bf45e740a8d0 MSRC-3617253 273.00 12.46 32.80 51.38 60.93 58.66 +https://github.com/Microsoft/visualfsharp master 95348d0aafd168064d4c2282c59d62ac95bbebdf 95348d0aafd168064d4c2282c59d62ac95bbebdf MSRC-3617253 256.40 11.22 32.40 47.49 58.47 59.82 https://github.com/Microsoft/visualfsharp master 4df997507226caa272f2c7d4fbdc52eb71c8ead2 4df997507226caa272f2c7d4fbdc52eb71c8ead2 MSRC-3617253 254.53 11.55 31.80 46.58 57.03 58.89 https://github.com/Microsoft/visualfsharp master 65d87f0b2ee67e50503540aad5d4438fdde14fea 65d87f0b2ee67e50503540aad5d4438fdde14fea MSRC-3617253 257.92 10.44 32.62 45.45 56.68 58.53 https://github.com/Microsoft/visualfsharp master ff078e94deff66e548efb668465fcdd601cc158d ff078e94deff66e548efb668465fcdd601cc158d MSRC-3617253 262.60 10.60 34.99 47.73 59.08 58.46 +https://github.com/Microsoft/visualfsharp master 284cb2ff115adb8ff5b1febe1c305a10c933172e 284cb2ff115adb8ff5b1febe1c305a10c933172e MSRC-3617253 262.07 10.58 34.79 48.58 58.51 58.31 + +https://github.com/dsyme/visualfsharp.git weak1 58bd2bec78f01e57fecff604146a3cc55eec4966 221224e6d20bd835c2b9e01e0a52bf45e740a8d0 MSRC-3617253 260.05 10.97 30.78 47.15 58.04 59.77 +https://github.com/dsyme/visualfsharp.git weak1 6be11a0290c689f2331a03fb9762592b24bdacad 95348d0aafd168064d4c2282c59d62ac95bbebdf MSRC-3617253 308.27 10.79 31.51 47.44 58.70 59.71 + +https://github.com/dsyme/visualfsharp.git weak2 35b7e2caed9b81e2ceb9de9f325ddeb550bf97d6 4df997507226caa272f2c7d4fbdc52eb71c8ead2 MSRC-3617253 257.26 11.24 30.62 48.03 57.80 57.60 https://github.com/AviAvni/visualfsharp.git fcs-memory-3 d91dbc81ce304a88a4e3c07032781421c71e3bab ff078e94deff66e548efb668465fcdd601cc158d MSRC-3617253 263.83 10.70 35.24 47.30 59.09 59.14 +https://github.com/AviAvni/visualfsharp.git fcs-memory-3 d91dbc81ce304a88a4e3c07032781421c71e3bab 284cb2ff115adb8ff5b1febe1c305a10c933172e MSRC-3617253 263.53 10.34 35.19 48.32 58.79 59.08 https://github.com/AviAvni/visualfsharp.git fcs-memory-3 d91dbc81ce304a88a4e3c07032781421c71e3bab 284cb2ff115adb8ff5b1febe1c305a10c933172e MSRC-3617253 263.53 10.34 35.19 48.32 58.79 59.08 https://github.com/dsyme/visualfsharp.git range1 46be8bee06180324b63a3b808cf4a90492a5f095 284cb2ff115adb8ff5b1febe1c305a10c933172e MSRC-3617253 262.84 10.55 35.17 48.54 59.51 59.15 https://github.com/Microsoft/visualfsharp master 284cb2ff115adb8ff5b1febe1c305a10c933172e 284cb2ff115adb8ff5b1febe1c305a10c933172e MSRC-3617253 262.07 10.58 34.79 48.58 58.51 58.31 @@ -183,3 +197,21 @@ https://github.com/dsyme/visualfsharp.git fix-5136 c9a7678e5 https://github.com/Microsoft/visualfsharp master 7bcbd1abbace1a41e0c6e12723957d87405c4cba 7bcbd1abbace1a41e0c6e12723957d87405c4cba MSRC-3617253 251.16 9.83 34.52 45.45 57.97 58.65 https://github.com/dsyme/visualfsharp.git fix-5136 c9a7678e508dc2ff847c82ee4933f464aa23bee0 7bcbd1abbace1a41e0c6e12723957d87405c4cba MSRC-3617253 257.62 10.34 35.18 45.40 56.07 57.88 https://github.com/Microsoft/visualfsharp master 7bcbd1abbace1a41e0c6e12723957d87405c4cba 7bcbd1abbace1a41e0c6e12723957d87405c4cba MSRC-3617253 250.59 10.10 34.82 45.33 58.62 63.86 +https://github.com/Microsoft/visualfsharp master d38481ed20fc27af9e767646b22e8da5fb037689 d38481ed20fc27af9e767646b22e8da5fb037689 MSRC-3617253 264.61 10.62 36.12 45.58 56.80 58.41 +https://github.com/Microsoft/visualfsharp master 24ed23a4f277fa24b23a93494770b1ced6a02c5c 24ed23a4f277fa24b23a93494770b1ced6a02c5c MSRC-3617253 266.80 10.34 37.16 47.67 58.73 58.82 +https://github.com/manofstick/visualfsharp.git notagged 73faf347d22716da3a7e1d3bcfabeeb505b8c80f d38481ed20fc27af9e767646b22e8da5fb037689 MSRC-3617253 279.33 10.53 35.73 42.43 52.15 59.65 +https://github.com/manofstick/visualfsharp.git notagged 73faf347d22716da3a7e1d3bcfabeeb505b8c80f f3d55f286278fcd7dc81fc3636e4b1fdc16218e0 MSRC-3617253 263.89 10.19 34.69 41.24 51.90 59.00 +https://github.com/manofstick/visualfsharp.git notagged 73faf347d22716da3a7e1d3bcfabeeb505b8c80f 24ed23a4f277fa24b23a93494770b1ced6a02c5c MSRC-3617253 264.92 10.70 34.44 41.29 52.49 59.16 +https://github.com/manofstick/visualfsharp.git nobox_comparer f5298fd5e407956d506da6e14623c1f698f90113 d38481ed20fc27af9e767646b22e8da5fb037689 MSRC-3617253 266.58 10.38 36.33 41.24 52.01 58.60 +https://github.com/manofstick/visualfsharp.git nobox_comparer f5298fd5e407956d506da6e14623c1f698f90113 24ed23a4f277fa24b23a93494770b1ced6a02c5c MSRC-3617253 266.91 10.36 34.71 41.20 52.88 59.43 +https://github.com/manofstick/visualfsharp.git nobox 5b80e902e50d9ffc43de1d48748ad735d6319403 d38481ed20fc27af9e767646b22e8da5fb037689 MSRC-3617253 269.76 10.40 35.36 42.61 51.98 58.77 +https://github.com/manofstick/visualfsharp.git nobox 5b80e902e50d9ffc43de1d48748ad735d6319403 24ed23a4f277fa24b23a93494770b1ced6a02c5c MSRC-3617253 263.90 10.33 35.20 42.92 53.58 56.52 +https://github.com/realvictorprm/visualfsharp.git 20181011_ConstraintSolverRefactoring e531753de12e648cef21b8d7feff2c4619f1fbe4 d38481ed20fc27af9e767646b22e8da5fb037689 MSRC-3617253 275.17 10.24 35.76 44.80 55.18 58.95 +https://github.com/realvictorprm/visualfsharp.git 20181011_ConstraintSolverRefactoring e531753de12e648cef21b8d7feff2c4619f1fbe4 d38481ed20fc27af9e767646b22e8da5fb037689 MSRC-3617253 260.77 10.01 35.35 45.31 56.67 59.00 +https://github.com/realvictorprm/visualfsharp.git 20181011_ConstraintSolverRefactoring e531753de12e648cef21b8d7feff2c4619f1fbe4 f3d55f286278fcd7dc81fc3636e4b1fdc16218e0 MSRC-3617253 270.06 10.33 35.78 46.71 57.46 59.77 +https://github.com/realvictorprm/visualfsharp.git 20181011_ConstraintSolverRefactoring e531753de12e648cef21b8d7feff2c4619f1fbe4 24ed23a4f277fa24b23a93494770b1ced6a02c5c MSRC-3617253 273.90 10.79 35.08 46.55 58.12 59.74 +https://github.com/manofstick/visualfsharp.git faster_map_3 df2e8dd09726e86ef62b71b23f8c14bbf9bd540c 24ed23a4f277fa24b23a93494770b1ced6a02c5c MSRC-3617253 263.89 10.44 34.44 42.21 51.63 60.27 +https://github.com/manofstick/visualfsharp.git faster_map_3 df2e8dd09726e86ef62b71b23f8c14bbf9bd540c f3d55f286278fcd7dc81fc3636e4b1fdc16218e0 MSRC-3617253 259.13 10.44 34.32 41.14 51.28 58.82 +https://github.com/manofstick/visualfsharp.git faster_map_3 df2e8dd09726e86ef62b71b23f8c14bbf9bd540c d38481ed20fc27af9e767646b22e8da5fb037689 MSRC-3617253 274.98 10.69 36.03 43.64 52.48 57.74 +https://github.com/manofstick/visualfsharp.git nobox_reflection 3a4f0b7356fafb2f8aef9f6360ab26585a3a20f8 24ed23a4f277fa24b23a93494770b1ced6a02c5c MSRC-3617253 262.95 10.58 34.71 43.21 53.43 59.23 +https://github.com/manofstick/visualfsharp.git nobox_reflection 3a4f0b7356fafb2f8aef9f6360ab26585a3a20f8 d38481ed20fc27af9e767646b22e8da5fb037689 MSRC-3617253 265.57 10.24 36.23 42.52 59.23 59.87 diff --git a/tests/service/CSharpProjectAnalysis.fs b/tests/service/CSharpProjectAnalysis.fs index 7047099e8cd..70d805b9e6b 100644 --- a/tests/service/CSharpProjectAnalysis.fs +++ b/tests/service/CSharpProjectAnalysis.fs @@ -67,8 +67,8 @@ let internal getProjectReferences (content, dllFiles, libDirs, otherFlags) = let ``Test that csharp references are recognized as such`` () = let csharpAssembly = PathRelativeToTestAssembly "CSharp_Analysis.dll" let _, table = getProjectReferences("""module M""", [csharpAssembly], None, None) - let ass = table.["CSharp_Analysis"] - let search = ass.Contents.Entities |> Seq.tryFind (fun e -> e.DisplayName = "CSharpClass") + let assembly = table.["CSharp_Analysis"] + let search = assembly.Contents.Entities |> Seq.tryFind (fun e -> e.DisplayName = "CSharpClass") Assert.True search.IsSome let found = search.Value // this is no F# thing diff --git a/tests/service/Common.fs b/tests/service/Common.fs index d388a9ca783..6999e97a2b2 100644 --- a/tests/service/Common.fs +++ b/tests/service/Common.fs @@ -109,7 +109,7 @@ let mkProjectCommandLineArgsSilent (dllName, fileNames) = yield "--noframework" yield "--debug:full" yield "--define:DEBUG" -#if NETCOREAPP2_0 +#if NETCOREAPP yield "--targetprofile:netcore" #endif yield "--optimize-" @@ -195,17 +195,18 @@ let parseAndCheckScript (file, input) = | FSharpCheckFileAnswer.Succeeded(res) -> parseResult, res | res -> failwithf "Parsing did not finish... (%A)" res -let parseSourceCode (name: string, code: string) = - let location = Path.Combine(Path.GetTempPath(),"test"+string(hash (name, code))) - try Directory.CreateDirectory(location) |> ignore with _ -> () +let parseSource (source: string) = + let location = Path.GetTempFileName() + let filePath = Path.Combine(location, ".fs") + let dllPath = Path.Combine(location, ".dll") - let projPath = Path.Combine(location, name + ".fsproj") - let filePath = Path.Combine(location, name + ".fs") - let dllPath = Path.Combine(location, name + ".dll") let args = mkProjectCommandLineArgs(dllPath, [filePath]) let options, errors = checker.GetParsingOptionsFromCommandLineArgs(List.ofArray args) - let parseResults = checker.ParseFile(filePath, code, options) |> Async.RunSynchronously - parseResults.ParseTree + let parseResults = checker.ParseFile(filePath, source, options) |> Async.RunSynchronously + + match parseResults.ParseTree with + | Some parseTree -> parseTree + | None -> failwithf "Expected there to be a parse tree for source:\n%s" source /// Extract range info let tups (m:Range.range) = (m.StartLine, m.StartColumn), (m.EndLine, m.EndColumn) @@ -231,6 +232,9 @@ let attribsOfSymbol (s:FSharpSymbol) = if v.IsVolatile then yield "volatile" if v.IsStatic then yield "static" if v.IsLiteral then yield sprintf "%A" v.LiteralValue.Value + if v.IsAnonRecordField then + let info, tys, i = v.AnonRecordFieldDetails + yield "anon(" + string i + ", [" + info.Assembly.QualifiedName + "/" + String.concat "+" info.EnclosingCompiledTypeNames + "/" + info.CompiledName + "]" + String.concat "," info.SortedFieldNames + ")" | :? FSharpEntity as v -> diff --git a/tests/service/EditorTests.fs b/tests/service/EditorTests.fs index d097c710651..81e66a7c20c 100644 --- a/tests/service/EditorTests.fs +++ b/tests/service/EditorTests.fs @@ -63,6 +63,12 @@ let ``Intro test`` () = let identToken = FSharpTokenTag.IDENT // let projectOptions = checker.GetProjectOptionsFromScript(file, input) |> Async.RunSynchronously + // So we check that the messages are the same + for msg in typeCheckResults.Errors do + printfn "Got an error, hopefully with the right text: %A" msg + + printfn "typeCheckResults.Errors.Length = %d" typeCheckResults.Errors.Length + // We only expect one reported error. However, // on Unix, using filenames like /home/user/Test.fsx gives a second copy of all parse errors due to the // way the load closure for scripts is generated. So this returns two identical errors @@ -433,8 +439,7 @@ let _ = printf " %*a" 3 (fun _ _ -> ()) 2 typeCheckResults.GetFormatSpecifierLocationsAndArity() |> Array.map (fun (range,numArgs) -> range.StartLine, range.StartColumn, range.EndLine, range.EndColumn, numArgs) |> shouldEqual - [|(2, 45, 2, 47, 1); (3, 23, 3, 25, 1); (4, 38, 4, 40, 1); (5, 27, 5, 29 -, 1); + [|(2, 45, 2, 47, 1); (3, 23, 3, 25, 1); (4, 38, 4, 40, 1); (5, 27, 5, 29, 1); (6, 17, 6, 20, 2); (7, 17, 7, 22, 1); (8, 17, 8, 23, 1); (9, 18, 9, 22, 1); (10, 18, 10, 21, 1); (12, 12, 12, 15, 1); (15, 12, 15, 15, 1); (16, 28, 16, 30, 1); (18, 30, 18, 32, 1); (19, 30, 19, 32, 1); @@ -1093,7 +1098,7 @@ let _ = RegexTypedStatic.IsMatch<"ABC" >( (*$*) ) // TEST: no assert on Ctrl-sp File.WriteAllText(fileName1, fileSource1) let fileLines1 = File.ReadAllLines(fileName1) let fileNames = [fileName1] - let args = Array.append (mkProjectCommandLineArgs (dllName, fileNames)) [| "-r:" + PathRelativeToTestAssembly(@"UnitTests\MockTypeProviders\DummyProviderForLanguageServiceTesting.dll") |] + let args = Array.append (mkProjectCommandLineArgs (dllName, fileNames)) [| "-r:" + PathRelativeToTestAssembly(@"DummyProviderForLanguageServiceTesting.dll") |] let options = checker.GetProjectOptionsFromCommandLineArgs (projFileName, args) let cleanFileName a = if a = fileName1 then "file1" else "??" diff --git a/tests/service/FscTests.fs b/tests/service/FscTests.fs index 82914dbdbae..553f5e468b0 100644 --- a/tests/service/FscTests.fs +++ b/tests/service/FscTests.fs @@ -48,7 +48,7 @@ type PEVerifier () = Some ("pedump", "--verify all") else let peverifyPath configuration = - Path.Combine(__SOURCE_DIRECTORY__, "..", "fsharpqa", "testenv", "src", "PEVerify", "bin", configuration, "net46", "PEVerify.exe") + Path.Combine(__SOURCE_DIRECTORY__, "..", "..", "artifacts", "bin", "PEVerify", configuration, "net46", "PEVerify.exe") let peverify = if File.Exists(peverifyPath "Debug") then peverifyPath "Debug" else peverifyPath "Release" diff --git a/tests/service/InteractiveCheckerTests.fs b/tests/service/InteractiveCheckerTests.fs index fba9adcb639..136505b6dd2 100644 --- a/tests/service/InteractiveCheckerTests.fs +++ b/tests/service/InteractiveCheckerTests.fs @@ -54,11 +54,7 @@ let internal identsAndRanges (input: Ast.ParsedInput) = | Ast.ParsedInput.SigFile _ -> [] let internal parseAndExtractRanges code = - let file = "Test" - let result = parseSourceCode (file, code) - match result with - | Some tree -> tree |> identsAndRanges - | None -> failwith "fail to parse..." + parseSource code |> identsAndRanges let input = """ diff --git a/tests/service/ProjectAnalysisTests.fs b/tests/service/ProjectAnalysisTests.fs index 0bb8d28b9a8..5ea55a40505 100644 --- a/tests/service/ProjectAnalysisTests.fs +++ b/tests/service/ProjectAnalysisTests.fs @@ -5048,6 +5048,101 @@ let ``Test Project40 all symbols`` () = ("IsItAnAMethod", ((13, 25), (13, 40)), ["member"; "funky"]); ("g", ((13, 4), (13, 5)), ["val"]); ("M", ((2, 7), (2, 8)), ["module"])] +//-------------------------------------------- + +module internal Project41 = + open System.IO + + let fileName1 = Path.ChangeExtension(Path.GetTempFileName(), ".fs") + // We need to us a stable name to keep the hashes stable + let base2 = Path.Combine(Path.GetDirectoryName(Path.GetTempFileName()), "stabletmp.tmp") + let dllName = Path.ChangeExtension(base2, ".dll") + let projFileName = Path.ChangeExtension(base2, ".fsproj") + let fileSource1 = """ +module M + + let data1 = {| X = 1 |} + + // Types can be written with the same syntax + let data2 : {| X : int |} = data1 + + type D = {| X : int |} + + // Access is as expected + let f1 (v : {| X : int |}) = v.X + + // Access is as expected + let f2 (v : D) = v.X + + // Access can be nested + let f3 (v : {| X: {| X : int; Y : string |} |}) = v.X.X + + """ + File.WriteAllText(fileName1, fileSource1) + let fileNames = [fileName1] + let args = mkProjectCommandLineArgs (dllName, fileNames) + let options = checker.GetProjectOptionsFromCommandLineArgs (projFileName, args) + let cleanFileName a = if a = fileName1 then "file1" else "??" + +[] +let ``Test project41 all symbols`` () = + + let wholeProjectResults = checker.ParseAndCheckProject(Project41.options) |> Async.RunSynchronously + let allSymbolUses = wholeProjectResults.GetAllUsesOfAllSymbols() |> Async.RunSynchronously + let allSymbolUsesInfo = + [ for s in allSymbolUses do + let pos = + match s.Symbol.DeclarationLocation with + | Some r when r.FileName = Project41.fileName1 -> r.StartLine, r.StartColumn + | _ -> (0,0) + yield (s.Symbol.DisplayName, tups s.RangeAlternate, attribsOfSymbol s.Symbol, pos) ] + allSymbolUsesInfo |> shouldEqual + [("X", ((4, 19), (4, 20)), + ["field"; "anon(0, [//<>f__AnonymousType1416859829`1']X)"], (4, 19)); + ("data1", ((4, 8), (4, 13)), ["val"], (4, 8)); + ("int", ((7, 23), (7, 26)), ["abbrev"], (0, 0)); + ("X", ((7, 19), (7, 20)), + ["field"; "anon(0, [//<>f__AnonymousType1416859829`1']X)"], (7, 19)); + ("data1", ((7, 32), (7, 37)), ["val"], (4, 8)); + ("data2", ((7, 8), (7, 13)), ["val"], (7, 8)); + ("int", ((9, 20), (9, 23)), ["abbrev"], (0, 0)); + ("X", ((9, 16), (9, 17)), + ["field"; "anon(0, [//<>f__AnonymousType1416859829`1']X)"], (9, 16)); + ("int", ((9, 20), (9, 23)), ["abbrev"], (0, 0)); + ("X", ((9, 16), (9, 17)), + ["field"; "anon(0, [//<>f__AnonymousType1416859829`1']X)"], (9, 16)); + ("D", ((9, 9), (9, 10)), ["abbrev"], (9, 9)); + ("int", ((12, 23), (12, 26)), ["abbrev"], (0, 0)); + ("X", ((12, 19), (12, 20)), + ["field"; "anon(0, [//<>f__AnonymousType1416859829`1']X)"], (12, 19)); + ("v", ((12, 12), (12, 13)), [], (12, 12)); + ("v", ((12, 33), (12, 34)), [], (12, 12)); + ("X", ((12, 33), (12, 36)), + ["field"; "anon(0, [//<>f__AnonymousType1416859829`1']X)"], (12, 19)); + ("f1", ((12, 8), (12, 10)), ["val"], (12, 8)); + ("D", ((15, 16), (15, 17)), ["abbrev"], (9, 9)); + ("v", ((15, 12), (15, 13)), [], (15, 12)); + ("v", ((15, 21), (15, 22)), [], (15, 12)); + ("X", ((15, 21), (15, 24)), + ["field"; "anon(0, [//<>f__AnonymousType1416859829`1']X)"], (9, 16)); + ("f2", ((15, 8), (15, 10)), ["val"], (15, 8)); + ("int", ((18, 29), (18, 32)), ["abbrev"], (0, 0)); + ("string", ((18, 38), (18, 44)), ["abbrev"], (0, 0)); + ("X", ((18, 25), (18, 26)), + ["field"; "anon(0, [//<>f__AnonymousType4026451324`2']X,Y)"], (18, 25)); + ("Y", ((18, 34), (18, 35)), + ["field"; "anon(1, [//<>f__AnonymousType4026451324`2']X,Y)"], (18, 34)); + ("X", ((18, 19), (18, 20)), + ["field"; "anon(0, [//<>f__AnonymousType1416859829`1']X)"], (18, 19)); + ("v", ((18, 12), (18, 13)), [], (18, 12)); + ("v", ((18, 54), (18, 55)), [], (18, 12)); + ("X", ((18, 56), (18, 57)), + ["field"; "anon(0, [//<>f__AnonymousType1416859829`1']X)"], (18, 19)); + ("X", ((18, 54), (18, 59)), + ["field"; "anon(0, [//<>f__AnonymousType4026451324`2']X,Y)"], (18, 25)); + ("f3", ((18, 8), (18, 10)), ["val"], (18, 8)); + ("M", ((2, 7), (2, 8)), ["module"], (2, 7))] + module internal ProjectBig = open System.IO diff --git a/tests/service/ServiceUntypedParseTests.fs b/tests/service/ServiceUntypedParseTests.fs index d47acf69de2..ccda4f5bac4 100644 --- a/tests/service/ServiceUntypedParseTests.fs +++ b/tests/service/ServiceUntypedParseTests.fs @@ -40,14 +40,12 @@ let private (=>) (source: string) (expected: CompletionContext option) = match markerPos with | None -> failwithf "Marker '%s' was not found in the source code" Marker | Some markerPos -> - match parseSourceCode("C:\\test.fs", source) with - | None -> failwith "No parse tree" - | Some parseTree -> - let actual = UntypedParseImpl.TryGetCompletionContext(markerPos, parseTree, lines.[Line.toZ markerPos.Line]) - try Assert.AreEqual(expected, actual) - with e -> - printfn "ParseTree: %A" parseTree - reraise() + let parseTree = parseSource source + let actual = UntypedParseImpl.TryGetCompletionContext(markerPos, parseTree, lines.[Line.toZ markerPos.Line]) + try Assert.AreEqual(expected, actual) + with e -> + printfn "ParseTree: %A" parseTree + reraise() module AttributeCompletion = [] diff --git a/tests/service/StructureTests.fs b/tests/service/StructureTests.fs index d87c3c18e78..c98027c4ca0 100644 --- a/tests/service/StructureTests.fs +++ b/tests/service/StructureTests.fs @@ -40,27 +40,23 @@ let (=>) (source: string) (expectedRanges: (Range * Range) list) = let getRange (r: range) = (r.StartLine, r.StartColumn, r.EndLine, r.EndColumn) - let ast = parseSourceCode(fileName, source) - + let tree = parseSource source try - match ast with - | Some tree -> - let actual = - Structure.getOutliningRanges lines tree - |> Seq.filter (fun sr -> sr.Range.StartLine <> sr.Range.EndLine) - |> Seq.map (fun sr -> getRange sr.Range, getRange sr.CollapseRange) - |> Seq.sort - |> List.ofSeq - let expected = List.sort expectedRanges - if actual <> expected then - failwithf "Expected %s, but was %s" (formatList expected) (formatList actual) - | None -> failwithf "Expected there to be a parse tree for source:\n%s" source + let actual = + Structure.getOutliningRanges lines tree + |> Seq.filter (fun sr -> sr.Range.StartLine <> sr.Range.EndLine) + |> Seq.map (fun sr -> getRange sr.Range, getRange sr.CollapseRange) + |> Seq.sort + |> List.ofSeq + let expected = List.sort expectedRanges + if actual <> expected then + failwithf "Expected %s, but was %s" (formatList expected) (formatList actual) with _ -> - printfn "AST:\n%+A" ast + printfn "AST:\n%+A" tree reraise() [] -let ``empty file``() = "" => [ (1, 0, 2, 0), (1, 0, 2, 0) ] +let ``empty file``() = "" => [] [] let ``nested module``() = @@ -68,8 +64,7 @@ let ``nested module``() = module MyModule = () """ - => [ (1, 0, 4, 0), (1, 0, 4, 0) - (2, 0, 3, 6), (2, 15, 3, 6) ] + => [ (2, 0, 3, 6), (2, 15, 3, 6) ] [] let ``module with multiline function``() = @@ -78,8 +73,7 @@ module MyModule = let foo() = foo() """ - => [ (1, 0, 5, 0), (1, 0, 5, 0) - (2, 0, 4, 13), (2, 15, 4, 13) + => [ (2, 0, 4, 13), (2, 15, 4, 13) (3, 4, 4, 13), (3, 13, 4, 13) (3, 8, 4, 13), (3, 13, 4, 13) ] @@ -91,8 +85,7 @@ type Color = | Green | Blue """ - => [ (1, 0, 6, 0), (1, 0, 6, 0) - (2, 5, 5, 10), (2, 11, 5, 10) + => [ (2, 5, 5, 10), (2, 11, 5, 10) (3, 4, 5, 10), (3, 4, 5, 10) ] [] @@ -107,8 +100,7 @@ type Color = member __.Dispose() = (docEventListener :> IDisposable).Dispose() """ - => [ (1, 0, 10, 0), (1, 0, 10, 0) - (2, 5, 9, 55), (2, 11, 9, 55) + => [ (2, 5, 9, 55), (2, 11, 9, 55) (3, 4, 5, 10), (3, 4, 5, 10) (7, 4, 9, 55), (7, 25, 9, 55) (8, 15, 9, 55), (8, 27, 9, 55) @@ -128,8 +120,7 @@ type Color = (docEventListener :> IDisposable).Dispose() """ => - [ (1, 0, 11, 0), (1, 0, 11, 0) - (2, 5, 10, 55), (2, 11, 10, 55) + [ (2, 5, 10, 55), (2, 11, 10, 55) (3, 4, 4, 14), (3, 4, 4, 14) (3, 6, 4, 13), (3, 6, 4, 13) (8, 4, 10, 55), (8, 25, 10, 55) @@ -147,8 +138,7 @@ type Color() = // 2 foo() () // 8 """ - => [ (1, 0, 9, 0), (1, 0, 9, 0) - (2, 5, 8, 10), (2, 11, 8, 10) + => [ (2, 5, 8, 10), (2, 11, 8, 10) (3, 8, 4, 10), (3, 13, 4, 10) (6, 4, 8, 10), (6, 6, 8, 10) ] @@ -182,8 +172,7 @@ module MyModule = // 2 member __.Dispose() = (docEventListener :> IDisposable).Dispose() """ - => [ (1, 0, 28, 0), (1, 0, 28, 0) - (2, 0, 27, 63), (2, 15, 27, 63) + => [ (2, 0, 27, 63), (2, 15, 27, 63) (4, 4, 5, 10), (4, 13, 5, 10) (4, 8, 5, 10), (4, 13, 5, 10) (7, 9, 15, 59), (7, 15, 15, 59) @@ -228,8 +217,7 @@ open H open G open H """ - => [ (1, 0, 26, 6), (1, 0, 26, 6) - (2, 5, 3, 6), (2, 5, 3, 6) + => [ (2, 5, 3, 6), (2, 5, 3, 6) (5, 0, 19, 17), (5, 8, 19, 17) (8, 9, 9, 10), (8, 9, 9, 10) (11, 4, 14, 17), (11, 12, 14, 17) @@ -263,8 +251,7 @@ let x = 1 "c" #r "d" """ - => [ (1, 0, 23, 6), (1, 0, 23, 6) - (2, 3, 8, 6), (2, 3, 8, 6) + => [ (2, 3, 8, 6), (2, 3, 8, 6) (11, 3, 23, 6), (11, 3, 23, 6) ] [] @@ -277,8 +264,7 @@ let f x = // 2 () // 6 x // 7 """ - => [ (1, 0, 8, 0), (1, 0, 8, 0) - (2, 0, 7, 5), (2, 7, 7, 5) + => [ (2, 0, 7, 5), (2, 7, 7, 5) (2, 4, 7, 5), (2, 7, 7, 5) (3, 8, 6, 10), (3, 11, 6, 10) (4, 12, 5, 14), (4, 13, 5, 14) ] @@ -296,8 +282,7 @@ match None with // 2 let x = () // 9 () // 10 """ - => [ (1, 0, 11, 0), (1, 0, 11, 0) - (2, 0, 10, 10), (2, 15, 10, 10) + => [ (2, 0, 10, 10), (2, 15, 10, 10) (6, 4, 10, 10), (5, 6, 10, 10) (6, 4, 10, 10), (6, 19, 10, 10) (9, 8, 10, 10), (8, 10, 10, 10) ] @@ -317,8 +302,7 @@ async { // 2 () // 11 } // 12 """ - => [ (1, 0, 12, 1), (1, 0, 12, 1) - (2, 0, 12, 1), (2, 7, 12, 0) + => [ (2, 0, 12, 1), (2, 7, 12, 0) (3, 4, 11, 14), (3, 37, 11, 14) (7, 8, 11, 14), (6, 10, 11, 14) (7, 8, 11, 14), (7, 23, 11, 14) @@ -335,8 +319,7 @@ seq { // 2 yield () } // 7 } // 8 """ - => [ (1, 0, 8, 1), (1, 0, 8, 1) - (2, 0, 8, 1), (2, 5, 8, 0) + => [ (2, 0, 8, 1), (2, 5, 8, 0) (4, 8, 5, 10), (4, 11, 5, 10) (6, 4, 7, 18), (6, 4, 7, 18) (6, 11, 7, 18), (6, 16, 7, 17) ] @@ -348,8 +331,7 @@ let _ = [ 1; 2 3 ] """ - => [ (1, 0, 5, 0), (1, 0, 5, 0) - (2, 0, 4, 9), (2, 5, 4, 9) + => [ (2, 0, 4, 9), (2, 5, 4, 9) (2, 4, 4, 9), (2, 5, 4, 9) (3, 4, 4, 9), (3, 5, 4, 8) ] @@ -360,8 +342,7 @@ let _ = { new System.IDisposable with member __.Dispose() = () } """ - => [ (1, 0, 5, 0), (1, 0, 5, 0) - (2, 0, 4, 34), (2, 5, 4, 34) + => [ (2, 0, 4, 34), (2, 5, 4, 34) (2, 4, 4, 34), (2, 5, 4, 34) (3, 4, 4, 34), (3, 28, 4, 34) ] @@ -376,8 +357,7 @@ with _ -> // 5 () // 7 () // 8 """ - => [ (1, 0, 9, 0), (1, 0, 9, 0) - (2, 0, 5, 0), (2, 3, 5, 0) + => [ (2, 0, 5, 0), (2, 3, 5, 0) (2, 0, 8, 6), (2, 3, 8, 6) (3, 8, 4, 10), (3, 11, 4, 10) (5, 0, 8, 6), (5, 4, 8, 6) @@ -395,8 +375,7 @@ finally // 5 () // 7 () // 8 """ - => [ (1, 0, 9, 0), (1, 0, 9, 0) - (2, 0, 8, 6), (2, 3, 8, 6) + => [ (2, 0, 8, 6), (2, 3, 8, 6) (3, 8, 4, 10), (3, 11, 4, 10) (5, 0, 8, 6), (5, 7, 8, 6) (6, 8, 7, 10), (6, 11, 7, 10) ] @@ -413,8 +392,7 @@ else () () """ - => [ (1, 0, 10, 0), (1, 0, 10, 0) - (2, 0, 9, 6), (2, 7, 9, 6) + => [ (2, 0, 9, 6), (2, 7, 9, 6) (2, 8, 5, 6), (2, 12, 5, 6) (3, 8, 4, 10), (3, 11, 4, 10) (7, 8, 8, 10), (7, 11, 8, 10) ] @@ -426,8 +404,7 @@ let ``code quotation``() = "code" @> """ - => [ (1, 0, 4, 10), (1, 0, 4, 10) - (2, 0, 4, 10), (2, 2, 4, 8) ] + => [ (2, 0, 4, 10), (2, 2, 4, 8) ] [] let ``raw code quotation``() = @@ -436,8 +413,7 @@ let ``raw code quotation``() = "code" @@> """ - => [ (1, 0, 4, 11), (1, 0, 4, 11) - (2, 0, 4, 11), (2, 3, 4, 8) ] + => [ (2, 0, 4, 11), (2, 3, 4, 8) ] [] let ``match lambda aka function``() = @@ -446,8 +422,7 @@ function | 0 -> () () """ - => [ (1, 0, 5, 0), (1, 0, 5, 0) - (2, 0, 4, 10), (2, 8, 4, 10) + => [ (2, 0, 4, 10), (2, 8, 4, 10) (3, 8, 4, 10), (3, 3, 4, 10) ] [] @@ -458,8 +433,7 @@ let matchwith num = | 0 -> () () """ - => [ (1, 0, 6, 0), (1, 0, 6, 0) - (2, 0, 5, 13), (2, 17, 5, 13) + => [ (2, 0, 5, 13), (2, 17, 5, 13) (2, 4, 5, 13), (2, 17, 5, 13) (3, 4, 5, 13), (3, 18, 5, 13) (4, 11, 5, 13), (4, 7, 5, 13) ] @@ -471,8 +445,7 @@ for x = 100 downto 10 do () () """ - => [ (1, 0, 5, 0), (1, 0, 5, 0) - (2, 0, 4, 6), (2, 0, 4, 6) ] + => [ (2, 0, 4, 6), (2, 0, 4, 6) ] [] let ``for each``() = @@ -481,8 +454,7 @@ for x in 0 .. 100 -> () () """ - => [ (1, 0, 5, 0), (1, 0, 5, 0) - (2, 0, 4, 14), (2, 0, 4, 14) + => [ (2, 0, 4, 14), (2, 0, 4, 14) (2, 18, 4, 14), (2, 18, 4, 14) ] [] @@ -492,8 +464,7 @@ let ``tuple``() = , 322 , 123123 ) """ - => [ (1, 0, 4, 10), (1, 0, 4, 10) - (2, 2, 4, 8), (2, 2, 4, 8) ] + => [ (2, 2, 4, 8), (2, 2, 4, 8) ] [] let ``do!``() = @@ -502,8 +473,7 @@ do! printfn "allo" printfn "allo" """ - => [(1, 0, 5, 0), (1, 0, 5, 0) - (2, 0, 4, 18), (2, 3, 4, 18)] + => [ (2, 0, 4, 18), (2, 3, 4, 18) ] [] let ``cexpr yield yield!``() = @@ -517,11 +487,10 @@ cexpr{ } } """ - => [(1, 0, 9, 5), (1, 0, 9, 5) - (2, 0, 9, 5), (2, 6, 9, 4) - (3, 4, 8, 17), (3, 4, 8, 17) - (4, 8, 8, 17), (4, 14, 8, 16) - (5, 20, 7, 26), (5, 20, 7, 26)] + => [ (2, 0, 9, 5), (2, 6, 9, 4) + (3, 4, 8, 17), (3, 4, 8, 17) + (4, 8, 8, 17), (4, 14, 8, 16) + (5, 20, 7, 26), (5, 20, 7, 26) ] [] let ``XML doc comments``() = @@ -539,8 +508,7 @@ module M = /// Single line comment let f x = x """ - => [ (1, 0, 14, 0), (1, 0, 14, 0) - (2, 0, 3, 10), (2, 0, 3, 10) + => [ (2, 0, 3, 10), (2, 0, 3, 10) (4, 0, 13, 15), (4, 8, 13, 15) (5, 4, 6, 14), (5, 4, 6, 14) (7, 9, 11, 19), (7, 11, 11, 19) @@ -562,8 +530,7 @@ module M = // Single line comment let f x = x """ - => [ (1, 0, 14, 0), (1, 0, 14, 0) - (2, 0, 3, 9), (2, 0, 3, 9) + => [ (2, 0, 3, 9), (2, 0, 3, 9) (4, 0, 13, 15), (4, 8, 13, 15) (5, 4, 6, 13), (5, 4, 6, 13) (7, 9, 11, 19), (7, 11, 11, 19) @@ -582,8 +549,7 @@ let ``XML doc and regular comments in one block``() = /// Line 8 /// Line 9 """ - => [ (1, 0, 11, 0), (1, 0, 11, 0) - (2, 0, 3, 9), (2, 0, 3, 9) + => [ (2, 0, 3, 9), (2, 0, 3, 9) (4, 0, 5, 10), (4, 0, 5, 10) (7, 0, 10, 10), (7, 0, 10, 10) ] @@ -596,9 +562,45 @@ module M = 'c', 1) """ - => [ (1, 0, 7, 0), (1, 0, 7, 0) - (2, 0, 6, 14), (2, 8, 6, 14) + => [ (2, 0, 6, 14), (2, 8, 6, 14) (3, 4, 6, 14), (3, 9, 6, 14) (3, 8, 6, 14), (3, 9, 6, 14) (4, 8, 6, 14), (4, 25, 6, 14) (5, 12, 6, 13), (5, 12, 6, 13) ] + +[] +let ``Top level module`` () = + """ +module TopLevelModule + +module Nested = + let x = 123 +""" + => [ (2, 7, 5, 15), (2, 21, 5, 15) + (4, 0, 5, 15), (4, 13, 5, 15) ] + +[] +let ``Top level namespace`` () = + """ +namespace TopLevelNamespace.Another + +module Nested = + let x = 123 +""" + => [ (4, 0, 5, 15), (4, 13, 5, 15) ] + +[] +let ``Multiple namespaces`` () = + """ +namespace TopLevelNamespace.Another + +module Nested = + let x = 123 + +namespace AnotherTopLevel.Nested + +module NestedModule = + let x = 123 +""" + => [ (4, 0, 5, 15), (4, 13, 5, 15) + (9, 0, 10, 15), (9, 19, 10, 15) ] diff --git a/tests/service/Symbols.fs b/tests/service/Symbols.fs index 8b5749f0546..da2a7795577 100644 --- a/tests/service/Symbols.fs +++ b/tests/service/Symbols.fs @@ -100,4 +100,27 @@ module Mod2 = mod1val1.XmlDocSig |> shouldEqual "P:Mod1.val1" mod2func2.XmlDocSig |> shouldEqual "M:Mod1.Mod2.func2" - \ No newline at end of file + +module Attributes = + [] + let ``Emit conditional attributes`` () = + let source = """ +open System +open System.Diagnostics + +[] +type FooAttribute() = + inherit Attribute() + +[] +let x = 123 +""" + let fileName, options = mkTestFileAndOptions source [| "--noconditionalerasure" |] + let _, checkResults = parseAndCheckFile fileName source options + + checkResults.GetAllUsesOfAllSymbolsInFile() + |> Async.RunSynchronously + |> Array.tryFind (fun su -> su.Symbol.DisplayName = "x") + |> Option.orElseWith (fun _ -> failwith "Could not get symbol") + |> Option.map (fun su -> su.Symbol :?> FSharpMemberOrFunctionOrValue) + |> Option.iter (fun symbol -> symbol.Attributes.Count |> shouldEqual 1) diff --git a/tests/service/TokenizerTests.fs b/tests/service/TokenizerTests.fs index 4973d398f29..84b95e5175e 100644 --- a/tests/service/TokenizerTests.fs +++ b/tests/service/TokenizerTests.fs @@ -20,7 +20,7 @@ open System.IO let sourceTok = FSharpSourceTokenizer([], Some "C:\\test.fsx") -let rec parseLine(line: string, state: int64 ref, tokenizer: FSharpLineTokenizer) = seq { +let rec parseLine(line: string, state: FSharpTokenizerLexState ref, tokenizer: FSharpLineTokenizer) = seq { match tokenizer.ScanToken(!state) with | Some(tok), nstate -> let str = line.Substring(tok.LeftColumn, tok.RightColumn - tok.LeftColumn + 1) @@ -31,7 +31,7 @@ let rec parseLine(line: string, state: int64 ref, tokenizer: FSharpLineTokenizer state := nstate } let tokenizeLines (lines:string[]) = - [ let state = ref 0L + [ let state = ref FSharpTokenizerLexState.Initial for n, line in lines |> Seq.zip [ 0 .. lines.Length-1 ] do let tokenizer = sourceTok.CreateLineTokenizer(line) yield n, parseLine(line, state, tokenizer) |> List.ofSeq ] diff --git a/tests/service/TreeVisitorTests.fs b/tests/service/TreeVisitorTests.fs new file mode 100644 index 00000000000..e81d140011e --- /dev/null +++ b/tests/service/TreeVisitorTests.fs @@ -0,0 +1,22 @@ +module Tests.Service.TreeVisitorTests + +open FSharp.Compiler.Service.Tests.Common +open Microsoft.FSharp.Compiler.Range +open Microsoft.FSharp.Compiler.SourceCodeServices.AstTraversal +open NUnit.Framework + +[] +let ``Visit type test`` () = + let visitor = + { new AstVisitorBase<_>() with + member x.VisitExpr(_, _, defaultTraverse, expr) = defaultTraverse expr + member x.VisitType(_, _) = Some () } + + let source = "123 :? int" + let parseTree = parseSource source + + Traverse(mkPos 1 11, parseTree, visitor) + |> Option.defaultWith (fun _ -> failwith "Did not visit type") + + Traverse(mkPos 1 3, parseTree, visitor) + |> Option.iter (fun _ -> failwith "Should not visit type") diff --git a/tests/service/data/CSharp_Analysis/CSharp_Analysis.csproj b/tests/service/data/CSharp_Analysis/CSharp_Analysis.csproj index 4f88e4a7873..4fc4184b23d 100644 --- a/tests/service/data/CSharp_Analysis/CSharp_Analysis.csproj +++ b/tests/service/data/CSharp_Analysis/CSharp_Analysis.csproj @@ -1,58 +1,11 @@  - - + + - Debug - AnyCPU - {887630A3-4B1D-40EA-B8B3-2D842E9C40DB} - Library - Properties - CSharp_Analysis - CSharp_Analysis - v4.5 - ..\..\..\..\ - ..\..\..\..\$(Configuration)\net40\bin - 512 - + net45 + 1.0.0.0 + nunit + $(NoWarn);0067;1591 - - true - full - false - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - TRACE - prompt - 4 - - - - - - - - - - - - - - - - - - - - ..\..\..\..\packages\NUnit.3.5.0\lib\net45\nunit.framework.dll - True - True - - - - - \ No newline at end of file + + diff --git a/tests/service/data/CSharp_Analysis/Properties/AssemblyInfo.cs b/tests/service/data/CSharp_Analysis/Properties/AssemblyInfo.cs index 6c36814e769..641372fb96d 100644 --- a/tests/service/data/CSharp_Analysis/Properties/AssemblyInfo.cs +++ b/tests/service/data/CSharp_Analysis/Properties/AssemblyInfo.cs @@ -2,35 +2,7 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -// Allgemeine Informationen über eine Assembly werden über die folgenden -// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern, -// die mit einer Assembly verknüpft sind. -[assembly: AssemblyTitle("CSharp_Analysis")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("CSharp_Analysis")] -[assembly: AssemblyCopyright("Copyright © 2015")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - // Durch Festlegen von ComVisible auf "false" werden die Typen in dieser Assembly unsichtbar // für COM-Komponenten. Wenn Sie auf einen Typ in dieser Assembly von // COM zugreifen müssen, legen Sie das ComVisible-Attribut für diesen Typ auf "true" fest. [assembly: ComVisible(false)] - -// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird -[assembly: Guid("e1b15939-475d-4134-a76c-20845e07be39")] - -// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten: -// -// Hauptversion -// Nebenversion -// Buildnummer -// Revision -// -// Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern -// übernehmen, indem Sie "*" eingeben: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/tests/service/data/Directory.Build.props b/tests/service/data/Directory.Build.props new file mode 100644 index 00000000000..bb8eac309b1 --- /dev/null +++ b/tests/service/data/Directory.Build.props @@ -0,0 +1,3 @@ + + + diff --git a/tests/service/data/Directory.Build.targets b/tests/service/data/Directory.Build.targets new file mode 100644 index 00000000000..ccd47cc0a9a --- /dev/null +++ b/tests/service/data/Directory.Build.targets @@ -0,0 +1,3 @@ + + + diff --git a/tests/service/data/TestTP/TestTP.fsproj b/tests/service/data/TestTP/TestTP.fsproj index 2e0ac9aa194..c56ec5f349b 100644 --- a/tests/service/data/TestTP/TestTP.fsproj +++ b/tests/service/data/TestTP/TestTP.fsproj @@ -1,76 +1,21 @@  - + + - $(MSBuildProjectDirectory)\..\..\..\..\src - - - - Debug - AnyCPU - 2.0 - ff76bd3c-5e0a-4752-b6c3-044f6e15719b - Library - TestTP - TestTP - v4.5 - true - TestTP - ..\..\..\..\$(Configuration)\net40\bin - - - - true - full - false - false - DEBUG;TRACE - 3 - AnyCPU - bin\Debug\TestTP.xml - true - - - pdbonly - true - true - TRACE - 3 - AnyCPU - bin\Release\TestTP.xml - true + net45 + true + nunit + + - - - ..\..\..\..\packages\Microsoft.Portable.FSharp.Core.10.1.0\lib\profiles\net40\FSharp.Core.dll - false - - - - - - - - CSharp_Analysis - {887630a3-4b1d-40ea-b8b3-2d842e9c40db} - True - + + - - - - - ..\..\..\..\packages\NUnit\lib\nunit.framework.dll - True - True - - - - - + diff --git a/verify-translations.cmd b/verify-translations.cmd index 6717de0f778..2580890c6fb 100644 --- a/verify-translations.cmd +++ b/verify-translations.cmd @@ -1,3 +1,3 @@ @echo off -%~dp0release\net40\bin\fsi.exe %~dp0src\scripts\VerifyAllTranslations.fsx -- %~dp0 +%~dp0artifacts\bin\fsi\Release\net46\fsi.exe %~dp0src\scripts\VerifyAllTranslations.fsx -- %~dp0 diff --git a/vsintegration/Directory.Build.targets b/vsintegration/Directory.Build.targets index 8e55b927f97..0a555189d7e 100644 --- a/vsintegration/Directory.Build.targets +++ b/vsintegration/Directory.Build.targets @@ -2,24 +2,15 @@ - - - net462 - - - true + $(NuGetPackageRoot)Microsoft.VSSDK.BuildTools\$(MicrosoftVSSDKBuildToolsPackageVersion) - - - - + + + + diff --git a/vsintegration/ItemTemplates/.gitignore b/vsintegration/ItemTemplates/.gitignore new file mode 100644 index 00000000000..cd42ee34e87 --- /dev/null +++ b/vsintegration/ItemTemplates/.gitignore @@ -0,0 +1,2 @@ +bin/ +obj/ diff --git a/vsintegration/ProjectTemplates/.gitignore b/vsintegration/ProjectTemplates/.gitignore new file mode 100644 index 00000000000..cd42ee34e87 --- /dev/null +++ b/vsintegration/ProjectTemplates/.gitignore @@ -0,0 +1,2 @@ +bin/ +obj/ diff --git a/vsintegration/ProjectTemplates/ConsoleProject/Template/ConsoleApplication.fsproj b/vsintegration/ProjectTemplates/ConsoleProject/Template/ConsoleApplication.fsproj index 2a102babc81..19c297de5e2 100644 --- a/vsintegration/ProjectTemplates/ConsoleProject/Template/ConsoleApplication.fsproj +++ b/vsintegration/ProjectTemplates/ConsoleProject/Template/ConsoleApplication.fsproj @@ -42,14 +42,6 @@ - - ..\packages\FSharp.Core.4.5.2\lib\net45\FSharp.Core.dll - True - - - ..\packages\System.ValueTuple.4.4.0\lib\netstandard1.0\System.ValueTuple.dll - True - diff --git a/vsintegration/ProjectTemplates/ConsoleProject/Template/ConsoleApplication.vstemplate b/vsintegration/ProjectTemplates/ConsoleProject/Template/ConsoleApplication.vstemplate index fccc228384f..31989064070 100644 --- a/vsintegration/ProjectTemplates/ConsoleProject/Template/ConsoleApplication.vstemplate +++ b/vsintegration/ProjectTemplates/ConsoleProject/Template/ConsoleApplication.vstemplate @@ -26,8 +26,8 @@ - - + + diff --git a/vsintegration/ProjectTemplates/ConsoleProject/Template/xlf/AssemblyInfo.fs.cs.xlf b/vsintegration/ProjectTemplates/ConsoleProject/Template/xlf/AssemblyInfo.fs.cs.xlf index a580d9e396b..68ea0772d85 100644 --- a/vsintegration/ProjectTemplates/ConsoleProject/Template/xlf/AssemblyInfo.fs.cs.xlf +++ b/vsintegration/ProjectTemplates/ConsoleProject/Template/xlf/AssemblyInfo.fs.cs.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/ProjectTemplates/ConsoleProject/Template/xlf/AssemblyInfo.fs.de.xlf b/vsintegration/ProjectTemplates/ConsoleProject/Template/xlf/AssemblyInfo.fs.de.xlf index 87fa85b31c9..6d38e4a5a9e 100644 --- a/vsintegration/ProjectTemplates/ConsoleProject/Template/xlf/AssemblyInfo.fs.de.xlf +++ b/vsintegration/ProjectTemplates/ConsoleProject/Template/xlf/AssemblyInfo.fs.de.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/ProjectTemplates/ConsoleProject/Template/xlf/AssemblyInfo.fs.es.xlf b/vsintegration/ProjectTemplates/ConsoleProject/Template/xlf/AssemblyInfo.fs.es.xlf index 9beb403796f..159e61b4e79 100644 --- a/vsintegration/ProjectTemplates/ConsoleProject/Template/xlf/AssemblyInfo.fs.es.xlf +++ b/vsintegration/ProjectTemplates/ConsoleProject/Template/xlf/AssemblyInfo.fs.es.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/ProjectTemplates/ConsoleProject/Template/xlf/AssemblyInfo.fs.fr.xlf b/vsintegration/ProjectTemplates/ConsoleProject/Template/xlf/AssemblyInfo.fs.fr.xlf index a259bd30511..ddea7c610e9 100644 --- a/vsintegration/ProjectTemplates/ConsoleProject/Template/xlf/AssemblyInfo.fs.fr.xlf +++ b/vsintegration/ProjectTemplates/ConsoleProject/Template/xlf/AssemblyInfo.fs.fr.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/ProjectTemplates/ConsoleProject/Template/xlf/AssemblyInfo.fs.it.xlf b/vsintegration/ProjectTemplates/ConsoleProject/Template/xlf/AssemblyInfo.fs.it.xlf index d5fc6c75583..79e98a0f0b4 100644 --- a/vsintegration/ProjectTemplates/ConsoleProject/Template/xlf/AssemblyInfo.fs.it.xlf +++ b/vsintegration/ProjectTemplates/ConsoleProject/Template/xlf/AssemblyInfo.fs.it.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/ProjectTemplates/ConsoleProject/Template/xlf/AssemblyInfo.fs.ko.xlf b/vsintegration/ProjectTemplates/ConsoleProject/Template/xlf/AssemblyInfo.fs.ko.xlf index 258b4ebab29..9382bec5e00 100644 --- a/vsintegration/ProjectTemplates/ConsoleProject/Template/xlf/AssemblyInfo.fs.ko.xlf +++ b/vsintegration/ProjectTemplates/ConsoleProject/Template/xlf/AssemblyInfo.fs.ko.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/ProjectTemplates/ConsoleProject/Template/xlf/AssemblyInfo.fs.pl.xlf b/vsintegration/ProjectTemplates/ConsoleProject/Template/xlf/AssemblyInfo.fs.pl.xlf index ee3471fb557..4ba5555261b 100644 --- a/vsintegration/ProjectTemplates/ConsoleProject/Template/xlf/AssemblyInfo.fs.pl.xlf +++ b/vsintegration/ProjectTemplates/ConsoleProject/Template/xlf/AssemblyInfo.fs.pl.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/ProjectTemplates/ConsoleProject/Template/xlf/AssemblyInfo.fs.pt-BR.xlf b/vsintegration/ProjectTemplates/ConsoleProject/Template/xlf/AssemblyInfo.fs.pt-BR.xlf index 48d258faa25..ba2e69fde6d 100644 --- a/vsintegration/ProjectTemplates/ConsoleProject/Template/xlf/AssemblyInfo.fs.pt-BR.xlf +++ b/vsintegration/ProjectTemplates/ConsoleProject/Template/xlf/AssemblyInfo.fs.pt-BR.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/ProjectTemplates/ConsoleProject/Template/xlf/AssemblyInfo.fs.ru.xlf b/vsintegration/ProjectTemplates/ConsoleProject/Template/xlf/AssemblyInfo.fs.ru.xlf index 6ec9384612e..78261dfa3a2 100644 --- a/vsintegration/ProjectTemplates/ConsoleProject/Template/xlf/AssemblyInfo.fs.ru.xlf +++ b/vsintegration/ProjectTemplates/ConsoleProject/Template/xlf/AssemblyInfo.fs.ru.xlf @@ -1,4 +1,4 @@ - + @@ -49,7 +49,7 @@ Minor Version - Дополнительный номер версии + Вспомогательная версия diff --git a/vsintegration/ProjectTemplates/ConsoleProject/Template/xlf/AssemblyInfo.fs.tr.xlf b/vsintegration/ProjectTemplates/ConsoleProject/Template/xlf/AssemblyInfo.fs.tr.xlf index 906ec8f3ef1..896836c9c7e 100644 --- a/vsintegration/ProjectTemplates/ConsoleProject/Template/xlf/AssemblyInfo.fs.tr.xlf +++ b/vsintegration/ProjectTemplates/ConsoleProject/Template/xlf/AssemblyInfo.fs.tr.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/ProjectTemplates/ConsoleProject/Template/xlf/AssemblyInfo.fs.zh-Hans.xlf b/vsintegration/ProjectTemplates/ConsoleProject/Template/xlf/AssemblyInfo.fs.zh-Hans.xlf index d76c9dbd18c..1c36b83e8aa 100644 --- a/vsintegration/ProjectTemplates/ConsoleProject/Template/xlf/AssemblyInfo.fs.zh-Hans.xlf +++ b/vsintegration/ProjectTemplates/ConsoleProject/Template/xlf/AssemblyInfo.fs.zh-Hans.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/ProjectTemplates/ConsoleProject/Template/xlf/Program.fs.cs.xlf b/vsintegration/ProjectTemplates/ConsoleProject/Template/xlf/Program.fs.cs.xlf index 54f3d3c0c94..50135acb5d2 100644 --- a/vsintegration/ProjectTemplates/ConsoleProject/Template/xlf/Program.fs.cs.xlf +++ b/vsintegration/ProjectTemplates/ConsoleProject/Template/xlf/Program.fs.cs.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/ProjectTemplates/ConsoleProject/Template/xlf/Program.fs.de.xlf b/vsintegration/ProjectTemplates/ConsoleProject/Template/xlf/Program.fs.de.xlf index e3b75382003..ec6378c9ed2 100644 --- a/vsintegration/ProjectTemplates/ConsoleProject/Template/xlf/Program.fs.de.xlf +++ b/vsintegration/ProjectTemplates/ConsoleProject/Template/xlf/Program.fs.de.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/ProjectTemplates/ConsoleProject/Template/xlf/Program.fs.es.xlf b/vsintegration/ProjectTemplates/ConsoleProject/Template/xlf/Program.fs.es.xlf index 30efd4ece6a..4ff250e4b9c 100644 --- a/vsintegration/ProjectTemplates/ConsoleProject/Template/xlf/Program.fs.es.xlf +++ b/vsintegration/ProjectTemplates/ConsoleProject/Template/xlf/Program.fs.es.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/ProjectTemplates/ConsoleProject/Template/xlf/Program.fs.fr.xlf b/vsintegration/ProjectTemplates/ConsoleProject/Template/xlf/Program.fs.fr.xlf index 315bebbcac2..c8f9baec854 100644 --- a/vsintegration/ProjectTemplates/ConsoleProject/Template/xlf/Program.fs.fr.xlf +++ b/vsintegration/ProjectTemplates/ConsoleProject/Template/xlf/Program.fs.fr.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/ProjectTemplates/ConsoleProject/Template/xlf/Program.fs.it.xlf b/vsintegration/ProjectTemplates/ConsoleProject/Template/xlf/Program.fs.it.xlf index 3f1c17cb06d..7517936c7b5 100644 --- a/vsintegration/ProjectTemplates/ConsoleProject/Template/xlf/Program.fs.it.xlf +++ b/vsintegration/ProjectTemplates/ConsoleProject/Template/xlf/Program.fs.it.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/ProjectTemplates/ConsoleProject/Template/xlf/Program.fs.ko.xlf b/vsintegration/ProjectTemplates/ConsoleProject/Template/xlf/Program.fs.ko.xlf index 3d4586af7d2..ad81379fa7f 100644 --- a/vsintegration/ProjectTemplates/ConsoleProject/Template/xlf/Program.fs.ko.xlf +++ b/vsintegration/ProjectTemplates/ConsoleProject/Template/xlf/Program.fs.ko.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/ProjectTemplates/ConsoleProject/Template/xlf/Program.fs.pl.xlf b/vsintegration/ProjectTemplates/ConsoleProject/Template/xlf/Program.fs.pl.xlf index f8a5de8d777..e4440770c4a 100644 --- a/vsintegration/ProjectTemplates/ConsoleProject/Template/xlf/Program.fs.pl.xlf +++ b/vsintegration/ProjectTemplates/ConsoleProject/Template/xlf/Program.fs.pl.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/ProjectTemplates/ConsoleProject/Template/xlf/Program.fs.pt-BR.xlf b/vsintegration/ProjectTemplates/ConsoleProject/Template/xlf/Program.fs.pt-BR.xlf index 30c89d53b94..fa58fbb608d 100644 --- a/vsintegration/ProjectTemplates/ConsoleProject/Template/xlf/Program.fs.pt-BR.xlf +++ b/vsintegration/ProjectTemplates/ConsoleProject/Template/xlf/Program.fs.pt-BR.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/ProjectTemplates/ConsoleProject/Template/xlf/Program.fs.ru.xlf b/vsintegration/ProjectTemplates/ConsoleProject/Template/xlf/Program.fs.ru.xlf index 7d661660156..18d343feba6 100644 --- a/vsintegration/ProjectTemplates/ConsoleProject/Template/xlf/Program.fs.ru.xlf +++ b/vsintegration/ProjectTemplates/ConsoleProject/Template/xlf/Program.fs.ru.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/ProjectTemplates/ConsoleProject/Template/xlf/Program.fs.tr.xlf b/vsintegration/ProjectTemplates/ConsoleProject/Template/xlf/Program.fs.tr.xlf index caa20c452c4..55b9e483481 100644 --- a/vsintegration/ProjectTemplates/ConsoleProject/Template/xlf/Program.fs.tr.xlf +++ b/vsintegration/ProjectTemplates/ConsoleProject/Template/xlf/Program.fs.tr.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/ProjectTemplates/ConsoleProject/Template/xlf/Program.fs.zh-Hans.xlf b/vsintegration/ProjectTemplates/ConsoleProject/Template/xlf/Program.fs.zh-Hans.xlf index 83e038a60e0..3bb540ffff6 100644 --- a/vsintegration/ProjectTemplates/ConsoleProject/Template/xlf/Program.fs.zh-Hans.xlf +++ b/vsintegration/ProjectTemplates/ConsoleProject/Template/xlf/Program.fs.zh-Hans.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/ProjectTemplates/ConsoleProject/Template/xlf/Program.fs.zh-Hant.xlf b/vsintegration/ProjectTemplates/ConsoleProject/Template/xlf/Program.fs.zh-Hant.xlf index 26ef14aae6b..29ef25458fa 100644 --- a/vsintegration/ProjectTemplates/ConsoleProject/Template/xlf/Program.fs.zh-Hant.xlf +++ b/vsintegration/ProjectTemplates/ConsoleProject/Template/xlf/Program.fs.zh-Hant.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/ProjectTemplates/LibraryProject/Template/Library.fsproj b/vsintegration/ProjectTemplates/LibraryProject/Template/Library.fsproj index e8601a827d6..5878583967c 100644 --- a/vsintegration/ProjectTemplates/LibraryProject/Template/Library.fsproj +++ b/vsintegration/ProjectTemplates/LibraryProject/Template/Library.fsproj @@ -38,14 +38,6 @@ - - ..\packages\FSharp.Core.4.5.2\lib\net45\FSharp.Core.dll - True - - - ..\packages\System.ValueTuple.4.4.0\lib\netstandard1.0\System.ValueTuple.dll - True - diff --git a/vsintegration/ProjectTemplates/LibraryProject/Template/Library.vstemplate b/vsintegration/ProjectTemplates/LibraryProject/Template/Library.vstemplate index bbfb2d3f25e..bd1ef57057b 100644 --- a/vsintegration/ProjectTemplates/LibraryProject/Template/Library.vstemplate +++ b/vsintegration/ProjectTemplates/LibraryProject/Template/Library.vstemplate @@ -26,8 +26,8 @@ - - + + diff --git a/vsintegration/ProjectTemplates/LibraryProject/Template/xlf/AssemblyInfo.fs.cs.xlf b/vsintegration/ProjectTemplates/LibraryProject/Template/xlf/AssemblyInfo.fs.cs.xlf index a580d9e396b..68ea0772d85 100644 --- a/vsintegration/ProjectTemplates/LibraryProject/Template/xlf/AssemblyInfo.fs.cs.xlf +++ b/vsintegration/ProjectTemplates/LibraryProject/Template/xlf/AssemblyInfo.fs.cs.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/ProjectTemplates/LibraryProject/Template/xlf/AssemblyInfo.fs.de.xlf b/vsintegration/ProjectTemplates/LibraryProject/Template/xlf/AssemblyInfo.fs.de.xlf index 87fa85b31c9..6d38e4a5a9e 100644 --- a/vsintegration/ProjectTemplates/LibraryProject/Template/xlf/AssemblyInfo.fs.de.xlf +++ b/vsintegration/ProjectTemplates/LibraryProject/Template/xlf/AssemblyInfo.fs.de.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/ProjectTemplates/LibraryProject/Template/xlf/AssemblyInfo.fs.es.xlf b/vsintegration/ProjectTemplates/LibraryProject/Template/xlf/AssemblyInfo.fs.es.xlf index 9beb403796f..159e61b4e79 100644 --- a/vsintegration/ProjectTemplates/LibraryProject/Template/xlf/AssemblyInfo.fs.es.xlf +++ b/vsintegration/ProjectTemplates/LibraryProject/Template/xlf/AssemblyInfo.fs.es.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/ProjectTemplates/LibraryProject/Template/xlf/AssemblyInfo.fs.fr.xlf b/vsintegration/ProjectTemplates/LibraryProject/Template/xlf/AssemblyInfo.fs.fr.xlf index a259bd30511..ddea7c610e9 100644 --- a/vsintegration/ProjectTemplates/LibraryProject/Template/xlf/AssemblyInfo.fs.fr.xlf +++ b/vsintegration/ProjectTemplates/LibraryProject/Template/xlf/AssemblyInfo.fs.fr.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/ProjectTemplates/LibraryProject/Template/xlf/AssemblyInfo.fs.it.xlf b/vsintegration/ProjectTemplates/LibraryProject/Template/xlf/AssemblyInfo.fs.it.xlf index d5fc6c75583..79e98a0f0b4 100644 --- a/vsintegration/ProjectTemplates/LibraryProject/Template/xlf/AssemblyInfo.fs.it.xlf +++ b/vsintegration/ProjectTemplates/LibraryProject/Template/xlf/AssemblyInfo.fs.it.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/ProjectTemplates/LibraryProject/Template/xlf/AssemblyInfo.fs.ko.xlf b/vsintegration/ProjectTemplates/LibraryProject/Template/xlf/AssemblyInfo.fs.ko.xlf index 258b4ebab29..9382bec5e00 100644 --- a/vsintegration/ProjectTemplates/LibraryProject/Template/xlf/AssemblyInfo.fs.ko.xlf +++ b/vsintegration/ProjectTemplates/LibraryProject/Template/xlf/AssemblyInfo.fs.ko.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/ProjectTemplates/LibraryProject/Template/xlf/AssemblyInfo.fs.pl.xlf b/vsintegration/ProjectTemplates/LibraryProject/Template/xlf/AssemblyInfo.fs.pl.xlf index ee3471fb557..4ba5555261b 100644 --- a/vsintegration/ProjectTemplates/LibraryProject/Template/xlf/AssemblyInfo.fs.pl.xlf +++ b/vsintegration/ProjectTemplates/LibraryProject/Template/xlf/AssemblyInfo.fs.pl.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/ProjectTemplates/LibraryProject/Template/xlf/AssemblyInfo.fs.pt-BR.xlf b/vsintegration/ProjectTemplates/LibraryProject/Template/xlf/AssemblyInfo.fs.pt-BR.xlf index 48d258faa25..ba2e69fde6d 100644 --- a/vsintegration/ProjectTemplates/LibraryProject/Template/xlf/AssemblyInfo.fs.pt-BR.xlf +++ b/vsintegration/ProjectTemplates/LibraryProject/Template/xlf/AssemblyInfo.fs.pt-BR.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/ProjectTemplates/LibraryProject/Template/xlf/AssemblyInfo.fs.ru.xlf b/vsintegration/ProjectTemplates/LibraryProject/Template/xlf/AssemblyInfo.fs.ru.xlf index 6ec9384612e..78261dfa3a2 100644 --- a/vsintegration/ProjectTemplates/LibraryProject/Template/xlf/AssemblyInfo.fs.ru.xlf +++ b/vsintegration/ProjectTemplates/LibraryProject/Template/xlf/AssemblyInfo.fs.ru.xlf @@ -1,4 +1,4 @@ - + @@ -49,7 +49,7 @@ Minor Version - Дополнительный номер версии + Вспомогательная версия diff --git a/vsintegration/ProjectTemplates/LibraryProject/Template/xlf/AssemblyInfo.fs.tr.xlf b/vsintegration/ProjectTemplates/LibraryProject/Template/xlf/AssemblyInfo.fs.tr.xlf index 906ec8f3ef1..896836c9c7e 100644 --- a/vsintegration/ProjectTemplates/LibraryProject/Template/xlf/AssemblyInfo.fs.tr.xlf +++ b/vsintegration/ProjectTemplates/LibraryProject/Template/xlf/AssemblyInfo.fs.tr.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/ProjectTemplates/LibraryProject/Template/xlf/AssemblyInfo.fs.zh-Hans.xlf b/vsintegration/ProjectTemplates/LibraryProject/Template/xlf/AssemblyInfo.fs.zh-Hans.xlf index d76c9dbd18c..1c36b83e8aa 100644 --- a/vsintegration/ProjectTemplates/LibraryProject/Template/xlf/AssemblyInfo.fs.zh-Hans.xlf +++ b/vsintegration/ProjectTemplates/LibraryProject/Template/xlf/AssemblyInfo.fs.zh-Hans.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/ProjectTemplates/LibraryProject/Template/xlf/Script.fsx.cs.xlf b/vsintegration/ProjectTemplates/LibraryProject/Template/xlf/Script.fsx.cs.xlf index 985099ec87c..7894dfcbdab 100644 --- a/vsintegration/ProjectTemplates/LibraryProject/Template/xlf/Script.fsx.cs.xlf +++ b/vsintegration/ProjectTemplates/LibraryProject/Template/xlf/Script.fsx.cs.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/ProjectTemplates/LibraryProject/Template/xlf/Script.fsx.de.xlf b/vsintegration/ProjectTemplates/LibraryProject/Template/xlf/Script.fsx.de.xlf index 0e507996fb1..ea2c666e1d6 100644 --- a/vsintegration/ProjectTemplates/LibraryProject/Template/xlf/Script.fsx.de.xlf +++ b/vsintegration/ProjectTemplates/LibraryProject/Template/xlf/Script.fsx.de.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/ProjectTemplates/LibraryProject/Template/xlf/Script.fsx.es.xlf b/vsintegration/ProjectTemplates/LibraryProject/Template/xlf/Script.fsx.es.xlf index 64e2f3bd158..a341541098d 100644 --- a/vsintegration/ProjectTemplates/LibraryProject/Template/xlf/Script.fsx.es.xlf +++ b/vsintegration/ProjectTemplates/LibraryProject/Template/xlf/Script.fsx.es.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/ProjectTemplates/LibraryProject/Template/xlf/Script.fsx.fr.xlf b/vsintegration/ProjectTemplates/LibraryProject/Template/xlf/Script.fsx.fr.xlf index 59fc3c21d0a..6397f046408 100644 --- a/vsintegration/ProjectTemplates/LibraryProject/Template/xlf/Script.fsx.fr.xlf +++ b/vsintegration/ProjectTemplates/LibraryProject/Template/xlf/Script.fsx.fr.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/ProjectTemplates/LibraryProject/Template/xlf/Script.fsx.it.xlf b/vsintegration/ProjectTemplates/LibraryProject/Template/xlf/Script.fsx.it.xlf index 32a62ec6536..d8c92ea17e0 100644 --- a/vsintegration/ProjectTemplates/LibraryProject/Template/xlf/Script.fsx.it.xlf +++ b/vsintegration/ProjectTemplates/LibraryProject/Template/xlf/Script.fsx.it.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/ProjectTemplates/LibraryProject/Template/xlf/Script.fsx.ko.xlf b/vsintegration/ProjectTemplates/LibraryProject/Template/xlf/Script.fsx.ko.xlf index b8477614c17..d1dcac5cd83 100644 --- a/vsintegration/ProjectTemplates/LibraryProject/Template/xlf/Script.fsx.ko.xlf +++ b/vsintegration/ProjectTemplates/LibraryProject/Template/xlf/Script.fsx.ko.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/ProjectTemplates/LibraryProject/Template/xlf/Script.fsx.pl.xlf b/vsintegration/ProjectTemplates/LibraryProject/Template/xlf/Script.fsx.pl.xlf index 26abdffefef..993d2765315 100644 --- a/vsintegration/ProjectTemplates/LibraryProject/Template/xlf/Script.fsx.pl.xlf +++ b/vsintegration/ProjectTemplates/LibraryProject/Template/xlf/Script.fsx.pl.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/ProjectTemplates/LibraryProject/Template/xlf/Script.fsx.pt-BR.xlf b/vsintegration/ProjectTemplates/LibraryProject/Template/xlf/Script.fsx.pt-BR.xlf index d1e9d07a6ee..e7d07e9d09a 100644 --- a/vsintegration/ProjectTemplates/LibraryProject/Template/xlf/Script.fsx.pt-BR.xlf +++ b/vsintegration/ProjectTemplates/LibraryProject/Template/xlf/Script.fsx.pt-BR.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/ProjectTemplates/LibraryProject/Template/xlf/Script.fsx.ru.xlf b/vsintegration/ProjectTemplates/LibraryProject/Template/xlf/Script.fsx.ru.xlf index b8dd108a583..a3df917ca5f 100644 --- a/vsintegration/ProjectTemplates/LibraryProject/Template/xlf/Script.fsx.ru.xlf +++ b/vsintegration/ProjectTemplates/LibraryProject/Template/xlf/Script.fsx.ru.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/ProjectTemplates/LibraryProject/Template/xlf/Script.fsx.tr.xlf b/vsintegration/ProjectTemplates/LibraryProject/Template/xlf/Script.fsx.tr.xlf index 2b4bb37062f..85a2f18ea61 100644 --- a/vsintegration/ProjectTemplates/LibraryProject/Template/xlf/Script.fsx.tr.xlf +++ b/vsintegration/ProjectTemplates/LibraryProject/Template/xlf/Script.fsx.tr.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/ProjectTemplates/LibraryProject/Template/xlf/Script.fsx.zh-Hans.xlf b/vsintegration/ProjectTemplates/LibraryProject/Template/xlf/Script.fsx.zh-Hans.xlf index 332774539b1..d3641659034 100644 --- a/vsintegration/ProjectTemplates/LibraryProject/Template/xlf/Script.fsx.zh-Hans.xlf +++ b/vsintegration/ProjectTemplates/LibraryProject/Template/xlf/Script.fsx.zh-Hans.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/ProjectTemplates/LibraryProject/Template/xlf/Script.fsx.zh-Hant.xlf b/vsintegration/ProjectTemplates/LibraryProject/Template/xlf/Script.fsx.zh-Hant.xlf index 9106b3e72cd..1d2d23cfe91 100644 --- a/vsintegration/ProjectTemplates/LibraryProject/Template/xlf/Script.fsx.zh-Hant.xlf +++ b/vsintegration/ProjectTemplates/LibraryProject/Template/xlf/Script.fsx.zh-Hant.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/ProjectTemplates/TutorialProject/Template/Tutorial.fsproj b/vsintegration/ProjectTemplates/TutorialProject/Template/Tutorial.fsproj index 02498d6e1d1..dd2eed1525f 100644 --- a/vsintegration/ProjectTemplates/TutorialProject/Template/Tutorial.fsproj +++ b/vsintegration/ProjectTemplates/TutorialProject/Template/Tutorial.fsproj @@ -45,14 +45,6 @@ - - ..\packages\FSharp.Core.4.5.2\lib\net45\FSharp.Core.dll - True - - - ..\packages\System.ValueTuple.4.4.0\lib\netstandard1.0\System.ValueTuple.dll - True - diff --git a/vsintegration/ProjectTemplates/TutorialProject/Template/Tutorial.vstemplate b/vsintegration/ProjectTemplates/TutorialProject/Template/Tutorial.vstemplate index 62ae09d17e2..a7c9f403d3a 100644 --- a/vsintegration/ProjectTemplates/TutorialProject/Template/Tutorial.vstemplate +++ b/vsintegration/ProjectTemplates/TutorialProject/Template/Tutorial.vstemplate @@ -24,8 +24,8 @@ - - + + diff --git a/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.cs.xlf b/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.cs.xlf index e7f408b7ac6..9658c4b6005 100644 --- a/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.cs.xlf +++ b/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.cs.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.de.xlf b/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.de.xlf index 34712e5a59d..9a66dab1cb6 100644 --- a/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.de.xlf +++ b/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.de.xlf @@ -1,4 +1,4 @@ - + @@ -284,7 +284,7 @@ and - und + Und diff --git a/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.es.xlf b/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.es.xlf index 638544aa504..30b02b2a50d 100644 --- a/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.es.xlf +++ b/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.es.xlf @@ -1,4 +1,4 @@ - + @@ -284,7 +284,7 @@ and - y + Y diff --git a/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.fr.xlf b/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.fr.xlf index 51bdc34726a..c87b85a0bd7 100644 --- a/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.fr.xlf +++ b/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.fr.xlf @@ -1,4 +1,4 @@ - + @@ -284,7 +284,7 @@ and - et + Et diff --git a/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.it.xlf b/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.it.xlf index 72ec6792d6c..9445a04d313 100644 --- a/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.it.xlf +++ b/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.it.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.ja.xlf b/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.ja.xlf index 2528a68e893..a6774d13b08 100644 --- a/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.ja.xlf +++ b/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.ja.xlf @@ -1,4 +1,4 @@ - + @@ -284,7 +284,7 @@ and - 」および「 + AND diff --git a/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.ko.xlf b/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.ko.xlf index 6e4f9c147a9..6537a73fefe 100644 --- a/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.ko.xlf +++ b/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.ko.xlf @@ -1,4 +1,4 @@ - + @@ -284,7 +284,7 @@ and - + 그리고 diff --git a/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.pl.xlf b/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.pl.xlf index 510321d6dc7..49707692510 100644 --- a/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.pl.xlf +++ b/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.pl.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.pt-BR.xlf b/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.pt-BR.xlf index a917ce2ce47..96dfb6b780b 100644 --- a/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.pt-BR.xlf +++ b/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.pt-BR.xlf @@ -1,4 +1,4 @@ - + @@ -284,7 +284,7 @@ and - e + E diff --git a/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.ru.xlf b/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.ru.xlf index 338efcef1f5..508e29b7fd7 100644 --- a/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.ru.xlf +++ b/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.ru.xlf @@ -1,4 +1,4 @@ - + @@ -284,7 +284,7 @@ and - и + И diff --git a/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.tr.xlf b/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.tr.xlf index cc131aae88d..c08fef4bacc 100644 --- a/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.tr.xlf +++ b/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.tr.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.zh-Hans.xlf b/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.zh-Hans.xlf index 80f00248fcd..4f0cb253170 100644 --- a/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.zh-Hans.xlf +++ b/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.zh-Hans.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.zh-Hant.xlf b/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.zh-Hant.xlf index 128330e9ee3..79a1c1c8486 100644 --- a/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.zh-Hant.xlf +++ b/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.zh-Hant.xlf @@ -1,4 +1,4 @@ - + @@ -284,7 +284,7 @@ and - + diff --git a/vsintegration/Templates.Directory.Build.props b/vsintegration/Templates.Directory.Build.props index 9be1daa15b8..c6a5cea2009 100644 --- a/vsintegration/Templates.Directory.Build.props +++ b/vsintegration/Templates.Directory.Build.props @@ -2,6 +2,12 @@ + + + + + + net46 v4.6 diff --git a/vsintegration/Templates.Directory.Build.targets b/vsintegration/Templates.Directory.Build.targets index 84513c489fc..4d8df139274 100644 --- a/vsintegration/Templates.Directory.Build.targets +++ b/vsintegration/Templates.Directory.Build.targets @@ -11,4 +11,21 @@ + + + + + $(OutputPath)$(TemplateCategory)\FSharp + $(MSBuildProjectDirectory)\$(TemplatesRootPath) + + + + + + + + + + diff --git a/vsintegration/Utils/LanguageServiceProfiling/LanguageServiceProfiling.fsproj b/vsintegration/Utils/LanguageServiceProfiling/LanguageServiceProfiling.fsproj index a61ba873ce9..dfe6034dfce 100644 --- a/vsintegration/Utils/LanguageServiceProfiling/LanguageServiceProfiling.fsproj +++ b/vsintegration/Utils/LanguageServiceProfiling/LanguageServiceProfiling.fsproj @@ -7,6 +7,7 @@ true $(SystemValueTuplePackageVersion) true + true diff --git a/vsintegration/Vsix/Directory.Build.props b/vsintegration/Vsix/Directory.Build.props index 9f5ffe146fe..2a730726842 100644 --- a/vsintegration/Vsix/Directory.Build.props +++ b/vsintegration/Vsix/Directory.Build.props @@ -4,7 +4,6 @@ RoslynDev - false false true $(VSRootSuffix) diff --git a/vsintegration/Vsix/Directory.Build.targets b/vsintegration/Vsix/Directory.Build.targets index fa37bc2cd13..677cf0afc9d 100644 --- a/vsintegration/Vsix/Directory.Build.targets +++ b/vsintegration/Vsix/Directory.Build.targets @@ -2,6 +2,11 @@ + + $(ArtifactsDir)\VSSetup\$(Configuration) + $(ArtifactsDir)\VSSetup.obj\$(Configuration)\Microsoft.FSharp\ + + False diff --git a/vsintegration/Vsix/VisualFSharpFull/VisualFSharpFull.csproj b/vsintegration/Vsix/VisualFSharpFull/VisualFSharpFull.csproj index 99a3e3d7007..95a623bfa12 100644 --- a/vsintegration/Vsix/VisualFSharpFull/VisualFSharpFull.csproj +++ b/vsintegration/Vsix/VisualFSharpFull/VisualFSharpFull.csproj @@ -22,12 +22,7 @@ License.txt true - - PreserveNewest - packages\System.ValueTuple.4.4.0.nupkg - true - - + PreserveNewest FSharp.Data.TypeProviders.dll true @@ -44,6 +39,7 @@ All 2 True + TargetFramework=net46 {649FA588-F02E-457C-9FCF-87E46407481E} @@ -54,6 +50,7 @@ All 2 True + TargetFramework=net46 {D5870CF0-ED51-4CBC-B3D7-6F56DA84AC06} @@ -64,6 +61,7 @@ All 2 True + TargetFramework=net46 {2E4D67B4-522D-4CF7-97E4-BA940F0B18F3} @@ -74,6 +72,7 @@ All 2 True + TargetFramework=net46 {DED3BBD7-53F4-428A-8C9F-27968E768605} @@ -84,8 +83,9 @@ All 2 True + TargetFramework=net45 - + {8B3E283D-B5FE-4055-9D80-7E3A32F3967B} FsiAnyCPU BuiltProjectOutputGroup%3bGetCopyToOutputDirectoryItems%3b @@ -95,8 +95,9 @@ X64 2 True + TargetFramework=net46 - + {D0E98C0D-490B-4C61-9329-0862F6E87645} Fsi BuiltProjectOutputGroup%3bGetCopyToOutputDirectoryItems%3b @@ -106,8 +107,9 @@ X86 2 True + TargetFramework=net46 - + {C94C257C-3C0A-4858-B5D8-D746498D1F08} fsc BuiltProjectOutputGroup%3bGetCopyToOutputDirectoryItems%3b @@ -117,6 +119,7 @@ All 2 True + TargetFramework=net46 {65e0e82a-eace-4787-8994-888674c2fe87} diff --git a/vsintegration/Vsix/VisualFSharpTemplates/VisualFSharpTemplates.csproj b/vsintegration/Vsix/VisualFSharpTemplates/VisualFSharpTemplates.csproj index 53ff7dae39c..110fc964e1c 100644 --- a/vsintegration/Vsix/VisualFSharpTemplates/VisualFSharpTemplates.csproj +++ b/vsintegration/Vsix/VisualFSharpTemplates/VisualFSharpTemplates.csproj @@ -6,16 +6,15 @@ VisualFSharpTemplate Library Microsoft\FSharpTemplates - false - + PreserveNewest packages\FSharp.Core.4.5.2.nupkg true - + PreserveNewest packages\System.ValueTuple.4.4.0.nupkg true diff --git a/vsintegration/fsharp-vsintegration-item-templates-build.proj b/vsintegration/fsharp-vsintegration-item-templates-build.proj index 7a463780dca..0a1fd670f91 100644 --- a/vsintegration/fsharp-vsintegration-item-templates-build.proj +++ b/vsintegration/fsharp-vsintegration-item-templates-build.proj @@ -5,13 +5,13 @@ - - - - - - - + + + + + + + diff --git a/vsintegration/fsharp-vsintegration-project-templates-build.proj b/vsintegration/fsharp-vsintegration-project-templates-build.proj index 59683fa3f98..da89b3a5d23 100644 --- a/vsintegration/fsharp-vsintegration-project-templates-build.proj +++ b/vsintegration/fsharp-vsintegration-project-templates-build.proj @@ -5,9 +5,9 @@ - - - + + + diff --git a/vsintegration/fsharp-vsintegration-src-build.proj b/vsintegration/fsharp-vsintegration-src-build.proj index 0b32bade2c2..93a8fbfd273 100644 --- a/vsintegration/fsharp-vsintegration-src-build.proj +++ b/vsintegration/fsharp-vsintegration-src-build.proj @@ -6,15 +6,15 @@ - - - - - - - - - + + + + + + + + + diff --git a/vsintegration/fsharp-vsintegration-unittests-build.proj b/vsintegration/fsharp-vsintegration-unittests-build.proj index 3ec0e0c1366..489e91ad2e9 100644 --- a/vsintegration/fsharp-vsintegration-unittests-build.proj +++ b/vsintegration/fsharp-vsintegration-unittests-build.proj @@ -1,39 +1,30 @@ - - net40 - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - + diff --git a/vsintegration/fsharp-vsintegration-vsix-build.proj b/vsintegration/fsharp-vsintegration-vsix-build.proj index d7f6d10b430..c208129ec44 100644 --- a/vsintegration/fsharp-vsintegration-vsix-build.proj +++ b/vsintegration/fsharp-vsintegration-vsix-build.proj @@ -1,12 +1,9 @@ - - net40 - - - + + diff --git a/vsintegration/src/Directory.Build.props b/vsintegration/src/Directory.Build.props new file mode 100644 index 00000000000..1ad6fb80ecd --- /dev/null +++ b/vsintegration/src/Directory.Build.props @@ -0,0 +1,9 @@ + + + + + + false + + + diff --git a/vsintegration/src/FSharp.Editor/Build/SetGlobalPropertiesForSdkProjects.fs b/vsintegration/src/FSharp.Editor/Build/SetGlobalPropertiesForSdkProjects.fs index f1c49af7496..dde8fbc04bc 100644 --- a/vsintegration/src/FSharp.Editor/Build/SetGlobalPropertiesForSdkProjects.fs +++ b/vsintegration/src/FSharp.Editor/Build/SetGlobalPropertiesForSdkProjects.fs @@ -13,7 +13,8 @@ open Microsoft.VisualStudio.ProjectSystem.Build // We can't use well-known constants here because `string + string` isn't a valid constant expression in F#. [] -[] +[] +[] type internal SetGlobalPropertiesForSdkProjects [] ( diff --git a/vsintegration/src/FSharp.Editor/CodeFix/FixIndexerAccess.fs b/vsintegration/src/FSharp.Editor/CodeFix/FixIndexerAccess.fs index b1b9b5e6879..7c9442c2d81 100644 --- a/vsintegration/src/FSharp.Editor/CodeFix/FixIndexerAccess.fs +++ b/vsintegration/src/FSharp.Editor/CodeFix/FixIndexerAccess.fs @@ -33,17 +33,18 @@ type internal FSharpFixIndexerAccessCodeFixProvider() = let diagnostics = ImmutableArray.Create diagnostic let span,replacement = try - let span = ref context.Span - + let mutable span = context.Span + + let notStartOfBracket (span: TextSpan) = + let t = TextSpan(span.Start, span.Length + 1) + let s = sourceText.GetSubText(t).ToString() + s.[s.Length-1] <> '[' + // skip all braces and blanks until we find [ - while - (!span).End < sourceText.Length && - let t = TextSpan((!span).Start,(!span).Length + 1) - let s = sourceText.GetSubText(t).ToString() - s.[s.Length-1] <> '[' do - span := TextSpan((!span).Start,(!span).Length + 1) - - !span,sourceText.GetSubText(!span).ToString() + while span.End < sourceText.Length && notStartOfBracket span do + span <- TextSpan(span.Start, span.Length + 1) + + span,sourceText.GetSubText(span).ToString() with | _ -> context.Span,sourceText.GetSubText(context.Span).ToString() diff --git a/vsintegration/src/FSharp.Editor/Common/Constants.fs b/vsintegration/src/FSharp.Editor/Common/Constants.fs index f304a6484b1..58d8a5448a1 100644 --- a/vsintegration/src/FSharp.Editor/Common/Constants.fs +++ b/vsintegration/src/FSharp.Editor/Common/Constants.fs @@ -78,6 +78,11 @@ module internal Guids = let languageServicePerformanceOptionPageIdString = "8FDA964A-263D-4B4E-9560-29897535217C" [] + /// "9007718C-357A-4327-A193-AB3EC38D7EE8" let advancedSettingsPageIdSring = "9007718C-357A-4327-A193-AB3EC38D7EE8" + [] + /// "9EBEBCE8-A79B-46B0-A8C5-A9818AEED17D" + let formattingOptionPageIdString = "9EBEBCE8-A79B-46B0-A8C5-A9818AEED17D" + let blueHighContrastThemeId = Guid "{ce94d289-8481-498b-8ca9-9b6191a315b9}" diff --git a/vsintegration/src/FSharp.Editor/Completion/CompletionProvider.fs b/vsintegration/src/FSharp.Editor/Completion/CompletionProvider.fs index fa1101d18de..fec42d030f7 100644 --- a/vsintegration/src/FSharp.Editor/Completion/CompletionProvider.fs +++ b/vsintegration/src/FSharp.Editor/Completion/CompletionProvider.fs @@ -221,7 +221,7 @@ type internal FSharpCompletionProvider let! _parsingOptions, projectOptions = projectInfoManager.TryGetOptionsForEditingDocumentOrProject(document) let! textVersion = context.Document.GetTextVersionAsync(context.CancellationToken) let getAllSymbols(fileCheckResults: FSharpCheckFileResults) = - if settings.IntelliSense.ShowAllSymbols + if settings.IntelliSense.IncludeSymbolsFromUnopenedNamespacesOrModules then assemblyContentProvider.GetAllEntitiesInProjectAndReferencedAssemblies(fileCheckResults) else [] let! results = diff --git a/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj b/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj index 2908a491dd8..98d8e28f771 100644 --- a/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj +++ b/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj @@ -11,7 +11,7 @@ true $(SystemValueTuplePackageVersion) $(OtherFlags) --warnon:1182 --subsystemversion:6.00 - true + true false @@ -50,6 +50,9 @@ + + + @@ -152,7 +155,7 @@ - + diff --git a/vsintegration/src/FSharp.Editor/FSharp.Editor.resx b/vsintegration/src/FSharp.Editor/FSharp.Editor.resx index 572a794eedf..3675912ce61 100644 --- a/vsintegration/src/FSharp.Editor/FSharp.Editor.resx +++ b/vsintegration/src/FSharp.Editor/FSharp.Editor.resx @@ -177,6 +177,15 @@ Performance + + Advanced + + + CodeLens + + + Formatting + The value is unused @@ -204,10 +213,4 @@ Rename '{0}' to '__' - - Advanced - - - CodeLens - \ No newline at end of file diff --git a/vsintegration/src/FSharp.Editor/Formatting/EditorFormattingService.fs b/vsintegration/src/FSharp.Editor/Formatting/EditorFormattingService.fs index 03061fa350f..5fff337649b 100644 --- a/vsintegration/src/FSharp.Editor/Formatting/EditorFormattingService.fs +++ b/vsintegration/src/FSharp.Editor/Formatting/EditorFormattingService.fs @@ -13,6 +13,7 @@ open Microsoft.CodeAnalysis.Text open Microsoft.FSharp.Compiler.SourceCodeServices open System.Threading +open System.Windows.Forms [] [, FSharpConstants.FSharpLanguageName)>] @@ -20,8 +21,13 @@ type internal FSharpEditorFormattingService [] ( checkerProvider: FSharpCheckerProvider, - projectInfoManager: FSharpProjectOptionsManager + projectInfoManager: FSharpProjectOptionsManager, + settings: EditorOptions ) = + + static let toIList (xs : 'a seq) = ResizeArray(xs) :> IList<'a> + + static let getIndentation (line : string) = line |> Seq.takeWhile ((=) ' ') |> Seq.length static member GetFormattingChanges(documentId: DocumentId, sourceText: SourceText, filePath: string, checker: FSharpChecker, indentStyle: FormattingOptions.IndentStyle, options: (FSharpParsingOptions * FSharpProjectOptions) option, position: int) = // Logic for determining formatting changes: @@ -68,6 +74,77 @@ type internal FSharpEditorFormattingService else return! None } + + static member GetPasteChanges(documentId: DocumentId, sourceText: SourceText, filePath: string, formattingOptions: Microsoft.VisualStudio.FSharp.Editor.FormattingOptions, tabSize: int, parsingOptions: FSharpParsingOptions, currentClipboard: string, span: TextSpan) = + asyncMaybe { + + do! Option.guard formattingOptions.FormatOnPaste + + let startLineIdx = sourceText.Lines.IndexOf span.Start + + // If we're starting and ending on the same line, we've got nothing to format + do! Option.guard (startLineIdx <> sourceText.Lines.IndexOf span.End) + + let startLine = sourceText.Lines.[startLineIdx] + + // VS quirk: if we're pasting on an empty line which has automatically been + // indented (i.e. by ISynchronousIndentationService), then the pasted span + // includes this automatic indentation. When pasting, we only care about what + // was actually in the clipboard. + let fixedSpan = + let pasteText = sourceText.GetSubText(span) + let pasteTextString = pasteText.ToString() + + if currentClipboard.Length > 0 && pasteTextString.EndsWith currentClipboard then + let prepended = pasteTextString.[0..pasteTextString.Length-currentClipboard.Length-1] + + // Only strip off leading indentation if the pasted span is otherwise + // identical to the clipboard (ignoring leading spaces). + if prepended |> Seq.forall ((=) ' ') then + TextSpan(span.Start + prepended.Length, span.Length - prepended.Length) + else + span + else + span + + // Calculate the indentation of the line we pasted onto + let currentIndent = + let priorStartSpan = TextSpan(startLine.Span.Start, startLine.Span.Length - (startLine.Span.End - fixedSpan.Start)) + + sourceText.GetSubText(priorStartSpan).ToString() + |> Seq.takeWhile ((=) ' ') + |> Seq.length + + let fixedPasteText = sourceText.GetSubText(fixedSpan) + let leadingIndentation = fixedPasteText.ToString() |> getIndentation + + let stripIndentation charsToRemove = + let searchIndent = String.replicate charsToRemove " " + let newText = String.replicate currentIndent " " + + fixedPasteText.Lines + |> Seq.indexed + |> Seq.choose (fun (i, line) -> + if line.ToString().StartsWith searchIndent then + TextChange(TextSpan(line.Start + fixedSpan.Start, charsToRemove), if i = 0 then "" else newText) + |> Some + else + None + ) + + if leadingIndentation > 0 then + return stripIndentation leadingIndentation + else + let nextLineShouldBeIndented = FSharpIndentationService.IndentShouldFollow(documentId, sourceText, filePath, span.Start, parsingOptions) + + let removeIndentation = + let nextLineIndent = fixedPasteText.Lines.[1].ToString() |> getIndentation + + if nextLineShouldBeIndented then nextLineIndent - tabSize + else nextLineIndent + + return stripIndentation removeIndentation + } member __.GetFormattingChangesAsync (document: Document, position: int, cancellationToken: CancellationToken) = async { @@ -76,20 +153,27 @@ type internal FSharpEditorFormattingService let indentStyle = options.GetOption(FormattingOptions.SmartIndent, FSharpConstants.FSharpLanguageName) let projectOptionsOpt = projectInfoManager.TryGetOptionsForEditingDocumentOrProject document let! textChange = FSharpEditorFormattingService.GetFormattingChanges(document.Id, sourceText, document.FilePath, checkerProvider.Checker, indentStyle, projectOptionsOpt, position) - - return - match textChange with - | Some change -> - ResizeArray([change]) :> IList<_> - - | None -> - ResizeArray() :> IList<_> + return textChange |> Option.toList |> toIList + } + + member __.OnPasteAsync (document: Document, span: TextSpan, currentClipboard: string, cancellationToken: CancellationToken) = + async { + let! sourceText = document.GetTextAsync(cancellationToken) |> Async.AwaitTask + let! options = document.GetOptionsAsync(cancellationToken) |> Async.AwaitTask + let tabSize = options.GetOption(FormattingOptions.TabSize, FSharpConstants.FSharpLanguageName) + + match projectInfoManager.TryGetOptionsForEditingDocumentOrProject document with + | Some (parsingOptions, _) -> + let! textChanges = FSharpEditorFormattingService.GetPasteChanges(document.Id, sourceText, document.FilePath, settings.Formatting, tabSize, parsingOptions, currentClipboard, span) + return textChanges |> Option.defaultValue Seq.empty |> toIList + | None -> + return toIList Seq.empty } interface IEditorFormattingService with member val SupportsFormatDocument = false member val SupportsFormatSelection = false - member val SupportsFormatOnPaste = false + member val SupportsFormatOnPaste = true member val SupportsFormatOnReturn = true override __.SupportsFormattingOnTypedCharacter (document, ch) = @@ -104,8 +188,10 @@ type internal FSharpEditorFormattingService async { return ResizeArray() :> IList<_> } |> RoslynHelpers.StartAsyncAsTask cancellationToken - override __.GetFormattingChangesOnPasteAsync (_document, _span, cancellationToken) = - async { return ResizeArray() :> IList<_> } + override this.GetFormattingChangesOnPasteAsync (document, span, cancellationToken) = + let currentClipboard = Clipboard.GetText() + + this.OnPasteAsync (document, span, currentClipboard, cancellationToken) |> RoslynHelpers.StartAsyncAsTask cancellationToken override this.GetFormattingChangesAsync (document, _typedChar, position, cancellationToken) = diff --git a/vsintegration/src/FSharp.Editor/Formatting/IndentationService.fs b/vsintegration/src/FSharp.Editor/Formatting/IndentationService.fs index c4c293624bd..20acd00c462 100644 --- a/vsintegration/src/FSharp.Editor/Formatting/IndentationService.fs +++ b/vsintegration/src/FSharp.Editor/Formatting/IndentationService.fs @@ -23,38 +23,26 @@ type internal FSharpIndentationService static member IsSmartIndentEnabled (options: Microsoft.CodeAnalysis.Options.OptionSet) = options.GetOption(FormattingOptions.SmartIndent, FSharpConstants.FSharpLanguageName) = FormattingOptions.IndentStyle.Smart - static member GetDesiredIndentation(documentId: DocumentId, sourceText: SourceText, filePath: string, lineNumber: int, tabSize: int, indentStyle: FormattingOptions.IndentStyle, options: (FSharpParsingOptions * FSharpProjectOptions) option): Option = - - // Match indentation with previous line - let rec tryFindPreviousNonEmptyLine l = - if l <= 0 then None - else - let previousLine = sourceText.Lines.[l - 1] - if not (String.IsNullOrEmpty(previousLine.ToString())) then - Some previousLine - else - tryFindPreviousNonEmptyLine (l - 1) - - let rec tryFindLastNonWhitespaceOrCommentToken (line: TextLine) = maybe { - let! parsingOptions, _projectOptions = options + static member IndentShouldFollow (documentId: DocumentId, sourceText: SourceText, filePath: string, position: int, parsingOptions: FSharpParsingOptions) = + let lastTokenOpt = let defines = CompilerEnvironment.GetCompilationDefinesForEditing parsingOptions - let tokens = Tokenizer.tokenizeLine(documentId, sourceText, line.Start, filePath, defines) - - return! - tokens - |> Array.rev - |> Array.tryFind (fun x -> - x.Tag <> FSharpTokenTag.WHITESPACE && - x.Tag <> FSharpTokenTag.COMMENT && - x.Tag <> FSharpTokenTag.LINE_COMMENT) - } + let tokens = Tokenizer.tokenizeLine(documentId, sourceText, position, filePath, defines) + + tokens + |> Array.rev + |> Array.tryFind (fun x -> + x.Tag <> FSharpTokenTag.WHITESPACE && + x.Tag <> FSharpTokenTag.COMMENT && + x.Tag <> FSharpTokenTag.LINE_COMMENT) let (|Eq|_|) y x = if x = y then Some() else None - let (|NeedIndent|_|) (token: Tokenizer.SavedTokenInfo) = - match token.Tag with + match lastTokenOpt with + | None -> false + | Some lastToken -> + match lastToken.Tag with | Eq FSharpTokenTag.EQUALS // = | Eq FSharpTokenTag.LARROW // <- | Eq FSharpTokenTag.RARROW // -> @@ -70,8 +58,20 @@ type internal FSharpIndentationService | Eq FSharpTokenTag.STRUCT // struct | Eq FSharpTokenTag.CLASS // class | Eq FSharpTokenTag.TRY -> // try - Some () - | _ -> None + true + | _ -> false + + static member GetDesiredIndentation(documentId: DocumentId, sourceText: SourceText, filePath: string, lineNumber: int, tabSize: int, indentStyle: FormattingOptions.IndentStyle, options: (FSharpParsingOptions * FSharpProjectOptions) option): Option = + + // Match indentation with previous line + let rec tryFindPreviousNonEmptyLine l = + if l <= 0 then None + else + let previousLine = sourceText.Lines.[l - 1] + if not (String.IsNullOrEmpty(previousLine.ToString())) then + Some previousLine + else + tryFindPreviousNonEmptyLine (l - 1) maybe { let! previousLine = tryFindPreviousNonEmptyLine lineNumber @@ -81,18 +81,15 @@ type internal FSharpIndentationService |> Seq.takeWhile ((=) ' ') |> Seq.length + let! parsingOptions, _ = options + // Only use smart indentation after tokens that need indentation // if the option is enabled - let lastToken = - if indentStyle = FormattingOptions.IndentStyle.Smart then - tryFindLastNonWhitespaceOrCommentToken previousLine - else - None - return - match lastToken with - | Some NeedIndent -> (lastIndent/tabSize + 1) * tabSize - | _ -> lastIndent + if indentStyle = FormattingOptions.IndentStyle.Smart && FSharpIndentationService.IndentShouldFollow(documentId, sourceText, filePath, previousLine.Start, parsingOptions) then + (lastIndent/tabSize + 1) * tabSize + else + lastIndent } interface ISynchronousIndentationService with diff --git a/vsintegration/src/FSharp.Editor/LanguageService/FSharpCheckerProvider.fs b/vsintegration/src/FSharp.Editor/LanguageService/FSharpCheckerProvider.fs new file mode 100644 index 00000000000..f8ffa8dae32 --- /dev/null +++ b/vsintegration/src/FSharp.Editor/LanguageService/FSharpCheckerProvider.fs @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. + +namespace Microsoft.VisualStudio.FSharp.Editor + +open System +open System.ComponentModel.Composition +open System.Diagnostics +open Microsoft.CodeAnalysis +open Microsoft.CodeAnalysis.Diagnostics +open Microsoft.FSharp.Compiler.SourceCodeServices +open Microsoft.VisualStudio +open Microsoft.VisualStudio.FSharp.Editor +open Microsoft.VisualStudio.LanguageServices +open Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem +open FSharp.NativeInterop + +#nowarn "9" // NativePtr.toNativeInt + +// Exposes FSharpChecker as MEF export +[); Composition.Shared>] +type internal FSharpCheckerProvider + [] + ( + analyzerService: IDiagnosticAnalyzerService, + [)>] workspace: VisualStudioWorkspaceImpl, + settings: EditorOptions + ) = + + let tryGetMetadataSnapshot (path, timeStamp) = + try + let metadataReferenceProvider = workspace.Services.GetService() + let md = metadataReferenceProvider.GetMetadata(path, timeStamp) + let amd = (md :?> AssemblyMetadata) + let mmd = amd.GetModules().[0] + let mmr = mmd.GetMetadataReader() + + // "lifetime is timed to Metadata you got from the GetMetadata(...). As long as you hold it strongly, raw + // memory we got from metadata reader will be alive. Once you are done, just let everything go and + // let finalizer handle resource rather than calling Dispose from Metadata directly. It is shared metadata. + // You shouldn't dispose it directly." + + let objToHold = box md + + // We don't expect any ilread WeakByteFile to be created when working in Visual Studio + Debug.Assert((Microsoft.FSharp.Compiler.AbstractIL.ILBinaryReader.GetStatistics().weakByteFileCount = 0), "Expected weakByteFileCount to be zero when using F# in Visual Studio. Was there a problem reading a .NET binary?") + + Some (objToHold, NativePtr.toNativeInt mmr.MetadataPointer, mmr.MetadataLength) + with ex -> + // We catch all and let the backup routines in the F# compiler find the error + Assert.Exception(ex) + None + + + let checker = + lazy + let checker = + FSharpChecker.Create( + projectCacheSize = settings.LanguageServicePerformance.ProjectCheckCacheSize, + keepAllBackgroundResolutions = false, + // Enabling this would mean that if devenv.exe goes above 2.3GB we do a one-off downsize of the F# Compiler Service caches + (* , MaxMemory = 2300 *) + legacyReferenceResolver=Microsoft.FSharp.Compiler.MSBuildReferenceResolver.Resolver, + tryGetMetadataSnapshot = tryGetMetadataSnapshot) + + // This is one half of the bridge between the F# background builder and the Roslyn analysis engine. + // When the F# background builder refreshes the background semantic build context for a file, + // we request Roslyn to reanalyze that individual file. + checker.BeforeBackgroundFileCheck.Add(fun (fileName, _extraProjectInfo) -> + async { + try + let solution = workspace.CurrentSolution + let documentIds = solution.GetDocumentIdsWithFilePath(fileName) + if not documentIds.IsEmpty then + let documentIdsFiltered = documentIds |> Seq.filter workspace.IsDocumentOpen |> Seq.toArray + for documentId in documentIdsFiltered do + Trace.TraceInformation("{0:n3} Requesting Roslyn reanalysis of {1}", DateTime.Now.TimeOfDay.TotalSeconds, documentId) + if documentIdsFiltered.Length > 0 then + analyzerService.Reanalyze(workspace,documentIds=documentIdsFiltered) + with ex -> + Assert.Exception(ex) + } |> Async.StartImmediate + ) + checker + + member this.Checker = checker.Value + diff --git a/vsintegration/src/FSharp.Editor/LanguageService/FSharpProjectOptionsManager.fs b/vsintegration/src/FSharp.Editor/LanguageService/FSharpProjectOptionsManager.fs new file mode 100644 index 00000000000..007ca3fbe18 --- /dev/null +++ b/vsintegration/src/FSharp.Editor/LanguageService/FSharpProjectOptionsManager.fs @@ -0,0 +1,186 @@ +// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. + +namespace Microsoft.VisualStudio.FSharp.Editor + +open System +open System.Collections.Concurrent +open System.Collections.Immutable +open System.ComponentModel.Composition +open System.IO +open System.Linq +open Microsoft.CodeAnalysis +open Microsoft.FSharp.Compiler.CompileOps +open Microsoft.FSharp.Compiler.SourceCodeServices +open Microsoft.VisualStudio +open Microsoft.VisualStudio.FSharp.Editor +open Microsoft.VisualStudio.FSharp.Editor.SiteProvider +open Microsoft.VisualStudio.LanguageServices +open Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem +open Microsoft.VisualStudio.Shell + +/// Exposes FCS FSharpProjectOptions information management as MEF component. +// +// This service allows analyzers to get an appropriate FSharpProjectOptions value for a project or single file. +// It also allows a 'cheaper' route to get the project options relevant to parsing (e.g. the #define values). +// The main entrypoints are TryGetOptionsForDocumentOrProject and TryGetOptionsForEditingDocumentOrProject. +[); Composition.Shared>] +type internal FSharpProjectOptionsManager + [] + ( + checkerProvider: FSharpCheckerProvider, + [)>] workspace: VisualStudioWorkspaceImpl, + [)>] serviceProvider: System.IServiceProvider, + settings: EditorOptions + ) = + + // A table of information about projects, excluding single-file projects. + let projectOptionsTable = FSharpProjectOptionsTable() + + // A table of information about single-file projects. Currently we only need the load time of each such file, plus + // the original options for editing + let singleFileProjectTable = ConcurrentDictionary() + + let tryGetOrCreateProjectId (projectFileName:string) = + let projectDisplayName = projectDisplayNameOf projectFileName + Some (workspace.ProjectTracker.GetOrCreateProjectIdForPath(projectFileName, projectDisplayName)) + + /// Retrieve the projectOptionsTable + member __.FSharpOptions = projectOptionsTable + + /// Clear a project from the project table + member this.ClearInfoForProject(projectId:ProjectId) = projectOptionsTable.ClearInfoForProject(projectId) + + /// Clear a project from the single file project table + member this.ClearInfoForSingleFileProject(projectId) = + singleFileProjectTable.TryRemove(projectId) |> ignore + + /// Update a project in the single file project table + member this.AddOrUpdateSingleFileProject(projectId, data) = singleFileProjectTable.[projectId] <- data + + /// Get the exact options for a single-file script + member this.ComputeSingleFileOptions (tryGetOrCreateProjectId, fileName, loadTime, fileContents) = + async { + let extraProjectInfo = Some(box workspace) + if SourceFile.MustBeSingleFileProject(fileName) then + // NOTE: we don't use a unique stamp for single files, instead comparing options structurally. + // This is because we repeatedly recompute the options. + let optionsStamp = None + let! options, _diagnostics = checkerProvider.Checker.GetProjectOptionsFromScript(fileName, fileContents, loadTime, [| |], ?extraProjectInfo=extraProjectInfo, ?optionsStamp=optionsStamp) + // NOTE: we don't use FCS cross-project references from scripts to projects. THe projects must have been + // compiled and #r will refer to files on disk + let referencedProjectFileNames = [| |] + let site = ProjectSitesAndFiles.CreateProjectSiteForScript(fileName, referencedProjectFileNames, options) + let deps, projectOptions = ProjectSitesAndFiles.GetProjectOptionsForProjectSite(settings.LanguageServicePerformance.EnableInMemoryCrossProjectReferences, site, serviceProvider, (tryGetOrCreateProjectId fileName), fileName, options.ExtraProjectInfo, Some projectOptionsTable) + let parsingOptions, _ = checkerProvider.Checker.GetParsingOptionsFromProjectOptions(projectOptions) + return (deps, parsingOptions, projectOptions) + else + let site = ProjectSitesAndFiles.ProjectSiteOfSingleFile(fileName) + let deps, projectOptions = ProjectSitesAndFiles.GetProjectOptionsForProjectSite(settings.LanguageServicePerformance.EnableInMemoryCrossProjectReferences, site, serviceProvider, (tryGetOrCreateProjectId fileName), fileName, extraProjectInfo, Some projectOptionsTable) + let parsingOptions, _ = checkerProvider.Checker.GetParsingOptionsFromProjectOptions(projectOptions) + return (deps, parsingOptions, projectOptions) + } + + /// Update the info for a project in the project table + member this.UpdateProjectInfo(tryGetOrCreateProjectId, projectId, site, userOpName, invalidateConfig) = + Logger.Log LogEditorFunctionId.LanguageService_UpdateProjectInfo + projectOptionsTable.AddOrUpdateProject(projectId, (fun isRefresh -> + let extraProjectInfo = Some(box workspace) + let referencedProjects, projectOptions = ProjectSitesAndFiles.GetProjectOptionsForProjectSite(settings.LanguageServicePerformance.EnableInMemoryCrossProjectReferences, site, serviceProvider, Some(projectId), site.ProjectFileName, extraProjectInfo, Some projectOptionsTable) + if invalidateConfig then checkerProvider.Checker.InvalidateConfiguration(projectOptions, startBackgroundCompileIfAlreadySeen = not isRefresh, userOpName = userOpName + ".UpdateProjectInfo") + let referencedProjectIds = referencedProjects |> Array.choose tryGetOrCreateProjectId + let parsingOptions, _ = checkerProvider.Checker.GetParsingOptionsFromProjectOptions(projectOptions) + referencedProjectIds, parsingOptions, Some site, projectOptions)) + + /// Get compilation defines relevant for syntax processing. + /// Quicker then TryGetOptionsForDocumentOrProject as it doesn't need to recompute the exact project + /// options for a script. + member this.GetCompilationDefinesForEditingDocument(document:Document) = + let projectOptionsOpt = this.TryGetOptionsForProject(document.Project.Id) + let parsingOptions = + match projectOptionsOpt with + | Some (parsingOptions, _site, _projectOptions) -> parsingOptions + | _ -> { FSharpParsingOptions.Default with IsInteractive = IsScript document.Name } + CompilerEnvironment.GetCompilationDefinesForEditing parsingOptions + + /// Try and get the Options for a project + member this.TryGetOptionsForProject(projectId:ProjectId) = projectOptionsTable.TryGetOptionsForProject(projectId) + + /// Get the exact options for a document or project + member this.TryGetOptionsForDocumentOrProject(document: Document) = + async { + let projectId = document.Project.Id + + // The options for a single-file script project are re-requested each time the file is analyzed. This is because the + // single-file project may contain #load and #r references which are changing as the user edits, and we may need to re-analyze + // to determine the latest settings. FCS keeps a cache to help ensure these are up-to-date. + match singleFileProjectTable.TryGetValue(projectId) with + | true, (loadTime, _, _) -> + try + let fileName = document.FilePath + let! cancellationToken = Async.CancellationToken + let! sourceText = document.GetTextAsync(cancellationToken) |> Async.AwaitTask + // NOTE: we don't use FCS cross-project references from scripts to projects. The projects must have been + // compiled and #r will refer to files on disk. + let tryGetOrCreateProjectId _ = None + let! _referencedProjectFileNames, parsingOptions, projectOptions = this.ComputeSingleFileOptions (tryGetOrCreateProjectId, fileName, loadTime, sourceText.ToString()) + this.AddOrUpdateSingleFileProject(projectId, (loadTime, parsingOptions, projectOptions)) + return Some (parsingOptions, None, projectOptions) + with ex -> + Assert.Exception(ex) + return None + | _ -> return this.TryGetOptionsForProject(projectId) + } + + /// Get the options for a document or project relevant for syntax processing. + /// Quicker then TryGetOptionsForDocumentOrProject as it doesn't need to recompute the exact project options for a script. + member this.TryGetOptionsForEditingDocumentOrProject(document:Document) = + let projectId = document.Project.Id + match singleFileProjectTable.TryGetValue(projectId) with + | true, (_loadTime, parsingOptions, originalOptions) -> Some (parsingOptions, originalOptions) + | _ -> this.TryGetOptionsForProject(projectId) |> Option.map(fun (parsingOptions, _, projectOptions) -> parsingOptions, projectOptions) + + /// get a siteprovider + member this.ProvideProjectSiteProvider(project:Project) = provideProjectSiteProvider(workspace, project, serviceProvider, Some projectOptionsTable) + + /// Tell the checker to update the project info for the specified project id + member this.UpdateProjectInfoWithProjectId(projectId:ProjectId, userOpName, invalidateConfig) = + let hier = workspace.GetHierarchy(projectId) + match hier with + | null -> () + | h when (h.IsCapabilityMatch("CPS")) -> + let project = workspace.CurrentSolution.GetProject(projectId) + if not (isNull project) then + let siteProvider = this.ProvideProjectSiteProvider(project) + let projectSite = siteProvider.GetProjectSite() + if projectSite.CompilationSourceFiles.Length <> 0 then + this.UpdateProjectInfo(tryGetOrCreateProjectId, projectId, projectSite, userOpName, invalidateConfig) + | _ -> () + + /// Tell the checker to update the project info for the specified project id + member this.UpdateDocumentInfoWithProjectId(projectId:ProjectId, documentId:DocumentId, userOpName, invalidateConfig) = + if workspace.IsDocumentOpen(documentId) then + this.UpdateProjectInfoWithProjectId(projectId, userOpName, invalidateConfig) + + [] + /// This handles commandline change notifications from the Dotnet Project-system + /// Prior to VS 15.7 path contained path to project file, post 15.7 contains target binpath + /// binpath is more accurate because a project file can have multiple in memory projects based on configuration + member this.HandleCommandLineChanges(path:string, sources:ImmutableArray, references:ImmutableArray, options:ImmutableArray) = + use _logBlock = Logger.LogBlock(LogEditorFunctionId.LanguageService_HandleCommandLineArgs) + + let projectId = + match workspace.ProjectTracker.TryGetProjectByBinPath(path) with + | true, project -> project.Id + | false, _ -> workspace.ProjectTracker.GetOrCreateProjectIdForPath(path, projectDisplayNameOf path) + let project = workspace.ProjectTracker.GetProject(projectId) + let path = project.ProjectFilePath + let fullPath p = + if Path.IsPathRooted(p) || path = null then p + else Path.Combine(Path.GetDirectoryName(path), p) + let sourcePaths = sources |> Seq.map(fun s -> fullPath s.Path) |> Seq.toArray + let referencePaths = references |> Seq.map(fun r -> fullPath r.Reference) |> Seq.toArray + + projectOptionsTable.SetOptionsWithProjectId(projectId, sourcePaths, referencePaths, options.ToArray()) + this.UpdateProjectInfoWithProjectId(projectId, "HandleCommandLineChanges", invalidateConfig=true) + + member __.Checker = checkerProvider.Checker diff --git a/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs b/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs index ec29089f2d8..0621b0fd9b4 100644 --- a/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs +++ b/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs @@ -33,6 +33,7 @@ open Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem open Microsoft.VisualStudio.LanguageServices.Implementation.TaskList open Microsoft.VisualStudio.LanguageServices.ProjectSystem open Microsoft.VisualStudio.Shell +open Microsoft.VisualStudio.Shell.Events open Microsoft.VisualStudio.Shell.Interop open Microsoft.VisualStudio.ComponentModelHost open Microsoft.VisualStudio.Text.Outlining @@ -40,242 +41,6 @@ open FSharp.NativeInterop #nowarn "9" // NativePtr.toNativeInt -// Exposes FSharpChecker as MEF export -[); Composition.Shared>] -type internal FSharpCheckerProvider - [] - ( - analyzerService: IDiagnosticAnalyzerService, - [)>] workspace: VisualStudioWorkspaceImpl, - settings: EditorOptions - ) = - - let tryGetMetadataSnapshot (path, timeStamp) = - try - let metadataReferenceProvider = workspace.Services.GetService() - let md = metadataReferenceProvider.GetMetadata(path, timeStamp) - let amd = (md :?> AssemblyMetadata) - let mmd = amd.GetModules().[0] - let mmr = mmd.GetMetadataReader() - - // "lifetime is timed to Metadata you got from the GetMetadata(...). As long as you hold it strongly, raw - // memory we got from metadata reader will be alive. Once you are done, just let everything go and - // let finalizer handle resource rather than calling Dispose from Metadata directly. It is shared metadata. - // You shouldn't dispose it directly." - - let objToHold = box md - - // We don't expect any ilread WeakByteFile to be created when working in Visual Studio - Debug.Assert((Microsoft.FSharp.Compiler.AbstractIL.ILBinaryReader.GetStatistics().weakByteFileCount = 0), "Expected weakByteFileCount to be zero when using F# in Visual Studio. Was there a problem reading a .NET binary?") - - Some (objToHold, NativePtr.toNativeInt mmr.MetadataPointer, mmr.MetadataLength) - with ex -> - // We catch all and let the backup routines in the F# compiler find the error - Assert.Exception(ex) - None - - - let checker = - lazy - let checker = - FSharpChecker.Create( - projectCacheSize = settings.LanguageServicePerformance.ProjectCheckCacheSize, - keepAllBackgroundResolutions = false, - // Enabling this would mean that if devenv.exe goes above 2.3GB we do a one-off downsize of the F# Compiler Service caches - (* , MaxMemory = 2300 *) - legacyReferenceResolver=Microsoft.FSharp.Compiler.MSBuildReferenceResolver.Resolver, - tryGetMetadataSnapshot = tryGetMetadataSnapshot) - - // This is one half of the bridge between the F# background builder and the Roslyn analysis engine. - // When the F# background builder refreshes the background semantic build context for a file, - // we request Roslyn to reanalyze that individual file. - checker.BeforeBackgroundFileCheck.Add(fun (fileName, _extraProjectInfo) -> - async { - try - let solution = workspace.CurrentSolution - let documentIds = solution.GetDocumentIdsWithFilePath(fileName) - if not documentIds.IsEmpty then - let documentIdsFiltered = documentIds |> Seq.filter workspace.IsDocumentOpen |> Seq.toArray - for documentId in documentIdsFiltered do - Trace.TraceInformation("{0:n3} Requesting Roslyn reanalysis of {1}", DateTime.Now.TimeOfDay.TotalSeconds, documentId) - if documentIdsFiltered.Length > 0 then - analyzerService.Reanalyze(workspace,documentIds=documentIdsFiltered) - with ex -> - Assert.Exception(ex) - } |> Async.StartImmediate - ) - checker - - member this.Checker = checker.Value - - -/// Exposes FCS FSharpProjectOptions information management as MEF component. -// -// This service allows analyzers to get an appropriate FSharpProjectOptions value for a project or single file. -// It also allows a 'cheaper' route to get the project options relevant to parsing (e.g. the #define values). -// The main entrypoints are TryGetOptionsForDocumentOrProject and TryGetOptionsForEditingDocumentOrProject. -[); Composition.Shared>] -type internal FSharpProjectOptionsManager - [] - ( - checkerProvider: FSharpCheckerProvider, - [)>] workspace: VisualStudioWorkspaceImpl, - [)>] serviceProvider: System.IServiceProvider, - settings: EditorOptions - ) = - - // A table of information about projects, excluding single-file projects. - let projectOptionsTable = FSharpProjectOptionsTable() - - // A table of information about single-file projects. Currently we only need the load time of each such file, plus - // the original options for editing - let singleFileProjectTable = ConcurrentDictionary() - - let tryGetOrCreateProjectId (projectFileName:string) = - let projectDisplayName = projectDisplayNameOf projectFileName - Some (workspace.ProjectTracker.GetOrCreateProjectIdForPath(projectFileName, projectDisplayName)) - - /// Retrieve the projectOptionsTable - member __.FSharpOptions = projectOptionsTable - - /// Clear a project from the project table - member this.ClearInfoForProject(projectId:ProjectId) = projectOptionsTable.ClearInfoForProject(projectId) - - /// Clear a project from the single file project table - member this.ClearInfoForSingleFileProject(projectId) = - singleFileProjectTable.TryRemove(projectId) |> ignore - - /// Update a project in the single file project table - member this.AddOrUpdateSingleFileProject(projectId, data) = singleFileProjectTable.[projectId] <- data - - /// Get the exact options for a single-file script - member this.ComputeSingleFileOptions (tryGetOrCreateProjectId, fileName, loadTime, fileContents) = - async { - let extraProjectInfo = Some(box workspace) - if SourceFile.MustBeSingleFileProject(fileName) then - // NOTE: we don't use a unique stamp for single files, instead comparing options structurally. - // This is because we repeatedly recompute the options. - let optionsStamp = None - let! options, _diagnostics = checkerProvider.Checker.GetProjectOptionsFromScript(fileName, fileContents, loadTime, [| |], ?extraProjectInfo=extraProjectInfo, ?optionsStamp=optionsStamp) - // NOTE: we don't use FCS cross-project references from scripts to projects. THe projects must have been - // compiled and #r will refer to files on disk - let referencedProjectFileNames = [| |] - let site = ProjectSitesAndFiles.CreateProjectSiteForScript(fileName, referencedProjectFileNames, options) - let deps, projectOptions = ProjectSitesAndFiles.GetProjectOptionsForProjectSite(settings.LanguageServicePerformance.EnableInMemoryCrossProjectReferences, site, serviceProvider, (tryGetOrCreateProjectId fileName), fileName, options.ExtraProjectInfo, Some projectOptionsTable) - let parsingOptions, _ = checkerProvider.Checker.GetParsingOptionsFromProjectOptions(projectOptions) - return (deps, parsingOptions, projectOptions) - else - let site = ProjectSitesAndFiles.ProjectSiteOfSingleFile(fileName) - let deps, projectOptions = ProjectSitesAndFiles.GetProjectOptionsForProjectSite(settings.LanguageServicePerformance.EnableInMemoryCrossProjectReferences, site, serviceProvider, (tryGetOrCreateProjectId fileName), fileName, extraProjectInfo, Some projectOptionsTable) - let parsingOptions, _ = checkerProvider.Checker.GetParsingOptionsFromProjectOptions(projectOptions) - return (deps, parsingOptions, projectOptions) - } - - /// Update the info for a project in the project table - member this.UpdateProjectInfo(tryGetOrCreateProjectId, projectId, site, userOpName, invalidateConfig) = - Logger.Log LogEditorFunctionId.LanguageService_UpdateProjectInfo - projectOptionsTable.AddOrUpdateProject(projectId, (fun isRefresh -> - let extraProjectInfo = Some(box workspace) - let referencedProjects, projectOptions = ProjectSitesAndFiles.GetProjectOptionsForProjectSite(settings.LanguageServicePerformance.EnableInMemoryCrossProjectReferences, site, serviceProvider, Some(projectId), site.ProjectFileName, extraProjectInfo, Some projectOptionsTable) - if invalidateConfig then checkerProvider.Checker.InvalidateConfiguration(projectOptions, startBackgroundCompileIfAlreadySeen = not isRefresh, userOpName = userOpName + ".UpdateProjectInfo") - let referencedProjectIds = referencedProjects |> Array.choose tryGetOrCreateProjectId - let parsingOptions, _ = checkerProvider.Checker.GetParsingOptionsFromProjectOptions(projectOptions) - referencedProjectIds, parsingOptions, Some site, projectOptions)) - - /// Get compilation defines relevant for syntax processing. - /// Quicker then TryGetOptionsForDocumentOrProject as it doesn't need to recompute the exact project - /// options for a script. - member this.GetCompilationDefinesForEditingDocument(document:Document) = - let projectOptionsOpt = this.TryGetOptionsForProject(document.Project.Id) - let parsingOptions = - match projectOptionsOpt with - | Some (parsingOptions, _site, _projectOptions) -> parsingOptions - | _ -> { FSharpParsingOptions.Default with IsInteractive = IsScript document.Name } - CompilerEnvironment.GetCompilationDefinesForEditing parsingOptions - - /// Try and get the Options for a project - member this.TryGetOptionsForProject(projectId:ProjectId) = projectOptionsTable.TryGetOptionsForProject(projectId) - - /// Get the exact options for a document or project - member this.TryGetOptionsForDocumentOrProject(document: Document) = - async { - let projectId = document.Project.Id - - // The options for a single-file script project are re-requested each time the file is analyzed. This is because the - // single-file project may contain #load and #r references which are changing as the user edits, and we may need to re-analyze - // to determine the latest settings. FCS keeps a cache to help ensure these are up-to-date. - match singleFileProjectTable.TryGetValue(projectId) with - | true, (loadTime, _, _) -> - try - let fileName = document.FilePath - let! cancellationToken = Async.CancellationToken - let! sourceText = document.GetTextAsync(cancellationToken) |> Async.AwaitTask - // NOTE: we don't use FCS cross-project references from scripts to projects. The projects must have been - // compiled and #r will refer to files on disk. - let tryGetOrCreateProjectId _ = None - let! _referencedProjectFileNames, parsingOptions, projectOptions = this.ComputeSingleFileOptions (tryGetOrCreateProjectId, fileName, loadTime, sourceText.ToString()) - this.AddOrUpdateSingleFileProject(projectId, (loadTime, parsingOptions, projectOptions)) - return Some (parsingOptions, None, projectOptions) - with ex -> - Assert.Exception(ex) - return None - | _ -> return this.TryGetOptionsForProject(projectId) - } - - /// Get the options for a document or project relevant for syntax processing. - /// Quicker then TryGetOptionsForDocumentOrProject as it doesn't need to recompute the exact project options for a script. - member this.TryGetOptionsForEditingDocumentOrProject(document:Document) = - let projectId = document.Project.Id - match singleFileProjectTable.TryGetValue(projectId) with - | true, (_loadTime, parsingOptions, originalOptions) -> Some (parsingOptions, originalOptions) - | _ -> this.TryGetOptionsForProject(projectId) |> Option.map(fun (parsingOptions, _, projectOptions) -> parsingOptions, projectOptions) - - /// get a siteprovider - member this.ProvideProjectSiteProvider(project:Project) = provideProjectSiteProvider(workspace, project, serviceProvider, Some projectOptionsTable) - - /// Tell the checker to update the project info for the specified project id - member this.UpdateProjectInfoWithProjectId(projectId:ProjectId, userOpName, invalidateConfig) = - let hier = workspace.GetHierarchy(projectId) - match hier with - | null -> () - | h when (h.IsCapabilityMatch("CPS")) -> - let project = workspace.CurrentSolution.GetProject(projectId) - if not (isNull project) then - let siteProvider = this.ProvideProjectSiteProvider(project) - let projectSite = siteProvider.GetProjectSite() - if projectSite.CompilationSourceFiles.Length <> 0 then - this.UpdateProjectInfo(tryGetOrCreateProjectId, projectId, projectSite, userOpName, invalidateConfig) - | _ -> () - - /// Tell the checker to update the project info for the specified project id - member this.UpdateDocumentInfoWithProjectId(projectId:ProjectId, documentId:DocumentId, userOpName, invalidateConfig) = - if workspace.IsDocumentOpen(documentId) then - this.UpdateProjectInfoWithProjectId(projectId, userOpName, invalidateConfig) - - [] - /// This handles commandline change notifications from the Dotnet Project-system - /// Prior to VS 15.7 path contained path to project file, post 15.7 contains target binpath - /// binpath is more accurate because a project file can have multiple in memory projects based on configuration - member this.HandleCommandLineChanges(path:string, sources:ImmutableArray, references:ImmutableArray, options:ImmutableArray) = - use _logBlock = Logger.LogBlock(LogEditorFunctionId.LanguageService_HandleCommandLineArgs) - - let projectId = - match workspace.ProjectTracker.TryGetProjectByBinPath(path) with - | true, project -> project.Id - | false, _ -> workspace.ProjectTracker.GetOrCreateProjectIdForPath(path, projectDisplayNameOf path) - let project = workspace.ProjectTracker.GetProject(projectId) - let path = project.ProjectFilePath - let fullPath p = - if Path.IsPathRooted(p) || path = null then p - else Path.Combine(Path.GetDirectoryName(path), p) - let sourcePaths = sources |> Seq.map(fun s -> fullPath s.Path) |> Seq.toArray - let referencePaths = references |> Seq.map(fun r -> fullPath r.Reference) |> Seq.toArray - - projectOptionsTable.SetOptionsWithProjectId(projectId, sourcePaths, referencePaths, options.ToArray()) - this.UpdateProjectInfoWithProjectId(projectId, "HandleCommandLineChanges", invalidateConfig=true) - - member __.Checker = checkerProvider.Checker - // Used to expose FSharpChecker/ProjectInfo manager to diagnostic providers // Diagnostic providers can be executed in environment that does not use MEF so they can rely only // on services exposed by the workspace @@ -336,6 +101,7 @@ type internal FSharpSettingsFactory [, "F#", null, "Performance", "6011")>] [, "F#", null, "Advanced", "6012")>] [, "F#", null, "CodeLens", "6013")>] +[, "F#", null, "Formatting", "6014")>] [] // 64 represents a hex number. It needs to be greater than 37 so the TextMate editor will not be chosen as higher priority. [, ".fs", 64)>] @@ -394,7 +160,7 @@ type internal FSharpPackage() as this = override this.RoslynLanguageName = FSharpConstants.FSharpLanguageName override this.CreateWorkspace() = this.ComponentModel.GetService() - override this.CreateLanguageService() = FSharpLanguageService(this) + override this.CreateLanguageService() = FSharpLanguageService(this, this.GetService(typeof) :?> IVsSolution) override this.CreateEditorFactories() = seq { yield FSharpEditorFactory(this) :> IVsEditorFactory } override this.RegisterMiscellaneousFilesWorkspaceInformation(_) = () @@ -405,7 +171,7 @@ type internal FSharpPackage() as this = GetToolWindowAsITestVFSI().GetMostRecentLines(n) [] -type internal FSharpLanguageService(package : FSharpPackage) = +type internal FSharpLanguageService(package : FSharpPackage, solution: IVsSolution) = inherit AbstractLanguageService(package) let projectInfoManager = package.ComponentModel.DefaultExportProvider.GetExport().Value @@ -423,207 +189,25 @@ type internal FSharpLanguageService(package : FSharpPackage) = project.Dispose() | _ -> () - let invalidPathChars = set (Path.GetInvalidPathChars()) - let isPathWellFormed (path: string) = not (String.IsNullOrWhiteSpace path) && path |> Seq.forall (fun c -> not (Set.contains c invalidPathChars)) - let tryGetOrCreateProjectId (workspace: VisualStudioWorkspaceImpl) (projectFileName: string) = let projectDisplayName = projectDisplayNameOf projectFileName Some (workspace.ProjectTracker.GetOrCreateProjectIdForPath(projectFileName, projectDisplayName)) - let optionsAssociation = ConditionalWeakTable() - - member private this.OnProjectAdded(projectId:ProjectId) = projectInfoManager.UpdateProjectInfoWithProjectId(projectId, "OnProjectAdded", invalidateConfig=true) - member private this.OnProjectReloaded(projectId:ProjectId) = projectInfoManager.UpdateProjectInfoWithProjectId(projectId, "OnProjectReloaded", invalidateConfig=true) - member private this.OnProjectRemoved(projectId) = projectInfoManager.ClearInfoForProject(projectId) - member private this.OnDocumentAdded(projectId:ProjectId, documentId:DocumentId) = projectInfoManager.UpdateDocumentInfoWithProjectId(projectId, documentId, "OnDocumentAdded", invalidateConfig=true) - member private this.OnDocumentReloaded(projectId:ProjectId, documentId:DocumentId) = projectInfoManager.UpdateDocumentInfoWithProjectId(projectId, documentId, "OnDocumentReloaded", invalidateConfig=true) + let mutable legacyProjectWorkspaceMap = Unchecked.defaultof override this.Initialize() = base.Initialize() - let workspaceChanged (args:WorkspaceChangeEventArgs) = - match args.Kind with - | WorkspaceChangeKind.ProjectAdded -> this.OnProjectAdded(args.ProjectId) - | WorkspaceChangeKind.ProjectReloaded -> this.OnProjectReloaded(args.ProjectId) - | WorkspaceChangeKind.ProjectRemoved -> this.OnProjectRemoved(args.ProjectId) - | WorkspaceChangeKind.DocumentAdded -> this.OnDocumentAdded(args.ProjectId, args.DocumentId) - | WorkspaceChangeKind.DocumentReloaded -> this.OnDocumentReloaded(args.ProjectId, args.DocumentId) - | WorkspaceChangeKind.DocumentRemoved - | WorkspaceChangeKind.AdditionalDocumentAdded - | WorkspaceChangeKind.AdditionalDocumentReloaded - | WorkspaceChangeKind.AdditionalDocumentRemoved - | WorkspaceChangeKind.AdditionalDocumentChanged - | WorkspaceChangeKind.DocumentInfoChanged - | WorkspaceChangeKind.DocumentChanged - | WorkspaceChangeKind.SolutionAdded - | WorkspaceChangeKind.SolutionChanged - | WorkspaceChangeKind.SolutionReloaded - | WorkspaceChangeKind.SolutionCleared - | _ -> () - this.Workspace.Options <- this.Workspace.Options.WithChangedOption(Completion.CompletionOptions.BlockForCompletionItems, FSharpConstants.FSharpLanguageName, false) this.Workspace.Options <- this.Workspace.Options.WithChangedOption(Shared.Options.ServiceFeatureOnOffOptions.ClosedFileDiagnostic, FSharpConstants.FSharpLanguageName, Nullable false) - this.Workspace.WorkspaceChanged.Add(workspaceChanged) - this.Workspace.DocumentClosed.Add <| fun args -> tryRemoveSingleFileProject args.Document.Project.Id - - Events.SolutionEvents.OnAfterCloseSolution.Add <| fun _ -> - //checkerProvider.Checker.StopBackgroundCompile() - - // FUTURE: consider enbling some or all of these to flush all caches and stop all background builds. However the operations - // are asynchronous and we need to decide if we stop everything synchronously. - //checker.ClearLanguageServiceRootCachesAndCollectAndFinalizeAllTransients() - //checkerProvider.Checker.InvalidateAll() - - singleFileProjects.Keys |> Seq.iter tryRemoveSingleFileProject - - let ctx = System.Threading.SynchronizationContext.Current - - let rec setupProjectsAfterSolutionOpen() = - async { - use openedProjects = MailboxProcessor.Start <| fun inbox -> - async { - // waits for AfterOpenSolution and then starts projects setup - do! Async.AwaitEvent Events.SolutionEvents.OnAfterOpenSolution |> Async.Ignore - while true do - let! siteProvider = inbox.Receive() - do! Async.SwitchToContext ctx - this.SetupProjectFile(siteProvider, this.Workspace, "SetupProjectsAfterSolutionOpen") - do! Async.SwitchToThreadPool() - } - - use _ = Events.SolutionEvents.OnAfterOpenProject |> Observable.subscribe ( fun args -> - match args.Hierarchy with - | :? IProvideProjectSite as siteProvider -> openedProjects.Post(siteProvider) - | _ -> () ) + this.Workspace.DocumentClosed.Add <| fun args -> tryRemoveSingleFileProject args.Document.Project.Id - do! Async.AwaitEvent Events.SolutionEvents.OnAfterCloseSolution |> Async.Ignore - do! setupProjectsAfterSolutionOpen() - } - setupProjectsAfterSolutionOpen() |> Async.StartImmediate + legacyProjectWorkspaceMap <- LegacyProjectWorkspaceMap(this.Workspace, solution, projectInfoManager, package.ComponentModel.GetService(), this.SystemServiceProvider) + legacyProjectWorkspaceMap.Initialize() let theme = package.ComponentModel.DefaultExportProvider.GetExport().Value theme.SetColors() - - /// Sync the Roslyn information for the project held in 'projectContext' to match the information given by 'site'. - /// Also sync the info in ProjectInfoManager if necessary. - member this.SyncProject(projectContext: IWorkspaceProjectContext, site: IProjectSite, workspace: VisualStudioWorkspaceImpl, forceUpdate, userOpName) = - let wellFormedFilePathSetIgnoreCase (paths: seq) = - HashSet(paths |> Seq.filter isPathWellFormed |> Seq.map (fun s -> try Path.GetFullPath(s) with _ -> s), StringComparer.OrdinalIgnoreCase) - - let mutable updated = forceUpdate - - let project = workspace.CurrentSolution.Projects |> Seq.filter (fun p -> p.Name = projectContext.DisplayName) |> Seq.exactlyOne - - // Sync the source files in projectContext. Note that these source files are __not__ maintained in order in projectContext - // as edits are made. It seems this is ok because the source file list is only used to drive roslyn per-file checking. - let updatedFiles = site.CompilationSourceFiles |> wellFormedFilePathSetIgnoreCase - let originalFiles = project.Documents |> Seq.map (fun file -> file.FilePath) |> wellFormedFilePathSetIgnoreCase - - for file in updatedFiles do - if not(originalFiles.Contains(file)) then - projectContext.AddSourceFile(file) - updated <- true - - for file in originalFiles do - if not(updatedFiles.Contains(file)) then - projectContext.RemoveSourceFile(file) - updated <- true - - let updatedRefs = site.CompilationReferences |> wellFormedFilePathSetIgnoreCase - let originalRefs = project.MetadataReferences |> Enumerable.OfType |> Seq.map (fun ref -> ref.FilePath) |> wellFormedFilePathSetIgnoreCase - - for ref in updatedRefs do - if not(originalRefs.Contains(ref)) then - projectContext.AddMetadataReference(ref, MetadataReferenceProperties.Assembly) - updated <- true - - for ref in originalRefs do - if not(updatedRefs.Contains(ref)) then - projectContext.RemoveMetadataReference(ref) - updated <- true - - // Update the project options association - let ok,originalOptions = optionsAssociation.TryGetValue(projectContext) - let updatedOptions = site.CompilationOptions - if not ok || originalOptions <> updatedOptions then - - // OK, project options have changed, try to fake out Roslyn to convince it to reparse things. - // Calling SetOptions fails because the CPS project system being used by the F# project system - // imlpementation at the moment has no command line parser installed, so we remove/add all the files - // instead. A change of flags doesn't happen very often and the remove/add is fast in any case. - //projectContext.SetOptions(String.concat " " updatedOptions) - for file in updatedFiles do - projectContext.RemoveSourceFile(file) - projectContext.AddSourceFile(file) - - // Record the last seen options as an associated value - if ok then optionsAssociation.Remove(projectContext) |> ignore - optionsAssociation.Add(projectContext, updatedOptions) - - updated <- true - - // update the cached options - if updated then - projectInfoManager.UpdateProjectInfo(tryGetOrCreateProjectId workspace, project.Id, site, userOpName + ".SyncProject", invalidateConfig=true) - - member this.SetupProjectFile(siteProvider: IProvideProjectSite, workspace: VisualStudioWorkspaceImpl, userOpName) = - let userOpName = userOpName + ".SetupProjectFile" - let rec setup (site: IProjectSite) = - let projectGuid = Guid(site.ProjectGuid) - let projectFileName = site.ProjectFileName - let projectDisplayName = projectDisplayNameOf projectFileName - - // This projectId is not guaranteed to be the same ProjectId that will actually be created once we call CreateProjectContext - // in Roslyn versions once https://github.com/dotnet/roslyn/pull/26931 is merged. Roslyn will still guarantee that once - // there is a project in the workspace with the same path, it'll return the ID of that. So this is sufficient to use - // in that case as long as we only use it to call GetProject. - let fakeProjectId = workspace.ProjectTracker.GetOrCreateProjectIdForPath(projectFileName, projectDisplayName) - - if isNull (workspace.ProjectTracker.GetProject fakeProjectId) then - let projectContextFactory = package.ComponentModel.GetService(); - - let hierarchy = - site.ProjectProvider - |> Option.map (fun p -> p :?> IVsHierarchy) - |> Option.toObj - - // Roslyn is expecting site to be an IVsHierarchy. - // It just so happens that the object that implements IProvideProjectSite is also - // an IVsHierarchy. This assertion is to ensure that the assumption holds true. - Debug.Assert(not (isNull hierarchy), "About to CreateProjectContext with a non-hierarchy site") - - let projectContext = - projectContextFactory.CreateProjectContext( - FSharpConstants.FSharpLanguageName, - projectDisplayName, - projectFileName, - projectGuid, - hierarchy, - Option.toObj site.CompilationBinOutputPath) - - // The real project ID that was actually added. See comments for fakeProjectId why this one is actually good. - let realProjectId = workspace.ProjectTracker.GetOrCreateProjectIdForPath(projectFileName, projectDisplayName) - - // Sync IProjectSite --> projectContext, and IProjectSite --> ProjectInfoManage - this.SyncProject(projectContext, site, workspace, forceUpdate=true, userOpName=userOpName) - - site.BuildErrorReporter <- Some (projectContext :?> Microsoft.VisualStudio.Shell.Interop.IVsLanguageServiceBuildErrorReporter2) - - // TODO: consider forceUpdate = false here. forceUpdate=true may be causing repeated computation? - site.AdviseProjectSiteChanges(FSharpConstants.FSharpLanguageServiceCallbackName, - AdviseProjectSiteChanges(fun () -> this.SyncProject(projectContext, site, workspace, forceUpdate=true, userOpName="AdviseProjectSiteChanges."+userOpName))) - - site.AdviseProjectSiteClosed(FSharpConstants.FSharpLanguageServiceCallbackName, - AdviseProjectSiteChanges(fun () -> - projectInfoManager.ClearInfoForProject(realProjectId) - optionsAssociation.Remove(projectContext) |> ignore - projectContext.Dispose())) - - for referencedSite in ProjectSitesAndFiles.GetReferencedProjectSites(Some realProjectId, site, this.SystemServiceProvider, Some (this.Workspace :>obj), Some projectInfoManager.FSharpOptions ) do - setup referencedSite - - setup (siteProvider.GetProjectSite()) member this.SetupStandAloneFile(fileName: string, fileContents: string, workspace: VisualStudioWorkspaceImpl, hier: IVsHierarchy) = let loadTime = DateTime.Now @@ -683,11 +267,10 @@ type internal FSharpLanguageService(package : FSharpPackage) = // CPS Projects, out-of-project file and script files don't match hier with - | :? IProvideProjectSite as siteProvider when not (IsScript(filename)) -> + | :? IProvideProjectSite as _siteProvider when not (IsScript(filename)) -> // This is the path for .fs/.fsi files in legacy projects - - this.SetupProjectFile(siteProvider, this.Workspace, "SetupNewTextView") + () | h when not (isNull h) && not (IsScript(filename)) -> let docId = this.Workspace.CurrentSolution.GetDocumentIdsWithFilePath(filename).FirstOrDefault() match docId with @@ -707,4 +290,4 @@ type internal FSharpLanguageService(package : FSharpPackage) = this.SetupStandAloneFile(filename, fileContents, this.Workspace, hier) | _ -> () - | _ -> () \ No newline at end of file + | _ -> () diff --git a/vsintegration/src/FSharp.Editor/LanguageService/LegacyProjectWorkspaceMap.fs b/vsintegration/src/FSharp.Editor/LanguageService/LegacyProjectWorkspaceMap.fs new file mode 100644 index 00000000000..dfca72cba99 --- /dev/null +++ b/vsintegration/src/FSharp.Editor/LanguageService/LegacyProjectWorkspaceMap.fs @@ -0,0 +1,201 @@ +// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. + +namespace Microsoft.VisualStudio.FSharp.Editor + +#nowarn "40" + +open System +open System.Collections.Concurrent +open System.Collections.Generic +open System.Diagnostics +open System.IO +open System.Linq +open System.Runtime.CompilerServices +open Microsoft.CodeAnalysis +open Microsoft.VisualStudio +open Microsoft.VisualStudio.FSharp.Editor +open Microsoft.VisualStudio.FSharp.Editor.SiteProvider +open Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem +open Microsoft.VisualStudio.LanguageServices.ProjectSystem +open Microsoft.VisualStudio.Shell.Interop + +[] +type internal LegacyProjectWorkspaceMap(workspace: VisualStudioWorkspaceImpl, + solution: IVsSolution, + projectInfoManager: FSharpProjectOptionsManager, + projectContextFactory: IWorkspaceProjectContextFactory, + serviceProvider: IServiceProvider) as this = + + let invalidPathChars = set (Path.GetInvalidPathChars()) + let optionsAssociation = ConditionalWeakTable() + let isPathWellFormed (path: string) = not (String.IsNullOrWhiteSpace path) && path |> Seq.forall (fun c -> not (Set.contains c invalidPathChars)) + + let legacyProjectLookup = ConcurrentDictionary() + + let tryGetOrCreateProjectId (workspace: VisualStudioWorkspaceImpl) (projectFileName: string) = + let projectDisplayName = projectDisplayNameOf projectFileName + Some (workspace.ProjectTracker.GetOrCreateProjectIdForPath(projectFileName, projectDisplayName)) + + member this.Initialize() = + solution.AdviseSolutionEvents(this) |> ignore + + /// Sync the Roslyn information for the project held in 'projectContext' to match the information given by 'site'. + /// Also sync the info in ProjectInfoManager if necessary. + member this.SyncLegacyProject(projectId: ProjectId, projectContext: IWorkspaceProjectContext, site: IProjectSite, workspace: VisualStudioWorkspaceImpl, forceUpdate, userOpName) = + let wellFormedFilePathSetIgnoreCase (paths: seq) = + HashSet(paths |> Seq.filter isPathWellFormed |> Seq.map (fun s -> try Path.GetFullPath(s) with _ -> s), StringComparer.OrdinalIgnoreCase) + + let mutable updated = forceUpdate + + // Sync the source files in projectContext. Note that these source files are __not__ maintained in order in projectContext + // as edits are made. It seems this is ok because the source file list is only used to drive roslyn per-file checking. + let updatedFiles = site.CompilationSourceFiles |> wellFormedFilePathSetIgnoreCase + let originalFiles = + match legacyProjectLookup.TryGetValue(projectId) with + | true, (originalFiles, _) -> originalFiles + | _ -> HashSet() + + for file in updatedFiles do + if not(originalFiles.Contains(file)) then + projectContext.AddSourceFile(file) + updated <- true + + for file in originalFiles do + if not(updatedFiles.Contains(file)) then + projectContext.RemoveSourceFile(file) + updated <- true + + let updatedRefs = site.CompilationReferences |> wellFormedFilePathSetIgnoreCase + let originalRefs = + match legacyProjectLookup.TryGetValue(projectId) with + | true, (_, originalRefs) -> originalRefs + | _ -> HashSet() + + for ref in updatedRefs do + if not(originalRefs.Contains(ref)) then + projectContext.AddMetadataReference(ref, MetadataReferenceProperties.Assembly) + updated <- true + + for ref in originalRefs do + if not(updatedRefs.Contains(ref)) then + projectContext.RemoveMetadataReference(ref) + updated <- true + + // Update the project options association + let ok,originalOptions = optionsAssociation.TryGetValue(projectContext) + let updatedOptions = site.CompilationOptions + if not ok || originalOptions <> updatedOptions then + + // OK, project options have changed, try to fake out Roslyn to convince it to reparse things. + // Calling SetOptions fails because the CPS project system being used by the F# project system + // imlpementation at the moment has no command line parser installed, so we remove/add all the files + // instead. A change of flags doesn't happen very often and the remove/add is fast in any case. + //projectContext.SetOptions(String.concat " " updatedOptions) + for file in updatedFiles do + projectContext.RemoveSourceFile(file) + projectContext.AddSourceFile(file) + + // Record the last seen options as an associated value + if ok then optionsAssociation.Remove(projectContext) |> ignore + optionsAssociation.Add(projectContext, updatedOptions) + + updated <- true + + // update the cached options + if updated then + projectInfoManager.UpdateProjectInfo(tryGetOrCreateProjectId workspace, projectId, site, userOpName + ".SyncLegacyProject", invalidateConfig=true) + + let info = (updatedFiles, updatedRefs) + legacyProjectLookup.AddOrUpdate(projectId, info, fun _ _ -> info) |> ignore + + member this.SetupLegacyProjectFile(siteProvider: IProvideProjectSite, workspace: VisualStudioWorkspaceImpl, userOpName) = + let userOpName = userOpName + ".SetupProjectFile" + let rec setup (site: IProjectSite) = + let projectGuid = Guid(site.ProjectGuid) + let projectFileName = site.ProjectFileName + let projectDisplayName = projectDisplayNameOf projectFileName + + // This projectId is not guaranteed to be the same ProjectId that will actually be created once we call CreateProjectContext + // in Roslyn versions once https://github.com/dotnet/roslyn/pull/26931 is merged. Roslyn will still guarantee that once + // there is a project in the workspace with the same path, it'll return the ID of that. So this is sufficient to use + // in that case as long as we only use it to call GetProject. + let fakeProjectId = workspace.ProjectTracker.GetOrCreateProjectIdForPath(projectFileName, projectDisplayName) + + if isNull (workspace.ProjectTracker.GetProject fakeProjectId) then + let hierarchy = + site.ProjectProvider + |> Option.map (fun p -> p :?> IVsHierarchy) + |> Option.toObj + + // Roslyn is expecting site to be an IVsHierarchy. + // It just so happens that the object that implements IProvideProjectSite is also + // an IVsHierarchy. This assertion is to ensure that the assumption holds true. + Debug.Assert(not (isNull hierarchy), "About to CreateProjectContext with a non-hierarchy site") + + let projectContext = + projectContextFactory.CreateProjectContext( + FSharpConstants.FSharpLanguageName, + projectDisplayName, + projectFileName, + projectGuid, + hierarchy, + Option.toObj site.CompilationBinOutputPath) + + // The real project ID that was actually added. See comments for fakeProjectId why this one is actually good. + let realProjectId = workspace.ProjectTracker.GetOrCreateProjectIdForPath(projectFileName, projectDisplayName) + + // Sync IProjectSite --> projectContext, and IProjectSite --> ProjectInfoManage + this.SyncLegacyProject(realProjectId, projectContext, site, workspace, forceUpdate=true, userOpName=userOpName) + + site.BuildErrorReporter <- Some (projectContext :?> Microsoft.VisualStudio.Shell.Interop.IVsLanguageServiceBuildErrorReporter2) + + // TODO: consider forceUpdate = false here. forceUpdate=true may be causing repeated computation? + site.AdviseProjectSiteChanges(FSharpConstants.FSharpLanguageServiceCallbackName, + AdviseProjectSiteChanges(fun () -> this.SyncLegacyProject(realProjectId, projectContext, site, workspace, forceUpdate=true, userOpName="AdviseProjectSiteChanges."+userOpName))) + + site.AdviseProjectSiteClosed(FSharpConstants.FSharpLanguageServiceCallbackName, + AdviseProjectSiteChanges(fun () -> + projectInfoManager.ClearInfoForProject(realProjectId) + optionsAssociation.Remove(projectContext) |> ignore + projectContext.Dispose())) + + for referencedSite in ProjectSitesAndFiles.GetReferencedProjectSites(Some realProjectId, site, serviceProvider, Some (workspace :>obj), Some projectInfoManager.FSharpOptions ) do + setup referencedSite + + setup (siteProvider.GetProjectSite()) + + interface IVsSolutionEvents with + + member __.OnAfterCloseSolution(_) = VSConstants.S_OK + + member __.OnAfterLoadProject(_, _) = VSConstants.S_OK + + member __.OnAfterOpenProject(hier, _) = + match hier with + | :? IProvideProjectSite as siteProvider -> + this.SetupLegacyProjectFile(siteProvider, workspace, "LegacyProjectWorkspaceMap.Initialize") + | _ -> () + VSConstants.S_OK + + member __.OnAfterOpenSolution(_, _) = VSConstants.S_OK + + member __.OnBeforeCloseProject(hier, _) = + match hier with + | :? IProvideProjectSite as siteProvider -> + let site = siteProvider.GetProjectSite() + let projectFileName = site.ProjectFileName + let projectDisplayName = projectDisplayNameOf projectFileName + let projectId = workspace.ProjectTracker.GetOrCreateProjectIdForPath(projectFileName, projectDisplayName) + legacyProjectLookup.TryRemove(projectId) |> ignore + | _ -> () + VSConstants.S_OK + + member __.OnBeforeCloseSolution(_) = VSConstants.S_OK + + member __.OnBeforeUnloadProject(_, _) = VSConstants.S_OK + + member __.OnQueryCloseProject(_, _, _) = VSConstants.S_OK + + member __.OnQueryCloseSolution(_, _) = VSConstants.S_OK + + member __.OnQueryUnloadProject(_, _) = VSConstants.S_OK \ No newline at end of file diff --git a/vsintegration/src/FSharp.Editor/LanguageService/ProjectSitesAndFiles.fs b/vsintegration/src/FSharp.Editor/LanguageService/ProjectSitesAndFiles.fs index 1bea848dae2..e9ce1769584 100644 --- a/vsintegration/src/FSharp.Editor/LanguageService/ProjectSitesAndFiles.fs +++ b/vsintegration/src/FSharp.Editor/LanguageService/ProjectSitesAndFiles.fs @@ -241,13 +241,15 @@ type internal ProjectSitesAndFiles() = yield Some project.Id, project.FilePath, outputPath, siteProvider | _ -> () - | (Some references), _ -> + | (Some references), Some (:? VisualStudioWorkspaceImpl as workspace) -> for p in references do match solutionService.GetProjectOfUniqueName(p.UniqueName) with | VSConstants.S_OK, (:? IProvideProjectSite as ps) -> - yield None, p.FileName, (fullOutputAssemblyPath p) |> Option.defaultValue "", ps + let path = ps.GetProjectSite().ProjectFileName + let projectId = workspace.ProjectTracker.GetOrCreateProjectIdForPath(path, projectDisplayNameOf path) + yield Some projectId, p.FileName, (fullOutputAssemblyPath p) |> Option.defaultValue "", ps | _ -> () - | None, _ -> () + | _ -> () |] let solutionService = try Some (serviceProvider.GetService(typeof) :?> IVsSolution) with _ -> None seq { match solutionService with diff --git a/vsintegration/src/FSharp.Editor/LanguageService/Tokenizer.fs b/vsintegration/src/FSharp.Editor/LanguageService/Tokenizer.fs index 66bb9018f3c..c131374ece0 100644 --- a/vsintegration/src/FSharp.Editor/LanguageService/Tokenizer.fs +++ b/vsintegration/src/FSharp.Editor/LanguageService/Tokenizer.fs @@ -556,7 +556,7 @@ module internal Tokenizer = i // Rescan the lines if necessary and report the information let result = new List() - let mutable lexState = if scanStartLine = 0 then 0L else sourceTextData.[scanStartLine - 1].Value.LexStateAtEndOfLine + let mutable lexState = if scanStartLine = 0 then FSharpTokenizerLexState.Initial else sourceTextData.[scanStartLine - 1].Value.LexStateAtEndOfLine for i = scanStartLine to endLine do cancellationToken.ThrowIfCancellationRequested() @@ -569,7 +569,7 @@ module internal Tokenizer = // 2. the hash codes match // 3. the start-of-line lex states are the same match sourceTextData.[i] with - | Some data when data.IsValid(textLine) && data.LexStateAtStartOfLine = lexState -> + | Some data when data.IsValid(textLine) && data.LexStateAtStartOfLine.Equals(lexState) -> data | _ -> // Otherwise, we recompute @@ -589,7 +589,7 @@ module internal Tokenizer = if endLine < lines.Count - 1 then match sourceTextData.[endLine+1] with | Some data -> - if data.LexStateAtStartOfLine <> lexState then + if not (data.LexStateAtStartOfLine.Equals(lexState)) then sourceTextData.ClearFrom (endLine+1) | None -> () result @@ -729,7 +729,7 @@ module internal Tokenizer = ) do i <- i - 1 i - let lexState = if scanStartLine = 0 then 0L else sourceTextData.[scanStartLine - 1].Value.LexStateAtEndOfLine + let lexState = if scanStartLine = 0 then FSharpTokenizerLexState.Initial else sourceTextData.[scanStartLine - 1].Value.LexStateAtEndOfLine let lineContents = textLine.Text.ToString(textLine.Span) // We can reuse the old data when diff --git a/vsintegration/src/FSharp.Editor/Navigation/GoToDefinition.fs b/vsintegration/src/FSharp.Editor/Navigation/GoToDefinition.fs index daaa1e6fa57..7cd0152c3dc 100644 --- a/vsintegration/src/FSharp.Editor/Navigation/GoToDefinition.fs +++ b/vsintegration/src/FSharp.Editor/Navigation/GoToDefinition.fs @@ -242,8 +242,8 @@ type internal GoToDefinition(checker: FSharpChecker, projectInfoManager: FSharpP let! targetSymbolUse = checkFileResults.GetSymbolUseAtLocation (fcsTextLineNumber, idRange.EndColumn, lineText, lexerSymbol.FullIsland, userOpName=userOpName) match declarations with - | FSharpFindDeclResult.ExternalDecl (assy, targetExternalSym) -> - let! project = originDocument.Project.Solution.Projects |> Seq.tryFind (fun p -> p.AssemblyName.Equals(assy, StringComparison.OrdinalIgnoreCase)) + | FSharpFindDeclResult.ExternalDecl (assembly, targetExternalSym) -> + let! project = originDocument.Project.Solution.Projects |> Seq.tryFind (fun p -> p.AssemblyName.Equals(assembly, StringComparison.OrdinalIgnoreCase)) let! symbols = SymbolFinder.FindSourceDeclarationsAsync(project, fun _ -> true) let roslynSymbols = diff --git a/vsintegration/src/FSharp.Editor/Navigation/GoToDefinitionService.fs b/vsintegration/src/FSharp.Editor/Navigation/GoToDefinitionService.fs index dd201ab7750..d2bcd9dd4f5 100644 --- a/vsintegration/src/FSharp.Editor/Navigation/GoToDefinitionService.fs +++ b/vsintegration/src/FSharp.Editor/Navigation/GoToDefinitionService.fs @@ -39,20 +39,13 @@ type internal FSharpGoToDefinitionService let gtdTask = gtd.FindDefinitionTask(document, position, cancellationToken) - // Wrap this in a try/with as if the user clicks "Cancel" on the thread dialog, we'll be cancelled + // Wrap this in a try/with as if the user clicks "Cancel" on the thread dialog, we'll be cancelled. // Task.Wait throws an exception if the task is cancelled, so be sure to catch it. - let gtdCompletionOrError = - try - // This call to Wait() is fine because we want to be able to provide the error message in the status bar. - gtdTask.Wait() - Ok gtdTask - with exc -> - Error(Exception.flattenMessage exc) - - match gtdCompletionOrError with - | Ok task -> - if task.Status = TaskStatus.RanToCompletion && task.Result.IsSome then - let item, _ = task.Result.Value + try + // This call to Wait() is fine because we want to be able to provide the error message in the status bar. + gtdTask.Wait() + if gtdTask.Status = TaskStatus.RanToCompletion && gtdTask.Result.IsSome then + let item, _ = gtdTask.Result.Value gtd.NavigateToItem(item, statusBar) // 'true' means do it, like Sheev Palpatine would want us to. @@ -60,8 +53,8 @@ type internal FSharpGoToDefinitionService else statusBar.TempMessage (SR.CannotDetermineSymbol()) false - | Error message -> - statusBar.TempMessage(String.Format(SR.NavigateToFailed(), message)) + with exc -> + statusBar.TempMessage(String.Format(SR.NavigateToFailed(), Exception.flattenMessage exc)) // Don't show the dialog box as it's most likely that the user cancelled. // Don't make them click twice. diff --git a/vsintegration/src/FSharp.Editor/Navigation/NavigableSymbolsService.fs b/vsintegration/src/FSharp.Editor/Navigation/NavigableSymbolsService.fs index 4ec1ef238fb..bc6cf3e233e 100644 --- a/vsintegration/src/FSharp.Editor/Navigation/NavigableSymbolsService.fs +++ b/vsintegration/src/FSharp.Editor/Navigation/NavigableSymbolsService.fs @@ -42,27 +42,21 @@ type internal FSharpNavigableSymbolSource(checkerProvider: FSharpCheckerProvider let snapshot = triggerSpan.Snapshot let position = triggerSpan.Start.Position let document = snapshot.GetOpenDocumentInCurrentContextWithChanges() - let! sourceText = document.GetTextAsync () |> liftTaskAsync + let! sourceText = document.GetTextAsync() |> liftTaskAsync statusBar.Message(SR.LocatingSymbol()) use _ = statusBar.Animate() let gtdTask = gtd.FindDefinitionTask(document, position, cancellationToken) - // Wrap this in a try/with as if the user clicks "Cancel" on the thread dialog, we'll be cancelled + // Wrap this in a try/with as if the user clicks "Cancel" on the thread dialog, we'll be cancelled. // Task.Wait throws an exception if the task is cancelled, so be sure to catch it. - let gtdCompletedOrError = - try - // This call to Wait() is fine because we want to be able to provide the error message in the status bar. - gtdTask.Wait() - Ok gtdTask - with exc -> - Error(Exception.flattenMessage exc) - - match gtdCompletedOrError with - | Ok task -> - if task.Status = TaskStatus.RanToCompletion && task.Result.IsSome then - let (navigableItem, range) = task.Result.Value + try + // This call to Wait() is fine because we want to be able to provide the error message in the status bar. + gtdTask.Wait() + + if gtdTask.Status = TaskStatus.RanToCompletion && gtdTask.Result.IsSome then + let navigableItem, range = gtdTask.Result.Value let declarationTextSpan = RoslynHelpers.FSharpRangeToTextSpan(sourceText, range) let declarationSpan = Span(declarationTextSpan.Start, declarationTextSpan.Length) @@ -70,12 +64,12 @@ type internal FSharpNavigableSymbolSource(checkerProvider: FSharpCheckerProvider return FSharpNavigableSymbol(navigableItem, symbolSpan, gtd, statusBar) :> INavigableSymbol else - statusBar.TempMessage (SR.CannotDetermineSymbol()) + statusBar.TempMessage(SR.CannotDetermineSymbol()) // The NavigableSymbols API accepts 'null' when there's nothing to navigate to. return null - | Error message -> - statusBar.TempMessage (String.Format(SR.NavigateToFailed(), message)) + with exc -> + statusBar.TempMessage(String.Format(SR.NavigateToFailed(), Exception.flattenMessage exc)) // The NavigableSymbols API accepts 'null' when there's nothing to navigate to. return null diff --git a/vsintegration/src/FSharp.Editor/Options/EditorOptions.fs b/vsintegration/src/FSharp.Editor/Options/EditorOptions.fs index 2851acda15c..269ae085680 100644 --- a/vsintegration/src/FSharp.Editor/Options/EditorOptions.fs +++ b/vsintegration/src/FSharp.Editor/Options/EditorOptions.fs @@ -28,12 +28,12 @@ type EnterKeySetting = type IntelliSenseOptions = { ShowAfterCharIsTyped: bool ShowAfterCharIsDeleted: bool - ShowAllSymbols : bool + IncludeSymbolsFromUnopenedNamespacesOrModules : bool EnterKeySetting : EnterKeySetting } static member Default = { ShowAfterCharIsTyped = true ShowAfterCharIsDeleted = true - ShowAllSymbols = true + IncludeSymbolsFromUnopenedNamespacesOrModules = false EnterKeySetting = EnterKeySetting.NeverNewline} @@ -58,7 +58,7 @@ type CodeFixesOptions = { // We have this off by default, disable until we work out how to make this low priority // See https://github.com/Microsoft/visualfsharp/pull/3238#issue-237699595 SimplifyName = false - AlwaysPlaceOpensAtTopLevel = false + AlwaysPlaceOpensAtTopLevel = true UnusedOpens = true UnusedDeclarations = true } @@ -94,6 +94,12 @@ type AdvancedOptions = { IsBlockStructureEnabled = true IsOutliningEnabled = true } +[] +type FormattingOptions = + { FormatOnPaste: bool } + static member Default = + { FormatOnPaste = true } + [] [)>] type EditorOptions @@ -111,19 +117,21 @@ type EditorOptions store.Register AdvancedOptions.Default store.Register IntelliSenseOptions.Default store.Register CodeLensOptions.Default + store.Register FormattingOptions.Default - member __.IntelliSense : IntelliSenseOptions = store.Read() - member __.QuickInfo : QuickInfoOptions = store.Read() - member __.CodeFixes : CodeFixesOptions = store.Read() - member __.LanguageServicePerformance : LanguageServicePerformanceOptions = store.Read() - member __.Advanced: AdvancedOptions = store.Read() - member __.CodeLens: CodeLensOptions = store.Read() + member __.IntelliSense : IntelliSenseOptions = store.Get() + member __.QuickInfo : QuickInfoOptions = store.Get() + member __.CodeFixes : CodeFixesOptions = store.Get() + member __.LanguageServicePerformance : LanguageServicePerformanceOptions = store.Get() + member __.Advanced: AdvancedOptions = store.Get() + member __.CodeLens: CodeLensOptions = store.Get() + member __.Formatting : FormattingOptions = store.Get() interface Microsoft.CodeAnalysis.Host.IWorkspaceService interface IPersistSettings with - member __.Read() = store.Read() - member __.Write(settings) = store.Write(settings) + member __.LoadSettings() = store.LoadSettings() + member __.SaveSettings(settings) = store.SaveSettings(settings) [] @@ -183,3 +191,9 @@ module internal OptionsUI = inherit AbstractOptionPage() override __.CreateView() = upcast AdvancedOptionsControl() + + [] + type internal FormattingOptionPage() = + inherit AbstractOptionPage() + override __.CreateView() = + upcast FormattingOptionsControl() diff --git a/vsintegration/src/FSharp.Editor/Options/SettingsPersistence.fs b/vsintegration/src/FSharp.Editor/Options/SettingsPersistence.fs index cec979e1656..d4e2c84dce6 100644 --- a/vsintegration/src/FSharp.Editor/Options/SettingsPersistence.fs +++ b/vsintegration/src/FSharp.Editor/Options/SettingsPersistence.fs @@ -9,8 +9,8 @@ open Microsoft.VisualStudio.Settings open Newtonsoft.Json type IPersistSettings = - abstract member Read : unit -> 't - abstract member Write : 't -> unit + abstract member LoadSettings : unit -> 't + abstract member SaveSettings : 't -> unit [] type SVsSettingsPersistenceManager = class end @@ -18,42 +18,69 @@ type SVsSettingsPersistenceManager = class end type SettingsStore(serviceProvider: IServiceProvider) = let settingsManager = serviceProvider.GetService(typeof) :?> ISettingsManager - // settings quallified type names are used as keys, this should be enough to avoid collisions - let storageKey (typ: Type) = typ.Namespace + "." + typ.Name + + let storageKeyVersions (typ: Type) = + // "TextEditor" prefix seems to be required for settings changes to be synced between IDE instances + [ "TextEditor.FSharp." + typ.Namespace + "." + typ.Name + // we keep this old storage key to upgrade without reverting user changes + typ.Namespace + "." + typ.Name ] + + let storageKey (typ: Type) = storageKeyVersions typ |> List.head // Each group of settings is a value of some named type, for example 'IntelliSenseOptions', 'QuickInfoOptions' - // We cache exactly one instance of each, treating them as immutable. - // This cache is updated by the SettingsStore when the user changes an option. - let cache = System.Collections.Concurrent.ConcurrentDictionary() + // and it is usually representing one separate option page in the UI. + // We cache exactly one immutable value of each type. + // This cache is updated by the SettingsStore when the user makes changes in the Options dialog + // or when a change is propagated from another VS IDE instance by SVsSettingsPersistenceManager. + let cache = ConcurrentDictionary() - let read() = + let getCached() = match cache.TryGetValue(typeof<'t>) with - | true, value -> value :?> 't - | _ -> failwithf "Settings %s are not registered." typeof<'t>.Name + | true, (:? 't as value) -> value + | _ -> failwithf "Settings %s are not registered." typeof<'t>.Name - let write settings = cache.[settings.GetType()] <- settings + let keepInCache settings = cache.[settings.GetType()] <- settings + + // The settings record, even though immutable, is being effectively mutated in two instances: + // when it is passed to the UI (provided it is marked with CLIMutable attribute); + // when it is being populated from JSON using JsonConvert.PopulateObject; + // We make a deep copy in these instances to isolate and contain the mutation + let clone (v: 't) = JsonConvert.SerializeObject v |> JsonConvert.DeserializeObject<'t> let updateFromStore settings = - let result, json = settings.GetType() |> storageKey |> settingsManager.TryGetValue - if result = GetValueResult.Success then - // if it fails we just return what we got - try JsonConvert.PopulateObject(json, settings) with _ -> () - settings - - member __.Read() = read() + // make a deep copy so that PopulateObject does not alter the original + let copy = clone settings + // if the new key is not found by ISettingsManager, we try the old keys + // so that user settings are not lost + settings.GetType() |> storageKeyVersions + |> Seq.map (settingsManager.TryGetValue) + |> Seq.tryPick ( function GetValueResult.Success, json -> Some json | _ -> None ) + |> Option.iter (fun json -> try JsonConvert.PopulateObject(json, copy) with _ -> ()) + copy - member __.Write settings = - write settings - // we replace default serialization with Newtonsoft.Json for easy schema evolution + member __.Get() = getCached() + + // Used by the AbstractOptionPage to populate dialog controls. + // We always have the latest value in the cache so we just return + // cloned value here because it may be altered by the UI if declared with [] + member __.LoadSettings() = getCached() |> clone + + member __.SaveSettings settings = + // We replace default serialization with Newtonsoft.Json for easy schema evolution. + // For example, if we add a new bool field to the record, representing another checkbox in Options dialog + // deserialization will still work fine. When we pass default value to JsonConvert.PopulateObject it will + // fill just the known fields. settingsManager.SetValueAsync(settings.GetType() |> storageKey, JsonConvert.SerializeObject settings, false) - |> Async.AwaitTask |> Async.StartImmediate + |> Async.AwaitTask |> Async.Start - member __.Register defaultSettings = - defaultSettings |> updateFromStore |> write + // This is the point we retrieve the initial value and subscribe to watch for changes + member __.Register (defaultSettings : 'options) = + defaultSettings |> updateFromStore |> keepInCache let subset = defaultSettings.GetType() |> storageKey |> settingsManager.GetSubset - + // this event is also raised when a setting change occurs in another VS instance, so we can keep everything in sync PropertyChangedAsyncEventHandler ( fun _ _ -> - read() |> updateFromStore |> write + (getCached(): 'options) |> updateFromStore |> keepInCache System.Threading.Tasks.Task.CompletedTask ) |> subset.add_SettingChangedAsync + \ No newline at end of file diff --git a/vsintegration/src/FSharp.Editor/Options/UIHelpers.fs b/vsintegration/src/FSharp.Editor/Options/UIHelpers.fs index 8ed209c80e1..2adae7a7a46 100644 --- a/vsintegration/src/FSharp.Editor/Options/UIHelpers.fs +++ b/vsintegration/src/FSharp.Editor/Options/UIHelpers.fs @@ -10,11 +10,15 @@ open Microsoft.VisualStudio.ComponentModelHost module internal OptionsUIHelpers = [] - type AbstractOptionPage<'t>() as this = + type AbstractOptionPage<'options>() as this = inherit UIElementDialogPage() + // this replicates the logic used by Roslyn option pages. Some following comments have been copied from + // https://github.com/dotnet/roslyn/blob/5b125935f891b3c20405459f8f7e1cdfdc2cfa3d/src/VisualStudio/Core/Impl/Options/AbstractOptionPage.cs + let mutable needsLoadOnNextActivate = true + let view = lazy this.CreateView() - + let optionService = // lazy, so GetService is called from UI thread lazy @@ -25,21 +29,33 @@ module internal OptionsUIHelpers = override this.Child = upcast view.Value - override this.SaveSettingsToStorage() = - this.GetResult() |> optionService.Value.Write + override this.OnActivate _ = + if needsLoadOnNextActivate then + // It looks like the bindings do not always pick up new source, unless we cycle the DataContext like this + view.Value.DataContext <- DependencyProperty.UnsetValue + view.Value.DataContext <- optionService.Value.LoadSettings<'options>() + needsLoadOnNextActivate <- false - override this.LoadSettingsFromStorage() = - optionService.Value.Read() |> this.SetViewModel - - //Override this method when using immutable settings type - member __.SetViewModel(settings: 't) = - // in case settings are a CLIMutable record - view.Value.DataContext <- null - view.Value.DataContext <- settings + override this.SaveSettingsToStorage() = + downcast view.Value.DataContext |> optionService.Value.SaveSettings<'options> + // Make sure we load the next time the page is activated, in case if options changed + // programmatically between now and the next time the page is activated + needsLoadOnNextActivate <- true - //Override this method when using immutable settings type - member __.GetResult() : 't = - downcast view.Value.DataContext + override this.LoadSettingsFromStorage() = + // This gets called in two situations: + // + // 1) during the initial page load when you first activate the page, before OnActivate + // is called. + // 2) during the closing of the dialog via Cancel/close when options don't need to be + // saved. The intent here is the settings get reloaded so the next time you open the + // page they are properly populated. + // + // This second one is tricky, because we don't actually want to update our controls + // right then, because they'd be wrong the next time the page opens -- it's possible + // they may have been changed programmatically. Therefore, we'll set a flag so we load + // next time + needsLoadOnNextActivate <- true //data binding helpers let radioButtonCoverter = diff --git a/vsintegration/src/FSharp.Editor/Structure/BlockStructureService.fs b/vsintegration/src/FSharp.Editor/Structure/BlockStructureService.fs index 5c219e16aef..af3341351a6 100644 --- a/vsintegration/src/FSharp.Editor/Structure/BlockStructureService.fs +++ b/vsintegration/src/FSharp.Editor/Structure/BlockStructureService.fs @@ -34,6 +34,7 @@ module internal BlockStructure = | Scope.Member -> BlockTypes.Member | Scope.LetOrUse | Scope.Match + | Scope.MatchBang | Scope.MatchClause | Scope.EnumCase | Scope.UnionCase @@ -92,6 +93,7 @@ module internal BlockStructure = | Scope.Match | Scope.MatchClause | Scope.MatchLambda + | Scope.MatchBang | Scope.ThenInIfThenElse | Scope.ElseInIfThenElse | Scope.TryWith diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.cs.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.cs.xlf index 73d205eca82..057ec914894 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.cs.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.cs.xlf @@ -1,4 +1,4 @@ - + @@ -34,7 +34,7 @@ Name can be simplified. - Název nelze zjednodušit. + Název se dá zjednodušit. @@ -157,6 +157,11 @@ CodeLens + + Formatting + Formatting + + \ No newline at end of file diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.de.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.de.xlf index b728e57410b..61cdd0a5d3f 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.de.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.de.xlf @@ -1,4 +1,4 @@ - + @@ -157,6 +157,11 @@ CodeLens + + Formatting + Formatting + + \ No newline at end of file diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.en.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.en.xlf index 666f3a369b5..ce6a404fc97 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.en.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.en.xlf @@ -157,6 +157,11 @@ CodeLens + + Formatting + Formatting + + \ No newline at end of file diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.es.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.es.xlf index 26758d30cf8..7b850fe196c 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.es.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.es.xlf @@ -1,4 +1,4 @@ - + @@ -149,7 +149,7 @@ Advanced - Avanzadas + Opciones avanzadas @@ -157,6 +157,11 @@ CodeLens + + Formatting + Formatting + + \ No newline at end of file diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.fr.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.fr.xlf index eadd06f5dbd..c41b9a5cd9d 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.fr.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.fr.xlf @@ -1,4 +1,4 @@ - + @@ -157,6 +157,11 @@ CodeLens + + Formatting + Formatting + + \ No newline at end of file diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.it.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.it.xlf index d288d6839fc..33454d45ff3 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.it.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.it.xlf @@ -1,4 +1,4 @@ - + @@ -157,6 +157,11 @@ CodeLens + + Formatting + Formatting + + \ No newline at end of file diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ja.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ja.xlf index 8b05b335d8f..6197ad8e8e1 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ja.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ja.xlf @@ -9,7 +9,7 @@ Implement interface - インターフェイスを実装する + インターフェイスを実装します。 @@ -34,7 +34,7 @@ Name can be simplified. - 名前を単純化できます。 + 名前を簡略化できます。 @@ -157,6 +157,11 @@ CodeLens + + Formatting + Formatting + + \ No newline at end of file diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ko.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ko.xlf index b017a3562e1..2be01c20ba2 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ko.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ko.xlf @@ -1,4 +1,4 @@ - + @@ -157,6 +157,11 @@ CodeLens + + Formatting + Formatting + + \ No newline at end of file diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pl.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pl.xlf index e0898181ecb..69ec9bc0c32 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pl.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pl.xlf @@ -1,4 +1,4 @@ - + @@ -34,7 +34,7 @@ Name can be simplified. - Nazwę można uprościć. + Nazwa może zostać uproszczona. @@ -157,6 +157,11 @@ CodeLens + + Formatting + Formatting + + \ No newline at end of file diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pt-BR.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pt-BR.xlf index 03c3c7bf667..ecf0c609517 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pt-BR.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pt-BR.xlf @@ -1,4 +1,4 @@ - + @@ -34,7 +34,7 @@ Name can be simplified. - O nome pode ser simplificado. + Nome pode ser simplificado. @@ -157,6 +157,11 @@ CodeLens + + Formatting + Formatting + + \ No newline at end of file diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ru.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ru.xlf index 16a1bba37ae..19409cbe5f3 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ru.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ru.xlf @@ -34,7 +34,7 @@ Name can be simplified. - Имя можно упростить. + Имя может быть упрощено. @@ -149,7 +149,7 @@ Advanced - Дополнительно + Дополнительный @@ -157,6 +157,11 @@ CodeLens + + Formatting + Formatting + + \ No newline at end of file diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.tr.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.tr.xlf index dd4dd7d6c03..7951d72959f 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.tr.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.tr.xlf @@ -1,4 +1,4 @@ - + @@ -9,7 +9,7 @@ Implement interface - Arabirim uygulama + Arabirimi uygula @@ -157,6 +157,11 @@ CodeLens + + Formatting + Formatting + + \ No newline at end of file diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hans.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hans.xlf index 1c301f002c1..9def8ae9629 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hans.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hans.xlf @@ -34,7 +34,7 @@ Name can be simplified. - 可简化名称。 + 可以简化名称。 @@ -74,7 +74,7 @@ IntelliSense - Intellisense + IntelliSense @@ -134,7 +134,7 @@ Exceptions: - 异常: + 异常: @@ -157,6 +157,11 @@ CodeLens + + Formatting + Formatting + + \ No newline at end of file diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hant.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hant.xlf index bcbd222af0d..48e46393abf 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hant.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hant.xlf @@ -1,4 +1,4 @@ - + @@ -134,7 +134,7 @@ Exceptions: - 例外狀況: + 例外狀況: @@ -157,6 +157,11 @@ CodeLens + + Formatting + Formatting + + \ No newline at end of file diff --git a/vsintegration/src/FSharp.LanguageService.Base/FSharp.LanguageService.Base.csproj b/vsintegration/src/FSharp.LanguageService.Base/FSharp.LanguageService.Base.csproj index 4cdef16b685..ce5cfed08aa 100644 --- a/vsintegration/src/FSharp.LanguageService.Base/FSharp.LanguageService.Base.csproj +++ b/vsintegration/src/FSharp.LanguageService.Base/FSharp.LanguageService.Base.csproj @@ -4,12 +4,11 @@ Library - false true false $(NoWarn);1570;1574;1587;1591;3001,3002,3003 true - true + true false @@ -60,6 +59,7 @@ + diff --git a/vsintegration/src/FSharp.LanguageService.Base/xlf/Microsoft.VisualStudio.Package.LanguageService.cs.xlf b/vsintegration/src/FSharp.LanguageService.Base/xlf/Microsoft.VisualStudio.Package.LanguageService.cs.xlf index 5fa17a956f2..01935ee0ac0 100644 --- a/vsintegration/src/FSharp.LanguageService.Base/xlf/Microsoft.VisualStudio.Package.LanguageService.cs.xlf +++ b/vsintegration/src/FSharp.LanguageService.Base/xlf/Microsoft.VisualStudio.Package.LanguageService.cs.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.LanguageService.Base/xlf/Microsoft.VisualStudio.Package.LanguageService.de.xlf b/vsintegration/src/FSharp.LanguageService.Base/xlf/Microsoft.VisualStudio.Package.LanguageService.de.xlf index 6c5d961e316..f14709b11e9 100644 --- a/vsintegration/src/FSharp.LanguageService.Base/xlf/Microsoft.VisualStudio.Package.LanguageService.de.xlf +++ b/vsintegration/src/FSharp.LanguageService.Base/xlf/Microsoft.VisualStudio.Package.LanguageService.de.xlf @@ -1,4 +1,4 @@ - + @@ -14,7 +14,7 @@ Members - Member + Mitglieder Tooltip for the drop down combo at top of document window showing list of known members. diff --git a/vsintegration/src/FSharp.LanguageService.Base/xlf/Microsoft.VisualStudio.Package.LanguageService.es.xlf b/vsintegration/src/FSharp.LanguageService.Base/xlf/Microsoft.VisualStudio.Package.LanguageService.es.xlf index 4f51649f109..9c41be20344 100644 --- a/vsintegration/src/FSharp.LanguageService.Base/xlf/Microsoft.VisualStudio.Package.LanguageService.es.xlf +++ b/vsintegration/src/FSharp.LanguageService.Base/xlf/Microsoft.VisualStudio.Package.LanguageService.es.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.LanguageService.Base/xlf/Microsoft.VisualStudio.Package.LanguageService.fr.xlf b/vsintegration/src/FSharp.LanguageService.Base/xlf/Microsoft.VisualStudio.Package.LanguageService.fr.xlf index 542a43a5b08..87150eb42ea 100644 --- a/vsintegration/src/FSharp.LanguageService.Base/xlf/Microsoft.VisualStudio.Package.LanguageService.fr.xlf +++ b/vsintegration/src/FSharp.LanguageService.Base/xlf/Microsoft.VisualStudio.Package.LanguageService.fr.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.LanguageService.Base/xlf/Microsoft.VisualStudio.Package.LanguageService.it.xlf b/vsintegration/src/FSharp.LanguageService.Base/xlf/Microsoft.VisualStudio.Package.LanguageService.it.xlf index 832c7cbb24d..1827234227d 100644 --- a/vsintegration/src/FSharp.LanguageService.Base/xlf/Microsoft.VisualStudio.Package.LanguageService.it.xlf +++ b/vsintegration/src/FSharp.LanguageService.Base/xlf/Microsoft.VisualStudio.Package.LanguageService.it.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.LanguageService.Base/xlf/Microsoft.VisualStudio.Package.LanguageService.ja.xlf b/vsintegration/src/FSharp.LanguageService.Base/xlf/Microsoft.VisualStudio.Package.LanguageService.ja.xlf index c2165bf9f9d..680fb1b9941 100644 --- a/vsintegration/src/FSharp.LanguageService.Base/xlf/Microsoft.VisualStudio.Package.LanguageService.ja.xlf +++ b/vsintegration/src/FSharp.LanguageService.Base/xlf/Microsoft.VisualStudio.Package.LanguageService.ja.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.LanguageService.Base/xlf/Microsoft.VisualStudio.Package.LanguageService.ko.xlf b/vsintegration/src/FSharp.LanguageService.Base/xlf/Microsoft.VisualStudio.Package.LanguageService.ko.xlf index 31b6b01633e..2b10d5448fa 100644 --- a/vsintegration/src/FSharp.LanguageService.Base/xlf/Microsoft.VisualStudio.Package.LanguageService.ko.xlf +++ b/vsintegration/src/FSharp.LanguageService.Base/xlf/Microsoft.VisualStudio.Package.LanguageService.ko.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.LanguageService.Base/xlf/Microsoft.VisualStudio.Package.LanguageService.pl.xlf b/vsintegration/src/FSharp.LanguageService.Base/xlf/Microsoft.VisualStudio.Package.LanguageService.pl.xlf index 53bfacf4caf..0f8ca025c20 100644 --- a/vsintegration/src/FSharp.LanguageService.Base/xlf/Microsoft.VisualStudio.Package.LanguageService.pl.xlf +++ b/vsintegration/src/FSharp.LanguageService.Base/xlf/Microsoft.VisualStudio.Package.LanguageService.pl.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.LanguageService.Base/xlf/Microsoft.VisualStudio.Package.LanguageService.pt-BR.xlf b/vsintegration/src/FSharp.LanguageService.Base/xlf/Microsoft.VisualStudio.Package.LanguageService.pt-BR.xlf index 8916fcb57e1..c341f4d3bf7 100644 --- a/vsintegration/src/FSharp.LanguageService.Base/xlf/Microsoft.VisualStudio.Package.LanguageService.pt-BR.xlf +++ b/vsintegration/src/FSharp.LanguageService.Base/xlf/Microsoft.VisualStudio.Package.LanguageService.pt-BR.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.LanguageService.Base/xlf/Microsoft.VisualStudio.Package.LanguageService.ru.xlf b/vsintegration/src/FSharp.LanguageService.Base/xlf/Microsoft.VisualStudio.Package.LanguageService.ru.xlf index 235eaa60242..b08e84f46b8 100644 --- a/vsintegration/src/FSharp.LanguageService.Base/xlf/Microsoft.VisualStudio.Package.LanguageService.ru.xlf +++ b/vsintegration/src/FSharp.LanguageService.Base/xlf/Microsoft.VisualStudio.Package.LanguageService.ru.xlf @@ -1,4 +1,4 @@ - + @@ -14,7 +14,7 @@ Members - Члены + Элементы Tooltip for the drop down combo at top of document window showing list of known members. diff --git a/vsintegration/src/FSharp.LanguageService.Base/xlf/Microsoft.VisualStudio.Package.LanguageService.tr.xlf b/vsintegration/src/FSharp.LanguageService.Base/xlf/Microsoft.VisualStudio.Package.LanguageService.tr.xlf index 4b600678ae4..78658d3f00c 100644 --- a/vsintegration/src/FSharp.LanguageService.Base/xlf/Microsoft.VisualStudio.Package.LanguageService.tr.xlf +++ b/vsintegration/src/FSharp.LanguageService.Base/xlf/Microsoft.VisualStudio.Package.LanguageService.tr.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.LanguageService.Base/xlf/Microsoft.VisualStudio.Package.LanguageService.zh-Hans.xlf b/vsintegration/src/FSharp.LanguageService.Base/xlf/Microsoft.VisualStudio.Package.LanguageService.zh-Hans.xlf index c3422f9abf8..a78d09aee63 100644 --- a/vsintegration/src/FSharp.LanguageService.Base/xlf/Microsoft.VisualStudio.Package.LanguageService.zh-Hans.xlf +++ b/vsintegration/src/FSharp.LanguageService.Base/xlf/Microsoft.VisualStudio.Package.LanguageService.zh-Hans.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.LanguageService.Base/xlf/Microsoft.VisualStudio.Package.LanguageService.zh-Hant.xlf b/vsintegration/src/FSharp.LanguageService.Base/xlf/Microsoft.VisualStudio.Package.LanguageService.zh-Hant.xlf index ac809d8d5fd..3fa4e9f803a 100644 --- a/vsintegration/src/FSharp.LanguageService.Base/xlf/Microsoft.VisualStudio.Package.LanguageService.zh-Hant.xlf +++ b/vsintegration/src/FSharp.LanguageService.Base/xlf/Microsoft.VisualStudio.Package.LanguageService.zh-Hant.xlf @@ -1,4 +1,4 @@ - + @@ -19,7 +19,7 @@ Types - 類型 + 型別 Tooltip for the drop down combo at top of document window showing list of known types. diff --git a/vsintegration/src/FSharp.LanguageService/Colorize.fs b/vsintegration/src/FSharp.LanguageService/Colorize.fs index 3a52e74397b..1f292c7c92a 100644 --- a/vsintegration/src/FSharp.LanguageService/Colorize.fs +++ b/vsintegration/src/FSharp.LanguageService/Colorize.fs @@ -44,7 +44,7 @@ module internal ColorStateLookup_DEPRECATED = toLexState.Add(result,lexState) result - do Add(0L)|>ignore // Add the 'unknown' state. + do Add(FSharpTokenizerLexState.Initial)|>ignore // Add the 'unknown' state. static member private TryGet<'tKey,'tVal>(dict:Dictionary<'tKey,'tVal>,key:'tKey) : 'tVal option = let mutable result = Unchecked.defaultof<'tVal> @@ -198,7 +198,7 @@ type internal FSharpColorizer_DEPRECATED /// Start state at the beginning of parsing a file. override c.GetStartState(state) = - state <- ColorStateLookup_DEPRECATED.ColorStateOfLexState(0L) + state <- ColorStateLookup_DEPRECATED.ColorStateOfLexState(FSharpTokenizerLexState.Initial) VSConstants.S_OK /// Colorize a line of text. Resulting per-character attributes are stored into attrs diff --git a/vsintegration/src/FSharp.LanguageService/FSharp.LanguageService.fsproj b/vsintegration/src/FSharp.LanguageService/FSharp.LanguageService.fsproj index a93173f1693..ccd97fff422 100644 --- a/vsintegration/src/FSharp.LanguageService/FSharp.LanguageService.fsproj +++ b/vsintegration/src/FSharp.LanguageService/FSharp.LanguageService.fsproj @@ -12,7 +12,7 @@ true $(SystemValueTuplePackageVersion) $(OtherFlags) --warnon:1182 --subsystemversion:6.00 - true + true false diff --git a/vsintegration/src/FSharp.LanguageService/xlf/FSLangSvcStrings.cs.xlf b/vsintegration/src/FSharp.LanguageService/xlf/FSLangSvcStrings.cs.xlf index c1fcfdca7b1..1b98c0b95c1 100644 --- a/vsintegration/src/FSharp.LanguageService/xlf/FSLangSvcStrings.cs.xlf +++ b/vsintegration/src/FSharp.LanguageService/xlf/FSLangSvcStrings.cs.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.LanguageService/xlf/FSLangSvcStrings.de.xlf b/vsintegration/src/FSharp.LanguageService/xlf/FSLangSvcStrings.de.xlf index c97b2e2cab0..8c2cdb0e764 100644 --- a/vsintegration/src/FSharp.LanguageService/xlf/FSLangSvcStrings.de.xlf +++ b/vsintegration/src/FSharp.LanguageService/xlf/FSLangSvcStrings.de.xlf @@ -1,4 +1,4 @@ - + @@ -19,7 +19,7 @@ Cannot navigate to definition. - Wechseln zur Definition ist nicht möglich. + Das Wechseln zur Definition ist nicht möglich. diff --git a/vsintegration/src/FSharp.LanguageService/xlf/FSLangSvcStrings.es.xlf b/vsintegration/src/FSharp.LanguageService/xlf/FSLangSvcStrings.es.xlf index d3d7a07a053..093e6c85782 100644 --- a/vsintegration/src/FSharp.LanguageService/xlf/FSLangSvcStrings.es.xlf +++ b/vsintegration/src/FSharp.LanguageService/xlf/FSLangSvcStrings.es.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.LanguageService/xlf/FSLangSvcStrings.fr.xlf b/vsintegration/src/FSharp.LanguageService/xlf/FSLangSvcStrings.fr.xlf index e3a42fd1d9b..c771efc2acc 100644 --- a/vsintegration/src/FSharp.LanguageService/xlf/FSLangSvcStrings.fr.xlf +++ b/vsintegration/src/FSharp.LanguageService/xlf/FSLangSvcStrings.fr.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.LanguageService/xlf/FSLangSvcStrings.it.xlf b/vsintegration/src/FSharp.LanguageService/xlf/FSLangSvcStrings.it.xlf index abb983ddd86..119ff1788de 100644 --- a/vsintegration/src/FSharp.LanguageService/xlf/FSLangSvcStrings.it.xlf +++ b/vsintegration/src/FSharp.LanguageService/xlf/FSLangSvcStrings.it.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.LanguageService/xlf/FSLangSvcStrings.ko.xlf b/vsintegration/src/FSharp.LanguageService/xlf/FSLangSvcStrings.ko.xlf index d9ebb322541..0727b9aa5e0 100644 --- a/vsintegration/src/FSharp.LanguageService/xlf/FSLangSvcStrings.ko.xlf +++ b/vsintegration/src/FSharp.LanguageService/xlf/FSLangSvcStrings.ko.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.LanguageService/xlf/FSLangSvcStrings.pl.xlf b/vsintegration/src/FSharp.LanguageService/xlf/FSLangSvcStrings.pl.xlf index 9f9ef85b76c..54d0db78033 100644 --- a/vsintegration/src/FSharp.LanguageService/xlf/FSLangSvcStrings.pl.xlf +++ b/vsintegration/src/FSharp.LanguageService/xlf/FSLangSvcStrings.pl.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.LanguageService/xlf/FSLangSvcStrings.pt-BR.xlf b/vsintegration/src/FSharp.LanguageService/xlf/FSLangSvcStrings.pt-BR.xlf index 7fb96cdc6a1..fec1904bb9b 100644 --- a/vsintegration/src/FSharp.LanguageService/xlf/FSLangSvcStrings.pt-BR.xlf +++ b/vsintegration/src/FSharp.LanguageService/xlf/FSLangSvcStrings.pt-BR.xlf @@ -1,4 +1,4 @@ - + @@ -19,7 +19,7 @@ Cannot navigate to definition. - Não é possível navegar para definição. + Não é possível navegar até a definição. diff --git a/vsintegration/src/FSharp.LanguageService/xlf/FSLangSvcStrings.ru.xlf b/vsintegration/src/FSharp.LanguageService/xlf/FSLangSvcStrings.ru.xlf index 5d09ca8300f..7f2313345a8 100644 --- a/vsintegration/src/FSharp.LanguageService/xlf/FSLangSvcStrings.ru.xlf +++ b/vsintegration/src/FSharp.LanguageService/xlf/FSLangSvcStrings.ru.xlf @@ -1,4 +1,4 @@ - + @@ -14,7 +14,7 @@ Loading... - Идет загрузка... + Загрузка... displayed when waiting for IntelliSense to load diff --git a/vsintegration/src/FSharp.LanguageService/xlf/FSLangSvcStrings.tr.xlf b/vsintegration/src/FSharp.LanguageService/xlf/FSLangSvcStrings.tr.xlf index 73ab05a5533..fafc7d644ff 100644 --- a/vsintegration/src/FSharp.LanguageService/xlf/FSLangSvcStrings.tr.xlf +++ b/vsintegration/src/FSharp.LanguageService/xlf/FSLangSvcStrings.tr.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.LanguageService/xlf/FSLangSvcStrings.zh-Hans.xlf b/vsintegration/src/FSharp.LanguageService/xlf/FSLangSvcStrings.zh-Hans.xlf index e33ea35ca76..115c4f86972 100644 --- a/vsintegration/src/FSharp.LanguageService/xlf/FSLangSvcStrings.zh-Hans.xlf +++ b/vsintegration/src/FSharp.LanguageService/xlf/FSLangSvcStrings.zh-Hans.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.LanguageService/xlf/FSLangSvcStrings.zh-Hant.xlf b/vsintegration/src/FSharp.LanguageService/xlf/FSLangSvcStrings.zh-Hant.xlf index 534256ae15c..b11b0ab3d74 100644 --- a/vsintegration/src/FSharp.LanguageService/xlf/FSLangSvcStrings.zh-Hant.xlf +++ b/vsintegration/src/FSharp.LanguageService/xlf/FSLangSvcStrings.zh-Hant.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.LanguageService/xlf/VSPackage.cs.xlf b/vsintegration/src/FSharp.LanguageService/xlf/VSPackage.cs.xlf index acacfc13502..558cc1afec2 100644 --- a/vsintegration/src/FSharp.LanguageService/xlf/VSPackage.cs.xlf +++ b/vsintegration/src/FSharp.LanguageService/xlf/VSPackage.cs.xlf @@ -1,4 +1,4 @@ - + @@ -19,7 +19,7 @@ Operator - Operátor + operátor @@ -49,7 +49,7 @@ Identifier - Identifikátor + identifikátor diff --git a/vsintegration/src/FSharp.LanguageService/xlf/VSPackage.de.xlf b/vsintegration/src/FSharp.LanguageService/xlf/VSPackage.de.xlf index ffc095348b1..7ffbbe10328 100644 --- a/vsintegration/src/FSharp.LanguageService/xlf/VSPackage.de.xlf +++ b/vsintegration/src/FSharp.LanguageService/xlf/VSPackage.de.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.LanguageService/xlf/VSPackage.es.xlf b/vsintegration/src/FSharp.LanguageService/xlf/VSPackage.es.xlf index 76cd632ccd8..bbc6b2006b9 100644 --- a/vsintegration/src/FSharp.LanguageService/xlf/VSPackage.es.xlf +++ b/vsintegration/src/FSharp.LanguageService/xlf/VSPackage.es.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.LanguageService/xlf/VSPackage.fr.xlf b/vsintegration/src/FSharp.LanguageService/xlf/VSPackage.fr.xlf index f27ce75afcc..8eef0e1148c 100644 --- a/vsintegration/src/FSharp.LanguageService/xlf/VSPackage.fr.xlf +++ b/vsintegration/src/FSharp.LanguageService/xlf/VSPackage.fr.xlf @@ -1,4 +1,4 @@ - + @@ -49,7 +49,7 @@ Identifier - Identificateur + identificateur diff --git a/vsintegration/src/FSharp.LanguageService/xlf/VSPackage.it.xlf b/vsintegration/src/FSharp.LanguageService/xlf/VSPackage.it.xlf index a79fee23068..f095cc4c4f4 100644 --- a/vsintegration/src/FSharp.LanguageService/xlf/VSPackage.it.xlf +++ b/vsintegration/src/FSharp.LanguageService/xlf/VSPackage.it.xlf @@ -1,4 +1,4 @@ - + @@ -19,7 +19,7 @@ Operator - Operatore + operatore @@ -49,7 +49,7 @@ Identifier - Identificatore + identificatore diff --git a/vsintegration/src/FSharp.LanguageService/xlf/VSPackage.ko.xlf b/vsintegration/src/FSharp.LanguageService/xlf/VSPackage.ko.xlf index df123fca81b..19ef2f72867 100644 --- a/vsintegration/src/FSharp.LanguageService/xlf/VSPackage.ko.xlf +++ b/vsintegration/src/FSharp.LanguageService/xlf/VSPackage.ko.xlf @@ -1,4 +1,4 @@ - + @@ -19,7 +19,7 @@ Operator - 연산자 + 운영자 @@ -44,7 +44,7 @@ Comment - 설명 + 주석 @@ -59,7 +59,7 @@ Number - 숫자 + 번호 diff --git a/vsintegration/src/FSharp.LanguageService/xlf/VSPackage.pl.xlf b/vsintegration/src/FSharp.LanguageService/xlf/VSPackage.pl.xlf index bfc6fb43a8e..e37a4cd55c0 100644 --- a/vsintegration/src/FSharp.LanguageService/xlf/VSPackage.pl.xlf +++ b/vsintegration/src/FSharp.LanguageService/xlf/VSPackage.pl.xlf @@ -1,4 +1,4 @@ - + @@ -19,7 +19,7 @@ Operator - Operator + operator @@ -49,7 +49,7 @@ Identifier - Identyfikator + identyfikator diff --git a/vsintegration/src/FSharp.LanguageService/xlf/VSPackage.pt-BR.xlf b/vsintegration/src/FSharp.LanguageService/xlf/VSPackage.pt-BR.xlf index 502d5956dac..13092af472b 100644 --- a/vsintegration/src/FSharp.LanguageService/xlf/VSPackage.pt-BR.xlf +++ b/vsintegration/src/FSharp.LanguageService/xlf/VSPackage.pt-BR.xlf @@ -1,4 +1,4 @@ - + @@ -49,7 +49,7 @@ Identifier - Identificador + identificador diff --git a/vsintegration/src/FSharp.LanguageService/xlf/VSPackage.ru.xlf b/vsintegration/src/FSharp.LanguageService/xlf/VSPackage.ru.xlf index 9078f979baa..63b801d5bf9 100644 --- a/vsintegration/src/FSharp.LanguageService/xlf/VSPackage.ru.xlf +++ b/vsintegration/src/FSharp.LanguageService/xlf/VSPackage.ru.xlf @@ -1,4 +1,4 @@ - + @@ -49,7 +49,7 @@ Identifier - Идентификатор + идентификатор @@ -64,7 +64,7 @@ String - Строка + String diff --git a/vsintegration/src/FSharp.LanguageService/xlf/VSPackage.tr.xlf b/vsintegration/src/FSharp.LanguageService/xlf/VSPackage.tr.xlf index f5f7b1334b4..2a16efa550b 100644 --- a/vsintegration/src/FSharp.LanguageService/xlf/VSPackage.tr.xlf +++ b/vsintegration/src/FSharp.LanguageService/xlf/VSPackage.tr.xlf @@ -1,4 +1,4 @@ - + @@ -19,7 +19,7 @@ Operator - İşleç + işleç @@ -49,7 +49,7 @@ Identifier - Tanımlayıcı + tanımlayıcı diff --git a/vsintegration/src/FSharp.LanguageService/xlf/VSPackage.zh-Hans.xlf b/vsintegration/src/FSharp.LanguageService/xlf/VSPackage.zh-Hans.xlf index ffccb77de00..885f5df2fac 100644 --- a/vsintegration/src/FSharp.LanguageService/xlf/VSPackage.zh-Hans.xlf +++ b/vsintegration/src/FSharp.LanguageService/xlf/VSPackage.zh-Hans.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.LanguageService/xlf/VSPackage.zh-Hant.xlf b/vsintegration/src/FSharp.LanguageService/xlf/VSPackage.zh-Hant.xlf index 99888a55edb..434c6f8ea37 100644 --- a/vsintegration/src/FSharp.LanguageService/xlf/VSPackage.zh-Hant.xlf +++ b/vsintegration/src/FSharp.LanguageService/xlf/VSPackage.zh-Hant.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.PatternMatcher/FSharp.PatternMatcher.csproj b/vsintegration/src/FSharp.PatternMatcher/FSharp.PatternMatcher.csproj index da6305fb62c..0ae980c7049 100644 --- a/vsintegration/src/FSharp.PatternMatcher/FSharp.PatternMatcher.csproj +++ b/vsintegration/src/FSharp.PatternMatcher/FSharp.PatternMatcher.csproj @@ -4,7 +4,6 @@ Library - false true diff --git a/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectSystem.Base.csproj b/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectSystem.Base.csproj index 5698b15ab62..462541e5dde 100644 --- a/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectSystem.Base.csproj +++ b/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectSystem.Base.csproj @@ -5,14 +5,13 @@ Library FSharp.ProjectSystem.Base - false true false $(NoWarn),1570,1572,1573,1574,1591,3001,3002,3003,3005,3008,3009,3021,3024 $(DefineConstants);CODE_ANALYSIS Microsoft.VisualStudio.FSharp.ProjectSystem true - true + true false @@ -69,7 +68,7 @@ We require a reference to Microsoft.VisualStudio.Shell.14.0.dll, but that causes some issues with duplicate type names. The ~hack~ fix is to include the package reference and ensure the Aliases metadata gets set afterwards. --> - + diff --git a/vsintegration/src/FSharp.ProjectSystem.Base/Project/xlf/Microsoft.VisualStudio.Package.Project.cs.xlf b/vsintegration/src/FSharp.ProjectSystem.Base/Project/xlf/Microsoft.VisualStudio.Package.Project.cs.xlf index 8fb69a16f23..ffeed383fc7 100644 --- a/vsintegration/src/FSharp.ProjectSystem.Base/Project/xlf/Microsoft.VisualStudio.Package.Project.cs.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.Base/Project/xlf/Microsoft.VisualStudio.Package.Project.cs.xlf @@ -1,4 +1,4 @@ - + @@ -119,7 +119,7 @@ error - chyba + Chyba @@ -252,7 +252,7 @@ Minimal - Minimální + minimální @@ -262,7 +262,7 @@ None - Žádné + žádné @@ -387,7 +387,7 @@ warning - upozornění + Upozornění @@ -792,7 +792,7 @@ Path - Cesta + PATH @@ -802,7 +802,7 @@ Version - Verze + VERSION diff --git a/vsintegration/src/FSharp.ProjectSystem.Base/Project/xlf/Microsoft.VisualStudio.Package.Project.de.xlf b/vsintegration/src/FSharp.ProjectSystem.Base/Project/xlf/Microsoft.VisualStudio.Package.Project.de.xlf index 2f107ee3f27..10949f3119e 100644 --- a/vsintegration/src/FSharp.ProjectSystem.Base/Project/xlf/Microsoft.VisualStudio.Package.Project.de.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.Base/Project/xlf/Microsoft.VisualStudio.Package.Project.de.xlf @@ -1,4 +1,4 @@ - + @@ -39,7 +39,7 @@ How the file relates to the build and deployment process - Gibt an, inwiefern sich die Datei auf den Build- und Bereitstellungsprozess bezieht. + Wie sich die Datei auf den Build- und Bereitstellungsprozess bezieht Project Build Property Description @@ -54,7 +54,7 @@ ECMA-335 CLI compatible framework (location must be provided) - ECMA-335 CLI-kompatibles Framework (Speicherort muss angegeben werden) + ECMA-335 CLI-kompatibles Framework (Ort muss angegeben werden) Target platform drop down option @@ -147,7 +147,7 @@ Error Saving File - Fehler beim Speichern der Datei. + Fehler beim Speichern der Datei @@ -212,7 +212,7 @@ The name of the file or folder - Der Name der Datei oder des Ordners + Der Name der Datei oder des Ordners. @@ -232,7 +232,7 @@ Location of the file - Speicherort der Datei + Dateiort @@ -242,7 +242,7 @@ Cannot save '{0}' outside the project directory. Linked items are not supported. - {0} kann nicht außerhalb des Projektverzeichnisses gespeichert werden. Verknüpfte Elemente werden nicht unterstützt. + {0}" kann nicht außerhalb des Projektverzeichnisses gespeichert werden. Verknüpfte Elemente werden nicht unterstützt. @@ -252,22 +252,22 @@ Minimal - Minimal + minimal Misc - Sonstiges + Verschiedenes None - Keine + NONE Normal - Normal + NORMAL @@ -282,7 +282,7 @@ Project - Projekt + Projekt @@ -487,7 +487,7 @@ Specifies the tool that transforms a file at design time and places the output of that transformation into another file. For example, a dataset (.xsd) file comes with a default custom tool. - Gibt das Tool an, das eine Datei zur Entwurfszeit transformiert und die Ausgabe in einer anderen Datei speichert. Datasetdateien (".xsd") verfügen beispielsweise über ein benutzerdefiniertes Standardtool. + Gibt das Tool an, das eine Datei zur Entwurfszeit transformiert und die Ausgabe in einer anderen Datei speichert. Datasetdateien (.xsd) enthalten z.B. ein benutzerdefiniertes Standardtool. @@ -587,7 +587,7 @@ A reference to {0} could not be added. Please make sure that the file is accessible, and that it is a valid assembly or COM component. - Ein Verweis auf "{0}" konnte nicht hinzugefügt werden. Stellen Sie sicher, dass auf die Datei zugegriffen werden kann und dass sie eine gültige Assembly oder COM-Komponente ist. + Es konnte kein Verweis auf "{0}" hinzugefügt werden. Achten Sie darauf, dass die Datei zugänglich ist und dass es sich um eine gültige Assembly- oder COM-Komponente handelt. @@ -662,12 +662,12 @@ Specific Version - Spezifische Version + Bestimmte Version Indicates whether this reference is to a specific version of an assembly. - Gibt an, ob sich dieser Verweis auf eine spezifische Version einer Assembly bezieht. + Gibt an, ob dieser Verweis auf eine bestimmte Version einer Assembly verweist. @@ -802,7 +802,7 @@ Version - Version + VERSION diff --git a/vsintegration/src/FSharp.ProjectSystem.Base/Project/xlf/Microsoft.VisualStudio.Package.Project.es.xlf b/vsintegration/src/FSharp.ProjectSystem.Base/Project/xlf/Microsoft.VisualStudio.Package.Project.es.xlf index a1b9309cd08..6677d941045 100644 --- a/vsintegration/src/FSharp.ProjectSystem.Base/Project/xlf/Microsoft.VisualStudio.Package.Project.es.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.Base/Project/xlf/Microsoft.VisualStudio.Package.Project.es.xlf @@ -1,4 +1,4 @@ - + @@ -9,7 +9,7 @@ Advanced - Avanzadas + Opciones avanzadas Project Property Page Caption @@ -24,7 +24,7 @@ A reference to '{0}' (with assembly name '{1}') could not be added. A reference to the component '{2}' with the same assembly name already exists in the project. - No se pudo agregar una referencia a '{0}' (con el nombre de ensamblado '{1}'). Ya existe una referencia al componente '{2}' con el mismo nombre de ensamblado en el proyecto. + No se puede agregar una referencia a '{0}' (con el nombre de ensamblado '{1}'). Ya existe en el proyecto una referencia al componente '{2}' con el mismo nombre del ensamblado. ReferenceAlreadyExists error message @@ -39,7 +39,7 @@ How the file relates to the build and deployment process - Relación del archivo con el proceso de compilación e implementación. + Relación del archivo con el proceso de compilación e implementación Project Build Property Description @@ -54,7 +54,7 @@ ECMA-335 CLI compatible framework (location must be provided) - Marco de trabajo compatible con ECMA-335 CLI (se debe proporcionar la ubicación) + Versión de .NET Framework compatible con ECMA-335 CLI (se debe proporcionar la ubicación) Target platform drop down option @@ -119,7 +119,7 @@ error - error + Fehler @@ -147,7 +147,7 @@ Error Saving File - Error al guardar el archivo. + Error al guardar el archivo @@ -197,7 +197,7 @@ Error Copying File - Error al copiar el archivo. + Error al copiar el archivo @@ -217,7 +217,7 @@ Folder Name - Nombre de la carpeta + Nombre de carpeta @@ -252,7 +252,7 @@ Minimal - Mínimo + mínimo @@ -262,12 +262,12 @@ None - Ninguno + NONE Normal - Normal + NORMAL @@ -302,7 +302,7 @@ Project Folder - Carpeta de proyecto + Carpeta del proyecto @@ -342,7 +342,7 @@ Save? - ¿Guardar? + ¿Desea guardar? @@ -387,7 +387,7 @@ warning - advertencia + Advertencia @@ -472,7 +472,7 @@ The path to the primary output - Ruta de acceso al resultado principal + Ruta de acceso de la salida principal @@ -487,7 +487,7 @@ Specifies the tool that transforms a file at design time and places the output of that transformation into another file. For example, a dataset (.xsd) file comes with a default custom tool. - Especifica la herramienta que transforma un archivo en tiempo de diseño y pone la salida de esa transformación en otro archivo. Por ejemplo, un archivo de conjunto de datos (.xsd) viene con una herramienta personalizada predeterminada. + Especifica la herramienta que transforma el archivo en tiempo de diseño y coloca la salida de la transformación en otro archivo. Por ejemplo, un archivo de conjunto de datos (.xsd) viene con una herramienta personalizada predeterminada. @@ -587,7 +587,7 @@ A reference to {0} could not be added. Please make sure that the file is accessible, and that it is a valid assembly or COM component. - No se pudo agregar una referencia a {0}. Asegúrese de que el archivo está accesible y de que es un ensamblado o un componente COM válido. + No se pudo agregar una referencia a {0}. Asegúrese de que el archivo es accesible y de que se trata de un ensamblado o componente COM válido. @@ -792,7 +792,7 @@ Path - Ruta de acceso + PATH diff --git a/vsintegration/src/FSharp.ProjectSystem.Base/Project/xlf/Microsoft.VisualStudio.Package.Project.fr.xlf b/vsintegration/src/FSharp.ProjectSystem.Base/Project/xlf/Microsoft.VisualStudio.Package.Project.fr.xlf index 3377431434e..7c9efded080 100644 --- a/vsintegration/src/FSharp.ProjectSystem.Base/Project/xlf/Microsoft.VisualStudio.Package.Project.fr.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.Base/Project/xlf/Microsoft.VisualStudio.Package.Project.fr.xlf @@ -1,4 +1,4 @@ - + @@ -119,7 +119,7 @@ error - erreur + Erreur @@ -252,7 +252,7 @@ Minimal - Minimal + minimal @@ -262,12 +262,12 @@ None - Aucun + Aucun(e) Normal - Normal + NORMAL @@ -387,7 +387,7 @@ warning - avertissement + Avertissement @@ -472,7 +472,7 @@ The path to the primary output - Chemin de la sortie principale + Le chemin de la sortie principale @@ -792,7 +792,7 @@ Path - Chemin + PATH diff --git a/vsintegration/src/FSharp.ProjectSystem.Base/Project/xlf/Microsoft.VisualStudio.Package.Project.it.xlf b/vsintegration/src/FSharp.ProjectSystem.Base/Project/xlf/Microsoft.VisualStudio.Package.Project.it.xlf index 7bcff058d42..78c38a31de4 100644 --- a/vsintegration/src/FSharp.ProjectSystem.Base/Project/xlf/Microsoft.VisualStudio.Package.Project.it.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.Base/Project/xlf/Microsoft.VisualStudio.Package.Project.it.xlf @@ -1,4 +1,4 @@ - + @@ -119,7 +119,7 @@ error - errore + Errore @@ -207,7 +207,7 @@ File and folder names cannot contain a leading period. - I nomi di file e di cartella non possono iniziare con un punto. + I nomi di file e di cartelle non possono iniziare con un punto. @@ -222,7 +222,7 @@ Name of this folder - Nome di questa cartella + Nome della cartella corrente @@ -242,7 +242,7 @@ Cannot save '{0}' outside the project directory. Linked items are not supported. - Non è possibile salvare '{0}' all'esterno della directory del progetto. Gli elementi collegati non sono supportati. + Impossibile salvare '{0}' all'esterno della directory del progetto. Gli elementi collegati non sono supportati. @@ -252,7 +252,7 @@ Minimal - Minimo + minimal @@ -267,7 +267,7 @@ Normal - Normale + NORMAL @@ -282,7 +282,7 @@ Project - Progetto + PROGETTO @@ -387,7 +387,7 @@ warning - avviso + Avviso @@ -442,7 +442,7 @@ Project Properties - Proprietà del progetto + Proprietà progetto @@ -792,7 +792,7 @@ Path - Percorso + PERCORSO diff --git a/vsintegration/src/FSharp.ProjectSystem.Base/Project/xlf/Microsoft.VisualStudio.Package.Project.ja.xlf b/vsintegration/src/FSharp.ProjectSystem.Base/Project/xlf/Microsoft.VisualStudio.Package.Project.ja.xlf index e1bd019f916..9fca5b1025a 100644 --- a/vsintegration/src/FSharp.ProjectSystem.Base/Project/xlf/Microsoft.VisualStudio.Package.Project.ja.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.Base/Project/xlf/Microsoft.VisualStudio.Package.Project.ja.xlf @@ -212,7 +212,7 @@ The name of the file or folder - ファイルまたはフォルダーの名前 + ファイルまたはフォルダーの名前です @@ -267,7 +267,7 @@ Normal - 標準 + NORMAL @@ -792,7 +792,7 @@ Path - パス + PATH diff --git a/vsintegration/src/FSharp.ProjectSystem.Base/Project/xlf/Microsoft.VisualStudio.Package.Project.ko.xlf b/vsintegration/src/FSharp.ProjectSystem.Base/Project/xlf/Microsoft.VisualStudio.Package.Project.ko.xlf index e276c7856ce..178ec108738 100644 --- a/vsintegration/src/FSharp.ProjectSystem.Base/Project/xlf/Microsoft.VisualStudio.Package.Project.ko.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.Base/Project/xlf/Microsoft.VisualStudio.Package.Project.ko.xlf @@ -1,4 +1,4 @@ - + @@ -64,7 +64,7 @@ If you change a file name extension, the file may become unusable. Are you sure you want to change it? - 파일 확장명을 바꾸면 파일을 사용할 수 없게 될 수도 있습니다. 확장명을 바꾸시겠습니까? + 확장명을 바꾸면 파일을 사용할 수 없게 될 수도 있습니다. 확장명을 바꾸시겠습니까? @@ -89,7 +89,7 @@ Indicates whether the reference will be copied to the output directory. - 참조를 출력 디렉터리로 복사할지 여부를 나타냅니다. + 참조를 출력 디렉터리에 복사할지 여부를 나타냅니다. @@ -252,22 +252,22 @@ Minimal - 최소 + minimal Misc - 기타 + Misc None - 없음 + None Normal - 보통 + NORMAL @@ -532,7 +532,7 @@ XML Serialization Assemblies - XML Serialization 어셈블리 + XML 직렬화 어셈블리 @@ -587,7 +587,7 @@ A reference to {0} could not be added. Please make sure that the file is accessible, and that it is a valid assembly or COM component. - {0}에 대한 참조를 추가할 수 없습니다. 파일에 액세스할 수 있는지, 올바른 어셈블리 또는 COM 구성 요소인지 확인하세요. + {0}에 대한 참조를 추가할 수 없습니다. 파일이 액세스 가능한지, 올바른 어셈블리 또는 COM 구성 요소인지 확인하십시오. @@ -642,7 +642,7 @@ Copy to Output Directory - 출력 디렉터리에 복사 + 출력 디렉터리로 복사 @@ -792,7 +792,7 @@ Path - 경로 + PATH diff --git a/vsintegration/src/FSharp.ProjectSystem.Base/Project/xlf/Microsoft.VisualStudio.Package.Project.pl.xlf b/vsintegration/src/FSharp.ProjectSystem.Base/Project/xlf/Microsoft.VisualStudio.Package.Project.pl.xlf index 334907964f5..5bea4d9201f 100644 --- a/vsintegration/src/FSharp.ProjectSystem.Base/Project/xlf/Microsoft.VisualStudio.Package.Project.pl.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.Base/Project/xlf/Microsoft.VisualStudio.Package.Project.pl.xlf @@ -1,4 +1,4 @@ - + @@ -119,7 +119,7 @@ error - błąd + Błąd @@ -252,17 +252,17 @@ Minimal - Minimalny + minimalne Misc - Różne + Misc None - Brak + brak @@ -387,7 +387,7 @@ warning - ostrzeżenie + Ostrzeżenie @@ -637,7 +637,7 @@ Copy always - Zawsze kopiuj + Zawsze Kopiuj CopyToOutputDirectory - drop down option @@ -792,7 +792,7 @@ Path - Ścieżka + ŚCIEŻKA diff --git a/vsintegration/src/FSharp.ProjectSystem.Base/Project/xlf/Microsoft.VisualStudio.Package.Project.pt-BR.xlf b/vsintegration/src/FSharp.ProjectSystem.Base/Project/xlf/Microsoft.VisualStudio.Package.Project.pt-BR.xlf index d0e04d11879..782ef79d2dc 100644 --- a/vsintegration/src/FSharp.ProjectSystem.Base/Project/xlf/Microsoft.VisualStudio.Package.Project.pt-BR.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.Base/Project/xlf/Microsoft.VisualStudio.Package.Project.pt-BR.xlf @@ -1,4 +1,4 @@ - + @@ -34,7 +34,7 @@ Build Action - Ação de Compilação + Ação de compilação Project Build Property Name @@ -89,7 +89,7 @@ Indicates whether the reference will be copied to the output directory. - Indica se a referência será copiada no diretório de saída. + Indica se a referência será copiada para o diretório de saída. @@ -119,7 +119,7 @@ error - erro + Erro @@ -222,7 +222,7 @@ Name of this folder - Nome desta pasta + O nome desta pasta @@ -252,7 +252,7 @@ Minimal - Mínimo + mínimo @@ -262,12 +262,12 @@ None - Nenhum + NENHUM Normal - Normal + NORMAL @@ -287,7 +287,7 @@ A reference to library '{0}' cannot be added. Adding this project as a reference would cause a circular dependency. - Não é possível adicionar uma referência à biblioteca '{0}'. A adição deste projeto como uma referência causaria uma dependência circular. + Uma referência à biblioteca '{0}' não pode ser adicionada. A inserção deste projeto como uma referência pode causar uma dependência circular. @@ -387,7 +387,7 @@ warning - aviso + Aviso @@ -482,7 +482,7 @@ Custom Tool - Ferramenta Personalizada + Ferramenta personalizada @@ -587,7 +587,7 @@ A reference to {0} could not be added. Please make sure that the file is accessible, and that it is a valid assembly or COM component. - Não foi possível adicionar uma referência ao {0}. Certifique-se de que o arquivo está acessível e se ele é um assembly ou um componente COM válido. + Não foi possível adicionar uma referência a {0}. Verifique se esse arquivo está acessível e se é um assembly ou componente COM válido. @@ -792,7 +792,7 @@ Path - Caminho + PATH diff --git a/vsintegration/src/FSharp.ProjectSystem.Base/Project/xlf/Microsoft.VisualStudio.Package.Project.ru.xlf b/vsintegration/src/FSharp.ProjectSystem.Base/Project/xlf/Microsoft.VisualStudio.Package.Project.ru.xlf index 00f7ac219dc..71484ba3f3d 100644 --- a/vsintegration/src/FSharp.ProjectSystem.Base/Project/xlf/Microsoft.VisualStudio.Package.Project.ru.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.Base/Project/xlf/Microsoft.VisualStudio.Package.Project.ru.xlf @@ -39,7 +39,7 @@ How the file relates to the build and deployment process - Роль этого файла в процессе сборки и развертывания + Роль этого файла в процессе построения и развертывания Project Build Property Description @@ -59,7 +59,7 @@ Compile - Компилировать + Компиляция Build Action - drop down option @@ -79,7 +79,7 @@ Content - Объект + Содержимое Build Action - drop down option @@ -99,7 +99,7 @@ Diagnostic - Диагностический + Диагностика @@ -119,7 +119,7 @@ error - ошибка + Ошибка @@ -252,7 +252,7 @@ Minimal - Минимальные + minimal @@ -262,12 +262,12 @@ None - Отсутствует + NONE Normal - Средний + NORMAL @@ -312,7 +312,7 @@ Quiet - Тихий режим + Тихий @@ -362,7 +362,7 @@ URL - URL + URL-адрес @@ -387,7 +387,7 @@ warning - предупреждение + Предупреждение @@ -507,7 +507,7 @@ Content Files - Файлы с содержимым + Файлы содержимого @@ -587,7 +587,7 @@ A reference to {0} could not be added. Please make sure that the file is accessible, and that it is a valid assembly or COM component. - Не удается добавить ссылку на "{0}". Убедитесь, что файл доступен и действительно представляет собой сборку или компонент COM. + Не удалось добавить ссылку на {0}. Убедитесь в том, что файл доступен и является допустимой сборкой или COM-компонентом. @@ -782,7 +782,7 @@ Identity - Удостоверение + Идентификатор diff --git a/vsintegration/src/FSharp.ProjectSystem.Base/Project/xlf/Microsoft.VisualStudio.Package.Project.tr.xlf b/vsintegration/src/FSharp.ProjectSystem.Base/Project/xlf/Microsoft.VisualStudio.Package.Project.tr.xlf index be3616f9b35..c382dc83183 100644 --- a/vsintegration/src/FSharp.ProjectSystem.Base/Project/xlf/Microsoft.VisualStudio.Package.Project.tr.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.Base/Project/xlf/Microsoft.VisualStudio.Package.Project.tr.xlf @@ -1,4 +1,4 @@ - + @@ -119,7 +119,7 @@ error - hata + Hata @@ -227,7 +227,7 @@ Full Path - Tam Yol + Tam yol @@ -252,17 +252,17 @@ Minimal - En az + minimal Misc - Çeşitli + Misc None - Yok + yok @@ -282,7 +282,7 @@ Project - Proje + PROJE @@ -292,7 +292,7 @@ Project File - Proje Dosyası + Proje dosyası @@ -387,7 +387,7 @@ warning - uyarı + Uyarı @@ -432,7 +432,7 @@ File Properties - Dosya Özellikleri + Dosya özellikleri @@ -792,7 +792,7 @@ Path - Yol + PATH @@ -802,7 +802,7 @@ Version - Sürüm + SÜRÜM diff --git a/vsintegration/src/FSharp.ProjectSystem.Base/Project/xlf/Microsoft.VisualStudio.Package.Project.zh-Hans.xlf b/vsintegration/src/FSharp.ProjectSystem.Base/Project/xlf/Microsoft.VisualStudio.Package.Project.zh-Hans.xlf index c10c54a12dc..d9537fb1e18 100644 --- a/vsintegration/src/FSharp.ProjectSystem.Base/Project/xlf/Microsoft.VisualStudio.Package.Project.zh-Hans.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.Base/Project/xlf/Microsoft.VisualStudio.Package.Project.zh-Hans.xlf @@ -1,4 +1,4 @@ - + @@ -24,12 +24,12 @@ A reference to '{0}' (with assembly name '{1}') could not be added. A reference to the component '{2}' with the same assembly name already exists in the project. - 未能添加对“{0}”的引用(使用程序集名称“{1}”)。该项目中已存在一个对具有相同程序集名称的组件“{2}”的引用。 + 无法添加对“{0}”(程序集名称为“{1}”)的引用。项目中已存在对具有相同程序集名称的组件“{2}”的引用。 ReferenceAlreadyExists error message Could not load attribute '{0}' from project file '{1}'. - 无法从项目文件“{1}”中加载属性“{0}”。 + 无法从项目文件“{1}”加载属性“{0}”。 @@ -242,7 +242,7 @@ Cannot save '{0}' outside the project directory. Linked items are not supported. - 无法在项目目录外保存“{0}”。不支持链接的项。 + 不能在项目目录外保存“{0}”。不支持链接的项。 @@ -252,7 +252,7 @@ Minimal - 最小 + 最少 @@ -262,12 +262,12 @@ None - + 没有 Normal - 常规 + 一般 @@ -282,12 +282,12 @@ Project - 项目 + PROJECT A reference to library '{0}' cannot be added. Adding this project as a reference would cause a circular dependency. - 无法添加对库“{0}”的引用。将此项目添加为引用将导致循环依赖。 + 无法添加对库“{0}”的引用。将此项目添加为引用将导致循环依赖关系。 @@ -352,7 +352,7 @@ The project file can only be saved into the project location '{0}'. - 此项目文件只能保存在项目位置“{0}”。 + 项目文件只能保存到项目位置“{0}”。 @@ -577,7 +577,7 @@ The nested project has failed to reload. - 未能重新加载此嵌套项目。 + 嵌套的项目重新加载失败。 @@ -792,7 +792,7 @@ Path - 路径 + PATH diff --git a/vsintegration/src/FSharp.ProjectSystem.Base/Project/xlf/Microsoft.VisualStudio.Package.Project.zh-Hant.xlf b/vsintegration/src/FSharp.ProjectSystem.Base/Project/xlf/Microsoft.VisualStudio.Package.Project.zh-Hant.xlf index fe5edae2aba..d1da28cf131 100644 --- a/vsintegration/src/FSharp.ProjectSystem.Base/Project/xlf/Microsoft.VisualStudio.Package.Project.zh-Hant.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.Base/Project/xlf/Microsoft.VisualStudio.Package.Project.zh-Hant.xlf @@ -1,4 +1,4 @@ - + @@ -267,7 +267,7 @@ Normal - 標準 + NORMAL @@ -667,7 +667,7 @@ Indicates whether this reference is to a specific version of an assembly. - 指出這個參考是否為某一組件的特定版本。 + 指出這個參考是否指向某一組件的特定版本。 @@ -792,7 +792,7 @@ Path - 路徑 + PATH diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/ProjectSystem.fsproj b/vsintegration/src/FSharp.ProjectSystem.FSharp/ProjectSystem.fsproj index 44cc567704d..264584077ef 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/ProjectSystem.fsproj +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/ProjectSystem.fsproj @@ -12,7 +12,7 @@ true $(SystemValueTuplePackageVersion) $(OtherFlags) --warnon:1182 --subsystemversion:6.00 - true + true false @@ -91,6 +91,7 @@ + diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/MenusAndCommands.vsct.cs.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/MenusAndCommands.vsct.cs.xlf index 02128b8f00d..a4f0096f3ab 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/MenusAndCommands.vsct.cs.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/MenusAndCommands.vsct.cs.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/MenusAndCommands.vsct.de.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/MenusAndCommands.vsct.de.xlf index 74b69acd487..81a9dcce028 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/MenusAndCommands.vsct.de.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/MenusAndCommands.vsct.de.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/MenusAndCommands.vsct.es.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/MenusAndCommands.vsct.es.xlf index 8f421623fdc..e97a202b506 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/MenusAndCommands.vsct.es.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/MenusAndCommands.vsct.es.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/MenusAndCommands.vsct.fr.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/MenusAndCommands.vsct.fr.xlf index 2e8a0c00453..c26cf5e9363 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/MenusAndCommands.vsct.fr.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/MenusAndCommands.vsct.fr.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/MenusAndCommands.vsct.it.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/MenusAndCommands.vsct.it.xlf index 5b59a67af85..7efc02f0660 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/MenusAndCommands.vsct.it.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/MenusAndCommands.vsct.it.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/MenusAndCommands.vsct.ja.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/MenusAndCommands.vsct.ja.xlf index 4266774b23c..aabe84846be 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/MenusAndCommands.vsct.ja.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/MenusAndCommands.vsct.ja.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/MenusAndCommands.vsct.ko.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/MenusAndCommands.vsct.ko.xlf index 626dd1404f5..38d31e07859 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/MenusAndCommands.vsct.ko.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/MenusAndCommands.vsct.ko.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/MenusAndCommands.vsct.pl.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/MenusAndCommands.vsct.pl.xlf index 0b59a2dd7d2..b1254473b28 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/MenusAndCommands.vsct.pl.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/MenusAndCommands.vsct.pl.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/MenusAndCommands.vsct.pt-BR.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/MenusAndCommands.vsct.pt-BR.xlf index e2a2158cf9e..88e975c7f34 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/MenusAndCommands.vsct.pt-BR.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/MenusAndCommands.vsct.pt-BR.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/MenusAndCommands.vsct.ru.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/MenusAndCommands.vsct.ru.xlf index 0af53178de6..b89ef29cb2a 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/MenusAndCommands.vsct.ru.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/MenusAndCommands.vsct.ru.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/MenusAndCommands.vsct.tr.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/MenusAndCommands.vsct.tr.xlf index 4ac66f5451d..15cdfec5b7a 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/MenusAndCommands.vsct.tr.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/MenusAndCommands.vsct.tr.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/MenusAndCommands.vsct.zh-Hant.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/MenusAndCommands.vsct.zh-Hant.xlf index af5e9e57b42..b6713a47eec 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/MenusAndCommands.vsct.zh-Hant.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/MenusAndCommands.vsct.zh-Hant.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.cs.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.cs.xlf index 5f16f51b7a6..d6e0544c20b 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.cs.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.cs.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.de.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.de.xlf index 1171f11de40..61a1b07a85c 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.de.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.de.xlf @@ -1,4 +1,4 @@ - + @@ -69,7 +69,7 @@ Project - Projekt + Projekt diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.es.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.es.xlf index 653304cb11a..b4806143a1f 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.es.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.es.xlf @@ -1,4 +1,4 @@ - + @@ -84,7 +84,7 @@ Project Folder - Carpeta de proyecto + Carpeta del proyecto @@ -289,7 +289,7 @@ An empty text file - Archivo de texto vacío. + Archivo de texto vacío @@ -299,7 +299,7 @@ A blank XML file - Archivo XML en blanco. + Archivo XML en blanco @@ -399,7 +399,7 @@ A file for storing resources - Archivo para almacenar recursos. + Archivo para almacenar recursos diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.fr.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.fr.xlf index a587c08ae0f..677b679130c 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.fr.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.fr.xlf @@ -1,4 +1,4 @@ - + @@ -399,7 +399,7 @@ A file for storing resources - Fichier de stockage des ressources + Fichier pour stocker les ressources diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.it.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.it.xlf index 08d29b24731..8cff31ef2b7 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.it.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.it.xlf @@ -1,4 +1,4 @@ - + @@ -64,12 +64,12 @@ Sets the .ico file to use as your application icon. - Consente di impostare il file con estensione da usare come icona dell'applicazione. + Imposta il file ico da utilizzare come icona dell'applicazione. Project - Progetto + PROGETTO @@ -329,7 +329,7 @@ A project item for consuming a .NET Managed Resources File (Resx) using ResxFile type provider. - Elemento di progetto per l'utilizzo di un file di risorse gestite .NET (Resx) con il provider di tipi ResxFile. + Elemento di progetto per l'utilizzo di un file di risorse gestite .NET (Resx) utilizzando il provider di tipi ResxFile. @@ -339,7 +339,7 @@ A project item for using the SqlDataConnection (LINQ to SQL) type provider to generate types and consume data in a live SQL database. - Elemento di progetto per l'uso del provider di tipi SqlDataConnection (LINQ to SQL) per generare i tipi e utilizzare i dati in un database SQL attivo. + Elemento di progetto per l'utilizzo del provider di tipi SqlDataConnection (LINQ to SQL) per generare i tipi e utilizzare i dati in un database SQL attivo. @@ -349,7 +349,7 @@ A project item for using the SqlEntityConnection (Entity Data Model) type provider to generate types and consume data in a live SQL database. - Elemento di progetto per l'uso del provider di tipi SqlEntityConnection (Entity Data Model) per generare i tipi e utilizzare i dati in un database SQL attivo. + Elemento di progetto per l'utilizzo del provider di tipi SqlEntityConnection (Entity Data Model) per generare i tipi e utilizzare i dati in un database SQL attivo. @@ -539,7 +539,7 @@ All of the Framework assemblies are already referenced. Please use the Object Browser to explore the references in the Framework. - Si è già fatto riferimento a tutti gli assembly del framework. Usare Visualizzatore oggetti per esplorare i riferimenti nel framework. + Si è già fatto riferimento a tutti gli assembly del framework. Utilizzare Visualizzatore oggetti per esplorare i riferimenti nel framework. diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.ja.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.ja.xlf index 3bac34d1a98..742b365524a 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.ja.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.ja.xlf @@ -1,4 +1,4 @@ - + @@ -399,7 +399,7 @@ A file for storing resources - リソースを格納するためのファイル + リソースを格納するファイル @@ -409,7 +409,7 @@ F# Interactive - F# インタラクティブ + F# Interactive @@ -459,7 +459,7 @@ F# Interactive - F# インタラクティブ + F# Interactive @@ -509,7 +509,7 @@ Change path and command line arguments passed to the F# Interactive - F# インタラクティブに渡されるパスとコマンド ライン引数を変更します + F# Interactive に渡されるパスとコマンド ライン引数を変更します diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.ko.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.ko.xlf index 2ddb349f1d2..611e3420a3c 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.ko.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.ko.xlf @@ -1,4 +1,4 @@ - + @@ -509,7 +509,7 @@ Change path and command line arguments passed to the F# Interactive - F# 대화형에 전달된 경로 및 명령줄 인수를 변경합니다. + F# Interactive에 전달된 경로 및 명령줄 인수를 변경합니다. diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.pl.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.pl.xlf index 19db868b25a..436d177ce92 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.pl.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.pl.xlf @@ -1,4 +1,4 @@ - + @@ -179,7 +179,7 @@ Windows - Windows + System Windows @@ -484,7 +484,7 @@ The project '{0}' could not be opened because opening it would cause a folder to be rendered multiple times in the solution explorer. One such problematic item is '{1}'. To open this project in Visual Studio, first edit the project file and fix the problem. - Nie można otworzyć projektu „{0}”, ponieważ spowodowałoby to wielokrotne renderowanie folderu w eksploratorze rozwiązań. Jednym z elementów powodujących problemy jest „{1}”. Aby otworzyć ten projekt w programie Visual Studio, najpierw edytuj plik projektu i rozwiąż problem. + Nie można otworzyć projektu „{0}”, ponieważ spowodowałoby to wielokrotne zrenderowanie folderu w eksploratorze rozwiązań. Jednym z elementów powodujących problemy jest „{1}”. Aby otworzyć ten projekt w programie Visual Studio, najpierw edytuj plik projektu i rozwiąż problem. @@ -509,7 +509,7 @@ Change path and command line arguments passed to the F# Interactive - Zmień ścieżkę i argumenty wiersza polecenia przekazywane do narzędzia F# Interactive + Zmień ścieżkę i argumenty wiersza polecenia przekazywane do programu F# Interactive diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.pt-BR.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.pt-BR.xlf index 845ca2cf553..dc9241bf161 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.pt-BR.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.pt-BR.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.ru.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.ru.xlf index 7d372af31d6..7cccb1aa076 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.ru.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.ru.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.tr.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.tr.xlf index 825c60397ef..739934c619d 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.tr.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.tr.xlf @@ -1,4 +1,4 @@ - + @@ -29,7 +29,7 @@ Output Type - Çıktı Türü + Çıkış Türü @@ -69,12 +69,12 @@ Project - Proje + PROJE Project File - Proje Dosyası + Proje dosyası diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.zh-Hans.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.zh-Hans.xlf index 68a622d5f69..d6e1bc60642 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.zh-Hans.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.zh-Hans.xlf @@ -69,7 +69,7 @@ Project - 项目 + PROJECT @@ -409,7 +409,7 @@ F# Interactive - F# 交互窗口 + F# 交互 @@ -459,7 +459,7 @@ F# Interactive - F# 交互窗口 + F# 交互 diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.zh-Hant.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.zh-Hant.xlf index 180e9957b9d..1ccc8023f3d 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.zh-Hant.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.zh-Hant.xlf @@ -299,7 +299,7 @@ A blank XML file - 空白 XML 檔 + 空的 XML 檔 @@ -409,7 +409,7 @@ F# Interactive - F# 互動 + F# Interactive @@ -459,7 +459,7 @@ F# Interactive - F# 互動 + F# Interactive @@ -509,7 +509,7 @@ Change path and command line arguments passed to the F# Interactive - 變更傳遞到 F# 互動的路徑和命令列引數 + 變更傳遞到 F# Interactive 的路徑和命令列引數 diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/FSharp.PropertiesPages.vbproj b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/FSharp.PropertiesPages.vbproj index 136f0b001df..a04064212fd 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/FSharp.PropertiesPages.vbproj +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/FSharp.PropertiesPages.vbproj @@ -4,8 +4,7 @@ Debug - net40 - $(FSharpSourcesRoot)\..\$(Configuration)\$(TargetDotnetProfile)\bin + $(ArtifactsBinDir)\$(MSBuildProjectName)\$(Configuration)\$(TargetFramework) AnyCPU 9.0.21022 2.0 @@ -24,6 +23,7 @@ false 41999,42016,42017,42018,42019,42020,42021,42022,42032,42036 40026;42105;42107;42353 + win v4.6 @@ -33,7 +33,7 @@ true true true - true + true true false diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/ApplicationPropPage.cs.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/ApplicationPropPage.cs.xlf index ec8edc0c8d7..4e2bdab5004 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/ApplicationPropPage.cs.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/ApplicationPropPage.cs.xlf @@ -1,4 +1,4 @@ - + @@ -34,7 +34,7 @@ O&utput type: - Typ &výstupu: + Typ výstup&u: diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/ApplicationPropPage.de.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/ApplicationPropPage.de.xlf index 476df538616..f4cac58bb50 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/ApplicationPropPage.de.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/ApplicationPropPage.de.xlf @@ -1,4 +1,4 @@ - + @@ -14,7 +14,7 @@ Specify how application resources will be managed: - Verwaltung von Anwendungsressourcen: + Geben Sie an, wie die Anwendungsressourcen verwaltet werden sollen: diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/ApplicationPropPage.es.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/ApplicationPropPage.es.xlf index 67b3ae1eb31..d1efc1ac634 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/ApplicationPropPage.es.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/ApplicationPropPage.es.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/ApplicationPropPage.fr.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/ApplicationPropPage.fr.xlf index aef6cabab2f..535fba0b84d 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/ApplicationPropPage.fr.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/ApplicationPropPage.fr.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/ApplicationPropPage.it.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/ApplicationPropPage.it.xlf index 8e8b37c8f64..0f42e210f47 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/ApplicationPropPage.it.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/ApplicationPropPage.it.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/ApplicationPropPage.ko.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/ApplicationPropPage.ko.xlf index e1ef23f8dc1..eb9cef6d52d 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/ApplicationPropPage.ko.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/ApplicationPropPage.ko.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/ApplicationPropPage.pl.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/ApplicationPropPage.pl.xlf index 4648179e594..cf9ac439157 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/ApplicationPropPage.pl.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/ApplicationPropPage.pl.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/ApplicationPropPage.pt-BR.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/ApplicationPropPage.pt-BR.xlf index aaa6ab47b3c..c7f5eb16bf0 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/ApplicationPropPage.pt-BR.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/ApplicationPropPage.pt-BR.xlf @@ -1,10 +1,10 @@ - + Assembly &name: - &Nome do Assembly: + &Nome do assembly: @@ -34,7 +34,7 @@ O&utput type: - Tipo de &saída: + Ti&po de saída: diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/ApplicationPropPage.ru.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/ApplicationPropPage.ru.xlf index 6d0281b6692..1c96a13b108 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/ApplicationPropPage.ru.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/ApplicationPropPage.ru.xlf @@ -1,10 +1,10 @@ - + Assembly &name: - &Имя сборки: + Имя &сборки: diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/ApplicationPropPage.tr.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/ApplicationPropPage.tr.xlf index 92519e88aea..c0e340cf72c 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/ApplicationPropPage.tr.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/ApplicationPropPage.tr.xlf @@ -1,4 +1,4 @@ - + @@ -34,7 +34,7 @@ O&utput type: - &Çıkış türü: + Ç&ıkış türü: diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/ApplicationPropPage.zh-Hans.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/ApplicationPropPage.zh-Hans.xlf index 6ac472f9381..f46d0dd37b0 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/ApplicationPropPage.zh-Hans.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/ApplicationPropPage.zh-Hans.xlf @@ -1,10 +1,10 @@ - + Assembly &name: - 程序集名称(&N): + 程序集名称(&N): @@ -34,7 +34,7 @@ O&utput type: - 输出类型(&U): + 输出类型(&U): diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildEventCommandLineDialog.cs.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildEventCommandLineDialog.cs.xlf index d322a95b1b4..d22f9360568 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildEventCommandLineDialog.cs.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildEventCommandLineDialog.cs.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildEventCommandLineDialog.de.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildEventCommandLineDialog.de.xlf index fec602bdf50..e4abf053c8a 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildEventCommandLineDialog.de.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildEventCommandLineDialog.de.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildEventCommandLineDialog.es.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildEventCommandLineDialog.es.xlf index 4e3fbdd1b03..e7c5dfd783b 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildEventCommandLineDialog.es.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildEventCommandLineDialog.es.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildEventCommandLineDialog.fr.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildEventCommandLineDialog.fr.xlf index 43a94c2473a..0e20482fc3f 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildEventCommandLineDialog.fr.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildEventCommandLineDialog.fr.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildEventCommandLineDialog.it.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildEventCommandLineDialog.it.xlf index c6603dae24d..c541698888e 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildEventCommandLineDialog.it.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildEventCommandLineDialog.it.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildEventCommandLineDialog.ja.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildEventCommandLineDialog.ja.xlf index cd6455ea64c..a2190934053 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildEventCommandLineDialog.ja.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildEventCommandLineDialog.ja.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildEventCommandLineDialog.ko.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildEventCommandLineDialog.ko.xlf index 2f92bb4c707..fc64e68a250 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildEventCommandLineDialog.ko.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildEventCommandLineDialog.ko.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildEventCommandLineDialog.pl.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildEventCommandLineDialog.pl.xlf index de9e2972dfb..559d3afb30b 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildEventCommandLineDialog.pl.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildEventCommandLineDialog.pl.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildEventCommandLineDialog.pt-BR.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildEventCommandLineDialog.pt-BR.xlf index 4478e6ad561..639f2f4b7c1 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildEventCommandLineDialog.pt-BR.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildEventCommandLineDialog.pt-BR.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildEventCommandLineDialog.ru.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildEventCommandLineDialog.ru.xlf index c9efae6f911..a04d10f5d56 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildEventCommandLineDialog.ru.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildEventCommandLineDialog.ru.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildEventCommandLineDialog.tr.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildEventCommandLineDialog.tr.xlf index 9f9ac6466e7..f384ef2d891 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildEventCommandLineDialog.tr.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildEventCommandLineDialog.tr.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildEventCommandLineDialog.zh-Hans.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildEventCommandLineDialog.zh-Hans.xlf index 5caf470b726..05d48d67ac2 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildEventCommandLineDialog.zh-Hans.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildEventCommandLineDialog.zh-Hans.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildEventCommandLineDialog.zh-Hant.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildEventCommandLineDialog.zh-Hant.xlf index 669a3a874c9..1a2e070f542 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildEventCommandLineDialog.zh-Hant.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildEventCommandLineDialog.zh-Hant.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildEventsPropPage.cs.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildEventsPropPage.cs.xlf index 6cc631bbbc7..25b8be2bb4d 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildEventsPropPage.cs.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildEventsPropPage.cs.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildEventsPropPage.de.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildEventsPropPage.de.xlf index 4edb425a91d..efd390ea7d0 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildEventsPropPage.de.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildEventsPropPage.de.xlf @@ -1,10 +1,10 @@ - + P&re-build event command line: - Befehlszeile für P&räbuildereignis + Befehlszeile für P&räbuildereignis: @@ -59,7 +59,7 @@ When the build updates the project output - Bei der Aktualisierung der Projektausgabe während der Erstellung + Wenn der Build die Projektausgabe aktualisiert diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildEventsPropPage.es.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildEventsPropPage.es.xlf index 8a687161774..fa7e8debee2 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildEventsPropPage.es.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildEventsPropPage.es.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildEventsPropPage.fr.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildEventsPropPage.fr.xlf index 0f9892f65c0..f53e9b2d152 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildEventsPropPage.fr.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildEventsPropPage.fr.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildEventsPropPage.it.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildEventsPropPage.it.xlf index ff6480bf0a3..d5578a8717c 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildEventsPropPage.it.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildEventsPropPage.it.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildEventsPropPage.ja.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildEventsPropPage.ja.xlf index 1224d4e6cb3..34ef742a546 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildEventsPropPage.ja.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildEventsPropPage.ja.xlf @@ -49,7 +49,7 @@ Always - 常時 + 常に行う diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildEventsPropPage.ko.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildEventsPropPage.ko.xlf index 2be535f212a..d24bbcb7111 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildEventsPropPage.ko.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildEventsPropPage.ko.xlf @@ -1,10 +1,10 @@ - + P&re-build event command line: - 빌드 전 이벤트 명령줄(&R): + 빌드 이벤트 명령줄 대화 상자(&R): diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildEventsPropPage.pl.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildEventsPropPage.pl.xlf index e2dbc5bce5a..59ff337b414 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildEventsPropPage.pl.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildEventsPropPage.pl.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildEventsPropPage.pt-BR.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildEventsPropPage.pt-BR.xlf index aec6e5568fa..93f6c1c59ea 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildEventsPropPage.pt-BR.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildEventsPropPage.pt-BR.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildEventsPropPage.ru.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildEventsPropPage.ru.xlf index aa1a35894d7..1416b0f53ba 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildEventsPropPage.ru.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildEventsPropPage.ru.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildEventsPropPage.tr.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildEventsPropPage.tr.xlf index b5f5bac5114..6cc5674746d 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildEventsPropPage.tr.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildEventsPropPage.tr.xlf @@ -1,4 +1,4 @@ - + @@ -24,7 +24,7 @@ P&ost-build event command line: - &Oluşturma sonrası olay komut satırı: + D&erleme sonrası olay komut satırı: diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildEventsPropPage.zh-Hans.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildEventsPropPage.zh-Hans.xlf index 41abaed4108..a59ec76dfd8 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildEventsPropPage.zh-Hans.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildEventsPropPage.zh-Hans.xlf @@ -49,7 +49,7 @@ Always - 始终 + 总是 diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildPropPage.cs.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildPropPage.cs.xlf index db4345b9870..d37993e8960 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildPropPage.cs.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildPropPage.cs.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildPropPage.de.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildPropPage.de.xlf index 320147d129d..8b50d8a68ad 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildPropPage.de.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildPropPage.de.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildPropPage.es.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildPropPage.es.xlf index d6fe8b01cb0..148b27b14c3 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildPropPage.es.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildPropPage.es.xlf @@ -1,4 +1,4 @@ - + @@ -54,7 +54,7 @@ Specif&ic warnings: - Advertenc&ias específicas: + A&dvertencias específicas: diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildPropPage.fr.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildPropPage.fr.xlf index e0721064309..3b2937eba2d 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildPropPage.fr.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildPropPage.fr.xlf @@ -1,4 +1,4 @@ - + @@ -9,7 +9,7 @@ &Prefer 32-bit - Préférer &32 bits + &Préférer 32 bits @@ -39,12 +39,12 @@ B&rowse... - Pa&rcourir... + P&arcourir... &Output path: - C&hemin de sortie : + Chemin de s&ortie : @@ -59,7 +59,7 @@ &None - Aucu&n + &Aucune @@ -104,7 +104,7 @@ Optimi&ze code - Op&timiser le code + Optimi&ser le code diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildPropPage.it.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildPropPage.it.xlf index 0890694a536..bfc4b4ca222 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildPropPage.it.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildPropPage.it.xlf @@ -1,4 +1,4 @@ - + @@ -59,7 +59,7 @@ &None - &Nessuno + &Nessuna diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildPropPage.ja.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildPropPage.ja.xlf index d83b51700bf..10c7d9b936a 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildPropPage.ja.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildPropPage.ja.xlf @@ -29,7 +29,7 @@ Errors and warnings - エラーと警告 + エラーおよび警告 diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildPropPage.ko.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildPropPage.ko.xlf index 537f14a12ca..90ac3d7d03b 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildPropPage.ko.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildPropPage.ko.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildPropPage.pl.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildPropPage.pl.xlf index 1b4413c9b1d..25dfce21243 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildPropPage.pl.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildPropPage.pl.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildPropPage.pt-BR.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildPropPage.pt-BR.xlf index a2ffb7e6c84..2c25e3468c9 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildPropPage.pt-BR.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildPropPage.pt-BR.xlf @@ -1,4 +1,4 @@ - + @@ -44,12 +44,12 @@ &Output path: - Caminho de &saída: + Caminh&o de saída: A&ll - Tud&o + T&odos diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildPropPage.ru.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildPropPage.ru.xlf index 7d4a6afc0f1..f40632449a1 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildPropPage.ru.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildPropPage.ru.xlf @@ -1,4 +1,4 @@ - + @@ -19,7 +19,7 @@ General - Общие + Общее diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildPropPage.tr.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildPropPage.tr.xlf index 7a55cc949b6..a519259ba20 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildPropPage.tr.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildPropPage.tr.xlf @@ -1,10 +1,10 @@ - + Conditional compilation s&ymbols: - &Koşullu derleme simgeleri: + Koşullu derleme s&embolleri: @@ -34,7 +34,7 @@ &XML documentation file: - &XML belgesi dosyası: + &XML belge dosyası: @@ -104,7 +104,7 @@ Optimi&ze code - &Kodu iyileştir + Kodu iyileş&tir @@ -129,7 +129,7 @@ Define DEB&UG constant - HATA &AYIKLAMA sabiti tanımla + DEB&UG sabitini tanımla diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildPropPage.zh-Hans.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildPropPage.zh-Hans.xlf index 7189b489018..43f058d2d98 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildPropPage.zh-Hans.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildPropPage.zh-Hans.xlf @@ -1,10 +1,10 @@ - + Conditional compilation s&ymbols: - 条件编译符号(&Y): + 条件编译符号(&Y): @@ -49,12 +49,12 @@ A&ll - 全部(&L) + 所有(&L) Specif&ic warnings: - 特定警告(&I): + 特定警告(&I): diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildPropPage.zh-Hant.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildPropPage.zh-Hant.xlf index b5d76de120c..73238eec1f7 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildPropPage.zh-Hant.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildPropPage.zh-Hant.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/DebugPropPage.cs.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/DebugPropPage.cs.xlf index 4fbcdb22b63..b7f7db82845 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/DebugPropPage.cs.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/DebugPropPage.cs.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/DebugPropPage.de.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/DebugPropPage.de.xlf index 2e570490493..de4a3a88349 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/DebugPropPage.de.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/DebugPropPage.de.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/DebugPropPage.es.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/DebugPropPage.es.xlf index 6c4f55c9e71..623a095ee6c 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/DebugPropPage.es.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/DebugPropPage.es.xlf @@ -1,4 +1,4 @@ - + @@ -39,7 +39,7 @@ Comma&nd line arguments: - &Argumentos de la línea de comandos: + Argume&ntos de la línea de comandos: @@ -74,7 +74,7 @@ Enable SQ&L Server debugging - &Habilitar depuración de SQL Server + Habilitar depuración de SQ&L Server diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/DebugPropPage.fr.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/DebugPropPage.fr.xlf index be876b43811..d7e927fcfbd 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/DebugPropPage.fr.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/DebugPropPage.fr.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/DebugPropPage.it.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/DebugPropPage.it.xlf index cc4d9cd5c87..6628f68dda5 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/DebugPropPage.it.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/DebugPropPage.it.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/DebugPropPage.pl.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/DebugPropPage.pl.xlf index bb6d9cc7666..3cb518e1054 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/DebugPropPage.pl.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/DebugPropPage.pl.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/DebugPropPage.pt-BR.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/DebugPropPage.pt-BR.xlf index e9c3aa64ff7..bebb8eb708d 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/DebugPropPage.pt-BR.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/DebugPropPage.pt-BR.xlf @@ -1,4 +1,4 @@ - + @@ -74,7 +74,7 @@ Enable SQ&L Server debugging - Habilitar depuração do SQ&L Server + Habilitar a depuração do SQ&L Server diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/DebugPropPage.ru.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/DebugPropPage.ru.xlf index e6efd612b58..f14f4e935de 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/DebugPropPage.ru.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/DebugPropPage.ru.xlf @@ -1,4 +1,4 @@ - + @@ -9,12 +9,12 @@ &Start project - &Запустить проект + &Запуск проекта Start e&xternal program: - &Запуск внешней программы: + Запуск &внешней программы: diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/DebugPropPage.tr.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/DebugPropPage.tr.xlf index ba949c79550..833e0b33f42 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/DebugPropPage.tr.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/DebugPropPage.tr.xlf @@ -1,4 +1,4 @@ - + @@ -19,7 +19,7 @@ Program to start - Başlatılacak Program + Başlatılacak program @@ -74,7 +74,7 @@ Enable SQ&L Server debugging - SQ&L Server üzerinde hata ayıklamayı etkinleştir + SQ&L Server hata ayıklamasını etkinleştir diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/DebugPropPage.zh-Hans.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/DebugPropPage.zh-Hans.xlf index 62204f8c922..d0d3cd5e240 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/DebugPropPage.zh-Hans.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/DebugPropPage.zh-Hans.xlf @@ -14,7 +14,7 @@ Start e&xternal program: - 启动外部程序(&X): + 启动外部程序(&X): diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/DebugPropPage.zh-Hant.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/DebugPropPage.zh-Hant.xlf index 8363b99591c..8d12410079c 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/DebugPropPage.zh-Hant.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/DebugPropPage.zh-Hant.xlf @@ -14,7 +14,7 @@ Start e&xternal program: - 起始外部程式(&X): + 啟動外部程式(&X): @@ -39,7 +39,7 @@ Comma&nd line arguments: - 命令列的引數(&N): + 命令列引數(&N): diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/PropPageHostDialog.cs.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/PropPageHostDialog.cs.xlf index 9fcb5feb91a..5341e67ab86 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/PropPageHostDialog.cs.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/PropPageHostDialog.cs.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/PropPageHostDialog.de.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/PropPageHostDialog.de.xlf index e35db629104..1e49de26935 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/PropPageHostDialog.de.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/PropPageHostDialog.de.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/PropPageHostDialog.es.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/PropPageHostDialog.es.xlf index 878c944cd3b..3e83917f8d0 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/PropPageHostDialog.es.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/PropPageHostDialog.es.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/PropPageHostDialog.fr.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/PropPageHostDialog.fr.xlf index a50f390374c..8cf63e41f08 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/PropPageHostDialog.fr.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/PropPageHostDialog.fr.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/PropPageHostDialog.it.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/PropPageHostDialog.it.xlf index f7f2c8a3adc..d6d276b1837 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/PropPageHostDialog.it.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/PropPageHostDialog.it.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/PropPageHostDialog.ja.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/PropPageHostDialog.ja.xlf index d4d314ddee0..3c9bc7d0ded 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/PropPageHostDialog.ja.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/PropPageHostDialog.ja.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/PropPageHostDialog.ko.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/PropPageHostDialog.ko.xlf index d17247b81e3..12804e7a3ee 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/PropPageHostDialog.ko.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/PropPageHostDialog.ko.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/PropPageHostDialog.pl.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/PropPageHostDialog.pl.xlf index 170199c9055..9337c152112 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/PropPageHostDialog.pl.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/PropPageHostDialog.pl.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/PropPageHostDialog.pt-BR.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/PropPageHostDialog.pt-BR.xlf index b8d2524a06e..c274532d09f 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/PropPageHostDialog.pt-BR.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/PropPageHostDialog.pt-BR.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/PropPageHostDialog.ru.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/PropPageHostDialog.ru.xlf index 0be5d4aaa0b..afca4527299 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/PropPageHostDialog.ru.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/PropPageHostDialog.ru.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/PropPageHostDialog.tr.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/PropPageHostDialog.tr.xlf index 6ef96b01cd7..f96c4a8da41 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/PropPageHostDialog.tr.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/PropPageHostDialog.tr.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/PropPageHostDialog.zh-Hans.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/PropPageHostDialog.zh-Hans.xlf index 938d6024a47..97512aa0978 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/PropPageHostDialog.zh-Hans.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/PropPageHostDialog.zh-Hans.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/PropPageHostDialog.zh-Hant.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/PropPageHostDialog.zh-Hant.xlf index a0ae25961e9..9dd06888ea3 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/PropPageHostDialog.zh-Hant.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/PropPageHostDialog.zh-Hant.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/PropPageUserControlBase.cs.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/PropPageUserControlBase.cs.xlf index c8e5b7cd36a..61b50997890 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/PropPageUserControlBase.cs.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/PropPageUserControlBase.cs.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/PropPageUserControlBase.de.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/PropPageUserControlBase.de.xlf index 094d10306c8..9f805b1c5a3 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/PropPageUserControlBase.de.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/PropPageUserControlBase.de.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/PropPageUserControlBase.es.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/PropPageUserControlBase.es.xlf index e7acc7bb0d7..1a6854976e7 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/PropPageUserControlBase.es.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/PropPageUserControlBase.es.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/PropPageUserControlBase.fr.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/PropPageUserControlBase.fr.xlf index 679f951b73e..a7d280bc2db 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/PropPageUserControlBase.fr.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/PropPageUserControlBase.fr.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/PropPageUserControlBase.it.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/PropPageUserControlBase.it.xlf index 916621220c2..b8b7b295ea9 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/PropPageUserControlBase.it.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/PropPageUserControlBase.it.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/PropPageUserControlBase.ja.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/PropPageUserControlBase.ja.xlf index c960d267e5d..36f1da5cbc3 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/PropPageUserControlBase.ja.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/PropPageUserControlBase.ja.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/PropPageUserControlBase.ko.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/PropPageUserControlBase.ko.xlf index 70df964d9ce..112e882ebe4 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/PropPageUserControlBase.ko.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/PropPageUserControlBase.ko.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/PropPageUserControlBase.pl.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/PropPageUserControlBase.pl.xlf index 209f6014fd6..3d877488af4 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/PropPageUserControlBase.pl.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/PropPageUserControlBase.pl.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/PropPageUserControlBase.pt-BR.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/PropPageUserControlBase.pt-BR.xlf index c5a93a9e71b..980b76d5496 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/PropPageUserControlBase.pt-BR.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/PropPageUserControlBase.pt-BR.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/PropPageUserControlBase.ru.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/PropPageUserControlBase.ru.xlf index 43cf83e3fcb..07322aa70c6 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/PropPageUserControlBase.ru.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/PropPageUserControlBase.ru.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/PropPageUserControlBase.tr.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/PropPageUserControlBase.tr.xlf index d6e2d953f71..d8dfa57ce72 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/PropPageUserControlBase.tr.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/PropPageUserControlBase.tr.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/PropPageUserControlBase.zh-Hans.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/PropPageUserControlBase.zh-Hans.xlf index b6177ce4c46..64eccb2e0a8 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/PropPageUserControlBase.zh-Hans.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/PropPageUserControlBase.zh-Hans.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/PropPageUserControlBase.zh-Hant.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/PropPageUserControlBase.zh-Hant.xlf index 2984ef0687a..59ebdbcf3e1 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/PropPageUserControlBase.zh-Hant.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/PropPageUserControlBase.zh-Hant.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/ReferencePathsPropPage.cs.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/ReferencePathsPropPage.cs.xlf index c3e2c3f0a18..73bc19a60f9 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/ReferencePathsPropPage.cs.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/ReferencePathsPropPage.cs.xlf @@ -1,4 +1,4 @@ - + @@ -9,7 +9,7 @@ &Update - &Aktualizovat + Akt&ualizovat diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/ReferencePathsPropPage.de.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/ReferencePathsPropPage.de.xlf index 494cdfc5c08..d404bd4ddfe 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/ReferencePathsPropPage.de.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/ReferencePathsPropPage.de.xlf @@ -1,4 +1,4 @@ - + @@ -39,7 +39,7 @@ Delete - Löschen + löschen diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/ReferencePathsPropPage.es.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/ReferencePathsPropPage.es.xlf index f93118c9d9e..9502fb15b84 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/ReferencePathsPropPage.es.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/ReferencePathsPropPage.es.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/ReferencePathsPropPage.fr.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/ReferencePathsPropPage.fr.xlf index 96d2c49eb32..1c1154e0b2e 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/ReferencePathsPropPage.fr.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/ReferencePathsPropPage.fr.xlf @@ -1,4 +1,4 @@ - + @@ -39,7 +39,7 @@ Delete - Supprimer + supprimer diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/ReferencePathsPropPage.it.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/ReferencePathsPropPage.it.xlf index 9ee4b7f053a..32767e6bdea 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/ReferencePathsPropPage.it.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/ReferencePathsPropPage.it.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/ReferencePathsPropPage.ja.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/ReferencePathsPropPage.ja.xlf index 2ee13151176..01d07dea709 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/ReferencePathsPropPage.ja.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/ReferencePathsPropPage.ja.xlf @@ -1,4 +1,4 @@ - + @@ -19,7 +19,7 @@ Browse - ブラウザー + 参照 diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/ReferencePathsPropPage.ko.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/ReferencePathsPropPage.ko.xlf index 02369eb5f01..7a549eb5755 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/ReferencePathsPropPage.ko.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/ReferencePathsPropPage.ko.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/ReferencePathsPropPage.pl.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/ReferencePathsPropPage.pl.xlf index 708a2d14223..e095b853263 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/ReferencePathsPropPage.pl.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/ReferencePathsPropPage.pl.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/ReferencePathsPropPage.pt-BR.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/ReferencePathsPropPage.pt-BR.xlf index 2fe1e1a6063..6d3ab0ec441 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/ReferencePathsPropPage.pt-BR.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/ReferencePathsPropPage.pt-BR.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/ReferencePathsPropPage.ru.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/ReferencePathsPropPage.ru.xlf index 40d3ac6c348..de3199b2abc 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/ReferencePathsPropPage.ru.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/ReferencePathsPropPage.ru.xlf @@ -1,4 +1,4 @@ - + @@ -29,17 +29,17 @@ Move up - Вверх + Переместить вверх Move down - Вниз + Переместить вниз Delete - Удаление. + Удалить diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/ReferencePathsPropPage.tr.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/ReferencePathsPropPage.tr.xlf index 05e5266da15..0f47c169698 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/ReferencePathsPropPage.tr.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/ReferencePathsPropPage.tr.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/ReferencePathsPropPage.zh-Hans.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/ReferencePathsPropPage.zh-Hans.xlf index c5195f9a2a7..6bcf6828e9e 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/ReferencePathsPropPage.zh-Hans.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/ReferencePathsPropPage.zh-Hans.xlf @@ -1,4 +1,4 @@ - + @@ -14,7 +14,7 @@ Reference &paths: - 引用路径(&P): + 引用路径(&P): diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/ReferencePathsPropPage.zh-Hant.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/ReferencePathsPropPage.zh-Hant.xlf index 910e618c7d0..725134dd28d 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/ReferencePathsPropPage.zh-Hant.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/ReferencePathsPropPage.zh-Hant.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/Microsoft.VisualStudio.Editors.Designer.resx b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/Microsoft.VisualStudio.Editors.Designer.resx index b6c6a8091ed..697e650fcbb 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/Microsoft.VisualStudio.Editors.Designer.resx +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/Microsoft.VisualStudio.Editors.Designer.resx @@ -1696,15 +1696,9 @@ CONSIDER: get this from CodeDom Application - - Application (Web) - User - - User (Web) - Name diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.cs.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.cs.xlf index 0011f9be1cb..ab9abd57bf9 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.cs.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.cs.xlf @@ -1,4 +1,4 @@ - + @@ -19,7 +19,7 @@ Version - Verze + VERSION @@ -355,7 +355,7 @@ Vyberte prosím platnou cestu ke složce. None - Žádné + žádné @@ -390,7 +390,7 @@ Vyberte prosím platnou cestu ke složce. Use of variable prior to assignment - Použití proměnné před přiřazením + Použití proměnné závisí na předchozím přiřazení @@ -819,7 +819,7 @@ Chyba: Windows Application - Aplikace pro systém Windows + Aplikace systému Windows @@ -960,7 +960,7 @@ Chyba: &Remove - Odeb&rat + O&debrat @@ -1257,7 +1257,7 @@ Chyba: The location specified is on an invalid or read-only disk, or contains a device name reserved for the system. - Zadané umístění je buď neplatné, nachází se na disku určeném jen pro čtení, nebo obsahuje název zařízení rezervovaný systémem. + Zadané umístění je buď neplatné, nachází se na disku určeném pouze pro čtení, nebo obsahuje název zařízení rezervovaný systémem. @@ -1602,7 +1602,7 @@ Chyba: (None) - (Žádný) + (žádné) Default Event @@ -1828,7 +1828,7 @@ CONSIDER: get this from CodeDom {0} x {1} - {0} x {1} + {0} x {1} Format string for showing a graphic's size # {0} = width (as an integer) @@ -1884,7 +1884,7 @@ CONSIDER: get this from CodeDom &Remove - Odeb&rat + O&debrat Add, Delete and Views button text in the main ToolStrip @@ -2344,21 +2344,11 @@ CONSIDER: get this from CodeDom Aplikace - - Application (Web) - Aplikace (web) - - User Uživatel - - User (Web) - Uživatel (web) - - Name Název @@ -2830,22 +2820,22 @@ Chcete aktualizovat hodnotu v souboru .settings? seconds - sekundy + Sekundy minutes - minuty + Minuty hours - hodiny + Hodiny days - dny + Dny diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.de.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.de.xlf index 0e771c59575..c042c5dd65a 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.de.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.de.xlf @@ -1,4 +1,4 @@ - + @@ -19,12 +19,12 @@ Version - Version + VERSION Signing - Signierung + Signieren @@ -133,7 +133,7 @@ Klicken Sie auf "OK", um diese Meldung zu ignorieren und den Vorgang fortzusetze N/A - Nicht zutreffend + N/V This is used in the platform and configuration comboboxes when showing pages that don't care about the current platform/configuration @@ -355,7 +355,7 @@ Wählen Sie einen gültigen Ordnerpfad aus. None - Keine + NONE @@ -557,7 +557,7 @@ Wenn diese Einstellung geändert wird, werden die Einstellungen in allen Konfigu Invalid value - Ungültiger Wert + Ungültiger Wert. @@ -875,7 +875,7 @@ Fehler: Static - Statisch + Static @@ -1627,7 +1627,7 @@ Fehler: Comment - Kommentieren + Kommentar Column names for the string table @@ -1818,7 +1818,7 @@ CONSIDER: get this from CodeDom Comment - Kommentieren + Kommentar Columns for the "Details" view of the resource editor @@ -1828,7 +1828,7 @@ CONSIDER: get this from CodeDom {0} x {1} - {0} x {1} + {0} x {1} Format string for showing a graphic's size # {0} = width (as an integer) @@ -2344,21 +2344,11 @@ CONSIDER: get this from CodeDom Anwendung - - Application (Web) - Anwendung (Web) - - User Benutzer - - User (Web) - Benutzer (Web) - - Name Name diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.en.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.en.xlf index 2b820cacf7e..8f158b4e155 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.en.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.en.xlf @@ -2344,21 +2344,11 @@ CONSIDER: get this from CodeDom Application - - Application (Web) - Application (Web) - - User User - - User (Web) - User (Web) - - Name Name diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.es.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.es.xlf index 89398dabf58..3a0ae3c38e5 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.es.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.es.xlf @@ -1,4 +1,4 @@ - + @@ -39,7 +39,7 @@ Debug - Depurar + depurar @@ -230,12 +230,12 @@ Seleccione una ruta de acceso de carpeta válida. Invalid version format, expected "[Major]", "[Major].[Minor]", "[Major].[Minor].[Build]" or "[Major].[Minor].[Build].[Revision]" - Formato de versión no válido, se esperaba "[Principal]", "[Principal].[Secundaria]", "[Principal].[Secundaria].[Compilación]" o "[Principal].[Secundaria].[Compilación].[Revisión]" + Formato de versión no válido; se esperaba "[Principal]", "[Principal].[Secundaria]", "[Principal].[Secundaria].[Compilación]" o "[Principal].[Secundaria].[Compilación].[Revisión]" A wildcard ("*") is not allowed in this field. - No se permite el carácter comodín ("*") en este campo. + No se permite el uso de caracteres comodín ("*") en este campo. @@ -355,7 +355,7 @@ Seleccione una ruta de acceso de carpeta válida. None - Ninguno + NONE @@ -365,7 +365,7 @@ Seleccione una ruta de acceso de carpeta válida. Error - Error + Fehler @@ -390,7 +390,7 @@ Seleccione una ruta de acceso de carpeta válida. Use of variable prior to assignment - Uso de variable anterior a la asignación. + Uso de variable anterior a la asignación @@ -400,7 +400,7 @@ Seleccione una ruta de acceso de carpeta válida. Unused local variable - Variable local no usada. + Variable local no usada @@ -502,7 +502,7 @@ Si cambia este valor, se restablecerán los valores de todas las configuraciones (Custom) - (Personalizada) + (Personalizado) Don't use @@ -614,7 +614,7 @@ Error: Error - Error + Fehler @@ -684,7 +684,7 @@ Error: The new passwords do not match. Enter the password again. - Las contraseñas no coinciden. Vuelva a escribir la contraseña. + Las nuevas contraseñas no coinciden. Vuelva a escribir la contraseña. @@ -1087,7 +1087,7 @@ Error: Assembly Version - Versión del ensamblado + Versión de ensamblado @@ -1828,7 +1828,7 @@ CONSIDER: get this from CodeDom {0} x {1} - {0} x {1} + {0} x {1} Format string for showing a graphic's size # {0} = width (as an integer) @@ -2344,21 +2344,11 @@ CONSIDER: get this from CodeDom Aplicación - - Application (Web) - Aplicación (web) - - User Usuario - - User (Web) - Usuario (web) - - Name Nombre @@ -2830,22 +2820,22 @@ El nuevo valor del archivo app.config es '{1}' seconds - segundos + Segundos minutes - minutos + Minutos hours - horas + Horas days - días + Días @@ -2855,7 +2845,7 @@ El nuevo valor del archivo app.config es '{1}' An error occurred while reading the Application configuration file. The file might be corrupted or contain invalid XML. - Error al leer el archivo de configuración de la aplicación. Puede que el archivo esté dañado o que contenga código XML no válido. + Error al leer el archivo de configuración de la aplicación. Puede que esté dañado o que contenga código XML no válido. diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.fr.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.fr.xlf index f5e2991076c..588f1f2e23c 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.fr.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.fr.xlf @@ -1,4 +1,4 @@ - + @@ -39,7 +39,7 @@ Debug - Déboguer + déboguer @@ -49,7 +49,7 @@ Database - Base de données + Base de données  @@ -69,7 +69,7 @@ Reference Paths - Chemins des références + Chemins d'accès des références @@ -215,7 +215,7 @@ Sélectionnez un chemin de dossier valide. Reference Paths - Chemins des références + Chemins d'accès des références @@ -225,7 +225,7 @@ Sélectionnez un chemin de dossier valide. Assembly Information - Informations de l'assembly + Informations sur l'assembly @@ -355,7 +355,7 @@ Sélectionnez un chemin de dossier valide. None - Aucun + Aucun(e) @@ -724,7 +724,7 @@ Erreur : Expiration Date - Date d'expiration + Date d’expiration @@ -1497,7 +1497,7 @@ Erreur : Name - Nom + Nom  @@ -1507,7 +1507,7 @@ Erreur : Name - Nom + Nom  @@ -1607,12 +1607,12 @@ Erreur : Requires: - Requiert : + Nécessite : Name - Nom + Nom  Column names for the string table @@ -1798,7 +1798,7 @@ CONSIDER: get this from CodeDom Name - Nom + Nom  Columns for the "Details" view of the resource editor @@ -1828,7 +1828,7 @@ CONSIDER: get this from CodeDom {0} x {1} - {0} x {1} + {0} x {1} Format string for showing a graphic's size # {0} = width (as an integer) @@ -2036,7 +2036,7 @@ CONSIDER: get this from CodeDom Text Files - Fichiers texte + Fichiers textes # File dialog filters # # E.g., for icons, the actual filter created would look like "Icons (*.ico)". These resources @@ -2336,7 +2336,7 @@ CONSIDER: get this from CodeDom Browse... - Parcourir... + Parcourir… Added as the last item in the list of available types to let the user browse for a new type @@ -2344,24 +2344,14 @@ CONSIDER: get this from CodeDom Application - - Application (Web) - Application (web) - - User Utilisateur - - User (Web) - Utilisateur (web) - - Name - Nom + Nom  @@ -2830,22 +2820,22 @@ Voulez-vous mettre à jour la valeur dans le fichier .settings ? seconds - secondes + Secondes minutes - minutes + Minutes hours - heures + Heures days - jours + Jours diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.it.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.it.xlf index ae70606d7ca..ea9be117a47 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.it.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.it.xlf @@ -1,4 +1,4 @@ - + @@ -173,7 +173,7 @@ Fare clic su OK per ignorare e continuare. Fare clic su ANNULLA per selezionare Select Output Path - Seleziona percorso di output + Seleziona percorso output @@ -230,7 +230,7 @@ Selezionare un percorso della cartella valido. Invalid version format, expected "[Major]", "[Major].[Minor]", "[Major].[Minor].[Build]" or "[Major].[Minor].[Build].[Revision]" - Formato di versione non valido: previsto [Principale]", "[Principale].[Secondaria]", "[Principale].[Secondaria].[Build]" o "[Principale].[Secondaria].[Build].[Revisione] + Formato di versione non valido. Previsto "[Major]", "[Major].[Minor]", "[Major].[Minor].[Build]" o "[Major].[Minor].[Build].[Revision]" @@ -240,7 +240,7 @@ Selezionare un percorso della cartella valido. Each part of the version number for '{0}' must be an integer between 0 and {1}. - Ogni parte del numero di versione per '{0}' deve essere un numero intero compreso tra 0 e {1}. + Ogni parte del numero di versione per '{0}' deve essere un intero compreso tra 0 e {1}. @@ -370,7 +370,7 @@ Selezionare un percorso della cartella valido. (custom) - (personalizzata) + (personalizzato) @@ -380,7 +380,7 @@ Selezionare un percorso della cartella valido. Late binding; call could fail at run time - Binding tardivo. La chiamata potrebbe non riuscire in fase di esecuzione + Associazione tardiva. La chiamata potrebbe non riuscire in fase di esecuzione @@ -1697,7 +1697,7 @@ Errore: The name of the resource '{0}' cannot be used as a valid identifier, because it contains one or more invalid characters: '{1}'. Please remove or replace those characters and try again. - Il nome della risorsa '{0}' non può essere usato come identificatore valido perché contiene uno o più caratteri non validi: \'{1\}'. Rimuovere o sostituire tali caratteri e riprovare. + Il nome della risorsa '{0}' non può essere usato come identificatore valido perché contiene uno o più caratteri non validi: '{1}'. Rimuovere o sostituire tali caratteri e riprovare. {0} = Resource name @@ -1828,7 +1828,7 @@ CONSIDER: get this from CodeDom {0} x {1} - {0} x {1} + {0} x {1} Format string for showing a graphic's size # {0} = width (as an integer) @@ -2344,21 +2344,11 @@ CONSIDER: get this from CodeDom Applicazione - - Application (Web) - Applicazione (Web) - - User Utente - - User (Web) - Utente (Web) - - Name Nome @@ -2830,22 +2820,22 @@ Aggiornare il valore nel file .settings? seconds - secondi + Secondi minutes - minuti + Minuti hours - ore + Ore days - giorni + Giorni diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.ja.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.ja.xlf index a8fe2004e40..3c99c346714 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.ja.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.ja.xlf @@ -14,7 +14,7 @@ References - 参照 + 参照設定 @@ -74,12 +74,12 @@ Pre-build Event Command Line - ビルド前イベントのコマンド ライン + ビルド前に実行するコマンド ライン Post-build Event Command Line - ビルド後イベントのコマンド ライン + ビルド後に実行するコマンド ライン @@ -375,7 +375,7 @@ Please select a valid folder path. Implicit conversion - 暗黙的な変換 + 暗黙的な変換です @@ -487,7 +487,7 @@ Changing this setting will reset the settings in all configurations. Canceling... - キャンセルしています... + 取り消しています... @@ -1828,7 +1828,7 @@ CONSIDER: get this from CodeDom {0} x {1} - {0} x {1} + {0} x {1} Format string for showing a graphic's size # {0} = width (as an integer) @@ -2123,7 +2123,7 @@ CONSIDER: get this from CodeDom Managed Resources Editor - マネージ リソース エディター + マネージド リソース エディター @@ -2344,21 +2344,11 @@ CONSIDER: get this from CodeDom アプリケーション - - Application (Web) - アプリケーション (Web) - - User ユーザー - - User (Web) - ユーザー (Web) - - Name 名前 @@ -2840,12 +2830,12 @@ app.config ファイルでの新しい値は '{1}' です hours - + 時間 days - + 日数 diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.ko.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.ko.xlf index b4cf73bdbf3..dd8dbaa95b5 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.ko.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.ko.xlf @@ -1,4 +1,4 @@ - + @@ -240,7 +240,7 @@ Please select a valid folder path. Each part of the version number for '{0}' must be an integer between 0 and {1}. - '{0}' 버전 번호의 각 부분은 0에서 {1} 사이의 정수여야 합니다. + '{0}'의 각 버전 번호 부분은 0에서 {1} 사이의 정수여야 합니다. @@ -355,7 +355,7 @@ Please select a valid folder path. None - 없음 + None @@ -537,7 +537,7 @@ Changing this setting will reset the settings in all configurations. Permission - 권한 + 사용 권한 @@ -679,7 +679,7 @@ Error: Enter a new password. - 새 암호를 입력하세요. + 새 암호를 입력하십시오. @@ -1377,7 +1377,7 @@ Error: Default Value - 기본값 + Default Value @@ -1387,7 +1387,7 @@ Error: Default Value - 기본값 + Default Value @@ -1407,7 +1407,7 @@ Error: Serializable - Serialize 가능 + 직렬화 가능 @@ -1417,7 +1417,7 @@ Error: Serializable - Serialize 가능 + 직렬화 가능 @@ -1617,7 +1617,7 @@ Error: Type - 형식 + Type Column names for the string table @@ -1627,7 +1627,7 @@ Error: Comment - 설명 + 주석 Column names for the string table @@ -1808,7 +1808,7 @@ CONSIDER: get this from CodeDom Type - 형식 + Type Columns for the "Details" view of the resource editor @@ -1818,7 +1818,7 @@ CONSIDER: get this from CodeDom Comment - 설명 + 주석 Columns for the "Details" view of the resource editor @@ -1828,7 +1828,7 @@ CONSIDER: get this from CodeDom {0} x {1} - {0} x {1} + {0} x {1} Format string for showing a graphic's size # {0} = width (as an integer) @@ -2344,21 +2344,11 @@ CONSIDER: get this from CodeDom 응용 프로그램 - - Application (Web) - 응용 프로그램(웹) - - User 사용자 - - User (Web) - 사용자(웹) - - Name 이름 @@ -2366,7 +2356,7 @@ CONSIDER: get this from CodeDom Type - 형식 + Type @@ -2381,7 +2371,7 @@ CONSIDER: get this from CodeDom Type '{0}' is not defined. - '{0}' 형식이 정의되어 있지 않습니다. + {0}' 형식이 정의되지 않았습니다. @@ -2855,7 +2845,7 @@ app.config 파일의 새 값은 '{1}'입니다. An error occurred while reading the Application configuration file. The file might be corrupted or contain invalid XML. - 응용 프로그램 구성 파일을 읽는 동안 오류가 발생했습니다. 파일이 손상되었거나 잘못된 XML이 포함되어 있습니다. + 지정한 응용 프로그램 구성 파일을 읽는 동안 오류가 발생했습니다. 파일이 손상되었거나 잘못된 XML이 포함되어 있습니다. diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.pl.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.pl.xlf index 4e053ce5db5..b317e8a727a 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.pl.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.pl.xlf @@ -1,4 +1,4 @@ - + @@ -59,7 +59,7 @@ Build - Kompilacja + Kompiluj @@ -74,7 +74,7 @@ Pre-build Event Command Line - Wiersz polecenia zdarzenia sprzed kompilacji + Wiersz polecenia zdarzenia przed kompilowaniem @@ -355,7 +355,7 @@ Wybierz prawidłową ścieżkę folderu. None - Brak + brak @@ -1077,7 +1077,7 @@ Błąd: Startup Object - Obiekt uruchomieniowy + Obiekt startowy @@ -1542,7 +1542,7 @@ Błąd: Default - Domyślne + Domyślny @@ -1582,7 +1582,7 @@ Błąd: Key - Klawisz + Klucz @@ -1607,7 +1607,7 @@ Błąd: Requires: - Wymaga: + Wymagania: @@ -1828,7 +1828,7 @@ CONSIDER: get this from CodeDom {0} x {1} - {0} x {1} + {0} x {1} Format string for showing a graphic's size # {0} = width (as an integer) @@ -2344,21 +2344,11 @@ CONSIDER: get this from CodeDom Aplikacja - - Application (Web) - Aplikacja (sieć Web) - - User Użytkownik - - User (Web) - Użytkownik (sieć Web) - - Name Nazwa @@ -2810,7 +2800,7 @@ Czy chcesz zaktualizować wartość w pliku settings? Learn more about client application services... - Dowiedz się więcej o usługach aplikacji klienta... + Dowiedz się więcej o usługach aplikacji klienckich… @@ -2830,22 +2820,22 @@ Czy chcesz zaktualizować wartość w pliku settings? seconds - sekundy + Sekundy minutes - minuty + Minuty hours - godziny + Godziny days - dni + Dni diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.pt-BR.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.pt-BR.xlf index c59226370a4..8a9809a7edf 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.pt-BR.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.pt-BR.xlf @@ -1,4 +1,4 @@ - + @@ -39,7 +39,7 @@ Debug - Depurar + depurar @@ -49,7 +49,7 @@ Database - Banco de Dados + Banco de dados @@ -59,12 +59,12 @@ Build - Build + Compilar Build Events - Eventos de Build + Eventos de Compilação @@ -74,12 +74,12 @@ Pre-build Event Command Line - Linha de Comando de Eventos Pré-build + Linha de comando do evento de pré-compilação Post-build Event Command Line - Linha de Comando de Eventos Pós-build + Linha de comando do evento de pós-compilação @@ -240,7 +240,7 @@ Selecione um caminho da pasta válido. Each part of the version number for '{0}' must be an integer between 0 and {1}. - Cada parte do número de versão de '{0}' deve ser um inteiro entre 0 e {1}. + Cada parte do número de versão para '{0}' deve ser um inteiro entre 0 e {1}. @@ -350,12 +350,12 @@ Selecione um caminho da pasta válido. Base address must be a hexadecimal number with less than or equal to 8 digits, for example, 0x11000000. - O endereço base deve ser um número hexadecimal com 8 ou menos dígitos, por exemplo, 0x11000000. + O endereço base deve ser um número hexadecimal com até 8 dígitos, por exemplo, 0x11000000. None - Nenhum + NENHUM @@ -385,7 +385,7 @@ Selecione um caminho da pasta válido. Implicit type; object assumed - Tipo implícito, objeto presumido + Tipo implícito; objeto assumido @@ -405,7 +405,7 @@ Selecione um caminho da pasta válido. Instance variable accesses shared member - A variável de instância acessa o membro compartilhado + Variável de instância acessa membro compartilhado @@ -724,7 +724,7 @@ Erro: Expiration Date - Data de Vencimento + Data de Validade @@ -1803,7 +1803,7 @@ CONSIDER: get this from CodeDom Filename - Nome do arquivo + Nome do Arquivo Columns for the "Details" view of the resource editor @@ -1828,7 +1828,7 @@ CONSIDER: get this from CodeDom {0} x {1} - {0} x {1} + {0} x {1} Format string for showing a graphic's size # {0} = width (as an integer) @@ -2344,21 +2344,11 @@ CONSIDER: get this from CodeDom Aplicativo - - Application (Web) - Aplicativo (Web) - - User Usuário - - User (Web) - Usuário (Web) - - Name Nome @@ -2830,22 +2820,22 @@ Deseja atualizar o valor no arquivo .settings? seconds - segundos + Segundos minutes - minutos + Minutos hours - horas + Horas days - dias + Dias diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.ru.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.ru.xlf index 80383103d67..3a81b127f71 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.ru.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.ru.xlf @@ -1,4 +1,4 @@ - + @@ -74,12 +74,12 @@ Pre-build Event Command Line - Командная строка событий перед сборкой + Командная строка события перед сборкой Post-build Event Command Line - Командная строка событий после сборки + Командная строка события после сборки @@ -173,12 +173,12 @@ Click OK to ignore and continue. Click CANCEL to choose a different output path. Select Output Path - Выбор выходного пути + Выбор пути для вывода Select Reference Path - Выбор пути для ссылок + Выберите путь для ссылки @@ -235,7 +235,7 @@ Please select a valid folder path. A wildcard ("*") is not allowed in this field. - Знак подстановки ("*") не допускается в этом поле. + Подстановочный символ ("*") недопустим в этом поле. @@ -355,7 +355,7 @@ Please select a valid folder path. None - Нет + NONE @@ -390,7 +390,7 @@ Please select a valid folder path. Use of variable prior to assignment - Использование переменной до присваивания + Использование переменной до инициализации @@ -709,12 +709,12 @@ Error: Issued To - Получатель сертификата + Выдан (кому) Issued By - Кем выдан + Выдан (кем) @@ -779,7 +779,7 @@ Error: Enter password to open file - Введите пароль, чтобы открыть файл + Введите пароль для открытия файла @@ -875,7 +875,7 @@ Error: Static - Статическая + Static @@ -960,7 +960,7 @@ Error: &Remove - Уда&лить + &Удалить @@ -1217,7 +1217,7 @@ Error: Microsoft Visual Studio - Microsoft Visual Studio + Службы Microsoft Visual Studio Error reporting @@ -1813,7 +1813,7 @@ CONSIDER: get this from CodeDom Size - Размер + Size Columns for the "Details" view of the resource editor @@ -1828,7 +1828,7 @@ CONSIDER: get this from CodeDom {0} x {1} - {0} x {1} + {0} x {1} Format string for showing a graphic's size # {0} = width (as an integer) @@ -1879,12 +1879,12 @@ CONSIDER: get this from CodeDom &Add - Д&обавить + & Добавить Add, Delete and Views button text in the main ToolStrip &Remove - Уда&лить + &Удалить Add, Delete and Views button text in the main ToolStrip @@ -2344,21 +2344,11 @@ CONSIDER: get this from CodeDom Приложение - - Application (Web) - Приложение (веб) - - User Пользователь - - User (Web) - Пользователь (веб) - - Name Имя @@ -2830,22 +2820,22 @@ Do you want to update the value in the .settings file? seconds - с + Секунды minutes - мин + Минуты hours - ч + Часы days - дн. + Дни diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.tr.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.tr.xlf index 689a912f21e..2c5fd4566c7 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.tr.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.tr.xlf @@ -1,4 +1,4 @@ - + @@ -19,7 +19,7 @@ Version - Sürüm + SÜRÜM @@ -34,7 +34,7 @@ Compile - Derleme + Derle @@ -59,7 +59,7 @@ Build - Derleme + Oluştur @@ -74,12 +74,12 @@ Pre-build Event Command Line - Derleme Öncesi Olay Komut Satırı + Oluşturma öncesi olay komut satırı Post-build Event Command Line - Derleme Sonrası Olay Komut Satırı + Oluşturma sonrası olay komut satırı @@ -98,7 +98,7 @@ Yoksayıp devam etmek için Tamam'a tıklayın. Farklı bir çıkış yolu seçm (None) - (Hiçbiri) + (Yok) @@ -113,7 +113,7 @@ Yoksayıp devam etmek için Tamam'a tıklayın. Farklı bir çıkış yolu seçm (None) - (Hiçbiri) + (Yok) @@ -143,7 +143,7 @@ Yoksayıp devam etmek için Tamam'a tıklayın. Farklı bir çıkış yolu seçm (None) - (Hiçbiri) + (Yok) @@ -355,7 +355,7 @@ Lütfen geçerli bir klasör yolu seçin. None - Hiçbiri + yok @@ -649,7 +649,7 @@ Hata: (None) - (Hiçbiri) + (Yok) @@ -1092,7 +1092,7 @@ Hata: Assembly File Version - Bütünleştirilmiş Kod Dosya Sürümü + Bütünleştirilmiş Kod Dosyası Sürümü @@ -1828,7 +1828,7 @@ CONSIDER: get this from CodeDom {0} x {1} - {0} x {1} + {0} x {1} Format string for showing a graphic's size # {0} = width (as an integer) @@ -2344,21 +2344,11 @@ CONSIDER: get this from CodeDom Uygulama - - Application (Web) - Uygulama (Web) - - User Kullanıcı - - User (Web) - Kullanıcı (Web) - - Name Ad @@ -2830,22 +2820,22 @@ app.config dosyasındaki yeni değer: '{1}' seconds - saniye + Saniye minutes - dakika + Dakika hours - saat + Saat days - gün + Gün @@ -2940,7 +2930,7 @@ app.config dosyasındaki yeni değer: '{1}' The application will fail to run in the selected zone because of this requested elevated permission. Click the help link above for more info. - İstenen bu yükseltilmiş izin nedeniyle, uygulama seçili bölgede çalışamayacak. Daha fazla bilgi için yukarıdaki yardım bağlantısına tıklayın. + İstenen bu yükseltilmiş izin nedeniyle uygulama, seçili bölgede çalıştırılamayacak. Daha fazla bilgi için yukarıdaki yardım bağlantısına tıklayın. diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.zh-Hans.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.zh-Hans.xlf index 953aa3b878f..d6947890646 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.zh-Hans.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.zh-Hans.xlf @@ -1,4 +1,4 @@ - + @@ -355,7 +355,7 @@ Please select a valid folder path. None - + 没有 @@ -714,7 +714,7 @@ Error: Issued By - 颁发者 + 发布者 @@ -1607,7 +1607,7 @@ Error: Requires: - 要求: + 要求: @@ -1828,7 +1828,7 @@ CONSIDER: get this from CodeDom {0} x {1} - {0} x {1} + {0} x {1} Format string for showing a graphic's size # {0} = width (as an integer) @@ -2344,21 +2344,11 @@ CONSIDER: get this from CodeDom 应用程序 - - Application (Web) - 应用程序 (Web) - - User 用户 - - User (Web) - 用户 (Web) - - Name 名称 diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.zh-Hant.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.zh-Hant.xlf index 272f1b2e49f..95da5d0ce0d 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.zh-Hant.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.zh-Hant.xlf @@ -1,4 +1,4 @@ - + @@ -1617,7 +1617,7 @@ Error: Type - 類型 + 型別 Column names for the string table @@ -1808,7 +1808,7 @@ CONSIDER: get this from CodeDom Type - 類型 + 型別 Columns for the "Details" view of the resource editor @@ -1828,7 +1828,7 @@ CONSIDER: get this from CodeDom {0} x {1} - {0} x {1} + {0} x {1} Format string for showing a graphic's size # {0} = width (as an integer) @@ -2344,21 +2344,11 @@ CONSIDER: get this from CodeDom 應用程式 - - Application (Web) - 應用程式 (Web) - - User 使用者 - - User (Web) - 使用者 (Web) - - Name 名稱 @@ -2366,7 +2356,7 @@ CONSIDER: get this from CodeDom Type - 類型 + 型別 @@ -2845,7 +2835,7 @@ app.config 檔的新值是 '{1}' days - 天數 + diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/MyExtensibilityRes.cs.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/MyExtensibilityRes.cs.xlf index ec65922d473..ce1b810cf17 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/MyExtensibilityRes.cs.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/MyExtensibilityRes.cs.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/MyExtensibilityRes.de.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/MyExtensibilityRes.de.xlf index 588c6249f3b..e3a8f29376a 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/MyExtensibilityRes.de.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/MyExtensibilityRes.de.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/MyExtensibilityRes.es.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/MyExtensibilityRes.es.xlf index 9376a024fb4..d0978505ed5 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/MyExtensibilityRes.es.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/MyExtensibilityRes.es.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/MyExtensibilityRes.fr.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/MyExtensibilityRes.fr.xlf index 0092c58edac..1e56c5d6e19 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/MyExtensibilityRes.fr.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/MyExtensibilityRes.fr.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/MyExtensibilityRes.it.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/MyExtensibilityRes.it.xlf index 2dd57154f02..6280018e839 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/MyExtensibilityRes.it.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/MyExtensibilityRes.it.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/MyExtensibilityRes.pl.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/MyExtensibilityRes.pl.xlf index e671ee203c8..0f4e2675694 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/MyExtensibilityRes.pl.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/MyExtensibilityRes.pl.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/MyExtensibilityRes.pt-BR.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/MyExtensibilityRes.pt-BR.xlf index 71fb221cb35..88ae7f11380 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/MyExtensibilityRes.pt-BR.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/MyExtensibilityRes.pt-BR.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/MyExtensibilityRes.ru.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/MyExtensibilityRes.ru.xlf index 9878db1c549..5057b9951c1 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/MyExtensibilityRes.ru.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/MyExtensibilityRes.ru.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/MyExtensibilityRes.tr.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/MyExtensibilityRes.tr.xlf index e54f9c008be..bd9dc0610f9 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/MyExtensibilityRes.tr.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/MyExtensibilityRes.tr.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/MyExtensibilityRes.zh-Hans.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/MyExtensibilityRes.zh-Hans.xlf index e79e6368f9e..166ebab67b2 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/MyExtensibilityRes.zh-Hans.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/MyExtensibilityRes.zh-Hans.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/WCF.cs.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/WCF.cs.xlf index 3c501581e95..653bb1767e4 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/WCF.cs.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/WCF.cs.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/WCF.de.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/WCF.de.xlf index 584143c8116..2b8aaa54d29 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/WCF.de.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/WCF.de.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/WCF.es.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/WCF.es.xlf index f6125e7269a..ad86a70442e 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/WCF.es.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/WCF.es.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/WCF.fr.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/WCF.fr.xlf index 4703e91b134..d1965a41440 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/WCF.fr.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/WCF.fr.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/WCF.it.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/WCF.it.xlf index e1289648175..8967301e759 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/WCF.it.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/WCF.it.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/WCF.ko.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/WCF.ko.xlf index 8ef523f70e7..4e90e7072ad 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/WCF.ko.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/WCF.ko.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/WCF.pl.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/WCF.pl.xlf index 325a2575411..d8f945b7ea0 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/WCF.pl.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/WCF.pl.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/WCF.pt-BR.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/WCF.pt-BR.xlf index 52699071a4d..1ed6f1401a3 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/WCF.pt-BR.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/WCF.pt-BR.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/WCF.ru.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/WCF.ru.xlf index 7c3bf7b2e09..d11ed3b461c 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/WCF.ru.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/WCF.ru.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/WCF.tr.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/WCF.tr.xlf index fbd3fadfd4c..d844a6fe77f 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/WCF.tr.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/WCF.tr.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/WCF.zh-Hant.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/WCF.zh-Hant.xlf index 57b2b4cfaee..6c90c96523d 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/WCF.zh-Hant.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/WCF.zh-Hant.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.UIResources/FSharp.UIResources.csproj b/vsintegration/src/FSharp.UIResources/FSharp.UIResources.csproj index a5d5df95ee1..dd0c543cb54 100644 --- a/vsintegration/src/FSharp.UIResources/FSharp.UIResources.csproj +++ b/vsintegration/src/FSharp.UIResources/FSharp.UIResources.csproj @@ -5,7 +5,6 @@ Library $(NoWarn);1591 - false Microsoft.VisualStudio.FSharp.UIResources $(NoWarn);1591 @@ -26,13 +25,28 @@ + + + True + True + Strings.resx + + + + + PublicResXFileCodeGenerator + Strings.Designer.cs + + + - - + + + @@ -58,5 +72,7 @@ false - + + + \ No newline at end of file diff --git a/vsintegration/src/FSharp.UIResources/FormattingOptionsControl.xaml b/vsintegration/src/FSharp.UIResources/FormattingOptionsControl.xaml new file mode 100644 index 00000000000..d69712f6120 --- /dev/null +++ b/vsintegration/src/FSharp.UIResources/FormattingOptionsControl.xaml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + diff --git a/vsintegration/src/FSharp.UIResources/FormattingOptionsControl.xaml.cs b/vsintegration/src/FSharp.UIResources/FormattingOptionsControl.xaml.cs new file mode 100644 index 00000000000..ade1f2291ed --- /dev/null +++ b/vsintegration/src/FSharp.UIResources/FormattingOptionsControl.xaml.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace Microsoft.VisualStudio.FSharp.UIResources +{ + /// + /// Interaction logic for FormattingOptionsControl.xaml + /// + public partial class FormattingOptionsControl : UserControl + { + public FormattingOptionsControl() + { + InitializeComponent(); + } + } +} diff --git a/vsintegration/src/FSharp.UIResources/IntelliSenseOptionControl.xaml b/vsintegration/src/FSharp.UIResources/IntelliSenseOptionControl.xaml index 7eb21c35559..dbb7b6bb8fc 100644 --- a/vsintegration/src/FSharp.UIResources/IntelliSenseOptionControl.xaml +++ b/vsintegration/src/FSharp.UIResources/IntelliSenseOptionControl.xaml @@ -25,7 +25,7 @@ - diff --git a/vsintegration/src/FSharp.UIResources/Strings.Designer.cs b/vsintegration/src/FSharp.UIResources/Strings.Designer.cs index a1afd465942..23634b9f2c6 100644 --- a/vsintegration/src/FSharp.UIResources/Strings.Designer.cs +++ b/vsintegration/src/FSharp.UIResources/Strings.Designer.cs @@ -168,6 +168,15 @@ public static string Enable_in_memory_cross_project_references { } } + /// + /// Looks up a localized string similar to Re-format indentation on paste. + /// + public static string Format_on_paste { + get { + return ResourceManager.GetString("Format_on_paste", resourceCulture); + } + } + /// /// Looks up a localized string similar to Enable stale data for IntelliSense features. /// diff --git a/vsintegration/src/FSharp.UIResources/Strings.resx b/vsintegration/src/FSharp.UIResources/Strings.resx index a10b4454580..11862ae1a14 100644 --- a/vsintegration/src/FSharp.UIResources/Strings.resx +++ b/vsintegration/src/FSharp.UIResources/Strings.resx @@ -225,4 +225,7 @@ Enter key behavior + + Re-format indentation on paste + \ No newline at end of file diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.cs.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.cs.xlf index 239e9000005..d1664bda923 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.cs.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.cs.xlf @@ -1,4 +1,4 @@ - + @@ -69,7 +69,7 @@ Show completion list after a character is _deleted - Zobrazovat seznam dokončení po _odstranění znaku + _Zobrazit seznam dokončení po odstranění znaku @@ -109,7 +109,7 @@ Analyze and suggest fixes for unused values - Analyzovat a navrhovat opravy pro nepoužité hodnoty + Analyzovat a navrhnout opravy pro nepoužité hodnoty @@ -182,6 +182,11 @@ Enter key behavior + + Re-format indentation on paste + Re-format indentation on paste + + \ No newline at end of file diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.de.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.de.xlf index 4bd995642a6..155f2e73ce0 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.de.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.de.xlf @@ -1,4 +1,4 @@ - + @@ -182,6 +182,11 @@ Enter key behavior + + Re-format indentation on paste + Re-format indentation on paste + + \ No newline at end of file diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.en.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.en.xlf index 9c5b33763c9..d37ed25e390 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.en.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.en.xlf @@ -182,6 +182,11 @@ Enter key behavior + + Re-format indentation on paste + Re-format indentation on paste + + \ No newline at end of file diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.es.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.es.xlf index 545ceb9b15b..1a7733e7f1d 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.es.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.es.xlf @@ -1,4 +1,4 @@ - + @@ -74,7 +74,7 @@ _Show completion list after a character is typed - _Mostrar la lista de finalización después de escribir un carácter + _Mostrar lista de finalización después de escribir un carácter @@ -182,6 +182,11 @@ Enter key behavior + + Re-format indentation on paste + Re-format indentation on paste + + \ No newline at end of file diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.fr.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.fr.xlf index dea1037b7b3..e161fb1253b 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.fr.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.fr.xlf @@ -1,4 +1,4 @@ - + @@ -182,6 +182,11 @@ Enter key behavior + + Re-format indentation on paste + Re-format indentation on paste + + \ No newline at end of file diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.it.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.it.xlf index 22ed85d58f7..342d3bb8252 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.it.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.it.xlf @@ -1,4 +1,4 @@ - + @@ -109,7 +109,7 @@ Analyze and suggest fixes for unused values - Analizza e suggerisci correzioni per valori inutilizzati + Analizar y sugerir correcciones para valores no utilizados @@ -182,6 +182,11 @@ Enter key behavior + + Re-format indentation on paste + Re-format indentation on paste + + \ No newline at end of file diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.ja.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.ja.xlf index 4230bb7e5ba..c33d988b863 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.ja.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.ja.xlf @@ -182,6 +182,11 @@ Enter key behavior + + Re-format indentation on paste + Re-format indentation on paste + + \ No newline at end of file diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.ko.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.ko.xlf index 9429a1d42ab..4c4242096b5 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.ko.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.ko.xlf @@ -1,4 +1,4 @@ - + @@ -182,6 +182,11 @@ Enter key behavior + + Re-format indentation on paste + Re-format indentation on paste + + \ No newline at end of file diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.pl.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.pl.xlf index 41c64aebd31..2a08c93478e 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.pl.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.pl.xlf @@ -1,4 +1,4 @@ - + @@ -182,6 +182,11 @@ Enter key behavior + + Re-format indentation on paste + Re-format indentation on paste + + \ No newline at end of file diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.pt-BR.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.pt-BR.xlf index a7efc694f2b..edf44ed639a 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.pt-BR.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.pt-BR.xlf @@ -1,4 +1,4 @@ - + @@ -182,6 +182,11 @@ Enter key behavior + + Re-format indentation on paste + Re-format indentation on paste + + \ No newline at end of file diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.ru.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.ru.xlf index 892209a2d43..1a4bab694ba 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.ru.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.ru.xlf @@ -1,4 +1,4 @@ - + @@ -182,6 +182,11 @@ Enter key behavior + + Re-format indentation on paste + Re-format indentation on paste + + \ No newline at end of file diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.tr.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.tr.xlf index f1187f2e25c..21f7c6ebbad 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.tr.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.tr.xlf @@ -1,4 +1,4 @@ - + @@ -182,6 +182,11 @@ Enter key behavior + + Re-format indentation on paste + Re-format indentation on paste + + \ No newline at end of file diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hans.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hans.xlf index db270930177..3023b827f32 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hans.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hans.xlf @@ -69,7 +69,7 @@ Show completion list after a character is _deleted - 删除字符后显示完成列表 + 删除字符后显示完成列表(_D) @@ -182,6 +182,11 @@ Enter key behavior + + Re-format indentation on paste + Re-format indentation on paste + + \ No newline at end of file diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hant.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hant.xlf index 264a4df8808..0e87b6f3907 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hant.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hant.xlf @@ -1,4 +1,4 @@ - + @@ -182,6 +182,11 @@ Enter key behavior + + Re-format indentation on paste + Re-format indentation on paste + + \ No newline at end of file diff --git a/vsintegration/src/FSharp.VS.FSI/FSharp.VS.FSI.fsproj b/vsintegration/src/FSharp.VS.FSI/FSharp.VS.FSI.fsproj index 29f70484239..ff45634d032 100644 --- a/vsintegration/src/FSharp.VS.FSI/FSharp.VS.FSI.fsproj +++ b/vsintegration/src/FSharp.VS.FSI/FSharp.VS.FSI.fsproj @@ -3,7 +3,6 @@ - net46 Library true false @@ -12,7 +11,7 @@ true $(SystemValueTuplePackageVersion) $(OtherFlags) --subsystemversion:6.00 - true + true false @@ -30,14 +29,12 @@ CompilerLocationUtils.fs - - true Microsoft.VisualStudio.FSharp.Interactive.SRProperties diff --git a/vsintegration/src/FSharp.VS.FSI/fsiPackage.fs b/vsintegration/src/FSharp.VS.FSI/fsiPackage.fs deleted file mode 100644 index 1f36d5b7d81..00000000000 --- a/vsintegration/src/FSharp.VS.FSI/fsiPackage.fs +++ /dev/null @@ -1,4 +0,0 @@ -// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. - -namespace Microsoft.VisualStudio.FSharp.Interactive - diff --git a/vsintegration/src/FSharp.VS.FSI/quickparse.fs b/vsintegration/src/FSharp.VS.FSI/quickparse.fs deleted file mode 100644 index 9099134a660..00000000000 --- a/vsintegration/src/FSharp.VS.FSI/quickparse.fs +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. - -namespace Microsoft.VisualStudio.FSharp.Interactive -open System.Globalization - -// Duplication note: -// Inlined from Language Service. -// If/when there is a common DLL this code can be shared. - -/// Methods for cheaply and innacurately parsing F# -module internal QuickParse = - /// The characters that are allowed to be in an identifier. - let private IsIdentifierPartCharacter c = - let cat = System.Char.GetUnicodeCategory(c) - ( - // Letters - cat = UnicodeCategory.UppercaseLetter - || cat = UnicodeCategory.LowercaseLetter - || cat = UnicodeCategory.TitlecaseLetter - || cat = UnicodeCategory.ModifierLetter - || cat = UnicodeCategory.OtherLetter - || cat = UnicodeCategory.LetterNumber - // Numbers - || cat = UnicodeCategory.DecimalDigitNumber - // Connectors - || cat = UnicodeCategory.ConnectorPunctuation - // Combiners - || cat = UnicodeCategory.NonSpacingMark - || cat = UnicodeCategory.SpacingCombiningMark - ) - /// Is this character a part of a long identifier - let private IsLongIdentifierPartCharacter c = - (IsIdentifierPartCharacter c) || (c='.') - /// Given a line of text and an index into the line return the - /// "island" of text that could be an identifier around index. - let GetIdentifierIsland(line:string,index)= - if index=0 && IsLongIdentifierPartCharacter line.[left] do left<-left-1 - while right + diff --git a/vsintegration/src/FSharp.VS.FSI/xlf/Properties.de.xlf b/vsintegration/src/FSharp.VS.FSI/xlf/Properties.de.xlf index defc84aed79..5f2e2e5f7fe 100644 --- a/vsintegration/src/FSharp.VS.FSI/xlf/Properties.de.xlf +++ b/vsintegration/src/FSharp.VS.FSI/xlf/Properties.de.xlf @@ -1,4 +1,4 @@ - + @@ -24,7 +24,7 @@ Misc - Sonstiges + Verschiedenes diff --git a/vsintegration/src/FSharp.VS.FSI/xlf/Properties.es.xlf b/vsintegration/src/FSharp.VS.FSI/xlf/Properties.es.xlf index 725e86521e8..5d803f1d2c3 100644 --- a/vsintegration/src/FSharp.VS.FSI/xlf/Properties.es.xlf +++ b/vsintegration/src/FSharp.VS.FSI/xlf/Properties.es.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.VS.FSI/xlf/Properties.fr.xlf b/vsintegration/src/FSharp.VS.FSI/xlf/Properties.fr.xlf index 1c66865aeaa..8f7a8e902b2 100644 --- a/vsintegration/src/FSharp.VS.FSI/xlf/Properties.fr.xlf +++ b/vsintegration/src/FSharp.VS.FSI/xlf/Properties.fr.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.VS.FSI/xlf/Properties.it.xlf b/vsintegration/src/FSharp.VS.FSI/xlf/Properties.it.xlf index 3ab00cc2b5c..aff5f3ba58d 100644 --- a/vsintegration/src/FSharp.VS.FSI/xlf/Properties.it.xlf +++ b/vsintegration/src/FSharp.VS.FSI/xlf/Properties.it.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.VS.FSI/xlf/Properties.ja.xlf b/vsintegration/src/FSharp.VS.FSI/xlf/Properties.ja.xlf index 2ecad3011a8..ecfeb3aa0ba 100644 --- a/vsintegration/src/FSharp.VS.FSI/xlf/Properties.ja.xlf +++ b/vsintegration/src/FSharp.VS.FSI/xlf/Properties.ja.xlf @@ -1,4 +1,4 @@ - + @@ -49,7 +49,7 @@ Debugging - デバッグ + デバッグ中 diff --git a/vsintegration/src/FSharp.VS.FSI/xlf/Properties.ko.xlf b/vsintegration/src/FSharp.VS.FSI/xlf/Properties.ko.xlf index b030fad5e50..8899fcea757 100644 --- a/vsintegration/src/FSharp.VS.FSI/xlf/Properties.ko.xlf +++ b/vsintegration/src/FSharp.VS.FSI/xlf/Properties.ko.xlf @@ -1,4 +1,4 @@ - + @@ -24,7 +24,7 @@ Misc - 기타 + Misc diff --git a/vsintegration/src/FSharp.VS.FSI/xlf/Properties.pl.xlf b/vsintegration/src/FSharp.VS.FSI/xlf/Properties.pl.xlf index 48e1694269a..13bb02d1077 100644 --- a/vsintegration/src/FSharp.VS.FSI/xlf/Properties.pl.xlf +++ b/vsintegration/src/FSharp.VS.FSI/xlf/Properties.pl.xlf @@ -1,4 +1,4 @@ - + @@ -24,7 +24,7 @@ Misc - Różne + Misc diff --git a/vsintegration/src/FSharp.VS.FSI/xlf/Properties.pt-BR.xlf b/vsintegration/src/FSharp.VS.FSI/xlf/Properties.pt-BR.xlf index 39b9925257b..955da096a1d 100644 --- a/vsintegration/src/FSharp.VS.FSI/xlf/Properties.pt-BR.xlf +++ b/vsintegration/src/FSharp.VS.FSI/xlf/Properties.pt-BR.xlf @@ -1,4 +1,4 @@ - + @@ -49,7 +49,7 @@ Debugging - Depuração + Depurando diff --git a/vsintegration/src/FSharp.VS.FSI/xlf/Properties.ru.xlf b/vsintegration/src/FSharp.VS.FSI/xlf/Properties.ru.xlf index b8733de8c12..a29d3fdf929 100644 --- a/vsintegration/src/FSharp.VS.FSI/xlf/Properties.ru.xlf +++ b/vsintegration/src/FSharp.VS.FSI/xlf/Properties.ru.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.VS.FSI/xlf/Properties.tr.xlf b/vsintegration/src/FSharp.VS.FSI/xlf/Properties.tr.xlf index 5fef942b6e2..94648b1870a 100644 --- a/vsintegration/src/FSharp.VS.FSI/xlf/Properties.tr.xlf +++ b/vsintegration/src/FSharp.VS.FSI/xlf/Properties.tr.xlf @@ -1,4 +1,4 @@ - + @@ -24,7 +24,7 @@ Misc - Çeşitli + Misc diff --git a/vsintegration/src/FSharp.VS.FSI/xlf/Properties.zh-Hans.xlf b/vsintegration/src/FSharp.VS.FSI/xlf/Properties.zh-Hans.xlf index 19c14755929..b04c862d117 100644 --- a/vsintegration/src/FSharp.VS.FSI/xlf/Properties.zh-Hans.xlf +++ b/vsintegration/src/FSharp.VS.FSI/xlf/Properties.zh-Hans.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.VS.FSI/xlf/VFSIstrings.txt.cs.xlf b/vsintegration/src/FSharp.VS.FSI/xlf/VFSIstrings.txt.cs.xlf index 82a60809e79..225e0cbb464 100644 --- a/vsintegration/src/FSharp.VS.FSI/xlf/VFSIstrings.txt.cs.xlf +++ b/vsintegration/src/FSharp.VS.FSI/xlf/VFSIstrings.txt.cs.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.VS.FSI/xlf/VFSIstrings.txt.de.xlf b/vsintegration/src/FSharp.VS.FSI/xlf/VFSIstrings.txt.de.xlf index e8dabd63d6b..32c7c963308 100644 --- a/vsintegration/src/FSharp.VS.FSI/xlf/VFSIstrings.txt.de.xlf +++ b/vsintegration/src/FSharp.VS.FSI/xlf/VFSIstrings.txt.de.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.VS.FSI/xlf/VFSIstrings.txt.es.xlf b/vsintegration/src/FSharp.VS.FSI/xlf/VFSIstrings.txt.es.xlf index 8fafdfe73df..6f70641c13c 100644 --- a/vsintegration/src/FSharp.VS.FSI/xlf/VFSIstrings.txt.es.xlf +++ b/vsintegration/src/FSharp.VS.FSI/xlf/VFSIstrings.txt.es.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.VS.FSI/xlf/VFSIstrings.txt.fr.xlf b/vsintegration/src/FSharp.VS.FSI/xlf/VFSIstrings.txt.fr.xlf index 14025011c11..f3644c81583 100644 --- a/vsintegration/src/FSharp.VS.FSI/xlf/VFSIstrings.txt.fr.xlf +++ b/vsintegration/src/FSharp.VS.FSI/xlf/VFSIstrings.txt.fr.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.VS.FSI/xlf/VFSIstrings.txt.it.xlf b/vsintegration/src/FSharp.VS.FSI/xlf/VFSIstrings.txt.it.xlf index 5f2b1b679c9..aca7dcb66cc 100644 --- a/vsintegration/src/FSharp.VS.FSI/xlf/VFSIstrings.txt.it.xlf +++ b/vsintegration/src/FSharp.VS.FSI/xlf/VFSIstrings.txt.it.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.VS.FSI/xlf/VFSIstrings.txt.ko.xlf b/vsintegration/src/FSharp.VS.FSI/xlf/VFSIstrings.txt.ko.xlf index 5f01c48a662..74d6688a076 100644 --- a/vsintegration/src/FSharp.VS.FSI/xlf/VFSIstrings.txt.ko.xlf +++ b/vsintegration/src/FSharp.VS.FSI/xlf/VFSIstrings.txt.ko.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.VS.FSI/xlf/VFSIstrings.txt.pl.xlf b/vsintegration/src/FSharp.VS.FSI/xlf/VFSIstrings.txt.pl.xlf index 34a64865416..a0e55d73b01 100644 --- a/vsintegration/src/FSharp.VS.FSI/xlf/VFSIstrings.txt.pl.xlf +++ b/vsintegration/src/FSharp.VS.FSI/xlf/VFSIstrings.txt.pl.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.VS.FSI/xlf/VFSIstrings.txt.pt-BR.xlf b/vsintegration/src/FSharp.VS.FSI/xlf/VFSIstrings.txt.pt-BR.xlf index 50aff667659..ecd1ed58565 100644 --- a/vsintegration/src/FSharp.VS.FSI/xlf/VFSIstrings.txt.pt-BR.xlf +++ b/vsintegration/src/FSharp.VS.FSI/xlf/VFSIstrings.txt.pt-BR.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.VS.FSI/xlf/VFSIstrings.txt.ru.xlf b/vsintegration/src/FSharp.VS.FSI/xlf/VFSIstrings.txt.ru.xlf index c0b711f3b86..5bb16785316 100644 --- a/vsintegration/src/FSharp.VS.FSI/xlf/VFSIstrings.txt.ru.xlf +++ b/vsintegration/src/FSharp.VS.FSI/xlf/VFSIstrings.txt.ru.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.VS.FSI/xlf/VFSIstrings.txt.tr.xlf b/vsintegration/src/FSharp.VS.FSI/xlf/VFSIstrings.txt.tr.xlf index 6d80fb6bee6..9ad5f906371 100644 --- a/vsintegration/src/FSharp.VS.FSI/xlf/VFSIstrings.txt.tr.xlf +++ b/vsintegration/src/FSharp.VS.FSI/xlf/VFSIstrings.txt.tr.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.VS.FSI/xlf/VSPackage.cs.xlf b/vsintegration/src/FSharp.VS.FSI/xlf/VSPackage.cs.xlf index 94409a3ba83..05471435c84 100644 --- a/vsintegration/src/FSharp.VS.FSI/xlf/VSPackage.cs.xlf +++ b/vsintegration/src/FSharp.VS.FSI/xlf/VSPackage.cs.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.VS.FSI/xlf/VSPackage.de.xlf b/vsintegration/src/FSharp.VS.FSI/xlf/VSPackage.de.xlf index 6d23fd5f296..dba7119a85e 100644 --- a/vsintegration/src/FSharp.VS.FSI/xlf/VSPackage.de.xlf +++ b/vsintegration/src/FSharp.VS.FSI/xlf/VSPackage.de.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.VS.FSI/xlf/VSPackage.es.xlf b/vsintegration/src/FSharp.VS.FSI/xlf/VSPackage.es.xlf index 5dac8007e72..d81c9d111fe 100644 --- a/vsintegration/src/FSharp.VS.FSI/xlf/VSPackage.es.xlf +++ b/vsintegration/src/FSharp.VS.FSI/xlf/VSPackage.es.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.VS.FSI/xlf/VSPackage.fr.xlf b/vsintegration/src/FSharp.VS.FSI/xlf/VSPackage.fr.xlf index 13eee90d1bb..131836a088a 100644 --- a/vsintegration/src/FSharp.VS.FSI/xlf/VSPackage.fr.xlf +++ b/vsintegration/src/FSharp.VS.FSI/xlf/VSPackage.fr.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.VS.FSI/xlf/VSPackage.it.xlf b/vsintegration/src/FSharp.VS.FSI/xlf/VSPackage.it.xlf index 3663e52ff36..827a3f071a7 100644 --- a/vsintegration/src/FSharp.VS.FSI/xlf/VSPackage.it.xlf +++ b/vsintegration/src/FSharp.VS.FSI/xlf/VSPackage.it.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.VS.FSI/xlf/VSPackage.ja.xlf b/vsintegration/src/FSharp.VS.FSI/xlf/VSPackage.ja.xlf index e72e126b1fd..4fede981d4c 100644 --- a/vsintegration/src/FSharp.VS.FSI/xlf/VSPackage.ja.xlf +++ b/vsintegration/src/FSharp.VS.FSI/xlf/VSPackage.ja.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.VS.FSI/xlf/VSPackage.ko.xlf b/vsintegration/src/FSharp.VS.FSI/xlf/VSPackage.ko.xlf index 2cf2374c950..18358f87a30 100644 --- a/vsintegration/src/FSharp.VS.FSI/xlf/VSPackage.ko.xlf +++ b/vsintegration/src/FSharp.VS.FSI/xlf/VSPackage.ko.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.VS.FSI/xlf/VSPackage.pl.xlf b/vsintegration/src/FSharp.VS.FSI/xlf/VSPackage.pl.xlf index 5c93445d21f..c7fa3150e06 100644 --- a/vsintegration/src/FSharp.VS.FSI/xlf/VSPackage.pl.xlf +++ b/vsintegration/src/FSharp.VS.FSI/xlf/VSPackage.pl.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.VS.FSI/xlf/VSPackage.pt-BR.xlf b/vsintegration/src/FSharp.VS.FSI/xlf/VSPackage.pt-BR.xlf index 6eafbec312d..d3efcae6cbd 100644 --- a/vsintegration/src/FSharp.VS.FSI/xlf/VSPackage.pt-BR.xlf +++ b/vsintegration/src/FSharp.VS.FSI/xlf/VSPackage.pt-BR.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.VS.FSI/xlf/VSPackage.ru.xlf b/vsintegration/src/FSharp.VS.FSI/xlf/VSPackage.ru.xlf index 82128f9ce6f..7dff862c42b 100644 --- a/vsintegration/src/FSharp.VS.FSI/xlf/VSPackage.ru.xlf +++ b/vsintegration/src/FSharp.VS.FSI/xlf/VSPackage.ru.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.VS.FSI/xlf/VSPackage.tr.xlf b/vsintegration/src/FSharp.VS.FSI/xlf/VSPackage.tr.xlf index 0a0e2372fc3..1b88583f604 100644 --- a/vsintegration/src/FSharp.VS.FSI/xlf/VSPackage.tr.xlf +++ b/vsintegration/src/FSharp.VS.FSI/xlf/VSPackage.tr.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.VS.FSI/xlf/VSPackage.zh-Hans.xlf b/vsintegration/src/FSharp.VS.FSI/xlf/VSPackage.zh-Hans.xlf index 6a485bd6d2c..1db4c02f255 100644 --- a/vsintegration/src/FSharp.VS.FSI/xlf/VSPackage.zh-Hans.xlf +++ b/vsintegration/src/FSharp.VS.FSI/xlf/VSPackage.zh-Hans.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/src/FSharp.VS.FSI/xlf/VSPackage.zh-Hant.xlf b/vsintegration/src/FSharp.VS.FSI/xlf/VSPackage.zh-Hant.xlf index 68641900a27..792559d932c 100644 --- a/vsintegration/src/FSharp.VS.FSI/xlf/VSPackage.zh-Hant.xlf +++ b/vsintegration/src/FSharp.VS.FSI/xlf/VSPackage.zh-Hant.xlf @@ -1,4 +1,4 @@ - + diff --git a/vsintegration/tests/GetTypesVSUnitTests/GetTypesVSUnitTests.fsproj b/vsintegration/tests/GetTypesVSUnitTests/GetTypesVSUnitTests.fsproj index 1167ad2577c..68470cf046d 100644 --- a/vsintegration/tests/GetTypesVSUnitTests/GetTypesVSUnitTests.fsproj +++ b/vsintegration/tests/GetTypesVSUnitTests/GetTypesVSUnitTests.fsproj @@ -10,6 +10,8 @@ false true true + true + true @@ -19,6 +21,7 @@ + diff --git a/vsintegration/tests/MockTypeProviders/DefinitionLocationAttribute/DefinitionLocationAttribute.csproj b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttribute/DefinitionLocationAttribute.csproj index 0b2fc8a750b..f5f0216e9f8 100644 --- a/vsintegration/tests/MockTypeProviders/DefinitionLocationAttribute/DefinitionLocationAttribute.csproj +++ b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttribute/DefinitionLocationAttribute.csproj @@ -1,43 +1,17 @@  - - - $(MSBuildProjectDirectory)\..\..\..\..\src - CSharp - - + + - Debug - AnyCPU - 2.0 - {DA39AD38-4A58-47BF-9215-E49768295169} - Library - DefinitionLocationAttribute - DEBUG;TRACE;$(DefineConstants) - 4 - 0169;0067 - v4.5 - $(FSharpSourcesRoot)\..\$(Configuration)\$(TargetDotnetProfile)\bin\UnitTests\MockTypeProviders + net45 + - - - - {DED3BBD7-53F4-428A-8C9F-27968E768605} - FSharp.Core - + + - - - - - - - - - - \ No newline at end of file + diff --git a/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/DefinitionLocationAttributeFileDoesnotExist.csproj b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/DefinitionLocationAttributeFileDoesnotExist.csproj index cf8838f72ce..f5f0216e9f8 100644 --- a/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/DefinitionLocationAttributeFileDoesnotExist.csproj +++ b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/DefinitionLocationAttributeFileDoesnotExist.csproj @@ -1,41 +1,17 @@  - + + - $(MSBuildProjectDirectory)\..\..\..\..\src - CSharp - - - - Debug - AnyCPU - 2.0 - {8C2439BD-0E49-4929-A8B1-29CEE228191E} - Library - DefinitionLocationAttributeFileDoesnotExist - v4.5 - DEBUG;TRACE;$(DefineConstants) - 4 - 0169;0067 - $(FSharpSourcesRoot)\..\$(Configuration)\$(TargetDotnetProfile)\bin\UnitTests\MockTypeProviders + net45 + - - - - {DED3BBD7-53F4-428A-8C9F-27968E768605} - FSharp.Core - + + - - - - - - - - - \ No newline at end of file + + diff --git a/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/DefinitionLocationAttributeLineDoesnotExist.csproj b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/DefinitionLocationAttributeLineDoesnotExist.csproj index c4c480ee525..f5f0216e9f8 100644 --- a/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/DefinitionLocationAttributeLineDoesnotExist.csproj +++ b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/DefinitionLocationAttributeLineDoesnotExist.csproj @@ -1,41 +1,17 @@  - + + - $(MSBuildProjectDirectory)\..\..\..\..\src - CSharp - - - - Debug - AnyCPU - 2.0 - {F47196DC-186D-4055-BAF2-658282A12F33} - Library - DefinitionLocationAttributeLineDoesnotExist - 4 - 0169;0067 - DEBUG;TRACE;$(DefineConstants) - v4.5 - $(FSharpSourcesRoot)\..\$(Configuration)\$(TargetDotnetProfile)\bin\UnitTests\MockTypeProviders + net45 + - - - - {DED3BBD7-53F4-428A-8C9F-27968E768605} - FSharp.Core - + + - - - - - - - - + diff --git a/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/DefinitionLocationAttributeWithSpaceInTheType.csproj b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/DefinitionLocationAttributeWithSpaceInTheType.csproj index a02e9e3bfa9..f5f0216e9f8 100644 --- a/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/DefinitionLocationAttributeWithSpaceInTheType.csproj +++ b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/DefinitionLocationAttributeWithSpaceInTheType.csproj @@ -1,42 +1,17 @@  - - - $(MSBuildProjectDirectory)\..\..\..\..\src - CSharp - - + + - Debug - AnyCPU - 2.0 - {D4C88934-5893-467E-A55C-A11ECD6479FE} - Library - DefinitionLocationAttributeWithSpaceInTheType - 4 - 0169;0067 - DEBUG;TRACE;$(DefineConstants) - v4.5 - $(FSharpSourcesRoot)\..\$(Configuration)\$(TargetDotnetProfile)\bin\UnitTests\MockTypeProviders + net45 + - - - - {DED3BBD7-53F4-428A-8C9F-27968E768605} - FSharp.Core - + + - - - - - - - - - + diff --git a/vsintegration/tests/MockTypeProviders/Directory.Build.props b/vsintegration/tests/MockTypeProviders/Directory.Build.props index bb5b23d29d0..a1295702c08 100644 --- a/vsintegration/tests/MockTypeProviders/Directory.Build.props +++ b/vsintegration/tests/MockTypeProviders/Directory.Build.props @@ -1,3 +1,15 @@ - + + + + + + false + + + + + 0067;0169;1591 + + diff --git a/vsintegration/tests/MockTypeProviders/Directory.Build.targets b/vsintegration/tests/MockTypeProviders/Directory.Build.targets index bb5b23d29d0..4bc8389ec97 100644 --- a/vsintegration/tests/MockTypeProviders/Directory.Build.targets +++ b/vsintegration/tests/MockTypeProviders/Directory.Build.targets @@ -1,3 +1,4 @@ - + + diff --git a/vsintegration/tests/MockTypeProviders/DummyProviderForLanguageServiceTesting/DummyProviderForLanguageServiceTesting.fsproj b/vsintegration/tests/MockTypeProviders/DummyProviderForLanguageServiceTesting/DummyProviderForLanguageServiceTesting.fsproj index 05c38f1a8ae..0fb60c539a1 100644 --- a/vsintegration/tests/MockTypeProviders/DummyProviderForLanguageServiceTesting/DummyProviderForLanguageServiceTesting.fsproj +++ b/vsintegration/tests/MockTypeProviders/DummyProviderForLanguageServiceTesting/DummyProviderForLanguageServiceTesting.fsproj @@ -1,41 +1,21 @@  - + + - $(MSBuildProjectDirectory)\..\..\..\..\src - FSharp - true - - - - Debug - AnyCPU - 2.0 - {6AFF752D-E991-4A08-9ED2-5BF46B0E0F8B} - Library - DummyProviderForLanguageServiceTesting - LIBRARY - 58;75 - false - DEBUG;TRACE;$(DefineConstants) - v4.5 - true - $(FSharpSourcesRoot)\..\$(Configuration)\$(TargetDotnetProfile)\bin\UnitTests\MockTypeProviders + net45 + true + - - - - - {DED3BBD7-53F4-428A-8C9F-27968E768605} - FSharp.Core - + + - + \ No newline at end of file diff --git a/vsintegration/tests/MockTypeProviders/EditorHideMethodsAttribute/EditorHideMethodsAttribute.csproj b/vsintegration/tests/MockTypeProviders/EditorHideMethodsAttribute/EditorHideMethodsAttribute.csproj index 66baa3dfe19..f5f0216e9f8 100644 --- a/vsintegration/tests/MockTypeProviders/EditorHideMethodsAttribute/EditorHideMethodsAttribute.csproj +++ b/vsintegration/tests/MockTypeProviders/EditorHideMethodsAttribute/EditorHideMethodsAttribute.csproj @@ -1,41 +1,17 @@  - + + - $(MSBuildProjectDirectory)\..\..\..\..\src - CSharp - - - - Debug - AnyCPU - 2.0 - {0B9CDEAF-EE8F-45E0-A4E0-34A8ED6DD09E} - Library - EditorHideMethodsAttribute - 4 - 0169;0067 - DEBUG;TRACE;$(DefineConstants) - v4.5 - $(FSharpSourcesRoot)\..\$(Configuration)\$(TargetDotnetProfile)\bin\UnitTests\MockTypeProviders + net45 + - - - - {DED3BBD7-53F4-428A-8C9F-27968E768605} - FSharp.Core - + + - - - - - - - - + diff --git a/vsintegration/tests/MockTypeProviders/EmptyAssembly/EmptyAssembly.fsproj b/vsintegration/tests/MockTypeProviders/EmptyAssembly/EmptyAssembly.fsproj index be555283db8..5f0e7a69b63 100644 --- a/vsintegration/tests/MockTypeProviders/EmptyAssembly/EmptyAssembly.fsproj +++ b/vsintegration/tests/MockTypeProviders/EmptyAssembly/EmptyAssembly.fsproj @@ -1,38 +1,18 @@  - + + - $(MSBuildProjectDirectory)\..\..\..\..\src - FSharp - - - - Debug - AnyCPU - 2.0 - {004982c6-93ea-4e70-b4f0-be7d7219926a} - Library - EmptyAssembly - LIBRARY - False - 58;75 - false - DEBUG;TRACE;$(DefineConstants) - v4.5 - true - $(FSharpSourcesRoot)\..\$(Configuration)\$(TargetDotnetProfile)\bin\UnitTests\MockTypeProviders + net45 + true + - - - - - {DED3BBD7-53F4-428A-8C9F-27968E768605} - FSharp.Core - + + - - \ No newline at end of file + + diff --git a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithAdequateComment/XmlDocAttributeWithAdequateComment.csproj b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithAdequateComment/XmlDocAttributeWithAdequateComment.csproj index 865547fb515..f5f0216e9f8 100644 --- a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithAdequateComment/XmlDocAttributeWithAdequateComment.csproj +++ b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithAdequateComment/XmlDocAttributeWithAdequateComment.csproj @@ -1,41 +1,17 @@  - + + - $(MSBuildProjectDirectory)\..\..\..\..\src - CSharp - - - - Debug - AnyCPU - 2.0 - {243A81AC-A954-4601-833A-60EEEFB00FCD} - Library - XmlDocAttributeWithAdequateComment - 4 - 0169;0067 - DEBUG;TRACE;$(DefineConstants) - v4.5 - $(FSharpSourcesRoot)\..\$(Configuration)\$(TargetDotnetProfile)\bin\UnitTests\MockTypeProviders + net45 + - - - - {DED3BBD7-53F4-428A-8C9F-27968E768605} - FSharp.Core - + + - - - - - - - - + diff --git a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithEmptyComment/XmlDocAttributeWithEmptyComment.csproj b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithEmptyComment/XmlDocAttributeWithEmptyComment.csproj index 6c71fe60010..f5f0216e9f8 100644 --- a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithEmptyComment/XmlDocAttributeWithEmptyComment.csproj +++ b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithEmptyComment/XmlDocAttributeWithEmptyComment.csproj @@ -1,41 +1,17 @@  - + + - $(MSBuildProjectDirectory)\..\..\..\..\src - CSharp - - - - Debug - AnyCPU - 2.0 - {B4595EB6-053A-400E-AA1B-7727F1BC900F} - Library - XmlDocAttributeWithEmptyComment - 4 - 0169;0067 - DEBUG;TRACE;$(DefineConstants) - v4.5 - $(FSharpSourcesRoot)\..\$(Configuration)\$(TargetDotnetProfile)\bin\UnitTests\MockTypeProviders + net45 + - - - - {DED3BBD7-53F4-428A-8C9F-27968E768605} - FSharp.Core - + + - - - - - - - - + diff --git a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/XmlDocAttributeWithLocalizedComment.csproj b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/XmlDocAttributeWithLocalizedComment.csproj index 694fcd781e9..f5f0216e9f8 100644 --- a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/XmlDocAttributeWithLocalizedComment.csproj +++ b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/XmlDocAttributeWithLocalizedComment.csproj @@ -1,41 +1,17 @@  - + + - $(MSBuildProjectDirectory)\..\..\..\..\src - CSharp - - - - Debug - AnyCPU - 2.0 - {A559D7E8-7EFD-473A-B618-A10B41AB523B} - Library - XmlDocAttributeWithLocalizedComment - 4 - 0169;0067 - DEBUG;TRACE;$(DefineConstants) - v4.5 - $(FSharpSourcesRoot)\..\$(Configuration)\$(TargetDotnetProfile)\bin\UnitTests\MockTypeProviders + net45 + - - - - {DED3BBD7-53F4-428A-8C9F-27968E768605} - FSharp.Core - + + - - - - - - - - + diff --git a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLongComment/XmlDocAttributeWithLongComment.csproj b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLongComment/XmlDocAttributeWithLongComment.csproj index 90f90e87985..f5f0216e9f8 100644 --- a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLongComment/XmlDocAttributeWithLongComment.csproj +++ b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLongComment/XmlDocAttributeWithLongComment.csproj @@ -1,41 +1,17 @@  - + + - $(MSBuildProjectDirectory)\..\..\..\..\src - CSharp - - - - Debug - AnyCPU - 2.0 - {AC85EE6D-033C-45F9-B8BA-884BC22EC6D9} - Library - XmlDocAttributeWithLongComment - 4 - 0169;0067 - DEBUG;TRACE;$(DefineConstants) - v4.5 - $(FSharpSourcesRoot)\..\$(Configuration)\$(TargetDotnetProfile)\bin\UnitTests\MockTypeProviders + net45 + - - - - {DED3BBD7-53F4-428A-8C9F-27968E768605} - FSharp.Core - + + - - - - - - - - + diff --git a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithNullComment/XmlDocAttributeWithNullComment.csproj b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithNullComment/XmlDocAttributeWithNullComment.csproj index 525153bff63..f5f0216e9f8 100644 --- a/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithNullComment/XmlDocAttributeWithNullComment.csproj +++ b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithNullComment/XmlDocAttributeWithNullComment.csproj @@ -1,41 +1,17 @@  - + + - $(MSBuildProjectDirectory)\..\..\..\..\src - CSharp - - - - Debug - AnyCPU - 2.0 - {956BBE41-ABD1-4DBA-9F3B-BA1C9821C98C} - Library - XmlDocAttributeWithNullComment - 4 - 0169;0067 - DEBUG;TRACE;$(DefineConstants) - v4.5 - $(FSharpSourcesRoot)\..\$(Configuration)\$(TargetDotnetProfile)\bin\UnitTests\MockTypeProviders + net45 + - - - - {DED3BBD7-53F4-428A-8C9F-27968E768605} - FSharp.Core - + + - - - - - - - - + diff --git a/vsintegration/tests/Salsa/salsa.fs b/vsintegration/tests/Salsa/salsa.fs index 1dc47629103..9314dbf3662 100644 --- a/vsintegration/tests/Salsa/salsa.fs +++ b/vsintegration/tests/Salsa/salsa.fs @@ -43,13 +43,13 @@ module internal Salsa = { new System.IDisposable with member this.Dispose() = actuallyBuild <- true } member th.Results = capturedFlags, capturedSources - member th.Compile(compile:System.Converter, flags:string[], sources:string[]) = + member th.Compile(compile:System.Func, flags:string[], sources:string[]) = capturedFlags <- flags capturedSources <- sources if actuallyBuild then - compile.Invoke(0) + compile.Invoke() else - 0 + 0 interface ITaskHost type BuildResult = { @@ -633,9 +633,11 @@ module internal Salsa = Append " bin\Debug\" if versionFile<>null then Append (sprintf " %s" versionFile) if otherFlags<>null then Append (sprintf " %s --resolutions" otherFlags) - if targetFrameworkVersion<>null then - Append(sprintf " true") - Append(sprintf " %s" targetFrameworkVersion) +// if targetFrameworkVersion<>null then +// Append(sprintf " true") +// Append(sprintf " %s" targetFrameworkVersion) +// else + Append(sprintf " %s" "4.6.1") Append " " for disabledWarning in disabledWarnings do Append (sprintf " %s;" disabledWarning) diff --git a/vsintegration/tests/UnitTests/.gitignore b/vsintegration/tests/UnitTests/.gitignore new file mode 100644 index 00000000000..eabace925a5 --- /dev/null +++ b/vsintegration/tests/UnitTests/.gitignore @@ -0,0 +1 @@ +watson-test.exe diff --git a/vsintegration/tests/UnitTests/App.config b/vsintegration/tests/UnitTests/App.config index edefefae9c9..34d853e9f43 100644 --- a/vsintegration/tests/UnitTests/App.config +++ b/vsintegration/tests/UnitTests/App.config @@ -6,7 +6,7 @@ - + @@ -33,6 +33,12 @@ + + + + + + diff --git a/vsintegration/tests/UnitTests/CompletionProviderTests.fs b/vsintegration/tests/UnitTests/CompletionProviderTests.fs index 1d64eb28984..f73c57ce899 100644 --- a/vsintegration/tests/UnitTests/CompletionProviderTests.fs +++ b/vsintegration/tests/UnitTests/CompletionProviderTests.fs @@ -612,6 +612,34 @@ let _ = """ VerifyCompletionList(fileContents, " join", ["groupJoin"; "join"; "leftOuterJoin"; "joinLocal"], []) +[] +let ``Byref Extension Methods`` () = + let fileContents = """ +module Extensions = + open System + open System.Runtime.CompilerServices + + [] + type Message = Message of String + + [] + type MessageExtensions private () = + let (|Message|) (Message message) = message + + [] + static member Print (Message message : Message) = + printfn "%s" message + + [] + static member PrintRef (Message message : inref) = + printfn "%s" message + + let wrappedMessage = Message "Hello World" + + wrappedMessage. +""" + VerifyCompletionList(fileContents, "wrappedMessage.", ["PrintRef"], []) + #if EXE ShouldDisplaySystemNamespace() #endif diff --git a/vsintegration/tests/UnitTests/EditorFormattingServiceTests.fs b/vsintegration/tests/UnitTests/EditorFormattingServiceTests.fs index 82101256552..c1d043377d5 100644 --- a/vsintegration/tests/UnitTests/EditorFormattingServiceTests.fs +++ b/vsintegration/tests/UnitTests/EditorFormattingServiceTests.fs @@ -2,13 +2,10 @@ namespace Microsoft.VisualStudio.FSharp.Editor.Tests.Roslyn open System -open System.Threading open NUnit.Framework open Microsoft.CodeAnalysis -open Microsoft.CodeAnalysis.Classification -open Microsoft.CodeAnalysis.Editor open Microsoft.CodeAnalysis.Text open Microsoft.VisualStudio.FSharp.Editor open Microsoft.FSharp.Compiler.SourceCodeServices @@ -32,12 +29,11 @@ type EditorFormattingServiceTests() = ExtraProjectInfo = None Stamp = None } - //let parsingOptions: FSharpParsingOptions = let documentId = DocumentId.CreateNewId(ProjectId.CreateNewId()) let indentStyle = FormattingOptions.IndentStyle.Smart - let template = """ + let indentTemplate = """ let foo = [ 15 ]marker1 @@ -56,6 +52,18 @@ let def = "hi" )marker4 """ + + let pasteTemplate = """ + +let foo = + printfn "Something here" + marker1 + +marker2 + + marker3 + +marker4""" [] [] @@ -63,17 +71,162 @@ let def = [] member this.TestIndentation(marker: string, expectedLine: string) = let checker = FSharpChecker.Create() - let position = template.IndexOf(marker) + let position = indentTemplate.IndexOf(marker) Assert.IsTrue(position >= 0, "Precondition failed: unable to find marker in template") - let sourceText = SourceText.From(template) + let sourceText = SourceText.From(indentTemplate) let lineNumber = sourceText.Lines |> Seq.findIndex (fun line -> line.Span.Contains position) let parsingOptions, _ = checker.GetParsingOptionsFromProjectOptions projectOptions let changesOpt = FSharpEditorFormattingService.GetFormattingChanges(documentId, sourceText, filePath, checker, indentStyle, Some (parsingOptions, projectOptions), position) |> Async.RunSynchronously match changesOpt with | None -> Assert.Fail("Expected a text change, but got None") - | Some change -> - let changedText = sourceText.WithChanges(change) + | Some changes -> + let changedText = sourceText.WithChanges(changes) let lineText = changedText.Lines.[lineNumber].ToString() Assert.IsTrue(lineText.StartsWith(expectedLine), "Changed line does not start with expected text") + + [] + [] + [] + member this.TestPasteChanges_PastingOntoIndentedLine(enabled: bool, prefix: string) = + let checker = FSharpChecker.Create() + let parsingOptions, _ = checker.GetParsingOptionsFromProjectOptions projectOptions + + let clipboard = prefix + """[] + type SomeNameHere () = + member __.Test ()""" + + let start = """ + +let foo = + printfn "Something here" + $ + +somethingElseHere +""" + + let expected = """ + +let foo = + printfn "Something here" + [] + type SomeNameHere () = + member __.Test () + +somethingElseHere +""" + + let sourceText = SourceText.From(start.Replace("$", clipboard)) + let span = TextSpan(start.IndexOf '$', clipboard.Length) + + let formattingOptions = { FormatOnPaste = enabled } + + let changesOpt = + FSharpEditorFormattingService.GetPasteChanges(documentId, sourceText, filePath, formattingOptions, 4, parsingOptions, clipboard, span) + |> Async.RunSynchronously + |> Option.map List.ofSeq + + if enabled then + match changesOpt with + | Some changes -> + let changedText = sourceText.WithChanges(changes).ToString() + Assert.AreEqual(expected, changedText) + | _ -> Assert.Fail (sprintf "Expected text changes, but got %+A" changesOpt) + else + Assert.AreEqual(None, changesOpt, "Expected no changes as FormatOnPaste is disabled") + + [] + [] + member this.TestPasteChanges_PastingOntoEmptyLine(prefix: string) = + let checker = FSharpChecker.Create() + let parsingOptions, _ = checker.GetParsingOptionsFromProjectOptions projectOptions + + let clipboard = prefix + """[] + type SomeNameHere () = + member __.Test ()""" + + let start = """ +$ + +let foo = + printfn "Something here" + +somethingElseHere +""" + + let expected = """ +[] +type SomeNameHere () = + member __.Test () + +let foo = + printfn "Something here" + +somethingElseHere +""" + + let sourceText = SourceText.From(start.Replace("$", clipboard)) + let span = TextSpan(start.IndexOf '$', clipboard.Length) + + let formattingOptions = { FormatOnPaste = true } + + let changesOpt = + FSharpEditorFormattingService.GetPasteChanges(documentId, sourceText, filePath, formattingOptions, 4, parsingOptions, clipboard, span) + |> Async.RunSynchronously + |> Option.map List.ofSeq + + match changesOpt with + | Some changes -> + let changedText = sourceText.WithChanges(changes).ToString() + Assert.AreEqual(expected, changedText) + | _ -> Assert.Fail (sprintf "Expected a changes, but got %+A" changesOpt) + + [] + member this.TestPasteChanges_PastingWithAutoIndentationInPasteSpan() = + let checker = FSharpChecker.Create() + let parsingOptions, _ = checker.GetParsingOptionsFromProjectOptions projectOptions + + let clipboard = """[] + type SomeNameHere () = + member __.Test ()""" + + let start = """ + +let foo = + printfn "Something here" + $ + +somethingElseHere +""" + + let expected = """ + +let foo = + printfn "Something here" + [] + type SomeNameHere () = + member __.Test () + +somethingElseHere +""" + + let sourceText = SourceText.From(start.Replace("$", clipboard)) + + // If we're pasting on an empty line which has been automatically indented, + // then the pasted span includes this automatic indentation. Check that we + // still format as expected + let span = TextSpan(start.IndexOf '$' - 4, clipboard.Length + 4) + + let formattingOptions = { FormatOnPaste = true } + + let changesOpt = + FSharpEditorFormattingService.GetPasteChanges(documentId, sourceText, filePath, formattingOptions, 4, parsingOptions, clipboard, span) + |> Async.RunSynchronously + |> Option.map List.ofSeq + + match changesOpt with + | Some changes -> + let changedText = sourceText.WithChanges(changes).ToString() + Assert.AreEqual(expected, changedText) + | _ -> Assert.Fail (sprintf "Expected a changes, but got %+A" changesOpt) diff --git a/vsintegration/tests/UnitTests/HelpContextServiceTests.fs b/vsintegration/tests/UnitTests/HelpContextServiceTests.fs index da005db0d09..76b918d0fad 100644 --- a/vsintegration/tests/UnitTests/HelpContextServiceTests.fs +++ b/vsintegration/tests/UnitTests/HelpContextServiceTests.fs @@ -234,7 +234,7 @@ type HelpContextServiceTests() = Some "N1" ] this.TestF1Keywords(keywords, file, - addtlRefAssy = [PathRelativeToTestAssembly(@"UnitTests\MockTypeProviders\DummyProviderForLanguageServiceTesting.dll")]) + addtlRefAssy = [PathRelativeToTestAssembly(@"DummyProviderForLanguageServiceTesting.dll")]) [] [] @@ -252,7 +252,7 @@ type HelpContextServiceTests() = Some "N1.T" ] this.TestF1Keywords(keywords, file, - addtlRefAssy = [PathRelativeToTestAssembly(@"UnitTests\MockTypeProviders\DummyProviderForLanguageServiceTesting.dll")]) + addtlRefAssy = [PathRelativeToTestAssembly(@"DummyProviderForLanguageServiceTesting.dll")]) [] member public this.``EndOfLine``() = diff --git a/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.Completion.fs b/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.Completion.fs index a16adb7450f..c72825d1ee4 100644 --- a/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.Completion.fs +++ b/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.Completion.fs @@ -225,7 +225,7 @@ type UsingMSBuild() as this = member public this.TestCompletionNotShowingWhenFastUpdate (firstSrc : list) secondSrc marker = let (_, _, file) = this.CreateSingleFileProject(firstSrc) MoveCursorToEndOfMarker(file,marker) - + // Now delete the property and leave only dot at the end // - user is typing fast so replac the content without background compilation ReplaceFileInMemoryWithoutCoffeeBreak file secondSrc @@ -243,21 +243,20 @@ type UsingMSBuild() as this = let (solution, project, file) = this.CreateSingleFileProject(fileContents) let completions = DotCompletionAtEndOfMarker file marker AssertCompListContainsAll(completions, list) - + //DoesNotContainAny At Start Of Marker Helper Function member private this.VerifyDotCompListDoesNotContainAnyAtStartOfMarker(fileContents : string, marker : string, list : string list, ?addtlRefAssy : list) = let (solution, project, file) = this.CreateSingleFileProject(fileContents, ?references = addtlRefAssy) let completions = DotCompletionAtStartOfMarker file marker AssertCompListDoesNotContainAny(completions, list) - + //DotCompList Is Empty At Start Of Marker Helper Function member private this.VerifyDotCompListIsEmptyAtStartOfMarker(fileContents : string, marker : string, ?addtlRefAssy : list) = let (solution, project, file) = this.CreateSingleFileProject(fileContents, ?references = addtlRefAssy) let completions = DotCompletionAtStartOfMarker file marker - AssertCompListIsEmpty(completions) - + AssertCompListIsEmpty(completions) [] member this.``AutoCompletion.ObjectMethods``() = @@ -365,7 +364,7 @@ a. [] [] member this.``TypeProvider.VisibilityChecksForGeneratedTypes``() = - let extraRefs = [PathRelativeToTestAssembly(@"UnitTests\MockTypeProviders\DummyProviderForLanguageServiceTesting.dll")] + let extraRefs = [PathRelativeToTestAssembly(@"DummyProviderForLanguageServiceTesting.dll")] let check = DoWithAutoCompleteUsingExtraRefs extraRefs true SourceFileKind.FS Microsoft.VisualStudio.FSharp.LanguageService.BackgroundRequestReason.MemberSelect let code = @@ -2200,7 +2199,7 @@ let x = new MyClass2(0) t.I"""], marker = "t.I", expected = "IM1", - addtlRefAssy = [PathRelativeToTestAssembly(@"UnitTests\MockTypeProviders\DummyProviderForLanguageServiceTesting.dll")]) + addtlRefAssy = [PathRelativeToTestAssembly(@"DummyProviderForLanguageServiceTesting.dll")]) [] [] @@ -2213,7 +2212,7 @@ let x = new MyClass2(0) t.Eve"""], marker = "t.Eve", expected = "Event1", - addtlRefAssy = [PathRelativeToTestAssembly(@"UnitTests\MockTypeProviders\EditorHideMethodsAttribute.dll")]) + addtlRefAssy = [PathRelativeToTestAssembly(@"EditorHideMethodsAttribute.dll")]) [] [] @@ -2225,7 +2224,7 @@ let x = new MyClass2(0) type boo = N1.T() let successes = ResizeArray<_>() let failures = ResizeArray<_>() printfn "Running %d systematic tests.... Failure will be printed if it occurs..." tests.Length for (lineName, suffixName, suffixText, builderName, fileContents, check, expectedToFail) in tests do - if successes.Count % 50 = 0 then + if successes.Count % 50 = 0 then printfn "Making progress, run %d so far..." successes.Count let fileContents = prefix + fileContents + suffixText - try - match check with - | QuickInfoExpected(where,expected) -> + try + match check with + | QuickInfoExpected(where,expected) -> let where = where.[0..where.Length-2] // chop a character off to get in the middle of the text this.AssertQuickInfoContainsAtEndOfMarker(fileContents,where,expected,addtlRefAssy=standard40AssemblyRefs ) - | AutoCompleteExpected(where,expected) -> + | AutoCompleteExpected(where,expected) -> this.VerifyCtrlSpaceListContainAllAtStartOfMarker(fileContents,where,[expected],addtlRefAssy=standard40AssemblyRefs ) - | DotCompleteExpected(where,expected) -> + | DotCompleteExpected(where,expected) -> this.VerifyDotCompListContainAllAtStartOfMarker(fileContents,where,[expected], addtlRefAssy=standard40AssemblyRefs) if not expectedToFail then successes.Add(lineName,suffixName,builderName,check) else unexpectedSuccesses.Add(lineName,suffixName,builderName,check) - with _ -> + with e -> + printfn "Exception thrown: (\"%s\", \"%s\", \"%s\", %A) " lineName suffixName builderName check if not expectedToFail then printfn " FAILURE on systematic test: (\"%s\", \"%s\", \"%s\", %A) " lineName suffixName builderName check printfn "\n\nfileContents = <<<%s>>>" fileContents @@ -2491,8 +2491,6 @@ let x = new MyClass2(0) if failures.Count <> 0 || unexpectedSuccesses.Count <> 0 then raise <| new Exception("there were unexpected results, see console output for details") - - [] [] [] @@ -2510,50 +2508,48 @@ let aaaaaa = [| "1" |] "NoClosingBrace,NextTypeDefinition", " \ntype NextDefinition() = member x.P = 1\n" ] let lines b = - [ "L1", "let v = " + b + " { " , [] - "L2", "let v = " + b + " { for " , [] - "L3", "let v = " + b + " { for bbbb " , [QI "for bbbb" "val bbbb"] - "L4", "let v = " + b + " { for bbbb in (*C*)" , [QI "for bbbb" "val bbbb"; AC "(*C*)" "aaaaaa" ] - "L5", "let v = " + b + " { for bbbb in [ (*C*) " , [QI "for bbbb" "val bbbb"; AC "(*C*)" "aaaaaa" ] - "L6", "let v = " + b + " { for bbbb in [ aaa(*C*) " , [QI "for bbbb" "val bbbb"; AC "(*C*)" "aaaaaa" ] - "L7", "let v = " + b + " { for bbbb in [ aaaaaa(*D1*)" , [QI "for bbbb" "val bbbb"; QI "aaaaaa" "val aaaaaa"; DC "(*D1*)" "Length" ] - "L8", "let v = " + b + " { for bbbb in [ aaaaaa(*D1*) ] " , [QI "for bbbb" "val bbbb"; QI "aaaaaa" "val aaaaaa"; DC "(*D1*)" "Length" ] - "L9", "let v = " + b + " { for bbbb in [ aaaaaa(*D1*) ] do (*C*)" , [QI "for bbbb" "val bbbb"; QI "aaaaaa" "val aaaaaa"; AC "(*C*)" (if b = "query" then "select" else "sin"); DC "(*D1*)" "Length" ] - "L10", "let v = " + b + " { for bbbb in [ aaaaaa(*D1*) ] do yield (*C*) " , [QI "for bbbb" "val bbbb"; QI "aaaaaa" "val aaaaaa"; AC "(*C*)" "aaaaaa"; AC "(*C*)" "bbbb" ; DC "(*D1*)" "Length" ] - "L11", "let v = " + b + " { for bbbb in [ aaaaaa(*D1*) ] do yield bb(*C*) " , [QI "for bbbb" "val bbbb"; QI "aaaaaa" "val aaaaaa"; AC "(*C*)" "bbbb" ; DC "(*D1*)" "Length" ] - "L12", "let v = " + b + " { for bbbb in [ aaaaaa(*D1*) ] do yield bbbb(*D2*) " , [QI "for bbbb" "val bbbb"; QI "aaaaaa" "val aaaaaa"; QI "yield bbbb" "val bbbb"; DC "(*D1*)" "Length" ; DC "(*D2*)" "Length" ] - "L13", "let v = " + b + " { for bbbb in [ aaaaaa(*D1*) ] do yield bbbb(*D2*) + (*C*)" , [QI "for bbbb" "val bbbb"; QI "aaaaaa" "val aaaaaa"; QI "yield bbbb" "val bbbb"; AC "(*C*)" "aaaaaa"; AC "(*C*)" "bbbb" ; DC "(*D1*)" "Length" ; DC "(*D2*)" "Length" ] - "L14", "let v = " + b + " { for bbbb in [ aaaaaa(*D1*) ] do yield bbbb(*D2*) + bb(*C*)" , [QI "for bbbb" "val bbbb"; QI "aaaaaa" "val aaaaaa"; QI "yield bbbb" "val bbbb"; AC "(*C*)" "bbbb" ; DC "(*D1*)" "Length" ; DC "(*D2*)" "Length" ] - "L15", "let v = " + b + " { for bbbb in [ aaaaaa(*D1*) ] do yield bbbb(*D2*) + bbbb(*D3*)" , [QI "for bbbb" "val bbbb"; QI "aaaaaa" "val aaaaaa"; QI "yield bbbb" "val bbbb"; QI "+ bbbb" "val bbbb"; DC "(*D3*)" "Length" ] ] + [ "AL1", "let v = " + b + " { " , [] + "AL2", "let v = " + b + " { for " , [] + "AL3", "let v = " + b + " { for bbbb " , [QI "for bbbb" "val bbbb"] + "AL4", "let v = " + b + " { for bbbb in (*C*)" , [QI "for bbbb" "val bbbb"; AC "(*C*)" "aaaaaa" ] + "AL5", "let v = " + b + " { for bbbb in [ (*C*) " , [QI "for bbbb" "val bbbb"; AC "(*C*)" "aaaaaa" ] + "AL6", "let v = " + b + " { for bbbb in [ aaa(*C*) " , [QI "for bbbb" "val bbbb"; AC "(*C*)" "aaaaaa" ] + "AL7", "let v = " + b + " { for bbbb in [ aaaaaa(*D1*)" , [QI "for bbbb" "val bbbb"; QI "aaaaaa" "val aaaaaa"; DC "(*D1*)" "Length" ] + "AL8", "let v = " + b + " { for bbbb in [ aaaaaa(*D1*) ] " , [QI "for bbbb" "val bbbb"; QI "aaaaaa" "val aaaaaa"; DC "(*D1*)" "Length" ] + "AL9", "let v = " + b + " { for bbbb in [ aaaaaa(*D1*) ] do (*C*)" , [QI "for bbbb" "val bbbb"; QI "aaaaaa" "val aaaaaa"; AC "(*C*)" (if b = "query" then "select" else "sin"); DC "(*D1*)" "Length" ] + "AL10", "let v = " + b + " { for bbbb in [ aaaaaa(*D1*) ] do yield (*C*) " , [QI "for bbbb" "val bbbb"; QI "aaaaaa" "val aaaaaa"; AC "(*C*)" "aaaaaa"; AC "(*C*)" "bbbb" ; DC "(*D1*)" "Length" ] + "AL11", "let v = " + b + " { for bbbb in [ aaaaaa(*D1*) ] do yield bb(*C*) " , [QI "for bbbb" "val bbbb"; QI "aaaaaa" "val aaaaaa"; AC "(*C*)" "bbbb" ; DC "(*D1*)" "Length" ] + "AL12", "let v = " + b + " { for bbbb in [ aaaaaa(*D1*) ] do yield bbbb(*D2*) " , [QI "for bbbb" "val bbbb"; QI "aaaaaa" "val aaaaaa"; QI "yield bbbb" "val bbbb"; DC "(*D1*)" "Length" ; DC "(*D2*)" "Length" ] + "AL13", "let v = " + b + " { for bbbb in [ aaaaaa(*D1*) ] do yield bbbb(*D2*) + (*C*)" , [QI "for bbbb" "val bbbb"; QI "aaaaaa" "val aaaaaa"; QI "yield bbbb" "val bbbb"; AC "(*C*)" "aaaaaa"; AC "(*C*)" "bbbb" ; DC "(*D1*)" "Length" ; DC "(*D2*)" "Length" ] + "AL14", "let v = " + b + " { for bbbb in [ aaaaaa(*D1*) ] do yield bbbb(*D2*) + bb(*C*)" , [QI "for bbbb" "val bbbb"; QI "aaaaaa" "val aaaaaa"; QI "yield bbbb" "val bbbb"; AC "(*C*)" "bbbb" ; DC "(*D1*)" "Length" ; DC "(*D2*)" "Length" ] + "AL15", "let v = " + b + " { for bbbb in [ aaaaaa(*D1*) ] do yield bbbb(*D2*) + bbbb(*D3*)" , [QI "for bbbb" "val bbbb"; QI "aaaaaa" "val aaaaaa"; QI "yield bbbb" "val bbbb"; QI "+ bbbb" "val bbbb"; DC "(*D3*)" "Length" ] ] let knownFailures = - [ - ("L10", "Empty", "seq", AutoCompleteExpected ("(*C*)","bbbb")) - ("L10", "Empty", "query", AutoCompleteExpected ("(*C*)","bbbb")) - ("L10", "ClosingBrace", "query", AutoCompleteExpected ("(*C*)","bbbb")) - ("L10", "ClosingBrace,NextDefinition", "query", AutoCompleteExpected ("(*C*)","bbbb")) - ("L3", "NoClosingBrace,NextDefinition", "seq", QuickInfoExpected ("for bbbb","val bbbb")) - ("L6", "NoClosingBrace,NextDefinition", "seq", QuickInfoExpected ("for bbbb","val bbbb")) - ("L6", "NoClosingBrace,NextDefinition", "seq", AutoCompleteExpected ("(*C*)","aaaaaa")) - ("L7", "NoClosingBrace,NextDefinition", "seq", QuickInfoExpected ("for bbbb","val bbbb")) - ("L7", "NoClosingBrace,NextDefinition", "seq", QuickInfoExpected ("aaaaaa","val aaaaaa")) - ("L7", "NoClosingBrace,NextDefinition", "seq", DotCompleteExpected ("(*D1*)","Length")) - ("L3", "NoClosingBrace,NextDefinition", "query", QuickInfoExpected ("for bbbb","val bbbb")) - ("L6", "NoClosingBrace,NextDefinition", "query", QuickInfoExpected ("for bbbb","val bbbb")) - ("L6", "NoClosingBrace,NextDefinition", "query", AutoCompleteExpected ("(*C*)","aaaaaa")) - ("L7", "NoClosingBrace,NextDefinition", "query", QuickInfoExpected ("for bbbb","val bbbb")) - ("L7", "NoClosingBrace,NextDefinition", "query", QuickInfoExpected ("aaaaaa","val aaaaaa")) - ("L7", "NoClosingBrace,NextDefinition", "query", DotCompleteExpected ("(*D1*)","Length")) - ("L10", "NoClosingBrace,NextDefinition", "seq", AutoCompleteExpected ("(*C*)","bbbb")) - ("L10", "NoClosingBrace,NextTypeDefinition", "seq", AutoCompleteExpected ("(*C*)","bbbb")) - ("L10", "NoClosingBrace,NextDefinition", "query", AutoCompleteExpected ("(*C*)","bbbb")) - ("L10", "NoClosingBrace,NextTypeDefinition", "query", AutoCompleteExpected ("(*C*)","bbbb")) + ("AL3", "NoClosingBrace,NextDefinition", "query", QuickInfoExpected ("for bbbb","val bbbb")) + ("AL3", "NoClosingBrace,NextDefinition", "seq", QuickInfoExpected ("for bbbb","val bbbb")) + ("AL6", "NoClosingBrace,NextDefinition", "query", AutoCompleteExpected ("(*C*)","aaaaaa")) + ("AL6", "NoClosingBrace,NextDefinition", "query", QuickInfoExpected ("for bbbb","val bbbb")) + ("AL6", "NoClosingBrace,NextDefinition", "seq", AutoCompleteExpected ("(*C*)","aaaaaa")) + ("AL6", "NoClosingBrace,NextDefinition", "seq", QuickInfoExpected ("for bbbb","val bbbb")) + ("AL7", "NoClosingBrace,NextDefinition", "query", DotCompleteExpected ("(*D1*)","Length")) + ("AL7", "NoClosingBrace,NextDefinition", "query", QuickInfoExpected ("aaaaaa","val aaaaaa")) + ("AL7", "NoClosingBrace,NextDefinition", "query", QuickInfoExpected ("for bbbb","val bbbb")) + ("AL7", "NoClosingBrace,NextDefinition", "seq", DotCompleteExpected ("(*D1*)","Length")) + ("AL7", "NoClosingBrace,NextDefinition", "seq", QuickInfoExpected ("aaaaaa","val aaaaaa")) + ("AL7", "NoClosingBrace,NextDefinition", "seq", QuickInfoExpected ("for bbbb","val bbbb")) + ("AL10", "ClosingBrace", "query", AutoCompleteExpected ("(*C*)","bbbb")) + ("AL10", "ClosingBrace,NextDefinition", "query", AutoCompleteExpected ("(*C*)","bbbb")) + ("AL10", "Empty", "query", AutoCompleteExpected ("(*C*)","bbbb")) + ("AL10", "Empty", "seq", AutoCompleteExpected ("(*C*)","bbbb")) + ("AL10", "NoClosingBrace,NextDefinition", "query", AutoCompleteExpected ("(*C*)","bbbb")) + ("AL10", "NoClosingBrace,NextDefinition", "seq", AutoCompleteExpected ("(*C*)","bbbb")) + ("AL10", "NoClosingBrace,NextTypeDefinition", "query", AutoCompleteExpected ("(*C*)","bbbb")) + ("AL10", "NoClosingBrace,NextTypeDefinition", "seq", AutoCompleteExpected ("(*C*)","bbbb")) ] this.WordByWordSystematicTestWithSpecificExpectations(prefix, suffixes, lines, ["seq";"query"], knownFailures) - [] [] @@ -2574,20 +2570,20 @@ let aaaaaa = 0 "NoClosingBrace,NextTypeDefinition", " \ntype NextDefinition() = member x.P = 1\n" ] let lines b = - [ "L1", "let f() = seq { while abb(*C*)" , [AC "(*C*)" "abbbbc"] - "L2", "let f() = seq { while abbbbc(*D1*)" , [QI "while abbbbc" "val abbbbc"; DC "(*D1*)" "Length"] - "L3", "let f() = seq { while abbbbc(*D1*) do (*C*)" , [QI "while abbbbc" "val abbbbc"; DC "(*D1*)" "Length"; AC "(*C*)" "abbbbc"] - "L4", "let f() = seq { while abbbbc(*D1*) do abb(*C*)" , [QI "while abbbbc" "val abbbbc"; DC "(*D1*)" "Length"; AC "(*C*)" "abbbbc"] - "L5", "let f() = seq { while abbbbc(*D1*) do abbbbc(*D2*)" , [QI "while abbbbc" "val abbbbc"; DC "(*D1*)" "Length"; QI "do abbbbc" "val abbbbc"; DC "(*D2*)" "Length"; ] - "L6", "let f() = seq { while abbbbc(*D1*) do abbbbc.[(*C*)" , [QI "while abbbbc" "val abbbbc"; DC "(*D1*)" "Length"; QI "do abbbbc" "val abbbbc"; AC "(*C*)" "abbbbc"; AC "(*C*)" "aaaaaa"; ] - "L7", "let f() = seq { while abbbbc(*D1*) do abbbbc.[aaa(*C*)" , [QI "while abbbbc" "val abbbbc"; DC "(*D1*)" "Length"; QI "do abbbbc" "val abbbbc"; AC "(*C*)" "aaaaaa"; ] - "L7a", "let f() = seq { while abbbbc(*D1*) do abbbbc.[aaa(*C*)]" , [QI "while abbbbc" "val abbbbc"; DC "(*D1*)" "Length"; QI "do abbbbc" "val abbbbc"; AC "(*C*)" "aaaaaa"; ] - "L7b", "let f() = seq { while abbbbc(*D1*) do abbbbc.[aaa(*C*)] <- " , [QI "while abbbbc" "val abbbbc"; DC "(*D1*)" "Length"; QI "do abbbbc" "val abbbbc"; AC "(*C*)" "aaaaaa"; ] - "L7c", "let f() = seq { while abbbbc(*D1*) do abbbbc.[aaa(*C*)] <- 1" , [QI "while abbbbc" "val abbbbc"; DC "(*D1*)" "Length"; QI "do abbbbc" "val abbbbc"; AC "(*C*)" "aaaaaa"; ] - "L7d", "let f() = seq { while abbbbc(*D1*) do abbbbc.[ (*C*) ] <- 1" , [QI "while abbbbc" "val abbbbc"; DC "(*D1*)" "Length"; QI "do abbbbc" "val abbbbc"; AC "(*C*)" "aaaaaa"; ] - "L8", "let f() = seq { while abbbbc(*D1*) do abbbbc.[aaaaaa]" , [QI "while abbbbc" "val abbbbc"; DC "(*D1*)" "Length"; QI "do abbbbc" "val abbbbc"; ] - "L9", "let f() = seq { while abbbbc(*D1*) do abbbbc.[aaaaaa] <- (*C*)" , [QI "while abbbbc" "val abbbbc"; DC "(*D1*)" "Length"; QI "do abbbbc" "val abbbbc"; AC "(*C*)" "abbbbc"; AC "(*C*)" "aaaaaa"; ] - "L10", "let f() = seq { while abbbbc(*D1*) do abbbbc.[aaaaaa] <- aaa(*C*)" , [QI "while abbbbc" "val abbbbc"; DC "(*D1*)" "Length"; QI "do abbbbc" "val abbbbc"; AC "(*C*)" "aaaaaa"; ] ] + [ "BL1", "let f() = seq { while abb(*C*)" , [AC "(*C*)" "abbbbc"] + "BL2", "let f() = seq { while abbbbc(*D1*)" , [QI "while abbbbc" "val abbbbc"; DC "(*D1*)" "Length"] + "BL3", "let f() = seq { while abbbbc(*D1*) do (*C*)" , [QI "while abbbbc" "val abbbbc"; DC "(*D1*)" "Length"; AC "(*C*)" "abbbbc"] + "BL4", "let f() = seq { while abbbbc(*D1*) do abb(*C*)" , [QI "while abbbbc" "val abbbbc"; DC "(*D1*)" "Length"; AC "(*C*)" "abbbbc"] + "BL5", "let f() = seq { while abbbbc(*D1*) do abbbbc(*D2*)" , [QI "while abbbbc" "val abbbbc"; DC "(*D1*)" "Length"; QI "do abbbbc" "val abbbbc"; DC "(*D2*)" "Length"; ] + "BL6", "let f() = seq { while abbbbc(*D1*) do abbbbc.[(*C*)" , [QI "while abbbbc" "val abbbbc"; DC "(*D1*)" "Length"; QI "do abbbbc" "val abbbbc"; AC "(*C*)" "abbbbc"; AC "(*C*)" "aaaaaa"; ] + "BL7", "let f() = seq { while abbbbc(*D1*) do abbbbc.[aaa(*C*)" , [QI "while abbbbc" "val abbbbc"; DC "(*D1*)" "Length"; QI "do abbbbc" "val abbbbc"; AC "(*C*)" "aaaaaa"; ] + "BL7a", "let f() = seq { while abbbbc(*D1*) do abbbbc.[aaa(*C*)]" , [QI "while abbbbc" "val abbbbc"; DC "(*D1*)" "Length"; QI "do abbbbc" "val abbbbc"; AC "(*C*)" "aaaaaa"; ] + "BL7b", "let f() = seq { while abbbbc(*D1*) do abbbbc.[aaa(*C*)] <- " , [QI "while abbbbc" "val abbbbc"; DC "(*D1*)" "Length"; QI "do abbbbc" "val abbbbc"; AC "(*C*)" "aaaaaa"; ] + "BL7c", "let f() = seq { while abbbbc(*D1*) do abbbbc.[aaa(*C*)] <- 1" , [QI "while abbbbc" "val abbbbc"; DC "(*D1*)" "Length"; QI "do abbbbc" "val abbbbc"; AC "(*C*)" "aaaaaa"; ] + "BL7d", "let f() = seq { while abbbbc(*D1*) do abbbbc.[ (*C*) ] <- 1" , [QI "while abbbbc" "val abbbbc"; DC "(*D1*)" "Length"; QI "do abbbbc" "val abbbbc"; AC "(*C*)" "aaaaaa"; ] + "BL8", "let f() = seq { while abbbbc(*D1*) do abbbbc.[aaaaaa]" , [QI "while abbbbc" "val abbbbc"; DC "(*D1*)" "Length"; QI "do abbbbc" "val abbbbc"; ] + "BL9", "let f() = seq { while abbbbc(*D1*) do abbbbc.[aaaaaa] <- (*C*)" , [QI "while abbbbc" "val abbbbc"; DC "(*D1*)" "Length"; QI "do abbbbc" "val abbbbc"; AC "(*C*)" "abbbbc"; AC "(*C*)" "aaaaaa"; ] + "BL10", "let f() = seq { while abbbbc(*D1*) do abbbbc.[aaaaaa] <- aaa(*C*)" , [QI "while abbbbc" "val abbbbc"; DC "(*D1*)" "Length"; QI "do abbbbc" "val abbbbc"; AC "(*C*)" "aaaaaa"; ] ] let knownFailures = [ @@ -2615,44 +2611,39 @@ let aaaaaa = 0 "NoClosingBrace,NextTypeDefinition", " \ntype NextDefinition() = member x.P = 1\n" ] let lines b = - [ "L1", "let x = query { for bbbb in abbbbc(*D0*) do join " , [QI "for bbbb" "val bbbb"; QI "in abbbbc" "val abbbbc"; DC "(*D0*)" "Length"; QI "join" "join"] - "L2", "let x = query { for bbbb in abbbbc(*D0*) do join cccc " , [QI "for bbbb" "val bbbb"; QI "in abbbbc" "val abbbbc"; DC "(*D0*)" "Length"; QI "join" "join"] - "L2a", "let x = query { for bbbb in abbbbc(*D0*) do join cccc )" , [QI "for bbbb" "val bbbb"; QI "in abbbbc" "val abbbbc"; DC "(*D0*)" "Length"; QI "join" "join"] - "L3", "let x = query { for bbbb in abbbbc(*D0*) do join cccc in " , [QI "for bbbb" "val bbbb"; QI "in abbbbc" "val abbbbc"; DC "(*D0*)" "Length"; QI "join" "join"] - "L3a", "let x = query { for bbbb in abbbbc(*D0*) do join cccc in )" , [QI "for bbbb" "val bbbb"; QI "in abbbbc" "val abbbbc"; DC "(*D0*)" "Length"; QI "join" "join"] - "L4", "let x = query { for bbbb in abbbbc(*D0*) do join cccc in abbb(*C*)" , [QI "for bbbb" "val bbbb"; QI "in abbbbc" "val abbbbc"; DC "(*D0*)" "Length";QI "join" "join"; AC "(*C*)" "abbbbc"] - "L4a", "let x = query { for bbbb in abbbbc(*D0*) do join cccc in abbb(*C*) )" , [QI "for bbbb" "val bbbb"; QI "in abbbbc" "val abbbbc"; DC "(*D0*)" "Length";QI "join" "join"; AC "(*C*)" "abbbbc"] - "L5", "let x = query { for bbbb in abbbbc(*D0*) do join cccc in abbbbc(*D1*)" , [QI "for bbbb" "val bbbb"; QI "in abbbbc" "val abbbbc"; DC "(*D0*)" "Length"; QI "join" "join"; DC "(*D1*)" "Length"] - "L5a", "let x = query { for bbbb in abbbbc(*D0*) do join cccc in abbbbc(*D1*) )" , [QI "for bbbb" "val bbbb"; QI "in abbbbc" "val abbbbc"; DC "(*D0*)" "Length"; QI "join" "join"; DC "(*D1*)" "Length"] - "L6", "let x = query { for bbbb in abbbbc(*D0*) do join cccc in abbbbc(*D1*) on " , [QI "for bbbb" "val bbbb"; QI "in abbbbc" "val abbbbc"; DC "(*D0*)" "Length"; QI "join" "join"; DC "(*D1*)" "Length"] - "L6a", "let x = query { for bbbb in abbbbc(*D0*) do join cccc in abbbbc(*D1*) on )" , [QI "for bbbb" "val bbbb"; QI "in abbbbc" "val abbbbc"; DC "(*D0*)" "Length"; QI "join" "join"; DC "(*D1*)" "Length"] - "L6b", "let x = query { for bbbb in abbbbc(*D0*) do join cccc in abbbbc(*D1*) on (bb(*C*)" , [QI "for bbbb" "val bbbb"; QI "in abbbbc" "val abbbbc"; DC "(*D0*)" "Length"; QI "join" "join"; DC "(*D1*)" "Length"; AC "(*C*)" "bbbb"] - "L7", "let x = query { for bbbb in abbbbc(*D0*) do join cccc in abbbbc(*D1*) on (bbbb" , [QI "for bbbb" "val bbbb"; QI "in abbbbc" "val abbbbc"; DC "(*D0*)" "Length"; QI "join" "join"; DC "(*D1*)" "Length"] - "L7a", "let x = query { for bbbb in abbbbc(*D0*) do join cccc in abbbbc(*D1*) on (bbbb )" , [QI "for bbbb" "val bbbb"; QI "in abbbbc" "val abbbbc"; DC "(*D0*)" "Length"; QI "join" "join"; DC "(*D1*)" "Length"] - "L8", "let x = query { for bbbb in abbbbc(*D0*) do join cccc in abbbbc(*D1*) on (bbbb = " , [QI "for bbbb" "val bbbb"; QI "in abbbbc" "val abbbbc"; DC "(*D0*)" "Length"; QI "join" "join"; DC "(*D1*)" "Length"] - "L8a", "let x = query { for bbbb in abbbbc(*D0*) do join cccc in abbbbc(*D1*) on (bbbb = )" , [QI "for bbbb" "val bbbb"; QI "in abbbbc" "val abbbbc"; DC "(*D0*)" "Length"; QI "join" "join"; DC "(*D1*)" "Length"] - "L8b", "let x = query { for bbbb in abbbbc(*D0*) do join cccc in abbbbc(*D1*) on (bbbb = cc(*C*)" , [QI "for bbbb" "val bbbb"; QI "in abbbbc" "val abbbbc"; DC "(*D0*)" "Length"; QI "join" "join"; DC "(*D1*)" "Length"; AC "(*C*)" "cccc"] - "L9", "let x = query { for bbbb in abbbbc(*D0*) do join cccc in abbbbc(*D1*) on (bbbb(*D11*) = cccc(*D12*)" , [QI "for bbbb" "val bbbb"; QI "in abbbbc" "val abbbbc"; DC "(*D0*)" "Length"; QI "join" "join"; DC "(*D1*)" "Length"; DC "(*D11*)" "CompareTo"; DC "(*D12*)" "CompareTo"] - "L10", "let x = query { for bbbb in abbbbc(*D0*) do join cccc in abbbbc(*D1*) on (bbbb(*D11*) = cccc(*D12*))" , [QI "for bbbb" "val bbbb"; QI "in abbbbc" "val abbbbc"; DC "(*D0*)" "Length"; QI "join" "join"; DC "(*D1*)" "Length"; DC "(*D11*)" "CompareTo"; DC "(*D12*)" "CompareTo"] - "L11", "let x = query { for bbbb in abbbbc(*D0*) do join cccc in abbbbc(*D1*) on (bbbb(*D11*) = cccc(*D12*)); " , [QI "for bbbb" "val bbbb"; QI "in abbbbc" "val abbbbc"; DC "(*D0*)" "Length"; QI "join" "join"; DC "(*D1*)" "Length"; DC "(*D11*)" "CompareTo"; DC "(*D12*)" "CompareTo"] - "L12", "let x = query { for bbbb in abbbbc(*D0*) do join cccc in abbbbc(*D1*) on (bbbb(*D11*) = cccc(*D12*)); select" , [QI "for bbbb" "val bbbb"; QI "in abbbbc" "val abbbbc"; DC "(*D0*)" "Length"; QI "join" "join"; DC "(*D1*)" "Length"; DC "(*D11*)" "CompareTo"; DC "(*D12*)" "CompareTo"] - "L13", "let x = query { for bbbb in abbbbc(*D0*) do join cccc in abbbbc(*D1*) on (bbbb(*D11*) = cccc(*D12*)); select (bb(*C*)" , [QI "for bbbb" "val bbbb"; QI "in abbbbc" "val abbbbc"; DC "(*D0*)" "Length"; QI "join" "join"; DC "(*D1*)" "Length"; DC "(*D11*)" "CompareTo"; DC "(*D12*)" "CompareTo"] - "L14", "let x = query { for bbbb in abbbbc(*D0*) do join cccc in abbbbc(*D1*) on (bbbb(*D11*) = cccc(*D12*)); select (bbbb(*D2*)" , [QI "for bbbb" "val bbbb"; QI "in abbbbc" "val abbbbc"; DC "(*D0*)" "Length"; QI "join" "join"; DC "(*D1*)" "Length"; DC "(*D2*)" "CompareTo"; DC "(*D11*)" "CompareTo"; DC "(*D12*)" "CompareTo"] - "L15", "let x = query { for bbbb in abbbbc(*D0*) do join cccc in abbbbc(*D1*) on (bbbb(*D11*) = cccc(*D12*)); select (bbbb(*D2*), " , [QI "for bbbb" "val bbbb"; QI "in abbbbc" "val abbbbc"; DC "(*D0*)" "Length"; QI "join" "join"; DC "(*D1*)" "Length"; DC "(*D2*)" "CompareTo"; DC "(*D11*)" "CompareTo"; DC "(*D12*)" "CompareTo"] - "L16", "let x = query { for bbbb in abbbbc(*D0*) do join cccc in abbbbc(*D1*) on (bbbb(*D11*) = cccc(*D12*)); select (bbbb(*D2*), cc(*C*)" , [QI "for bbbb" "val bbbb"; QI "in abbbbc" "val abbbbc"; DC "(*D0*)" "Length"; QI "join" "join"; DC "(*D1*)" "Length"; DC "(*D2*)" "CompareTo"; AC "(*C*)" "cccc"; DC "(*D11*)" "CompareTo"; DC "(*D12*)" "CompareTo"] - "L17", "let x = query { for bbbb in abbbbc(*D0*) do join cccc in abbbbc(*D1*) on (bbbb(*D11*) = cccc(*D12*)); select (bbbb(*D2*), cccc(*D3*)" , [QI "for bbbb" "val bbbb"; QI "in abbbbc" "val abbbbc"; DC "(*D0*)" "Length"; QI "join" "join"; DC "(*D1*)" "Length"; DC "(*D2*)" "CompareTo"; DC "(*D3*)" "CompareTo"; QI "(bbbb" "val bbbb"; QI ", cccc" "val cccc"; DC "(*D11*)" "CompareTo"; DC "(*D12*)" "CompareTo" ] - "L18", "let x = query { for bbbb in abbbbc(*D0*) do join cccc in abbbbc(*D1*) on (bbbb(*D11*) = cccc(*D12*)); select (bbbb(*D2*), cccc(*D3*))" , [QI "for bbbb" "val bbbb"; QI "in abbbbc" "val abbbbc"; DC "(*D0*)" "Length"; QI "join" "join"; DC "(*D1*)" "Length"; DC "(*D2*)" "CompareTo"; DC "(*D3*)" "CompareTo"; QI "(bbbb" "val bbbb"; QI ", cccc" "val cccc"; DC "(*D11*)" "CompareTo"; DC "(*D12*)" "CompareTo" ] ] + [ "CL1", "let x = query { for bbbb in abbbbc(*D0*) do join " , [QI "for bbbb" "val bbbb"; QI "in abbbbc" "val abbbbc"; DC "(*D0*)" "Length"; QI "join" "join"] + "CL2", "let x = query { for bbbb in abbbbc(*D0*) do join cccc " , [QI "for bbbb" "val bbbb"; QI "in abbbbc" "val abbbbc"; DC "(*D0*)" "Length"; QI "join" "join"] + "CL2a", "let x = query { for bbbb in abbbbc(*D0*) do join cccc )" , [QI "for bbbb" "val bbbb"; QI "in abbbbc" "val abbbbc"; DC "(*D0*)" "Length"; QI "join" "join"] + "CL3", "let x = query { for bbbb in abbbbc(*D0*) do join cccc in " , [QI "for bbbb" "val bbbb"; QI "in abbbbc" "val abbbbc"; DC "(*D0*)" "Length"; QI "join" "join"] + "CL3a", "let x = query { for bbbb in abbbbc(*D0*) do join cccc in )" , [QI "for bbbb" "val bbbb"; QI "in abbbbc" "val abbbbc"; DC "(*D0*)" "Length"; QI "join" "join"] + "CL4", "let x = query { for bbbb in abbbbc(*D0*) do join cccc in abbb(*C*)" , [QI "for bbbb" "val bbbb"; QI "in abbbbc" "val abbbbc"; DC "(*D0*)" "Length";QI "join" "join"; AC "(*C*)" "abbbbc"] + "CL4a", "let x = query { for bbbb in abbbbc(*D0*) do join cccc in abbb(*C*) )" , [QI "for bbbb" "val bbbb"; QI "in abbbbc" "val abbbbc"; DC "(*D0*)" "Length";QI "join" "join"; AC "(*C*)" "abbbbc"] + "CL5", "let x = query { for bbbb in abbbbc(*D0*) do join cccc in abbbbc(*D1*)" , [QI "for bbbb" "val bbbb"; QI "in abbbbc" "val abbbbc"; DC "(*D0*)" "Length"; QI "join" "join"; DC "(*D1*)" "Length"] + "CL5a", "let x = query { for bbbb in abbbbc(*D0*) do join cccc in abbbbc(*D1*) )" , [QI "for bbbb" "val bbbb"; QI "in abbbbc" "val abbbbc"; DC "(*D0*)" "Length"; QI "join" "join"; DC "(*D1*)" "Length"] + "CL6", "let x = query { for bbbb in abbbbc(*D0*) do join cccc in abbbbc(*D1*) on " , [QI "for bbbb" "val bbbb"; QI "in abbbbc" "val abbbbc"; DC "(*D0*)" "Length"; QI "join" "join"; DC "(*D1*)" "Length"] + "CL6a", "let x = query { for bbbb in abbbbc(*D0*) do join cccc in abbbbc(*D1*) on )" , [QI "for bbbb" "val bbbb"; QI "in abbbbc" "val abbbbc"; DC "(*D0*)" "Length"; QI "join" "join"; DC "(*D1*)" "Length"] + "CL6b", "let x = query { for bbbb in abbbbc(*D0*) do join cccc in abbbbc(*D1*) on (bb(*C*)" , [QI "for bbbb" "val bbbb"; QI "in abbbbc" "val abbbbc"; DC "(*D0*)" "Length"; QI "join" "join"; DC "(*D1*)" "Length"; AC "(*C*)" "bbbb"] + "CL7", "let x = query { for bbbb in abbbbc(*D0*) do join cccc in abbbbc(*D1*) on (bbbb" , [QI "for bbbb" "val bbbb"; QI "in abbbbc" "val abbbbc"; DC "(*D0*)" "Length"; QI "join" "join"; DC "(*D1*)" "Length"] + "CL7a", "let x = query { for bbbb in abbbbc(*D0*) do join cccc in abbbbc(*D1*) on (bbbb )" , [QI "for bbbb" "val bbbb"; QI "in abbbbc" "val abbbbc"; DC "(*D0*)" "Length"; QI "join" "join"; DC "(*D1*)" "Length"] + "CL8", "let x = query { for bbbb in abbbbc(*D0*) do join cccc in abbbbc(*D1*) on (bbbb = " , [QI "for bbbb" "val bbbb"; QI "in abbbbc" "val abbbbc"; DC "(*D0*)" "Length"; QI "join" "join"; DC "(*D1*)" "Length"] + "CL8a", "let x = query { for bbbb in abbbbc(*D0*) do join cccc in abbbbc(*D1*) on (bbbb = )" , [QI "for bbbb" "val bbbb"; QI "in abbbbc" "val abbbbc"; DC "(*D0*)" "Length"; QI "join" "join"; DC "(*D1*)" "Length"] + "CL8b", "let x = query { for bbbb in abbbbc(*D0*) do join cccc in abbbbc(*D1*) on (bbbb = cc(*C*)" , [QI "for bbbb" "val bbbb"; QI "in abbbbc" "val abbbbc"; DC "(*D0*)" "Length"; QI "join" "join"; DC "(*D1*)" "Length"; AC "(*C*)" "cccc"] + "CL9", "let x = query { for bbbb in abbbbc(*D0*) do join cccc in abbbbc(*D1*) on (bbbb(*D11*) = cccc(*D12*)" , [QI "for bbbb" "val bbbb"; QI "in abbbbc" "val abbbbc"; DC "(*D0*)" "Length"; QI "join" "join"; DC "(*D1*)" "Length"; DC "(*D11*)" "CompareTo"; DC "(*D12*)" "CompareTo"] + "CL10", "let x = query { for bbbb in abbbbc(*D0*) do join cccc in abbbbc(*D1*) on (bbbb(*D11*) = cccc(*D12*))" , [QI "for bbbb" "val bbbb"; QI "in abbbbc" "val abbbbc"; DC "(*D0*)" "Length"; QI "join" "join"; DC "(*D1*)" "Length"; DC "(*D11*)" "CompareTo"; DC "(*D12*)" "CompareTo"] + "CL11", "let x = query { for bbbb in abbbbc(*D0*) do join cccc in abbbbc(*D1*) on (bbbb(*D11*) = cccc(*D12*)); " , [QI "for bbbb" "val bbbb"; QI "in abbbbc" "val abbbbc"; DC "(*D0*)" "Length"; QI "join" "join"; DC "(*D1*)" "Length"; DC "(*D11*)" "CompareTo"; DC "(*D12*)" "CompareTo"] + "CL12", "let x = query { for bbbb in abbbbc(*D0*) do join cccc in abbbbc(*D1*) on (bbbb(*D11*) = cccc(*D12*)); select" , [QI "for bbbb" "val bbbb"; QI "in abbbbc" "val abbbbc"; DC "(*D0*)" "Length"; QI "join" "join"; DC "(*D1*)" "Length"; DC "(*D11*)" "CompareTo"; DC "(*D12*)" "CompareTo"] + "CL13", "let x = query { for bbbb in abbbbc(*D0*) do join cccc in abbbbc(*D1*) on (bbbb(*D11*) = cccc(*D12*)); select (bb(*C*)" , [QI "for bbbb" "val bbbb"; QI "in abbbbc" "val abbbbc"; DC "(*D0*)" "Length"; QI "join" "join"; DC "(*D1*)" "Length"; DC "(*D11*)" "CompareTo"; DC "(*D12*)" "CompareTo"] + "CL14", "let x = query { for bbbb in abbbbc(*D0*) do join cccc in abbbbc(*D1*) on (bbbb(*D11*) = cccc(*D12*)); select (bbbb(*D2*)" , [QI "for bbbb" "val bbbb"; QI "in abbbbc" "val abbbbc"; DC "(*D0*)" "Length"; QI "join" "join"; DC "(*D1*)" "Length"; DC "(*D2*)" "CompareTo"; DC "(*D11*)" "CompareTo"; DC "(*D12*)" "CompareTo"] + "CL15", "let x = query { for bbbb in abbbbc(*D0*) do join cccc in abbbbc(*D1*) on (bbbb(*D11*) = cccc(*D12*)); select (bbbb(*D2*), " , [QI "for bbbb" "val bbbb"; QI "in abbbbc" "val abbbbc"; DC "(*D0*)" "Length"; QI "join" "join"; DC "(*D1*)" "Length"; DC "(*D2*)" "CompareTo"; DC "(*D11*)" "CompareTo"; DC "(*D12*)" "CompareTo"] + "CL16", "let x = query { for bbbb in abbbbc(*D0*) do join cccc in abbbbc(*D1*) on (bbbb(*D11*) = cccc(*D12*)); select (bbbb(*D2*), cc(*C*)" , [QI "for bbbb" "val bbbb"; QI "in abbbbc" "val abbbbc"; DC "(*D0*)" "Length"; QI "join" "join"; DC "(*D1*)" "Length"; DC "(*D2*)" "CompareTo"; AC "(*C*)" "cccc"; DC "(*D11*)" "CompareTo"; DC "(*D12*)" "CompareTo"] + "CL17", "let x = query { for bbbb in abbbbc(*D0*) do join cccc in abbbbc(*D1*) on (bbbb(*D11*) = cccc(*D12*)); select (bbbb(*D2*), cccc(*D3*)" , [QI "for bbbb" "val bbbb"; QI "in abbbbc" "val abbbbc"; DC "(*D0*)" "Length"; QI "join" "join"; DC "(*D1*)" "Length"; DC "(*D2*)" "CompareTo"; DC "(*D3*)" "CompareTo"; QI "(bbbb" "val bbbb"; QI ", cccc" "val cccc"; DC "(*D11*)" "CompareTo"; DC "(*D12*)" "CompareTo" ] + "CL18", "let x = query { for bbbb in abbbbc(*D0*) do join cccc in abbbbc(*D1*) on (bbbb(*D11*) = cccc(*D12*)); select (bbbb(*D2*), cccc(*D3*))" , [QI "for bbbb" "val bbbb"; QI "in abbbbc" "val abbbbc"; DC "(*D0*)" "Length"; QI "join" "join"; DC "(*D1*)" "Length"; DC "(*D2*)" "CompareTo"; DC "(*D3*)" "CompareTo"; QI "(bbbb" "val bbbb"; QI ", cccc" "val cccc"; DC "(*D11*)" "CompareTo"; DC "(*D12*)" "CompareTo" ] ] let knownFailures = [ - //("L2", "NoClosingBrace,NextDefinition", "", QuickInfoExpected ("for bbbb","val bbbb")) - //("L2", "NoClosingBrace,NextDefinition", "", QuickInfoExpected ("in abbbbc","val abbbbc")) - //("L2", "NoClosingBrace,NextDefinition", "", DotCompleteExpected ("(*D0*)","Length")) - //("L2", "NoClosingBrace,NextDefinition", "", QuickInfoExpected ("join","join")) - ] + ] this.WordByWordSystematicTestWithSpecificExpectations(prefix, suffixes, lines, [""], knownFailures) - [] /// This is a sanity check that the multiple-line case is much the same as the single-line cae @@ -2673,51 +2664,51 @@ let aaaaaa = 0 "NoClosingBrace,NextTypeDefinition", " \ntype NextDefinition() = member x.P = 1\n" ] let lines b = - [ "L1", """ + [ "DL1", """ let x = query { for bbbb in abbbbc(*D0*) do join """ , [QI "for bbbb" "val bbbb"; QI "in abbbbc" "val abbbbc"; DC "(*D0*)" "Length"; QI "join" "join"] - "L2", """ + "DL2", """ let x = query { for bbbb in abbbbc(*D0*) do join cccc """ , [QI "for bbbb" "val bbbb"; QI "in abbbbc" "val abbbbc"; DC "(*D0*)" "Length"; QI "join" "join"] - "L2a", """ + "DL2a", """ let x = query { for bbbb in abbbbc(*D0*) do join cccc ) """ , [QI "for bbbb" "val bbbb"; QI "in abbbbc" "val abbbbc"; DC "(*D0*)" "Length"; QI "join" "join"] - "L3", """ + "DL3", """ let x = query { for bbbb in abbbbc(*D0*) do join cccc in """ , [QI "for bbbb" "val bbbb"; QI "in abbbbc" "val abbbbc"; DC "(*D0*)" "Length"; QI "join" "join"] - "L3a", """ + "DL3a", """ let x = query { for bbbb in abbbbc(*D0*) do join cccc in ) """ , [QI "for bbbb" "val bbbb"; QI "in abbbbc" "val abbbbc"; DC "(*D0*)" "Length"; QI "join" "join"] - "L4", """ + "DL4", """ let x = query { for bbbb in abbbbc(*D0*) do join cccc in abbb(*C*) """ , [QI "for bbbb" "val bbbb"; QI "in abbbbc" "val abbbbc"; DC "(*D0*)" "Length";QI "join" "join"; AC "(*C*)" "abbbbc"] - "L4a", """ + "DL4a", """ let x = query { for bbbb in abbbbc(*D0*) do join cccc in abbb(*C*) ) """ , [QI "for bbbb" "val bbbb"; QI "in abbbbc" "val abbbbc"; DC "(*D0*)" "Length";QI "join" "join"; AC "(*C*)" "abbbbc"] - "L5", """ + "DL5", """ let x = query { for bbbb in abbbbc(*D0*) do join cccc in abbbbc(*D1*) """ , [QI "for bbbb" "val bbbb"; QI "in abbbbc" "val abbbbc"; DC "(*D0*)" "Length"; QI "join" "join"; DC "(*D1*)" "Length"] - "L5a", """ + "DL5a", """ let x = query { for bbbb in abbbbc(*D0*) do join cccc in abbbbc(*D1*) ) """ , [QI "for bbbb" "val bbbb"; QI "in abbbbc" "val abbbbc"; DC "(*D0*)" "Length"; QI "join" "join"; DC "(*D1*)" "Length"] - "L6", """ + "DL6", """ let x = query { for bbbb in abbbbc(*D0*) do join cccc in abbbbc(*D1*) on """ , [QI "for bbbb" "val bbbb"; QI "in abbbbc" "val abbbbc"; DC "(*D0*)" "Length"; QI "join" "join"; DC "(*D1*)" "Length"] @@ -2730,63 +2721,63 @@ let x = query { for bbbb in abbbbc(*D0*) do let x = query { for bbbb in abbbbc(*D0*) do join cccc in abbbbc(*D1*) on (bb(*C*) """ , [QI "for bbbb" "val bbbb"; QI "in abbbbc" "val abbbbc"; DC "(*D0*)" "Length"; QI "join" "join"; DC "(*D1*)" "Length"; AC "(*C*)" "bbbb"] - "L7", """ + "DL7", """ let x = query { for bbbb in abbbbc(*D0*) do join cccc in abbbbc(*D1*) on (bbbb """ , [QI "for bbbb" "val bbbb"; QI "in abbbbc" "val abbbbc"; DC "(*D0*)" "Length"; QI "join" "join"; DC "(*D1*)" "Length"] - "L7a", """ + "DL7a", """ let x = query { for bbbb in abbbbc(*D0*) do join cccc in abbbbc(*D1*) on (bbbb ) """ , [QI "for bbbb" "val bbbb"; QI "in abbbbc" "val abbbbc"; DC "(*D0*)" "Length"; QI "join" "join"; DC "(*D1*)" "Length"] - "L8", """ + "DL8", """ let x = query { for bbbb in abbbbc(*D0*) do join cccc in abbbbc(*D1*) on (bbbb = """ , [QI "for bbbb" "val bbbb"; QI "in abbbbc" "val abbbbc"; DC "(*D0*)" "Length"; QI "join" "join"; DC "(*D1*)" "Length"] - "L8a", """ + "DL8a", """ let x = query { for bbbb in abbbbc(*D0*) do join cccc in abbbbc(*D1*) on (bbbb = ) """ , [QI "for bbbb" "val bbbb"; QI "in abbbbc" "val abbbbc"; DC "(*D0*)" "Length"; QI "join" "join"; DC "(*D1*)" "Length"] - "L8b", """ + "DL8b", """ let x = query { for bbbb in abbbbc(*D0*) do join cccc in abbbbc(*D1*) on (bbbb = cc(*C*) """ , [QI "for bbbb" "val bbbb"; QI "in abbbbc" "val abbbbc"; DC "(*D0*)" "Length"; QI "join" "join"; DC "(*D1*)" "Length"; AC "(*C*)" "cccc"] - "L9", """ + "DL9", """ let x = query { for bbbb in abbbbc(*D0*) do join cccc in abbbbc(*D1*) on (bbbb(*D11*) = cccc(*D12*) """ , [QI "for bbbb" "val bbbb"; QI "in abbbbc" "val abbbbc"; DC "(*D0*)" "Length"; QI "join" "join"; DC "(*D1*)" "Length"; DC "(*D11*)" "CompareTo"; DC "(*D12*)" "CompareTo"] - "L10", """ + "DL10", """ let x = query { for bbbb in abbbbc(*D0*) do join cccc in abbbbc(*D1*) on (bbbb(*D11*) = cccc(*D12*)) """ , [QI "for bbbb" "val bbbb"; QI "in abbbbc" "val abbbbc"; DC "(*D0*)" "Length"; QI "join" "join"; DC "(*D1*)" "Length"; DC "(*D11*)" "CompareTo"; DC "(*D12*)" "CompareTo"] - "L11", """ + "DL11", """ let x = query { for bbbb in abbbbc(*D0*) do join cccc in abbbbc(*D1*) on (bbbb(*D11*) = cccc(*D12*)); """ , [QI "for bbbb" "val bbbb"; QI "in abbbbc" "val abbbbc"; DC "(*D0*)" "Length"; QI "join" "join"; DC "(*D1*)" "Length"; DC "(*D11*)" "CompareTo"; DC "(*D12*)" "CompareTo"] - "L12", """ + "DL12", """ let x = query { for bbbb in abbbbc(*D0*) do join cccc in abbbbc(*D1*) on (bbbb(*D11*) = cccc(*D12*)); select """ , [QI "for bbbb" "val bbbb"; QI "in abbbbc" "val abbbbc"; DC "(*D0*)" "Length"; QI "join" "join"; DC "(*D1*)" "Length"; DC "(*D11*)" "CompareTo"; DC "(*D12*)" "CompareTo"] - "L13", """ + "DL13", """ let x = query { for bbbb in abbbbc(*D0*) do join cccc in abbbbc(*D1*) on (bbbb(*D11*) = cccc(*D12*)); select (bb(*C*) """ , [QI "for bbbb" "val bbbb"; QI "in abbbbc" "val abbbbc"; DC "(*D0*)" "Length"; QI "join" "join"; DC "(*D1*)" "Length"; DC "(*D11*)" "CompareTo"; DC "(*D12*)" "CompareTo"] - "L14", """ + "DL14", """ let x = query { for bbbb in abbbbc(*D0*) do join cccc in abbbbc(*D1*) on (bbbb(*D11*) = cccc(*D12*)); select (bbbb(*D2*) """ , [QI "for bbbb" "val bbbb"; QI "in abbbbc" "val abbbbc"; DC "(*D0*)" "Length"; QI "join" "join"; DC "(*D1*)" "Length"; DC "(*D2*)" "CompareTo"; DC "(*D11*)" "CompareTo"; DC "(*D12*)" "CompareTo"] - "L15", """ + "DL15", """ let x = query { for bbbb in abbbbc(*D0*) do join cccc in abbbbc(*D1*) on (bbbb(*D11*) = cccc(*D12*)); select (bbbb(*D2*), """ , [QI "for bbbb" "val bbbb"; QI "in abbbbc" "val abbbbc"; DC "(*D0*)" "Length"; QI "join" "join"; DC "(*D1*)" "Length"; DC "(*D2*)" "CompareTo"; DC "(*D11*)" "CompareTo"; DC "(*D12*)" "CompareTo"] - "L16", """ + "DL16", """ let x = query { for bbbb in abbbbc(*D0*) do join cccc in abbbbc(*D1*) on (bbbb(*D11*) = cccc(*D12*)); select (bbbb(*D2*), cc(*C*) """ , [QI "for bbbb" "val bbbb"; QI "in abbbbc" "val abbbbc"; DC "(*D0*)" "Length"; QI "join" "join"; DC "(*D1*)" "Length"; DC "(*D2*)" "CompareTo"; AC "(*C*)" "cccc"; DC "(*D11*)" "CompareTo"; DC "(*D12*)" "CompareTo"] - "L17", """ + "DL17", """ let x = query { for bbbb in abbbbc(*D0*) do join cccc in abbbbc(*D1*) on (bbbb(*D11*) = cccc(*D12*)); select (bbbb(*D2*), cccc(*D3*) """ , [QI "for bbbb" "val bbbb"; QI "in abbbbc" "val abbbbc"; DC "(*D0*)" "Length"; QI "join" "join"; DC "(*D1*)" "Length"; DC "(*D2*)" "CompareTo"; DC "(*D3*)" "CompareTo"; QI "(bbbb" "val bbbb"; QI ", cccc" "val cccc"; DC "(*D11*)" "CompareTo"; DC "(*D12*)" "CompareTo" ] - "L18", """ + "DL18", """ let x = query { for bbbb in abbbbc(*D0*) do join cccc in abbbbc(*D1*) on (bbbb(*D11*) = cccc(*D12*)); select (bbbb(*D2*), cccc(*D3*)) """ , [QI "for bbbb" "val bbbb"; QI "in abbbbc" "val abbbbc"; DC "(*D0*)" "Length"; QI "join" "join"; DC "(*D1*)" "Length"; DC "(*D2*)" "CompareTo"; DC "(*D3*)" "CompareTo"; QI "(bbbb" "val bbbb"; QI ", cccc" "val cccc"; DC "(*D11*)" "CompareTo"; DC "(*D12*)" "CompareTo" ] ] @@ -2794,10 +2785,10 @@ let x = query { for bbbb in abbbbc(*D0*) do let knownFailures = [ - //("L2", "NoClosingBrace,NextDefinition", "", QuickInfoExpected ("for bbbb","val bbbb")) - //("L2", "NoClosingBrace,NextDefinition", "", QuickInfoExpected ("in abbbbc","val abbbbc")) - //("L2", "NoClosingBrace,NextDefinition", "", DotCompleteExpected ("(*D0*)","Length")) - //("L2", "NoClosingBrace,NextDefinition", "", QuickInfoExpected ("join","join")) + //("DL2", "NoClosingBrace,NextDefinition", "", QuickInfoExpected ("for bbbb","val bbbb")) + //("DL2", "NoClosingBrace,NextDefinition", "", QuickInfoExpected ("in abbbbc","val abbbbc")) + //("DL2", "NoClosingBrace,NextDefinition", "", DotCompleteExpected ("(*D0*)","Length")) + //("DL2", "NoClosingBrace,NextDefinition", "", QuickInfoExpected ("join","join")) ] @@ -4207,7 +4198,7 @@ let x = query { for bbbb in abbbbc(*D0*) do AssertEqualWithMessage(3, occurrences, "Found wrong number of overloads for 'File.Open'.") [] - member public this.``Duplicates.Bug2094``() = + member public this.``Duplicates.Bug2094``() = let code = [ "open Microsoft.FSharp.Control" @@ -4218,8 +4209,8 @@ let x = query { for bbbb in abbbbc(*D0*) do // Get description for Expr.Var let (CompletionItem(_, _, _, descrFunc, _)) = completions |> Array.find (fun (CompletionItem(name, _, _, _, _)) -> name = "Start") - let occurrences = this.CountMethodOccurrences(descrFunc(), "Start") - AssertEqualWithMessage(1, occurrences, "Found wrong number of overloads for 'MailboxProcessor.Start'.") + let occurrences = this.CountMethodOccurrences(descrFunc(), "Start") + AssertEqualWithMessage(1, occurrences, sprintf "Found wrong number of overloads for 'MailboxProcessor.Start'. Found %A." completions) [] member public this.``WithinMatchClause.Bug1603``() = @@ -5448,7 +5439,7 @@ let x = query { for bbbb in abbbbc(*D0*) do t(*Marker*)""", marker = "(*Marker*)", list = ["Equals";"GetHashCode"], - addtlRefAssy = [PathRelativeToTestAssembly(@"UnitTests\MockTypeProviders\EditorHideMethodsAttribute.dll")]) + addtlRefAssy = [PathRelativeToTestAssembly(@"EditorHideMethodsAttribute.dll")]) [] [] @@ -5461,7 +5452,7 @@ let x = query { for bbbb in abbbbc(*D0*) do t(*Marker*)""", marker = "(*Marker*)", list = ["Event1"], - addtlRefAssy = [PathRelativeToTestAssembly(@"UnitTests\MockTypeProviders\EditorHideMethodsAttribute.dll")]) + addtlRefAssy = [PathRelativeToTestAssembly(@"EditorHideMethodsAttribute.dll")]) [] [] @@ -5474,7 +5465,7 @@ let x = query { for bbbb in abbbbc(*D0*) do t(*Marker*)""", marker = "(*Marker*)", list = ["IM1"], - addtlRefAssy = [PathRelativeToTestAssembly(@"UnitTests\MockTypeProviders\DummyProviderForLanguageServiceTesting.dll")]) + addtlRefAssy = [PathRelativeToTestAssembly(@"DummyProviderForLanguageServiceTesting.dll")]) [] [] @@ -5486,7 +5477,7 @@ let x = query { for bbbb in abbbbc(*D0*) do type XXX = N1.T1(*Marker*)""", marker = "(*Marker*)", list = ["SomeNestedType"], - addtlRefAssy = [PathRelativeToTestAssembly(@"UnitTests\MockTypeProviders\DummyProviderForLanguageServiceTesting.dll")]) + addtlRefAssy = [PathRelativeToTestAssembly(@"DummyProviderForLanguageServiceTesting.dll")]) // should _not_ have it here this.VerifyDotCompListDoesNotContainAnyAtStartOfMarker( fileContents = """ @@ -5494,7 +5485,7 @@ let x = query { for bbbb in abbbbc(*D0*) do t(*Marker*)""", marker = "(*Marker*)", list = ["SomeNestedType"], - addtlRefAssy = [PathRelativeToTestAssembly(@"UnitTests\MockTypeProviders\DummyProviderForLanguageServiceTesting.dll")]) + addtlRefAssy = [PathRelativeToTestAssembly(@"DummyProviderForLanguageServiceTesting.dll")]) [] [] @@ -5507,7 +5498,7 @@ let x = query { for bbbb in abbbbc(*D0*) do t.Event1(*Marker*)""", marker = "(*Marker*)", list = ["AddHandler";"RemoveHandler"], - addtlRefAssy = [PathRelativeToTestAssembly(@"UnitTests\MockTypeProviders\EditorHideMethodsAttribute.dll")]) + addtlRefAssy = [PathRelativeToTestAssembly(@"EditorHideMethodsAttribute.dll")]) [] [] @@ -5519,7 +5510,7 @@ let x = query { for bbbb in abbbbc(*D0*) do fileContents = """ let t = N.T.M(*Marker*)()""", marker = "(*Marker*)", - addtlRefAssy = [PathRelativeToTestAssembly(@"UnitTests\MockTypeProviders\EditorHideMethodsAttribute.dll")]) + addtlRefAssy = [PathRelativeToTestAssembly(@"EditorHideMethodsAttribute.dll")]) [] [] @@ -5533,7 +5524,7 @@ let x = query { for bbbb in abbbbc(*D0*) do let t = N.T.StaticProp(*Marker*)""", marker = "(*Marker*)", list = ["GetType"; "Equals"], // just a couple of System.Object methods: we expect them to be there! - addtlRefAssy = [PathRelativeToTestAssembly(@"UnitTests\MockTypeProviders\EditorHideMethodsAttribute.dll")]) + addtlRefAssy = [PathRelativeToTestAssembly(@"EditorHideMethodsAttribute.dll")]) [] member this.CompListInDiffFileTypes() = diff --git a/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.ErrorList.fs b/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.ErrorList.fs index d72c2c4032f..95ade7d3af7 100644 --- a/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.ErrorList.fs +++ b/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.ErrorList.fs @@ -5,6 +5,7 @@ namespace Tests.LanguageService.ErrorList open System open System.IO open NUnit.Framework +open Microsoft.VisualStudio.FSharp open Salsa.Salsa open Salsa.VsOpsUtils open UnitTests.TestLib.Salsa @@ -12,6 +13,12 @@ open UnitTests.TestLib.Utils open UnitTests.TestLib.LanguageService open UnitTests.TestLib.ProjectSystem +[] +type public AssemblyResolverTestFixture () = + + [] + member public __.Init () = AssemblyResolver.addResolver () + [] [] type UsingMSBuild() as this = @@ -365,7 +372,7 @@ type staticInInterface = [] [] member public this.``TypeProvider.MultipleErrors`` () = - let tpRef = PathRelativeToTestAssembly(@"UnitTests\MockTypeProviders\DummyProviderForLanguageServiceTesting.dll") + let tpRef = PathRelativeToTestAssembly(@"DummyProviderForLanguageServiceTesting.dll") let checkList n = printfn "===TypeProvider.MultipleErrors: %d===" n let content = sprintf "type Err = TPErrors.TP<%d>" n @@ -437,7 +444,7 @@ type staticInInterface = but here has type 'int' """ this.VerifyErrorListContainedExpectedString(fileContent,expectedStr, - addtlRefAssy = [PathRelativeToTestAssembly(@"UnitTests\MockTypeProviders\DummyProviderForLanguageServiceTesting.dll")]) + addtlRefAssy = [PathRelativeToTestAssembly(@"DummyProviderForLanguageServiceTesting.dll")]) [] [] @@ -451,7 +458,7 @@ but here has type let expectedStr = "An error occurred applying the static arguments to a provided type" this.VerifyErrorListContainedExpectedString(fileContent,expectedStr, - addtlRefAssy = [PathRelativeToTestAssembly(@"UnitTests\MockTypeProviders\DummyProviderForLanguageServiceTesting.dll")]) + addtlRefAssy = [PathRelativeToTestAssembly(@"DummyProviderForLanguageServiceTesting.dll")]) [] [] @@ -465,7 +472,7 @@ but here has type let expectedStr = "The static parameter 'ParamIgnored' of the provided type or method 'T' requires a value. Static parameters to type providers may be optionally specified using named arguments, e.g. 'T'." this.VerifyErrorListContainedExpectedString(fileContent,expectedStr, - addtlRefAssy = [PathRelativeToTestAssembly(@"UnitTests\MockTypeProviders\DummyProviderForLanguageServiceTesting.dll")]) + addtlRefAssy = [PathRelativeToTestAssembly(@"DummyProviderForLanguageServiceTesting.dll")]) [] [] member public this.``TypeProvider.ProhibitedMethods`` () = @@ -480,7 +487,7 @@ but here has type ( code, sprintf "Array method '%s' is supplied by the runtime and cannot be directly used in code." str, - addtlRefAssy = [PathRelativeToTestAssembly(@"UnitTests\MockTypeProviders\DummyProviderForLanguageServiceTesting.dll")] + addtlRefAssy = [PathRelativeToTestAssembly(@"DummyProviderForLanguageServiceTesting.dll")] ) [] @@ -505,7 +512,7 @@ but here has type type foo = N1.T< const "Hello World",2>""", expectedNum = 1, - addtlRefAssy = [PathRelativeToTestAssembly(@"UnitTests\MockTypeProviders\DummyProviderForLanguageServiceTesting.dll")]) + addtlRefAssy = [PathRelativeToTestAssembly(@"DummyProviderForLanguageServiceTesting.dll")]) [] [] @@ -516,7 +523,7 @@ but here has type this.VerifyNoErrorListAtOpenProject( fileContents = """ type foo = N1.T< const "Hello World",2>""", - addtlRefAssy = [PathRelativeToTestAssembly(@"UnitTests\MockTypeProviders\DummyProviderForLanguageServiceTesting.dll")]) + addtlRefAssy = [PathRelativeToTestAssembly(@"DummyProviderForLanguageServiceTesting.dll")]) [] diff --git a/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.GotoDefinition.fs b/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.GotoDefinition.fs index 0fad94e8e46..ff5af668d1b 100644 --- a/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.GotoDefinition.fs +++ b/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.GotoDefinition.fs @@ -216,7 +216,7 @@ type UsingMSBuild() = // C01234567890 """, "T(*GotoValDef*)", "// A0(*ColumnMarker*)1234567890", - PathRelativeToTestAssembly(@"UnitTests\MockTypeProviders\DefinitionLocationAttribute.dll"), + PathRelativeToTestAssembly(@"DefinitionLocationAttribute.dll"), "(*ColumnMarker*)") // This test case checks the type with space in between like N.``T T`` for GotoDefinition @@ -228,7 +228,7 @@ type UsingMSBuild() = // C01234567890 """, "T``", "// A0(*ColumnMarker*)1234567890", - PathRelativeToTestAssembly(@"UnitTests\MockTypeProviders\DefinitionLocationAttributeWithSpaceInTheType.dll"), + PathRelativeToTestAssembly(@"DefinitionLocationAttributeWithSpaceInTheType.dll"), "(*ColumnMarker*)") // Basic scenario on a provided Constructor @@ -241,7 +241,7 @@ type UsingMSBuild() = // C01234567890 """, "T(*GotoValDef*)", "// A0(*ColumnMarker*)1234567890", - PathRelativeToTestAssembly(@"UnitTests\MockTypeProviders\DefinitionLocationAttribute.dll"), + PathRelativeToTestAssembly(@"DefinitionLocationAttribute.dll"), "(*ColumnMarker*)") // Basic scenario on a provided Method @@ -253,7 +253,7 @@ type UsingMSBuild() = // C01234567890 """, "M(*GotoValDef*)", "// A0(*ColumnMarker*)1234567890", - PathRelativeToTestAssembly(@"UnitTests\MockTypeProviders\DefinitionLocationAttribute.dll"), + PathRelativeToTestAssembly(@"DefinitionLocationAttribute.dll"), "(*ColumnMarker*)") // Basic scenario on a provided Property @@ -265,7 +265,7 @@ type UsingMSBuild() = // C01234567890 """, "StaticProp(*GotoValDef*)", "// A0(*ColumnMarker*)1234567890", - PathRelativeToTestAssembly(@"UnitTests\MockTypeProviders\DefinitionLocationAttribute.dll"), + PathRelativeToTestAssembly(@"DefinitionLocationAttribute.dll"), "(*ColumnMarker*)") // Basic scenario on a provided Event @@ -278,7 +278,7 @@ type UsingMSBuild() = // C01234567890 """, "Event1(*GotoValDef*)", "// A0(*ColumnMarker*)1234567890", - PathRelativeToTestAssembly(@"UnitTests\MockTypeProviders\DefinitionLocationAttribute.dll"), + PathRelativeToTestAssembly(@"DefinitionLocationAttribute.dll"), "(*ColumnMarker*)") // Actually execute all the scenarios... @@ -331,7 +331,7 @@ type UsingMSBuild() = """, marker = "T<", f = (fun (_, result) -> Assert.IsFalse(result.Success) ), - addtlRefAssy = [PathRelativeToTestAssembly(@"UnitTests\MockTypeProviders\DummyProviderForLanguageServiceTesting.dll")] + addtlRefAssy = [PathRelativeToTestAssembly(@"DummyProviderForLanguageServiceTesting.dll")] ) [] @@ -359,7 +359,7 @@ type UsingMSBuild() = let expectedText = sprintf "provided member '%s'" name Assert.IsTrue(result.ErrorDescription.Contains(expectedText)) ), - addtlRefAssy = [PathRelativeToTestAssembly(@"UnitTests\MockTypeProviders\DummyProviderForLanguageServiceTesting.dll")] + addtlRefAssy = [PathRelativeToTestAssembly(@"DummyProviderForLanguageServiceTesting.dll")] ) [] [] @@ -373,7 +373,7 @@ type UsingMSBuild() = // B01234567890 // C01234567890 """, marker = "T(*GotoValDef*)", - addtlRefAssy = [PathRelativeToTestAssembly(@"UnitTests\MockTypeProviders\DefinitionLocationAttributeFileDoesnotExist.dll")]) + addtlRefAssy = [PathRelativeToTestAssembly(@"DefinitionLocationAttributeFileDoesnotExist.dll")]) [] [] @@ -388,7 +388,7 @@ type UsingMSBuild() = // B01234567890 // C01234567890 """, marker = "T(*GotoValDef*)", - addtlRefAssy = [PathRelativeToTestAssembly(@"UnitTests\MockTypeProviders\DefinitionLocationAttributeLineDoesnotExist.dll")]) + addtlRefAssy = [PathRelativeToTestAssembly(@"DefinitionLocationAttributeLineDoesnotExist.dll")]) [] [] @@ -402,7 +402,7 @@ type UsingMSBuild() = // B01234567890 // C01234567890 """, marker = "T(*GotoValDef*)", - addtlRefAssy = [PathRelativeToTestAssembly(@"UnitTests\MockTypeProviders\DefinitionLocationAttributeFileDoesnotExist.dll")]) + addtlRefAssy = [PathRelativeToTestAssembly(@"DefinitionLocationAttributeFileDoesnotExist.dll")]) @@ -418,7 +418,7 @@ type UsingMSBuild() = // B01234567890 // C01234567890 """, marker = "M(*GotoValDef*)", - addtlRefAssy = [PathRelativeToTestAssembly(@"UnitTests\MockTypeProviders\DefinitionLocationAttributeFileDoesnotExist.dll")]) + addtlRefAssy = [PathRelativeToTestAssembly(@"DefinitionLocationAttributeFileDoesnotExist.dll")]) [] [] @@ -432,7 +432,7 @@ type UsingMSBuild() = // B01234567890 // C01234567890 """, marker = "StaticProp(*GotoValDef*)", - addtlRefAssy = [PathRelativeToTestAssembly(@"UnitTests\MockTypeProviders\DefinitionLocationAttributeFileDoesnotExist.dll")]) + addtlRefAssy = [PathRelativeToTestAssembly(@"DefinitionLocationAttributeFileDoesnotExist.dll")]) [] [] @@ -447,7 +447,7 @@ type UsingMSBuild() = // B01234567890 // C01234567890 """, marker = "Event1(*GotoValDef*)", - addtlRefAssy = [PathRelativeToTestAssembly(@"UnitTests\MockTypeProviders\DefinitionLocationAttributeFileDoesnotExist.dll")]) + addtlRefAssy = [PathRelativeToTestAssembly(@"DefinitionLocationAttributeFileDoesnotExist.dll")]) [] member public this.``ModuleDefintion``() = diff --git a/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.ParameterInfo.fs b/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.ParameterInfo.fs index 8fe4486f160..06b42d32efc 100644 --- a/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.ParameterInfo.fs +++ b/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.ParameterInfo.fs @@ -329,7 +329,7 @@ type UsingMSBuild() = let foo = N1.T1.M1((*Marker*) """ this.VerifyParameterInfoAtStartOfMarker(fileContent,"(*Marker*)",[["arg1"]], - addtlRefAssy = [PathRelativeToTestAssembly(@"UnitTests\MockTypeProviders\DummyProviderForLanguageServiceTesting.dll")]) + addtlRefAssy = [PathRelativeToTestAssembly(@"DummyProviderForLanguageServiceTesting.dll")]) [] [] @@ -340,7 +340,7 @@ type UsingMSBuild() = let foo = N1.T1.M2((*Marker*) """ this.VerifyParameterInfoAtStartOfMarker(fileContent,"(*Marker*)",[["arg1";"arg2"]], - addtlRefAssy = [PathRelativeToTestAssembly(@"UnitTests\MockTypeProviders\DummyProviderForLanguageServiceTesting.dll")]) + addtlRefAssy = [PathRelativeToTestAssembly(@"DummyProviderForLanguageServiceTesting.dll")]) [] [] @@ -353,7 +353,7 @@ type UsingMSBuild() = let foo = N1.T1.M2((*Marker*) """ this.VerifyFirstParameterInfoColonContent(fileContent,"(*Marker*)",": int", - addtlRefAssy = [PathRelativeToTestAssembly(@"UnitTests\MockTypeProviders\DummyProviderForLanguageServiceTesting.dll")]) + addtlRefAssy = [PathRelativeToTestAssembly(@"DummyProviderForLanguageServiceTesting.dll")]) [] @@ -365,7 +365,7 @@ type UsingMSBuild() = let foo = new N1.T1((*Marker*) """ this.VerifyParameterInfoOverloadMethodIndex(fileContent,"(*Marker*)",0,[], - addtlRefAssy = [PathRelativeToTestAssembly(@"UnitTests\MockTypeProviders\DummyProviderForLanguageServiceTesting.dll")]) + addtlRefAssy = [PathRelativeToTestAssembly(@"DummyProviderForLanguageServiceTesting.dll")]) [] [] @@ -376,7 +376,7 @@ type UsingMSBuild() = let foo = new N1.T1((*Marker*) """ this.VerifyParameterInfoOverloadMethodIndex(fileContent,"(*Marker*)",1,["arg1"], - addtlRefAssy = [PathRelativeToTestAssembly(@"UnitTests\MockTypeProviders\DummyProviderForLanguageServiceTesting.dll")]) + addtlRefAssy = [PathRelativeToTestAssembly(@"DummyProviderForLanguageServiceTesting.dll")]) [] [] @@ -387,7 +387,7 @@ type UsingMSBuild() = let foo = new N1.T1((*Marker*) """ this.VerifyParameterInfoOverloadMethodIndex(fileContent,"(*Marker*)",2,["arg1";"arg2"], - addtlRefAssy = [PathRelativeToTestAssembly(@"UnitTests\MockTypeProviders\DummyProviderForLanguageServiceTesting.dll")]) + addtlRefAssy = [PathRelativeToTestAssembly(@"DummyProviderForLanguageServiceTesting.dll")]) [] [] @@ -398,7 +398,7 @@ type UsingMSBuild() = type foo = N1.T<(*Marker*) """ this.VerifyParameterInfoAtStartOfMarker(fileContent,"(*Marker*)",[["Param1";"ParamIgnored"]], - addtlRefAssy = [PathRelativeToTestAssembly(@"UnitTests\MockTypeProviders\DummyProviderForLanguageServiceTesting.dll")]) + addtlRefAssy = [PathRelativeToTestAssembly(@"DummyProviderForLanguageServiceTesting.dll")]) [] [] @@ -410,7 +410,7 @@ type UsingMSBuild() = type foo = N1.T< "Hello", 2>(*Marker*) """ this.VerifyNoParameterInfoAtStartOfMarker(fileContent,"(*Marker*)", - addtlRefAssy = [PathRelativeToTestAssembly(@"UnitTests\MockTypeProviders\DummyProviderForLanguageServiceTesting.dll")]) + addtlRefAssy = [PathRelativeToTestAssembly(@"DummyProviderForLanguageServiceTesting.dll")]) [] [] @@ -421,26 +421,29 @@ type UsingMSBuild() = type foo = N1.T<"Hello",(*Marker*) """ this.VerifyParameterInfoContainedAtStartOfMarker(fileContent,"(*Marker*)",["Param1";"ParamIgnored"], - [PathRelativeToTestAssembly(@"UnitTests\MockTypeProviders\DummyProviderForLanguageServiceTesting.dll")]) + [PathRelativeToTestAssembly(@"DummyProviderForLanguageServiceTesting.dll")]) [] member public this.``Single.InMatchClause``() = + let v461 = Version(4,6,1) let fileContent = """ let rec f l = match l with | [] -> System.String.Format((*Mark*) | x :: xs -> f xs""" // Note, 3 of these 8 are only available on .NET 4.6.1. On .NET 4.5 only 5 overloads are returned. - this.VerifyParameterInfoAtStartOfMarker(fileContent,"(*Mark*)",[["format"; "arg0"]; - ["format"; "args"]; - ["provider"; "format"; "args"]; - ["provider"; "format"; "arg0"]; - ["format"; "arg0"; "arg1"]; - ["provider"; "format"; "arg0"; "arg1"]; - ["format"; "arg0"; "arg1"; "arg2"]; - ["provider"; "format"; "arg0"; "arg1"; "arg2"]]) - + let expected = [["format"; "arg0"]; //Net4.5 + ["format"; "args"]; //Net4.5 + ["provider"; "format"; "args"]; //Net4.5 + ["format"; "arg0"; "arg1"]; //Net4.5 + ["format"; "arg0"; "arg1"; "arg2"]; //Net4.5 + ["provider"; "format"; "arg0"]; //Net4.6.1 + ["provider"; "format"; "arg0"; "arg1"]; //Net4.6.1 + ["provider"; "format"; "arg0"; "arg1"; "arg2"]] //Net4.6.1 + + this.VerifyParameterInfoAtStartOfMarker(fileContent,"(*Mark*)", expected) + (* --- Parameter Info Systematic Tests ------------------------------------------------- *) member public this.TestSystematicParameterInfo (marker, methReq, ?startOfMarker) = @@ -765,7 +768,7 @@ type UsingMSBuild() = //This test verifies that ParamInfo location on a provided type with namespace that exposes static parameter that takes >1 argument works normally. member public this.``TypeProvider.Type.ParameterInfoLocation.WithNamespace`` () = this.TestParameterInfoLocation("type boo = N1.T<$",11, - addtlRefAssy = [PathRelativeToTestAssembly(@"UnitTests\MockTypeProviders\DummyProviderForLanguageServiceTesting.dll")]) + addtlRefAssy = [PathRelativeToTestAssembly(@"DummyProviderForLanguageServiceTesting.dll")]) [] [] @@ -774,7 +777,7 @@ type UsingMSBuild() = member public this.``TypeProvider.Type.ParameterInfoLocation.WithOutNamespace`` () = this.TestParameterInfoLocation("open N1 \n"+"type boo = T<$", expectedPos = 11, - addtlRefAssy = [PathRelativeToTestAssembly(@"UnitTests\MockTypeProviders\DummyProviderForLanguageServiceTesting.dll")]) + addtlRefAssy = [PathRelativeToTestAssembly(@"DummyProviderForLanguageServiceTesting.dll")]) [] [] @@ -783,7 +786,7 @@ type UsingMSBuild() = //The intent here to make sure the ParamInfo is not shown when inside a string member public this.``TypeProvider.Type.Negative.InString`` () = this.TestParameterInfoNegative("type boo = \"N1.T<$\"", - addtlRefAssy = [PathRelativeToTestAssembly(@"UnitTests\MockTypeProviders\DummyProviderForLanguageServiceTesting.dll")]) + addtlRefAssy = [PathRelativeToTestAssembly(@"DummyProviderForLanguageServiceTesting.dll")]) [] [] @@ -792,7 +795,7 @@ type UsingMSBuild() = //The intent here to make sure the ParamInfo is not shown when inside a comment member public this.``TypeProvider.Type.Negative.InComment`` () = this.TestParameterInfoNegative("// type boo = N1.T<$", - addtlRefAssy = [PathRelativeToTestAssembly(@"UnitTests\MockTypeProviders\DummyProviderForLanguageServiceTesting.dll")]) + addtlRefAssy = [PathRelativeToTestAssembly(@"DummyProviderForLanguageServiceTesting.dll")]) // Following are tricky: @@ -1524,13 +1527,13 @@ We really need to rewrite some code paths here to use the real parse tree rather member public this.``LocationOfParams.TypeProviders.Basic``() = this.TestParameterInfoLocationOfParamsWithVariousSurroundingContexts(""" type U = ^N1.T^<^ "fo$o",^ 42 ^>""", - additionalReferenceAssemblies = [PathRelativeToTestAssembly(@"UnitTests\MockTypeProviders\DummyProviderForLanguageServiceTesting.dll")]) + additionalReferenceAssemblies = [PathRelativeToTestAssembly(@"DummyProviderForLanguageServiceTesting.dll")]) [] member public this.``LocationOfParams.TypeProviders.BasicNamed``() = this.TestParameterInfoLocationOfParamsWithVariousSurroundingContexts(""" type U = ^N1.T^<^ "fo$o",^ ParamIgnored=42 ^>""", - additionalReferenceAssemblies = [PathRelativeToTestAssembly(@"UnitTests\MockTypeProviders\DummyProviderForLanguageServiceTesting.dll")]) + additionalReferenceAssemblies = [PathRelativeToTestAssembly(@"DummyProviderForLanguageServiceTesting.dll")]) [] @@ -1538,42 +1541,42 @@ We really need to rewrite some code paths here to use the real parse tree rather this.TestParameterInfoLocationOfParamsWithVariousSurroundingContexts(""" type U = ^N1.T^<^ $ """, // missing all params, just have < markAtEnd = true, - additionalReferenceAssemblies = [PathRelativeToTestAssembly(@"UnitTests\MockTypeProviders\DummyProviderForLanguageServiceTesting.dll")]) + additionalReferenceAssemblies = [PathRelativeToTestAssembly(@"DummyProviderForLanguageServiceTesting.dll")]) [] member public this.``LocationOfParams.TypeProviders.Prefix1``() = this.TestParameterInfoLocationOfParamsWithVariousSurroundingContexts(""" type U = ^N1.T^<^ "fo$o",^ 42 """, // missing > markAtEnd = true, - additionalReferenceAssemblies = [PathRelativeToTestAssembly(@"UnitTests\MockTypeProviders\DummyProviderForLanguageServiceTesting.dll")]) + additionalReferenceAssemblies = [PathRelativeToTestAssembly(@"DummyProviderForLanguageServiceTesting.dll")]) [] member public this.``LocationOfParams.TypeProviders.Prefix1Named``() = this.TestParameterInfoLocationOfParamsWithVariousSurroundingContexts(""" type U = ^N1.T^<^ "fo$o",^ ParamIgnored=42 """, // missing > markAtEnd = true, - additionalReferenceAssemblies = [PathRelativeToTestAssembly(@"UnitTests\MockTypeProviders\DummyProviderForLanguageServiceTesting.dll")]) + additionalReferenceAssemblies = [PathRelativeToTestAssembly(@"DummyProviderForLanguageServiceTesting.dll")]) [] member public this.``LocationOfParams.TypeProviders.Prefix2``() = this.TestParameterInfoLocationOfParamsWithVariousSurroundingContexts(""" type U = ^N1.T^<^ "fo$o",^ """, // missing last param markAtEnd = true, - additionalReferenceAssemblies = [PathRelativeToTestAssembly(@"UnitTests\MockTypeProviders\DummyProviderForLanguageServiceTesting.dll")]) + additionalReferenceAssemblies = [PathRelativeToTestAssembly(@"DummyProviderForLanguageServiceTesting.dll")]) [] member public this.``LocationOfParams.TypeProviders.Prefix2Named1``() = this.TestParameterInfoLocationOfParamsWithVariousSurroundingContexts(""" type U = ^N1.T^<^ "fo$o",^ ParamIgnored= """, // missing last param after name with equals markAtEnd = true, - additionalReferenceAssemblies = [PathRelativeToTestAssembly(@"UnitTests\MockTypeProviders\DummyProviderForLanguageServiceTesting.dll")]) + additionalReferenceAssemblies = [PathRelativeToTestAssembly(@"DummyProviderForLanguageServiceTesting.dll")]) [] member public this.``LocationOfParams.TypeProviders.Prefix2Named2``() = this.TestParameterInfoLocationOfParamsWithVariousSurroundingContexts(""" type U = ^N1.T^<^ "fo$o",^ ParamIgnored """, // missing last param after name sans equals markAtEnd = true, - additionalReferenceAssemblies = [PathRelativeToTestAssembly(@"UnitTests\MockTypeProviders\DummyProviderForLanguageServiceTesting.dll")]) + additionalReferenceAssemblies = [PathRelativeToTestAssembly(@"DummyProviderForLanguageServiceTesting.dll")]) [] member public this.``LocationOfParams.TypeProviders.Negative1``() = @@ -1595,7 +1598,7 @@ We really need to rewrite some code paths here to use the real parse tree rather member public this.``LocationOfParams.TypeProviders.Negative4.Bug181000``() = this.TestNoParameterInfo(""" type U = ^N1.T^<^ "foo",^ 42 ^>$ """, // when the caret is right of the '>', we should not report any param info - additionalReferenceAssemblies = [PathRelativeToTestAssembly(@"UnitTests\MockTypeProviders\DummyProviderForLanguageServiceTesting.dll")]) + additionalReferenceAssemblies = [PathRelativeToTestAssembly(@"DummyProviderForLanguageServiceTesting.dll")]) [] member public this.``LocationOfParams.TypeProviders.BasicWithinExpr``() = @@ -1603,7 +1606,7 @@ We really need to rewrite some code paths here to use the real parse tree rather let f() = let r = id( ^N1.T^<^ "fo$o",^ ParamIgnored=42 ^> ) r """, - additionalReferenceAssemblies = [PathRelativeToTestAssembly(@"UnitTests\MockTypeProviders\DummyProviderForLanguageServiceTesting.dll")]) + additionalReferenceAssemblies = [PathRelativeToTestAssembly(@"DummyProviderForLanguageServiceTesting.dll")]) [] member public this.``LocationOfParams.TypeProviders.BasicWithinExpr.DoesNotInterfereWithOuterFunction``() = @@ -1611,37 +1614,37 @@ We really need to rewrite some code paths here to use the real parse tree rather let f() = let r = ^id^(^ N1.$T< "foo", ParamIgnored=42 > ^) r """, - additionalReferenceAssemblies = [PathRelativeToTestAssembly(@"UnitTests\MockTypeProviders\DummyProviderForLanguageServiceTesting.dll")]) + additionalReferenceAssemblies = [PathRelativeToTestAssembly(@"DummyProviderForLanguageServiceTesting.dll")]) [] member public this.``LocationOfParams.TypeProviders.Bug199744.ExcessCommasShouldNotAssertAndShouldGiveInfo.Case1``() = this.TestParameterInfoLocationOfParamsWithVariousSurroundingContexts(""" type U = ^N1.T^<^ "fo$o",^ 42,^ ,^ ^>""", - additionalReferenceAssemblies = [PathRelativeToTestAssembly(@"UnitTests\MockTypeProviders\DummyProviderForLanguageServiceTesting.dll")]) + additionalReferenceAssemblies = [PathRelativeToTestAssembly(@"DummyProviderForLanguageServiceTesting.dll")]) [] member public this.``LocationOfParams.TypeProviders.Bug199744.ExcessCommasShouldNotAssertAndShouldGiveInfo.Case2``() = this.TestParameterInfoLocationOfParamsWithVariousSurroundingContexts(""" type U = ^N1.T^<^ "fo$o",^ ,^ ^>""", - additionalReferenceAssemblies = [PathRelativeToTestAssembly(@"UnitTests\MockTypeProviders\DummyProviderForLanguageServiceTesting.dll")]) + additionalReferenceAssemblies = [PathRelativeToTestAssembly(@"DummyProviderForLanguageServiceTesting.dll")]) [] member public this.``LocationOfParams.TypeProviders.Bug199744.ExcessCommasShouldNotAssertAndShouldGiveInfo.Case3``() = this.TestParameterInfoLocationOfParamsWithVariousSurroundingContexts(""" type U = ^N1.T^<^ ,^$ ^>""", - additionalReferenceAssemblies = [PathRelativeToTestAssembly(@"UnitTests\MockTypeProviders\DummyProviderForLanguageServiceTesting.dll")]) + additionalReferenceAssemblies = [PathRelativeToTestAssembly(@"DummyProviderForLanguageServiceTesting.dll")]) [] [] member public this.``LocationOfParams.TypeProviders.StaticParametersAtConstructorCallSite``() = this.TestParameterInfoLocationOfParamsWithVariousSurroundingContexts(""" let x = new ^N1.T^<^ "fo$o",^ 42 ^>()""", - additionalReferenceAssemblies = [PathRelativeToTestAssembly(@"UnitTests\MockTypeProviders\DummyProviderForLanguageServiceTesting.dll")]) + additionalReferenceAssemblies = [PathRelativeToTestAssembly(@"DummyProviderForLanguageServiceTesting.dll")]) [] member public this.``TypeProvider.FormatOfNamesOfSystemTypes``() = let code = ["""type TTT = N1.T< "foo", ParamIgnored=42 > """] - let references = [PathRelativeToTestAssembly(@"UnitTests\MockTypeProviders\DummyProviderForLanguageServiceTesting.dll")] + let references = [PathRelativeToTestAssembly(@"DummyProviderForLanguageServiceTesting.dll")] let (_, _, file) = this.CreateSingleFileProject(code, references = references) let gpatcc = GlobalParseAndTypeCheckCounter.StartNew(this.VS) MoveCursorToEndOfMarker(file,"foo") diff --git a/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.QuickInfo.fs b/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.QuickInfo.fs index 683f239faa5..267943da1d3 100644 --- a/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.QuickInfo.fs +++ b/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.QuickInfo.fs @@ -217,7 +217,7 @@ type UsingMSBuild() = fileContents, marker = "MembersTP(*Marker*)", expected = "type HiddenBaseMembersTP =\n inherit TPBaseTy\n member ShowThisProp : unit", - addtlRefAssy = [PathRelativeToTestAssembly(@"UnitTests\MockTypeProviders\DummyProviderForLanguageServiceTesting.dll")]) + addtlRefAssy = [PathRelativeToTestAssembly(@"DummyProviderForLanguageServiceTesting.dll")]) [] member public this.``QuickInfo.OverriddenMethods``() = @@ -293,7 +293,7 @@ Full name: Microsoft.FSharp.Control.Async""".TrimStart().Replace("\r\n", "\n") [] member public this.``TypeProviders.NestedTypesOrder``() = let code = "type t = N1.TypeWithNestedTypes(*M*)" - let tpReference = PathRelativeToTestAssembly( @"UnitTests\MockTypeProviders\DummyProviderForLanguageServiceTesting.dll") + let tpReference = PathRelativeToTestAssembly( @"DummyProviderForLanguageServiceTesting.dll") this.VerifyOrderOfNestedTypesInQuickInfo( source = code, marker = "(*M*)", @@ -347,7 +347,7 @@ Full name: Microsoft.FSharp.Control.Async""".TrimStart().Replace("\r\n", "\n") let a = typeof """ this.AssertQuickInfoContainsAtStartOfMarker (fileContents, "T(*Marker*)", "This is a synthetic type created by me!", - addtlRefAssy = [PathRelativeToTestAssembly( @"UnitTests\MockTypeProviders\XmlDocAttributeWithAdequateComment.dll")]) + addtlRefAssy = [PathRelativeToTestAssembly( @"XmlDocAttributeWithAdequateComment.dll")]) [] [] @@ -360,7 +360,7 @@ Full name: Microsoft.FSharp.Control.Async""".TrimStart().Replace("\r\n", "\n") this.AssertQuickInfoContainsAtStartOfMarker (fileContents, "T(*Marker*)", "This is a synthetic type created by me!. Which is used to test the tool tip of the typeprovider type to check if it shows the right message or not.", - addtlRefAssy = [PathRelativeToTestAssembly( @"UnitTests\MockTypeProviders\XmlDocAttributeWithLongComment.dll")]) + addtlRefAssy = [PathRelativeToTestAssembly( @"XmlDocAttributeWithLongComment.dll")]) [] [] @@ -373,7 +373,7 @@ Full name: Microsoft.FSharp.Control.Async""".TrimStart().Replace("\r\n", "\n") this.AssertQuickInfoContainsAtStartOfMarker (fileContents, "T(*Marker*)", "type T =\n new : unit -> T\n event Event1 : EventHandler\n static member M : unit -> int []\n static member StaticProp : decimal", - addtlRefAssy = [PathRelativeToTestAssembly( @"UnitTests\MockTypeProviders\XmlDocAttributeWithNullComment.dll")]) + addtlRefAssy = [PathRelativeToTestAssembly( @"XmlDocAttributeWithNullComment.dll")]) [] [] @@ -386,7 +386,7 @@ Full name: Microsoft.FSharp.Control.Async""".TrimStart().Replace("\r\n", "\n") this.AssertQuickInfoContainsAtStartOfMarker (fileContents, "T(*Marker*)", "type T =\n new : unit -> T\n event Event1 : EventHandler\n static member M : unit -> int []\n static member StaticProp : decimal\nFull name: N.T", - addtlRefAssy = [PathRelativeToTestAssembly( @"UnitTests\MockTypeProviders\XmlDocAttributeWithEmptyComment.dll")]) + addtlRefAssy = [PathRelativeToTestAssembly( @"XmlDocAttributeWithEmptyComment.dll")]) [] @@ -400,7 +400,7 @@ Full name: Microsoft.FSharp.Control.Async""".TrimStart().Replace("\r\n", "\n") this.AssertQuickInfoContainsAtStartOfMarker (fileContents, "T(*Marker*)", "This is a synthetic type Localized! ኤፍ ሻርፕ", - addtlRefAssy = [PathRelativeToTestAssembly( @"UnitTests\MockTypeProviders\XmlDocAttributeWithLocalizedComment.dll")]) + addtlRefAssy = [PathRelativeToTestAssembly( @"XmlDocAttributeWithLocalizedComment.dll")]) [] [] @@ -412,7 +412,7 @@ Full name: Microsoft.FSharp.Control.Async""".TrimStart().Replace("\r\n", "\n") let foo = new N.T(*Marker*)() """ this.AssertQuickInfoContainsAtStartOfMarker (fileContents, "T(*Marker*)", "This is a synthetic .ctor created by me for N.T", - addtlRefAssy = [PathRelativeToTestAssembly( @"UnitTests\MockTypeProviders\XmlDocAttributeWithAdequateComment.dll")]) + addtlRefAssy = [PathRelativeToTestAssembly( @"XmlDocAttributeWithAdequateComment.dll")]) [] [] @@ -425,7 +425,7 @@ Full name: Microsoft.FSharp.Control.Async""".TrimStart().Replace("\r\n", "\n") this.AssertQuickInfoContainsAtStartOfMarker (fileContents, "T(*Marker*)", "This is a synthetic .ctor created by me for N.T. Which is used to test the tool tip of the typeprovider Constructor to check if it shows the right message or not.", - addtlRefAssy = [PathRelativeToTestAssembly( @"UnitTests\MockTypeProviders\XmlDocAttributeWithLongComment.dll")]) + addtlRefAssy = [PathRelativeToTestAssembly( @"XmlDocAttributeWithLongComment.dll")]) [] [] @@ -438,7 +438,7 @@ Full name: Microsoft.FSharp.Control.Async""".TrimStart().Replace("\r\n", "\n") this.AssertQuickInfoContainsAtStartOfMarker (fileContents, "T(*Marker*)", "N.T() : N.T", - addtlRefAssy = [PathRelativeToTestAssembly( @"UnitTests\MockTypeProviders\XmlDocAttributeWithNullComment.dll")]) + addtlRefAssy = [PathRelativeToTestAssembly( @"XmlDocAttributeWithNullComment.dll")]) [] [] @@ -451,7 +451,7 @@ Full name: Microsoft.FSharp.Control.Async""".TrimStart().Replace("\r\n", "\n") this.AssertQuickInfoContainsAtStartOfMarker (fileContents, "T(*Marker*)", "N.T() : N.T", - addtlRefAssy = [PathRelativeToTestAssembly( @"UnitTests\MockTypeProviders\XmlDocAttributeWithEmptyComment.dll")]) + addtlRefAssy = [PathRelativeToTestAssembly( @"XmlDocAttributeWithEmptyComment.dll")]) [] [] @@ -464,7 +464,7 @@ Full name: Microsoft.FSharp.Control.Async""".TrimStart().Replace("\r\n", "\n") this.AssertQuickInfoContainsAtStartOfMarker (fileContents, "T(*Marker*)", "This is a synthetic .ctor Localized! ኤፍ ሻርፕ for N.T", - addtlRefAssy = [PathRelativeToTestAssembly( @"UnitTests\MockTypeProviders\XmlDocAttributeWithLocalizedComment.dll")]) + addtlRefAssy = [PathRelativeToTestAssembly( @"XmlDocAttributeWithLocalizedComment.dll")]) [] @@ -479,7 +479,7 @@ Full name: Microsoft.FSharp.Control.Async""".TrimStart().Replace("\r\n", "\n") this.AssertQuickInfoContainsAtStartOfMarker (fileContents, "Event1(*Marker*)", "This is a synthetic *event* created by me for N.T", - addtlRefAssy = [PathRelativeToTestAssembly( @"UnitTests\MockTypeProviders\XmlDocAttributeWithAdequateComment.dll")]) + addtlRefAssy = [PathRelativeToTestAssembly( @"XmlDocAttributeWithAdequateComment.dll")]) [] [] @@ -493,7 +493,7 @@ Full name: Microsoft.FSharp.Control.Async""".TrimStart().Replace("\r\n", "\n") this.AssertQuickInfoContainsAtStartOfMarker (fileContents, "Event1(*Marker*)", "This is a synthetic *event* Localized! ኤፍ ሻርፕ for N.T", - addtlRefAssy = [PathRelativeToTestAssembly( @"UnitTests\MockTypeProviders\XmlDocAttributeWithLocalizedComment.dll")]) + addtlRefAssy = [PathRelativeToTestAssembly( @"XmlDocAttributeWithLocalizedComment.dll")]) [] [] @@ -517,7 +517,7 @@ Full name: Microsoft.FSharp.Control.Async""".TrimStart().Replace("\r\n", "\n") this.AssertQuickInfoContainsAtStartOfMarker (fileContents, "Event1(*Marker*)", "This is a synthetic *event* created by me for N.T. Which is used to test the tool tip of the typeprovider Event to check if it shows the right message or not.!", - addtlRefAssy = [PathRelativeToTestAssembly( @"UnitTests\MockTypeProviders\XmlDocAttributeWithLongComment.dll")]) + addtlRefAssy = [PathRelativeToTestAssembly( @"XmlDocAttributeWithLongComment.dll")]) [] [] @@ -531,7 +531,7 @@ Full name: Microsoft.FSharp.Control.Async""".TrimStart().Replace("\r\n", "\n") this.AssertQuickInfoContainsAtStartOfMarker (fileContents, "Event1(*Marker*)", "event N.T.Event1: IEvent", - addtlRefAssy = [PathRelativeToTestAssembly( @"UnitTests\MockTypeProviders\XmlDocAttributeWithNullComment.dll")]) + addtlRefAssy = [PathRelativeToTestAssembly( @"XmlDocAttributeWithNullComment.dll")]) [] [] @@ -545,7 +545,7 @@ Full name: Microsoft.FSharp.Control.Async""".TrimStart().Replace("\r\n", "\n") this.AssertQuickInfoContainsAtStartOfMarker (fileContents, "Event1(*Marker*)", "event N.T.Event1: IEvent", - addtlRefAssy = [PathRelativeToTestAssembly( @"UnitTests\MockTypeProviders\XmlDocAttributeWithEmptyComment.dll")]) + addtlRefAssy = [PathRelativeToTestAssembly( @"XmlDocAttributeWithEmptyComment.dll")]) [] @@ -559,7 +559,7 @@ Full name: Microsoft.FSharp.Control.Async""".TrimStart().Replace("\r\n", "\n") this.AssertQuickInfoContainsAtStartOfMarker (fileContents, "M(*Marker*)", "This is a synthetic *method* created by me!!", - addtlRefAssy = [PathRelativeToTestAssembly( @"UnitTests\MockTypeProviders\XmlDocAttributeWithAdequateComment.dll")]) + addtlRefAssy = [PathRelativeToTestAssembly( @"XmlDocAttributeWithAdequateComment.dll")]) [] [] @@ -572,7 +572,7 @@ Full name: Microsoft.FSharp.Control.Async""".TrimStart().Replace("\r\n", "\n") this.AssertQuickInfoContainsAtStartOfMarker (fileContents, "M(*Marker*)", "This is a synthetic *method* Localized! ኤፍ ሻርፕ", - addtlRefAssy = [PathRelativeToTestAssembly( @"UnitTests\MockTypeProviders\XmlDocAttributeWithLocalizedComment.dll")]) + addtlRefAssy = [PathRelativeToTestAssembly( @"XmlDocAttributeWithLocalizedComment.dll")]) [] [] @@ -585,7 +585,7 @@ Full name: Microsoft.FSharp.Control.Async""".TrimStart().Replace("\r\n", "\n") this.AssertQuickInfoContainsAtStartOfMarker (fileContents, "M(*Marker*)", "This is a synthetic *method* created by me!!. Which is used to test the tool tip of the typeprovider Method to check if it shows the right message or not.!", - addtlRefAssy = [PathRelativeToTestAssembly( @"UnitTests\MockTypeProviders\XmlDocAttributeWithLongComment.dll")]) + addtlRefAssy = [PathRelativeToTestAssembly( @"XmlDocAttributeWithLongComment.dll")]) [] [] @@ -598,7 +598,7 @@ Full name: Microsoft.FSharp.Control.Async""".TrimStart().Replace("\r\n", "\n") this.AssertQuickInfoContainsAtStartOfMarker (fileContents, "M(*Marker*)", "N.T.M() : int []", - addtlRefAssy = [PathRelativeToTestAssembly( @"UnitTests\MockTypeProviders\XmlDocAttributeWithNullComment.dll")]) + addtlRefAssy = [PathRelativeToTestAssembly( @"XmlDocAttributeWithNullComment.dll")]) [] [] @@ -611,7 +611,7 @@ Full name: Microsoft.FSharp.Control.Async""".TrimStart().Replace("\r\n", "\n") this.AssertQuickInfoContainsAtStartOfMarker (fileContents, "M(*Marker*)", "N.T.M() : int []", - addtlRefAssy = [PathRelativeToTestAssembly( @"UnitTests\MockTypeProviders\XmlDocAttributeWithEmptyComment.dll")]) + addtlRefAssy = [PathRelativeToTestAssembly( @"XmlDocAttributeWithEmptyComment.dll")]) [] @@ -625,7 +625,7 @@ Full name: Microsoft.FSharp.Control.Async""".TrimStart().Replace("\r\n", "\n") this.AssertQuickInfoContainsAtStartOfMarker (fileContents, "StaticProp(*Marker*)", "This is a synthetic *property* created by me for N.T", - addtlRefAssy = [PathRelativeToTestAssembly( @"UnitTests\MockTypeProviders\XmlDocAttributeWithAdequateComment.dll")]) + addtlRefAssy = [PathRelativeToTestAssembly( @"XmlDocAttributeWithAdequateComment.dll")]) [] [] @@ -638,7 +638,7 @@ Full name: Microsoft.FSharp.Control.Async""".TrimStart().Replace("\r\n", "\n") this.AssertQuickInfoContainsAtStartOfMarker (fileContents, "StaticProp(*Marker*)", "This is a synthetic *property* Localized! ኤፍ ሻርፕ for N.T", - addtlRefAssy = [PathRelativeToTestAssembly( @"UnitTests\MockTypeProviders\XmlDocAttributeWithLocalizedComment.dll")]) + addtlRefAssy = [PathRelativeToTestAssembly( @"XmlDocAttributeWithLocalizedComment.dll")]) [] [] @@ -651,7 +651,7 @@ Full name: Microsoft.FSharp.Control.Async""".TrimStart().Replace("\r\n", "\n") this.AssertQuickInfoContainsAtStartOfMarker (fileContents, "StaticProp(*Marker*)", "This is a synthetic *property* created by me for N.T. Which is used to test the tool tip of the typeprovider Property to check if it shows the right message or not.!", - addtlRefAssy = [PathRelativeToTestAssembly( @"UnitTests\MockTypeProviders\XmlDocAttributeWithLongComment.dll")]) + addtlRefAssy = [PathRelativeToTestAssembly( @"XmlDocAttributeWithLongComment.dll")]) [] [] @@ -664,7 +664,7 @@ Full name: Microsoft.FSharp.Control.Async""".TrimStart().Replace("\r\n", "\n") this.AssertQuickInfoContainsAtStartOfMarker (fileContents, "StaticProp(*Marker*)", "property N.T.StaticProp: decimal", - addtlRefAssy = [PathRelativeToTestAssembly( @"UnitTests\MockTypeProviders\XmlDocAttributeWithNullComment.dll")]) + addtlRefAssy = [PathRelativeToTestAssembly( @"XmlDocAttributeWithNullComment.dll")]) [] [] @@ -677,7 +677,7 @@ Full name: Microsoft.FSharp.Control.Async""".TrimStart().Replace("\r\n", "\n") this.AssertQuickInfoContainsAtStartOfMarker (fileContents, "StaticProp(*Marker*)", "property N.T.StaticProp: decimal", - addtlRefAssy = [PathRelativeToTestAssembly( @"UnitTests\MockTypeProviders\XmlDocAttributeWithEmptyComment.dll")]) + addtlRefAssy = [PathRelativeToTestAssembly( @"XmlDocAttributeWithEmptyComment.dll")]) [] @@ -694,7 +694,7 @@ Full name: Microsoft.FSharp.Control.Async""".TrimStart().Replace("\r\n", "\n") fileContents, marker = "foo(*Marker*)", expected = "type foo = N1.T", - addtlRefAssy = [PathRelativeToTestAssembly(@"UnitTests\MockTypeProviders\DummyProviderForLanguageServiceTesting.dll")]) + addtlRefAssy = [PathRelativeToTestAssembly(@"DummyProviderForLanguageServiceTesting.dll")]) [] [] @@ -711,7 +711,7 @@ Full name: Microsoft.FSharp.Control.Async""".TrimStart().Replace("\r\n", "\n") fileContents, marker = "foo(*Marker*)", expected = "type foo", - addtlRefAssy = [PathRelativeToTestAssembly(@"UnitTests\MockTypeProviders\DummyProviderForLanguageServiceTesting.dll")]) + addtlRefAssy = [PathRelativeToTestAssembly(@"DummyProviderForLanguageServiceTesting.dll")]) [] [] @@ -728,7 +728,7 @@ Full name: Microsoft.FSharp.Control.Async""".TrimStart().Replace("\r\n", "\n") fileContents, marker = "foo(*Marker*)", expected = "XMLComment", - addtlRefAssy = [PathRelativeToTestAssembly(@"UnitTests\MockTypeProviders\DummyProviderForLanguageServiceTesting.dll")]) + addtlRefAssy = [PathRelativeToTestAssembly(@"DummyProviderForLanguageServiceTesting.dll")]) [] [] @@ -739,7 +739,7 @@ Full name: Microsoft.FSharp.Control.Async""".TrimStart().Replace("\r\n", "\n") fileContents, marker = "TTT", expected = "type TTT = Samples.FSharp.RegexTypeProvider.RegexTyped<...>\nFull name: File1.TTT", - addtlRefAssy = ["System"; PathRelativeToTestAssembly(@"UnitTests\MockTypeProviders\DummyProviderForLanguageServiceTesting.dll")]) + addtlRefAssy = ["System"; PathRelativeToTestAssembly(@"DummyProviderForLanguageServiceTesting.dll")]) [] [] @@ -754,7 +754,7 @@ Full name: Microsoft.FSharp.Control.Async""".TrimStart().Replace("\r\n", "\n") fileContents, marker = "reaCode.Val", expected = """property Samples.FSharp.RegexTypeProvider.RegexTyped<...>.MatchType.AreaCode: System.Text.RegularExpressions.Group""", - addtlRefAssy = ["System"; PathRelativeToTestAssembly(@"UnitTests\MockTypeProviders\DummyProviderForLanguageServiceTesting.dll")]) + addtlRefAssy = ["System"; PathRelativeToTestAssembly(@"DummyProviderForLanguageServiceTesting.dll")]) // Regression for 2948 [] @@ -2118,15 +2118,13 @@ query." member public this.``GenericDotNetMethodShowsComment``() = this.AssertMemberDataTipContainsInOrder ((*code *) - ["System.Linq.ParallelEnumerable." - ] , + ["System.Linq.ParallelEnumerable."] , (* marker *) "ParallelEnumerable.", (* completed item *) "ElementAt", (* expect to see in order... *) [ - "System.Core"; "Signature:M:System.Linq.ParallelEnumerable.ElementAt``1(System.Linq.ParallelQuery{``0},System.Int32" ] ) @@ -2985,9 +2983,9 @@ query." this.AssertQuickInfoContainsAtStartOfMarker (fileContent, "(*Marker5*)", "value param") this.AssertQuickInfoContainsAtStartOfMarker (fileContent, "(*Marker6*)", "value param") this.AssertQuickInfoContainsAtStartOfMarker (fileContent, "(*Marker7*)", "Param1 of string", - addtlRefAssy = [PathRelativeToTestAssembly(@"UnitTests\MockTypeProviders\DummyProviderForLanguageServiceTesting.dll")]) + addtlRefAssy = [PathRelativeToTestAssembly(@"DummyProviderForLanguageServiceTesting.dll")]) this.AssertQuickInfoContainsAtStartOfMarker (fileContent, "(*Marker8*)", "Ignored", - addtlRefAssy = [PathRelativeToTestAssembly(@"UnitTests\MockTypeProviders\DummyProviderForLanguageServiceTesting.dll")]) + addtlRefAssy = [PathRelativeToTestAssembly(@"DummyProviderForLanguageServiceTesting.dll")]) member private this.VerifyUsingFsTestLib fileContent queries crossProject = use _guard = this.UsingNewVS() diff --git a/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.Script.fs b/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.Script.fs index 6a9f0637463..cbe55e9baf9 100644 --- a/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.Script.fs +++ b/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.Script.fs @@ -1558,7 +1558,7 @@ type UsingMSBuild() as this = ] let refs = [ - PathRelativeToTestAssembly(@"UnitTests\MockTypeProviders\DummyProviderForLanguageServiceTesting.dll") + PathRelativeToTestAssembly(@"DummyProviderForLanguageServiceTesting.dll") ] let (_, project, file) = this.CreateSingleFileProject(code, references = refs) TakeCoffeeBreak(this.VS) @@ -1566,7 +1566,7 @@ type UsingMSBuild() as this = member public this.TypeProviderDisposalSmokeTest(clearing) = use _guard = this.UsingNewVS() - let providerAssemblyName = PathRelativeToTestAssembly(@"UnitTests\MockTypeProviders\DummyProviderForLanguageServiceTesting.dll") + let providerAssemblyName = PathRelativeToTestAssembly(@"DummyProviderForLanguageServiceTesting.dll") let providerAssembly = System.Reflection.Assembly.LoadFrom providerAssemblyName Assert.IsNotNull(providerAssembly, "provider assembly should not be null") let providerCounters = providerAssembly.GetType("DummyProviderForLanguageServiceTesting.GlobalCounters") @@ -1606,7 +1606,7 @@ type UsingMSBuild() as this = for i in 1 .. 50 do let solution = this.CreateSolution() let project = CreateProject(solution,"testproject" + string (i % 20)) - this.AddAssemblyReference(project, PathRelativeToTestAssembly(@"UnitTests\MockTypeProviders\DummyProviderForLanguageServiceTesting.dll")) + this.AddAssemblyReference(project, PathRelativeToTestAssembly(@"DummyProviderForLanguageServiceTesting.dll")) let fileName = sprintf "File%d.fs" i let file1 = AddFileFromText(project,fileName, ["let x" + string i + " = N1.T1()" ]) let file = OpenFile(project,fileName) diff --git a/vsintegration/tests/UnitTests/LegacyProjectSystem/Tests.ProjectSystem.References.fs b/vsintegration/tests/UnitTests/LegacyProjectSystem/Tests.ProjectSystem.References.fs index 5bc1c6286eb..81b6b55ccb8 100644 --- a/vsintegration/tests/UnitTests/LegacyProjectSystem/Tests.ProjectSystem.References.fs +++ b/vsintegration/tests/UnitTests/LegacyProjectSystem/Tests.ProjectSystem.References.fs @@ -70,8 +70,8 @@ type References() = DoWithTempFile "Test.fsproj" (fun projFile -> File.AppendAllText(projFile, TheTests.SimpleFsprojText([], [], "")) use project = TheTests.CreateProject(projFile) - let assName = new AssemblyName(typeof.Assembly.FullName) - let selectorData = new VSCOMPONENTSELECTORDATA(``type`` = VSCOMPONENTTYPE.VSCOMPONENTTYPE_ComPlus, bstrFile = "*" + assName.FullName) + let assemblyName = new AssemblyName(typeof.Assembly.FullName) + let selectorData = new VSCOMPONENTSELECTORDATA(``type`` = VSCOMPONENTTYPE.VSCOMPONENTTYPE_ComPlus, bstrFile = "*" + assemblyName.FullName) let refContainer = GetReferenceContainerNode(project) refContainer.AddReferenceFromSelectorData(selectorData) |> Assert.IsNotNull let l = new List() diff --git a/vsintegration/tests/unittests/SemanticColorizationServiceTests.fs b/vsintegration/tests/UnitTests/SemanticColorizationServiceTests.fs similarity index 100% rename from vsintegration/tests/unittests/SemanticColorizationServiceTests.fs rename to vsintegration/tests/UnitTests/SemanticColorizationServiceTests.fs diff --git a/vsintegration/tests/UnitTests/SignatureHelpProviderTests.fs b/vsintegration/tests/UnitTests/SignatureHelpProviderTests.fs index ee651357715..b26f786fabb 100644 --- a/vsintegration/tests/UnitTests/SignatureHelpProviderTests.fs +++ b/vsintegration/tests/UnitTests/SignatureHelpProviderTests.fs @@ -39,7 +39,7 @@ let internal projectOptions = { ProjectId = None SourceFiles = [| filePath |] ReferencedProjects = [| |] - OtherOptions = [| "-r:" + PathRelativeToTestAssembly(@"UnitTests\MockTypeProviders\DummyProviderForLanguageServiceTesting.dll") |] + OtherOptions = [| "-r:" + PathRelativeToTestAssembly(@"DummyProviderForLanguageServiceTesting.dll") |] IsIncompleteTypeCheckEnvironment = true UseScriptResolutionRules = false LoadTime = DateTime.MaxValue diff --git a/vsintegration/tests/unittests/SyntacticColorizationServiceTests.fs b/vsintegration/tests/UnitTests/SyntacticColorizationServiceTests.fs similarity index 100% rename from vsintegration/tests/unittests/SyntacticColorizationServiceTests.fs rename to vsintegration/tests/UnitTests/SyntacticColorizationServiceTests.fs diff --git a/vsintegration/tests/UnitTests/TestLib.LanguageService.fs b/vsintegration/tests/UnitTests/TestLib.LanguageService.fs index 35425ae98dc..002d47aad57 100644 --- a/vsintegration/tests/UnitTests/TestLib.LanguageService.fs +++ b/vsintegration/tests/UnitTests/TestLib.LanguageService.fs @@ -15,12 +15,15 @@ open UnitTests.TestLib.Utils open Microsoft.FSharp.Compiler open System.Text.RegularExpressions open Microsoft.FSharp.Compiler.SourceCodeServices +open Microsoft.VisualStudio.FSharp + #nowarn "52" // The value has been copied to ensure the original is not mutated [] -module internal Globals = +module internal Globals = let checker = FSharpChecker.Create(legacyReferenceResolver=Microsoft.FSharp.Compiler.MSBuildReferenceResolver.Resolver) + //open Internal.Utilities type internal TextSpan = Microsoft.VisualStudio.TextManager.Interop.TextSpan @@ -243,6 +246,8 @@ type internal GlobalParseAndTypeCheckCounter private(initialParseCount:int, init /// various functions that abstract actions over vs. type LanguageServiceBaseTests() = + let _resolver = AssemblyResolver.addResolver () + let mutable defaultSolution : OpenSolution = Unchecked.defaultof<_> let cache = System.Collections.Generic.Dictionary() diff --git a/vsintegration/tests/UnitTests/Tests.Build.fs b/vsintegration/tests/UnitTests/Tests.Build.fs index ecdf69f5cf3..b1b7228a16f 100644 --- a/vsintegration/tests/UnitTests/Tests.Build.fs +++ b/vsintegration/tests/UnitTests/Tests.Build.fs @@ -40,8 +40,8 @@ type MyLogger(f : string -> unit) = type FauxHostObject() = let mutable myFlags : string[] = null let mutable mySources : string[] = null - member x.Compile(compile:System.Converter, flags:string[], sources:string[]) = - myFlags <- flags + member x.Compile(compile:System.Func, flags:string[], sources:string[]) = + myFlags <- flags mySources <- sources 0 member x.Flags = myFlags @@ -77,7 +77,7 @@ type Build() = let p = tool.InternalGenerateFullPathToTool() Assert.Fail("should not succeed") with e -> - e.Message.AssertMatchesPattern("ToolPath is unknown; specify the path to fsc.exe as the ToolPath property.") + e.Message.AssertMatchesPattern("ToolPath is unknown; specify the path to the tool.") [] member public this.TestCodePage() = @@ -92,7 +92,8 @@ type Build() = "--warnaserror:76" + Environment.NewLine + "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + - "--highentropyva-" + Environment.NewLine) + "--highentropyva-" + Environment.NewLine + + "--nocopyfsharpcore" + Environment.NewLine) cmd [] @@ -107,7 +108,8 @@ type Build() = "--warnaserror:76" + Environment.NewLine + "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + - "--highentropyva-" + Environment.NewLine) + "--highentropyva-" + Environment.NewLine + + "--nocopyfsharpcore" + Environment.NewLine) cmd [] @@ -122,7 +124,8 @@ type Build() = "--warnaserror:76" + Environment.NewLine + "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + - "--highentropyva-" + Environment.NewLine) + "--highentropyva-" + Environment.NewLine + + "--nocopyfsharpcore" + Environment.NewLine) cmd [] @@ -139,7 +142,8 @@ type Build() = "--warnaserror:76" + Environment.NewLine + "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + - "--highentropyva-" + Environment.NewLine) + "--highentropyva-" + Environment.NewLine + + "--nocopyfsharpcore" + Environment.NewLine) cmd [] @@ -154,7 +158,8 @@ type Build() = "--warnaserror:76" + Environment.NewLine + "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + - "--highentropyva-" + Environment.NewLine) + "--highentropyva-" + Environment.NewLine + + "--nocopyfsharpcore" + Environment.NewLine) cmd [] @@ -168,7 +173,8 @@ type Build() = "--warnaserror:76" + Environment.NewLine + "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + - "--highentropyva-" + Environment.NewLine) + "--highentropyva-" + Environment.NewLine + + "--nocopyfsharpcore" + Environment.NewLine) cmd [] @@ -183,7 +189,8 @@ type Build() = "--warnaserror-:52,109" + Environment.NewLine + "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + - "--highentropyva-" + Environment.NewLine) + "--highentropyva-" + Environment.NewLine + + "--nocopyfsharpcore" + Environment.NewLine) cmd [] @@ -198,7 +205,8 @@ type Build() = "--warnaserror:76" + Environment.NewLine + "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + - "--highentropyva-" + Environment.NewLine) + "--highentropyva-" + Environment.NewLine + + "--nocopyfsharpcore" + Environment.NewLine) cmd [] @@ -213,7 +221,8 @@ type Build() = "--warnaserror:76" + Environment.NewLine + "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + - "--highentropyva-" + Environment.NewLine) + "--highentropyva-" + Environment.NewLine + + "--nocopyfsharpcore" + Environment.NewLine) cmd [] @@ -228,7 +237,8 @@ type Build() = "--warnaserror:76" + Environment.NewLine + "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + - "--highentropyva-" + Environment.NewLine) + "--highentropyva-" + Environment.NewLine + + "--nocopyfsharpcore" + Environment.NewLine) cmd [] @@ -243,7 +253,8 @@ type Build() = "--warnaserror:76" + Environment.NewLine + "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + - "--highentropyva-" + Environment.NewLine) + "--highentropyva-" + Environment.NewLine + + "--nocopyfsharpcore" + Environment.NewLine) cmd [] @@ -258,7 +269,8 @@ type Build() = "--warnaserror:76" + Environment.NewLine + "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + - "--highentropyva-" + Environment.NewLine) + "--highentropyva-" + Environment.NewLine + + "--nocopyfsharpcore" + Environment.NewLine) cmd [] @@ -272,7 +284,8 @@ type Build() = "--warnaserror:76" + Environment.NewLine + "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + - "--highentropyva-" + Environment.NewLine) + "--highentropyva-" + Environment.NewLine + + "--nocopyfsharpcore" + Environment.NewLine) cmd [] @@ -287,7 +300,8 @@ type Build() = "--warnaserror:76" + Environment.NewLine + "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + - "--highentropyva-" + Environment.NewLine) + "--highentropyva-" + Environment.NewLine + + "--nocopyfsharpcore" + Environment.NewLine) cmd [] @@ -302,6 +316,7 @@ type Build() = "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + "--highentropyva-" + Environment.NewLine + + "--nocopyfsharpcore" + Environment.NewLine + "--yadda" + Environment.NewLine + "yadda" + Environment.NewLine) cmd @@ -318,7 +333,8 @@ type Build() = "--warnaserror:76" + Environment.NewLine + "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + - "--highentropyva-" + Environment.NewLine) + "--highentropyva-" + Environment.NewLine + + "--nocopyfsharpcore" + Environment.NewLine) cmd [] @@ -333,7 +349,8 @@ type Build() = "--warnaserror:76" + Environment.NewLine + "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + - "--highentropyva-" + Environment.NewLine) + "--highentropyva-" + Environment.NewLine + + "--nocopyfsharpcore" + Environment.NewLine) cmd [] @@ -348,7 +365,8 @@ type Build() = "--warnaserror:76" + Environment.NewLine + "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + - "--highentropyva-" + Environment.NewLine) + "--highentropyva-" + Environment.NewLine + + "--nocopyfsharpcore" + Environment.NewLine) cmd [] @@ -363,7 +381,8 @@ type Build() = "--warnaserror:76" + Environment.NewLine + "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + - "--highentropyva-" + Environment.NewLine) + "--highentropyva-" + Environment.NewLine + + "--nocopyfsharpcore" + Environment.NewLine) cmd [] @@ -379,7 +398,8 @@ type Build() = "--warnaserror:76" + Environment.NewLine + "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + - "--highentropyva-" + Environment.NewLine) + "--highentropyva-" + Environment.NewLine + + "--nocopyfsharpcore" + Environment.NewLine) cmd [] @@ -395,7 +415,8 @@ type Build() = "--warnaserror:76" + Environment.NewLine + "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + - "--highentropyva-" + Environment.NewLine) cmd + "--highentropyva-" + Environment.NewLine + + "--nocopyfsharpcore" + Environment.NewLine) cmd [] member public this.TestReferencePathWithSpaces() = @@ -410,7 +431,8 @@ type Build() = "--warnaserror:76" + Environment.NewLine + "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + - "--highentropyva-" + Environment.NewLine) + "--highentropyva-" + Environment.NewLine + + "--nocopyfsharpcore" + Environment.NewLine) cmd [] @@ -425,7 +447,8 @@ type Build() = "--warnaserror:76" + Environment.NewLine + "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + - "--highentropyva-" + Environment.NewLine) + "--highentropyva-" + Environment.NewLine + + "--nocopyfsharpcore" + Environment.NewLine) cmd [] @@ -442,6 +465,7 @@ type Build() = "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + "--highentropyva-" + Environment.NewLine + + "--nocopyfsharpcore" + Environment.NewLine + src + Environment.NewLine + src + Environment.NewLine) cmd @@ -459,7 +483,8 @@ type Build() = "--warnaserror:76" + Environment.NewLine + "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + - "--highentropyva-" + Environment.NewLine) + "--highentropyva-" + Environment.NewLine + + "--nocopyfsharpcore" + Environment.NewLine) cmd [] @@ -474,7 +499,8 @@ type Build() = "--warnaserror:76" + Environment.NewLine + "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + - "--highentropyva-" + Environment.NewLine) + "--highentropyva-" + Environment.NewLine + + "--nocopyfsharpcore" + Environment.NewLine) cmd [] @@ -489,7 +515,8 @@ type Build() = "--warnaserror:76" + Environment.NewLine + "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + - "--highentropyva-" + Environment.NewLine) + "--highentropyva-" + Environment.NewLine + + "--nocopyfsharpcore" + Environment.NewLine) cmd [] @@ -503,7 +530,8 @@ type Build() = "--utf8output" + Environment.NewLine + "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + - "--highentropyva-" + Environment.NewLine) + "--highentropyva-" + Environment.NewLine + + "--nocopyfsharpcore" + Environment.NewLine) cmd [] @@ -517,7 +545,8 @@ type Build() = "--win32res:foo.res" + Environment.NewLine + "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + - "--highentropyva-" + Environment.NewLine) + "--highentropyva-" + Environment.NewLine + + "--nocopyfsharpcore" + Environment.NewLine) cmd [] @@ -531,7 +560,8 @@ type Build() = "--win32manifest:foo.manifest" + Environment.NewLine + "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + - "--highentropyva-" + Environment.NewLine) + "--highentropyva-" + Environment.NewLine + + "--nocopyfsharpcore" + Environment.NewLine) cmd [] @@ -544,7 +574,8 @@ type Build() = "--warnaserror:76" + Environment.NewLine + "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + - "--highentropyva+" + Environment.NewLine) + "--highentropyva+" + Environment.NewLine + + "--nocopyfsharpcore" + Environment.NewLine) cmd [] @@ -558,7 +589,8 @@ type Build() = "--fullpaths" + Environment.NewLine + "--flaterrors" + Environment.NewLine + "--subsystemversion:6.02" + Environment.NewLine + - "--highentropyva-" + Environment.NewLine) + "--highentropyva-" + Environment.NewLine + + "--nocopyfsharpcore" + Environment.NewLine) cmd [] @@ -627,6 +659,7 @@ type Build() = "--flaterrors" + Environment.NewLine + "--subsystemversion:4.0" + Environment.NewLine + "--highentropyva-" + Environment.NewLine + + "--nocopyfsharpcore" + Environment.NewLine + "--yadda:yadda" + Environment.NewLine + "--other:internal quote" + Environment.NewLine + "blah" + Environment.NewLine + @@ -670,6 +703,7 @@ type Build() = "--flaterrors" "--subsystemversion:4.0" "--highentropyva-" + "--nocopyfsharpcore" "--yadda:yadda" "--other:internal quote" // note stripped internal quotes "blah" |] diff --git a/vsintegration/tests/UnitTests/Tests.XmlDocComments.fs b/vsintegration/tests/UnitTests/Tests.XmlDocComments.fs index 63843436082..2506296bb6c 100644 --- a/vsintegration/tests/UnitTests/Tests.XmlDocComments.fs +++ b/vsintegration/tests/UnitTests/Tests.XmlDocComments.fs @@ -10,12 +10,13 @@ open UnitTests.TestLib.Salsa open UnitTests.TestLib.Utils [] -type XmlDocComments() = +type XmlDocComments() = inherit UnitTests.TestLib.LanguageService.LanguageServiceBaseTests(VsOpts = InstalledMSBuildTestFlavour()) - // Work around an innocuous 'feature' with how QuickInfo is displayed, lines which + + // Work around an innocuous 'feature' with how QuickInfo is displayed, lines which // should have a "\r\n" just have a "\r" - let trimnewlines (str : string) = - str.Replace("\r", "").Replace("\n", "") + let trimnewlines (str : string) = + str.Replace("\r", "").Replace("\n", "") member public this.AssertQuickInfoContainsAtStartOfMarker code marker expected = let (_solution, _project, file) = this.CreateSingleFileProject(code : string) diff --git a/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj b/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj index a6f6e7b2726..398eab56a43 100644 --- a/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj +++ b/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj @@ -13,6 +13,8 @@ true true false + true + true @@ -107,6 +109,9 @@ CompilerService\UnusedOpensTests.fs + + CompilerService\TreeVisitorTests.fs + Roslyn\SyntacticColorizationServiceTests.fs @@ -160,6 +165,7 @@ + @@ -172,6 +178,23 @@ + + + + + + + + + + + + + + + + + @@ -189,6 +212,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +